/* Typing Text GIF Maker only; shared type, colors and components come from main.css. */
/* Phones: one column (text → preview → settings) with the Generate bar pinned
   to the bottom of the screen while the tool is in view. Wide screens: text and
   preview on the left, settings and Generate on the right. */
.tt-editor { position: relative; display: grid; gap: 16px; min-width: 0; }
.tt-main, .tt-side { display: contents; }
.tt-input { display: grid; gap: 8px; min-width: 0; }
.tt-stage-col { display: grid; gap: 8px; min-width: 0; }
.tt-settings { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.tt-settings[disabled] .tt-block { opacity: .6; }

.tt-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 28px; }
.tt-head small { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tt-step, .tt-step-title { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.tt-step > span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--amber); font: 700 12.5px var(--display); }
.tt-replay {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--card); color: var(--ink-2); font: 600 13px var(--body); cursor: pointer;
}
.tt-replay svg { width: 14px; height: 14px; }
.tt-replay:hover { border-color: var(--mat); color: var(--mat-deep); }
.tt-replay:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.tt-action {
  position: sticky; bottom: 0; z-index: 3; display: grid; gap: 8px;
  margin: 0 -10px -10px; padding: 10px; border-radius: 16px 16px 0 0;
  background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(6px);
  box-shadow: 0 -10px 24px -16px rgba(22, 32, 28, .45);
}
.tt-result { scroll-margin-bottom: 96px; }

.tt-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.tt-label output, .tt-label small { font-weight: 500; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.tt-text {
  width: 100%; min-height: 92px; padding: 12px 14px; resize: vertical;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); color: var(--ink);
  font: 500 17px/1.45 var(--body);
}
.tt-text:focus { outline: none; border-color: var(--mat); box-shadow: 0 0 0 3px var(--mat-soft); }
.tt-hint { margin: 0; font-size: 13px; color: var(--muted); }
.tt-input .warn { margin: 0; }
.tt-busy { display: grid; gap: 8px; }
.tt-busy-row { display: flex; align-items: center; gap: 12px; }
.tt-busy progress { flex: 1; height: 10px; accent-color: var(--mat); }
[data-status]:empty { display: none; }
[data-status] { margin: 0; font-size: 14px; color: var(--ink-2); }

.tt-stage { min-height: 220px; padding: 16px; }
.tt-stage canvas, .tt-stage img {
  display: block; max-width: 100%; max-height: 260px; width: auto; height: auto;
  object-fit: contain; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6);
}
.tt-stage.is-transparent canvas, .tt-stage.is-transparent img { background: var(--checker); }
.tt-stage-col .file-meta { display: block; text-align: center; }

.tt-block { border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.tt-block > summary {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px;
  cursor: pointer; list-style: none; font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.tt-block > summary::-webkit-details-marker { display: none; }
.tt-sum { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.tt-block[open] .tt-sum { visibility: hidden; }
.tt-block > summary::after { content: ""; flex: none; margin-left: 4px; width: 8px; height: 8px; border: solid var(--ink-2); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s var(--ease); }
.tt-block[open] > summary::after { transform: rotate(-135deg); }
.tt-block > summary:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 12px; }
.tt-body { display: grid; gap: 16px; padding: 2px 14px 16px; }
.tt-body fieldset { display: grid; gap: 16px; min-width: 0; margin: 0; padding: 0; border: 0; }
.tt-body fieldset[disabled] { opacity: .5; }
.tt-field { display: grid; gap: 6px; min-width: 0; }
.tt-field input[type="range"] { width: 100%; min-height: 32px; accent-color: var(--mat); cursor: pointer; }
.tt-range-box { display: grid; grid-template-columns: 1fr 84px; gap: 10px; align-items: center; }
.tt-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tt-two label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tt-color { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.tt-colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tt-colors .is-off { opacity: .45; }
.tt-body .switch { margin-top: 0; }
.tt-body .note { margin: 0; }

.tt-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: 12px; background: var(--paper-2); }
.tt-seg label { position: relative; display: grid; place-items: center; min-height: 40px; padding: 4px 6px; border-radius: 9px; cursor: pointer; font-size: 14px; color: var(--ink-2); text-align: center; }
.tt-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tt-seg label:has(input:checked) { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(22, 32, 28, .15); }
.tt-seg label:has(input:focus-visible) { outline: 3px solid var(--amber); outline-offset: 2px; }
.tt-seg .glyph { font: 700 18px/1 ui-monospace, Menlo, Consolas, monospace; }
.tt-seg .f-sans { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.tt-seg .f-serif { font-family: Georgia, "Times New Roman", serif; }
.tt-seg .f-mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

.tt-result dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; text-align: center; }
.tt-result dl div { padding: 8px 4px; border-radius: 10px; background: var(--card); }
.tt-result dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tt-result dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tt-result p { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }

@media (min-width: 640px) {
  .tt-stage { min-height: 300px; }
  .tt-stage canvas, .tt-stage img { max-height: 380px; }
}
@media (min-width: 980px) {
  .tt-editor { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 22px; }
  .tt-main, .tt-side { display: grid; gap: 16px; align-content: start; min-width: 0; }
  .tt-side { align-self: stretch; grid-template-rows: auto 1fr; }
  .tt-action { align-self: end; margin: 0; padding: 12px 0 0; border-radius: 0; box-shadow: none; background: var(--card); backdrop-filter: none; }
  .tt-stage { min-height: 360px; }
  .tt-stage canvas, .tt-stage img { max-height: 400px; }
}
@media (max-width: 639px) {
  .typing-hero .lede { font-size: 16px; }
  .typing-hero .hero-head { margin-bottom: 12px; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
