/* TextFromTrack — application styles built on tokens.css.
   Design system primitives live here; tokens.css stays a verbatim copy of the handoff. */

body.tft-canvas {
  background: var(--tft-paper);
  color: var(--tft-ink);
  font-family: var(--tft-display);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Wordmark — [T]extFromTrack */
.tft-wordmark {
  font-family: var(--tft-display);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--tft-ink);
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}
.tft-wordmark > .b { opacity: 0.45; font-weight: 400; }
.tft-wordmark > .t { font-weight: 600; }
.tft-wordmark > .suffix { margin-left: 0.05em; font-weight: 600; }
.tft-wordmark.on-ink { color: var(--tft-paper); }

/* Top bar — appears on every authenticated page */
.tft-topbar {
  background: var(--tft-paper);
  border-bottom: 1px solid var(--tft-line);
  font-family: var(--tft-display);
  position: sticky;
  top: 0;
  z-index: 10;
}
.tft-topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}
.tft-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--tft-ink);
}
.tft-topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tft-topbar-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tft-topbar-brand { font-size: 18px; }
.tft-caption-mono.is-mute { color: var(--tft-mute); }

/* Credit pill — active / signal state */
.tft-pill-credit {
  background: var(--tft-signal-soft);
  color: var(--tft-signal-ink);
  font-family: var(--tft-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 5px 10px;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  font-weight: 500;
  font-feature-settings: "zero", "ss02";
}
.tft-pill-credit:hover { filter: brightness(0.97); }

/* Credit pill — redesigned with green dot indicator */
.tft-credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--tft-signal-soft);
  border-radius: 999px;
  border: 0;
  cursor: pointer;
}
.tft-credit-pill .dot {
  width: 6px; height: 6px; border-radius: 3px;
  background: var(--tft-signal);
  flex-shrink: 0;
}
.tft-credit-pill .tft-mono {
  font-size: 12px;
  color: var(--tft-signal-ink);
  font-weight: 500;
  font-feature-settings: "zero", "ss02";
}
.tft-credit-pill:hover { filter: brightness(0.97); }
.tft-credit-pill:focus-visible { outline: 2px solid var(--tft-signal); outline-offset: 2px; }

/* Buy button — desktop shows full label, mobile shows just "+" */
.tft-buy-btn .tft-buy-plus { display: none; }

/* Outline pill — neutral chip */
.tft-pill-outline {
  background: var(--tft-card);
  color: var(--tft-ink-2);
  border: 1px solid var(--tft-line);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--tft-mono);
  letter-spacing: 0.04em;
  cursor: pointer;
  font-feature-settings: "zero", "ss02";
}
.tft-pill-outline:hover { background: var(--tft-paper-2); border-color: var(--tft-ink-3); }

/* Primary button — ink fill (CTA) */
.tft-btn-primary {
  background: var(--tft-ink);
  color: var(--tft-paper);
  border: 0;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--tft-display);
  letter-spacing: -0.005em;
}
.tft-btn-primary:hover { background: var(--tft-ink-2); }
.tft-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Quiet link — admin / logout / cancel */
.tft-link-quiet {
  color: var(--tft-ink-3);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0 4px;
  font-family: var(--tft-display);
}
.tft-link-quiet:hover { color: var(--tft-ink); }

/* Avatar — circular initial badge */
.tft-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--tft-paper-2);
  border: 1px solid var(--tft-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--tft-display);
  font-weight: 500;
  font-size: 13px;
  color: var(--tft-ink-2);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  flex-shrink: 0;
}
.tft-avatar:hover { border-color: var(--tft-ink-3); }

/* Eyebrow caps — section labels */
.tft-eyebrow {
  font-family: var(--tft-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tft-mute);
  font-feature-settings: "zero", "ss02";
}

/* Micro caption — file metadata in mono */
.tft-caption-mono {
  font-family: var(--tft-mono);
  font-size: 12px;
  color: var(--tft-ink-3);
  font-feature-settings: "zero", "ss02";
}

/* ── Step 4 — Upload page ─────────────────────────────────────── */

.tft-hero { text-align: left; max-width: 640px; margin: 0 0 20px; }
.tft-hero-sub-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.tft-pills-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 24px;
}
.tft-section-recent { margin-top: 40px; }
.tft-recent-strip-card {
  border-top: 1px solid var(--tft-line);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--tft-paper-2);
  flex-wrap: wrap;
  border-radius: 14px;
  border: 1px solid var(--tft-line);
}
.tft-alert-amber.has-cap { max-width: 100%; margin: 0 0 24px; }
.tft-alert-amber { align-items: flex-start; }
.tft-alert-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: oklch(38% 0.10 75);
}
.tft-alert-body {
  margin: 4px 0 0;
  font-size: 12px;
  color: oklch(45% 0.08 75);
  line-height: 1.5;
}
.tft-btn-primary.is-sm { font-size: 12px; padding: 6px 12px; }
.tft-recent-strip-action { margin-left: auto; }
.tft-hero-h1 {
  font-family: var(--tft-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  font-size: 28px;
  line-height: 1.1;
  color: var(--tft-ink);
  margin: 0 0 8px;
}
@media (min-width: 768px) {
  .tft-hero-h1 { font-size: 36px; line-height: 1.05; letter-spacing: -0.03em; }
}
.tft-hero-sub {
  font-size: 14px;
  line-height: 1.5;
  color: var(--tft-ink-3);
  margin: 0;
  max-width: 56ch;
}
@media (min-width: 768px) {
  .tft-hero-sub { font-size: 15px; }
}
.tft-eyebrow-step {
  font-family: var(--tft-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tft-mute);
  font-feature-settings: "zero", "ss02";
  display: block;
  margin-bottom: 14px;
}

.tft-dropzone {
  width: 100%;
  background: var(--tft-card);
  border: 1.5px dashed var(--tft-line);
  border-radius: 14px;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
  font-family: inherit;
  color: inherit;
  box-sizing: border-box;
  text-align: center;
}
@media (min-width: 768px) {
  .tft-dropzone {
    flex-direction: row;
    gap: 22px;
    padding: 30px 24px;
    align-items: center;
    text-align: left;
  }
}
.tft-dropzone:hover,
.tft-dropzone.is-dragging,
.tft-dropzone:focus-visible {
  background: var(--tft-signal-soft);
  border-color: var(--tft-signal);
  outline: none;
}
.tft-dropzone-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--tft-ink);
}
.tft-dropzone-caption {
  font-family: var(--tft-mono);
  font-size: 10px;
  color: var(--tft-mute);
  letter-spacing: 0.06em;
  font-feature-settings: "zero", "ss02";
}
/* New inner element styles for redesigned dropzone */
.tft-dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.tft-dropzone-text .primary {
  font-size: 15px;
  font-weight: 500;
  color: var(--tft-ink);
}
.tft-dropzone-text .caption {
  font-family: var(--tft-mono);
  font-size: 10px;
  color: var(--tft-mute);
  letter-spacing: 0.06em;
  font-feature-settings: "zero", "ss02";
}
.tft-dropzone-cta {
  padding: 8px 16px;
  background: var(--tft-ink);
  color: var(--tft-paper);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
  pointer-events: none;
}
.tft-eq svg rect { fill: var(--tft-ink-2); }
.tft-dropzone:hover .tft-eq svg rect,
.tft-dropzone.is-dragging .tft-eq svg rect,
.tft-dropzone:focus-visible .tft-eq svg rect { fill: var(--tft-signal); }
.tft-dropzone:hover .tft-eq svg rect,
.tft-dropzone.is-dragging .tft-eq svg rect { animation: tft-eq 1.1s ease-in-out infinite; transform-origin: bottom; }
.tft-dropzone:hover .tft-eq svg rect:nth-child(1) { animation-delay: 0s; }
.tft-dropzone:hover .tft-eq svg rect:nth-child(2) { animation-delay: 0.08s; }
.tft-dropzone:hover .tft-eq svg rect:nth-child(3) { animation-delay: 0.16s; }
.tft-dropzone:hover .tft-eq svg rect:nth-child(4) { animation-delay: 0.24s; }
.tft-dropzone:hover .tft-eq svg rect:nth-child(5) { animation-delay: 0.32s; }
.tft-dropzone:hover .tft-eq svg rect:nth-child(6) { animation-delay: 0.40s; }

/* Toggle pills — bigger than topbar pills, dot indicator */
.tft-pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--tft-line);
  background: var(--tft-card);
  color: var(--tft-ink-2);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--tft-display);
  cursor: pointer;
  transition: all .15s;
}
.tft-pill-toggle:hover { border-color: var(--tft-ink-3); }
.tft-pill-toggle.is-active {
  background: var(--tft-ink);
  border-color: var(--tft-ink);
  color: var(--tft-paper);
}
.tft-pill-toggle .dot {
  width: 6px; height: 6px; border-radius: 3px;
  background: var(--tft-line);
  transition: background .15s;
}
.tft-pill-toggle.is-active .dot { background: var(--tft-signal); }
.tft-pill-toggle.is-readonly { cursor: default; }

/* Recent strip */
.tft-recent-strip {
  border-top: 1px solid var(--tft-line);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--tft-paper-2);
  flex-wrap: wrap;
}
.tft-recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--tft-card);
  border: 1px solid var(--tft-line);
  border-radius: 10px;
  max-width: 320px;
}
.tft-recent-chip .name {
  font-family: var(--tft-mono);
  font-size: 12px;
  color: var(--tft-ink-2);
  font-feature-settings: "zero", "ss02";
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: 200px;
}
.tft-recent-chip .time {
  font-family: var(--tft-mono);
  font-size: 11px;
  color: var(--tft-mute);
  font-feature-settings: "zero", "ss02";
}
.tft-status-dot {
  width: 8px; height: 8px; border-radius: 4px;
  background: var(--tft-signal);
  flex-shrink: 0;
}
.tft-status-dot.is-processing {
  background: var(--tft-amber);
  box-shadow: 0 0 0 3px oklch(78% 0.14 75 / 0.2);
}
.tft-status-dot.is-error { background: oklch(60% 0.20 25); }
.tft-status-dot.is-pending { background: var(--tft-line); }

/* Low-balance warning — amber alert in tokens vocabulary */
.tft-alert-amber {
  background: oklch(96% 0.04 75);
  border: 1px solid var(--tft-amber);
  color: oklch(38% 0.10 75);
  border-radius: var(--tft-r-md);
  padding: 12px 14px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Options — segmented controls + extras ─────────────────────── */
.tft-options {
  margin-top: 18px;
  background: var(--tft-card);
  border: 1px solid var(--tft-line);
  border-radius: 14px;
}
.tft-option-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--tft-line-2);
}
.tft-option-row--last { border-bottom: none; }
.tft-option-row .label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tft-option-row .name { font-size: 13px; font-weight: 500; color: var(--tft-ink); }
.tft-option-row .hint {
  font-family: var(--tft-mono);
  font-size: 10px;
  color: var(--tft-mute);
  letter-spacing: 0.04em;
  font-feature-settings: "zero", "ss02";
}
@media (min-width: 768px) {
  .tft-option-row {
    flex-direction: row;
    align-items: center;
    gap: 18px;
    padding: 14px 18px;
  }
  .tft-option-row .label { flex: 0 0 160px; }
}

.tft-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  background: var(--tft-paper-2);
  border: 1px solid var(--tft-line);
  border-radius: 10px;
  padding: 3px;
}
.tft-seg button {
  padding: 7px 12px;
  background: transparent;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  color: var(--tft-ink-3);
  cursor: pointer;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tft-seg button.is-active {
  background: var(--tft-card);
  color: var(--tft-ink);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.tft-seg button:focus-visible {
  outline: 2px solid var(--tft-signal);
  outline-offset: 1px;
}
.tft-pro {
  font-size: 9px;
  font-family: var(--tft-mono);
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--tft-signal-soft);
  color: var(--tft-signal-ink);
  letter-spacing: 0.06em;
  font-feature-settings: "zero", "ss02";
}

.tft-extras { display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 768px) {
  .tft-extras { margin-left: auto; }
}
.tft-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 36px;
  background: var(--tft-card);
  border: 1px solid var(--tft-line);
  color: var(--tft-ink-2);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  transition: all .15s;
}
.tft-toggle .dot {
  width: 5px; height: 5px; border-radius: 3px;
  background: var(--tft-line);
  transition: background .15s;
}
.tft-toggle.is-on {
  background: var(--tft-ink);
  color: var(--tft-paper);
  border-color: var(--tft-ink);
}
.tft-toggle.is-on .dot { background: var(--tft-signal); }
.tft-toggle:focus-visible { outline: 2px solid var(--tft-signal); outline-offset: 2px; }

/* ── Recents sidebar ─────────────────────────────────────────────── */
.tft-recents-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.tft-mono.caps {
  font-family: var(--tft-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tft-mute);
  font-feature-settings: "zero", "ss02";
}
.tft-link {
  font-family: var(--tft-mono);
  font-size: 11px;
  color: var(--tft-ink-3);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--tft-line);
  text-underline-offset: 4px;
  font-feature-settings: "zero", "ss02";
}
.tft-link:hover { color: var(--tft-ink); text-decoration-color: var(--tft-ink-3); }
.tft-recents-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tft-recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--tft-card);
  border: 1px solid var(--tft-line);
  border-radius: 12px;
}
.tft-recent-item .dot {
  width: 8px; height: 8px; border-radius: 4px;
  background: var(--tft-signal);
  flex-shrink: 0;
}
.tft-recent-item .dot.is-error { background: oklch(60% 0.20 25); }
.tft-recent-item .dot.is-pending { background: var(--tft-line); }
.tft-recent-item .meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tft-recent-item .name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--tft-ink);
}
.tft-recent-item .sub {
  font-family: var(--tft-mono);
  font-size: 10px;
  color: var(--tft-mute);
  letter-spacing: 0.06em;
  font-feature-settings: "zero", "ss02";
}

/* ── Mobile responsive overrides ──────────────────────────────────── */
@media (max-width: 600px) {
  .tft-topbar-inner { padding: 10px 12px; }
  .tft-lang-pill { display: none; }
  .tft-main { padding: 16px 12px 80px; gap: 16px; }
  .tft-hero-h1 { font-size: 24px; }
  .tft-options { border-radius: 10px; }
  .tft-dropzone { padding: 20px 16px; border-radius: 10px; }
  /* Buy button: hide label text, show bare "+" only */
  .tft-buy-btn .label { display: none; }
  .tft-buy-btn .tft-buy-plus { display: inline; }
  .tft-buy-btn { padding: 7px 11px; }
}

/* Focus-visible outlines */
.tft-dropzone:focus-visible {
  outline: 2px solid var(--tft-signal);
  outline-offset: 2px;
}
.tft-btn-primary:focus-visible,
.tft-btn-ghost:focus-visible,
.tft-avatar:focus-visible {
  outline: 2px solid var(--tft-signal);
  outline-offset: 2px;
}

/* ── Step 5 — Transcript view ─────────────────────────────────── */

/* Export pills — TXT / SRT / LRC / JSON */
.tft-export-btn {
  padding: 8px 12px;
  background: var(--tft-card);
  color: var(--tft-ink-2);
  border: 1px solid var(--tft-line);
  border-radius: 8px;
  font-family: var(--tft-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-feature-settings: "zero", "ss02";
  text-transform: uppercase;
  transition: all .15s;
}
.tft-export-btn:hover { background: var(--tft-paper-2); border-color: var(--tft-ink-3); }
.tft-export-btn.is-active {
  background: var(--tft-signal-soft);
  color: var(--tft-signal-ink);
  border-color: var(--tft-signal);
}

/* Transcript line states */
.tft-line {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: baseline;
  gap: 14px;
  padding: 8px 12px;
  border-radius: 10px;
  border-left: 3px solid transparent;
  background: transparent;
  transition: background .15s, border-color .15s;
  font-family: var(--tft-display);
}
.tft-line .ts {
  font-family: var(--tft-mono);
  font-size: 12px;
  color: var(--tft-ink-3);
  font-feature-settings: "zero", "ss02";
  -webkit-user-select: none;
  user-select: none;
}
.tft-line .text {
  font-size: 16px;
  line-height: 1.4;
  color: var(--tft-ink-2);
  font-weight: 400;
}
.tft-line.is-active {
  background: var(--tft-signal-soft);
  border-left-color: var(--tft-signal);
}
.tft-line.is-active .ts { color: var(--tft-signal-ink); }
.tft-line.is-active .text { color: var(--tft-ink); font-weight: 500; }
.tft-line.is-past .ts { color: var(--tft-mute); }
.tft-line.is-past .text { color: var(--tft-mute); }

/* Editable variant for the segment editor */
.tft-line input.text-input {
  font-family: var(--tft-display);
  font-size: 16px;
  line-height: 1.4;
  color: inherit;
  background: transparent;
  border: 0;
  width: 100%;
  padding: 0;
  outline: 0;
}
.tft-line input.text-input:focus { background: var(--tft-paper-2); border-radius: 4px; padding: 2px 4px; margin: -2px -4px; }

/* Stat row for meta panel */
.tft-stat-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--tft-line);
}
.tft-stat-row .label {
  font-family: var(--tft-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tft-mute);
  font-feature-settings: "zero", "ss02";
}
.tft-stat-row .value {
  font-size: 16px;
  font-weight: 500;
  color: var(--tft-ink);
}

/* Card surfaces */
.tft-card {
  background: var(--tft-card);
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-lg);
  box-shadow: var(--tft-shadow-sm);
  overflow: hidden;
}
.tft-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--tft-paper-2);
  border-bottom: 1px solid var(--tft-line);
}

/* Page main content */
.tft-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 80px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 1024px) {
  .tft-main {
    grid-template-columns: 1fr 320px;
    gap: 36px;
    padding: 36px 28px 80px;
  }
  .tft-topbar-inner { padding: 12px 28px; }
  .tft-upload-col { grid-column: 1; }
  .tft-recents { grid-column: 2; grid-row: 1; position: sticky; top: 68px; align-self: start; }
  .tft-result-col { grid-column: 1 / -1; }
}

/* Artwork thumbnail in card header — hidden until image loads */
.tft-artwork {
  width: 32px; height: 32px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  display: none;
}
.tft-artwork.is-loaded { display: block; }

/* Job-card surfaces & badges (step 5 surface treatment) */
.tft-card-filename {
  font-weight: 500;
  color: var(--tft-ink);
  font-size: 15px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.tft-badge {
  font-family: var(--tft-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tft-paper-2);
  color: var(--tft-ink-3);
  border: 1px solid var(--tft-line);
  font-feature-settings: "zero", "ss02";
}
.tft-badge.is-lang {
  background: var(--tft-signal-soft);
  color: var(--tft-signal-ink);
  border-color: var(--tft-signal);
  text-transform: uppercase;
}

/* Section heading — Results, etc. */
.tft-section-h {
  font-family: var(--tft-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tft-mute);
  font-feature-settings: "zero", "ss02";
  margin: 0 0 12px;
}

/* Status icon halo helpers */
.tft-icon-amber { color: var(--tft-amber); }
.tft-icon-signal { color: var(--tft-signal); }
.tft-icon-error { color: oklch(60% 0.20 25); }

/* Audio player chrome */
.tft-player-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--tft-paper-2);
  border: 1px solid var(--tft-line);
  border-radius: 12px;
  padding: 8px 12px;
}
.tft-play-btn {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--tft-ink);
  color: var(--tft-paper);
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.tft-play-btn:hover { background: var(--tft-ink-2); }
.tft-time {
  font-family: var(--tft-mono);
  font-size: 11px;
  color: var(--tft-ink-3);
  flex-shrink: 0;
  -webkit-user-select: none;
  user-select: none;
  font-feature-settings: "zero", "ss02";
}

/* Scrubber — token-based fill gradient */
.scrubber.tft {
  background: linear-gradient(
    to right,
    var(--tft-signal) calc(var(--pct, 0) * 1%),
    var(--tft-line) calc(var(--pct, 0) * 1%)
  );
}
.scrubber.tft::-webkit-slider-thumb { background: var(--tft-signal); }
.scrubber.tft::-moz-range-thumb { background: var(--tft-signal); }

/* Export pill row */
.tft-export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Segment table container */
.tft-segments {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--tft-line);
  border-radius: 12px;
  background: var(--tft-card);
  padding: 8px;
}

/* Time chip in the player */
.tft-time-w20 { width: 90px; text-align: right; }

/* Sync checkbox label */
.tft-sync-label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  -webkit-user-select: none;
  user-select: none;
  font-size: 12px;
  color: var(--tft-ink-3);
  cursor: pointer;
}
.tft-sync-label.is-disabled { cursor: not-allowed; opacity: 0.4; }
.tft-sync-label input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: var(--tft-signal);
}

/* Lyrics editor container header */
.tft-segments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

/* Lyrics-modified badge */
.tft-modified-badge {
  display: inline-block;
  font-family: var(--tft-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: oklch(94% 0.05 75);
  color: oklch(38% 0.10 75);
  margin-left: 8px;
  font-feature-settings: "zero", "ss02";
}
.tft-revert-link {
  background: transparent;
  border: 0;
  font-size: 12px;
  color: var(--tft-ink-3);
  text-decoration: underline;
  cursor: pointer;
}
.tft-revert-link:hover { color: var(--tft-ink); }

/* Save transcript button */
.tft-save-link {
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--tft-signal-ink);
  text-decoration: underline;
  cursor: pointer;
}
.tft-save-link:hover { color: var(--tft-signal); }
.tft-save-link:disabled { opacity: 0.5; cursor: wait; }

/* Flex wrapper for save/revert action buttons */
.tft-segments-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Done-state body padding override */
.tft-card-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Audio + Lyrics tag button (primary action with icon) */
.tft-btn-primary.is-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tft-btn-primary[disabled] { opacity: 0.6; cursor: wait; }

/* Roon-sync footnote */
.tft-roon-note {
  font-size: 12px;
  color: var(--tft-mute);
  line-height: 1.5;
  margin: 0;
}
.tft-roon-note strong { color: var(--tft-ink-3); font-weight: 500; }

/* Fallback textarea when no segments */
.tft-fallback-textarea {
  width: 100%;
  border: 1px solid var(--tft-line);
  border-radius: 12px;
  background: var(--tft-card);
  padding: 14px 16px;
  font-family: var(--tft-mono);
  font-size: 13px;
  color: var(--tft-ink-2);
  outline: 0;
  resize: vertical;
}
.tft-fallback-textarea:focus { border-color: var(--tft-signal); background: var(--tft-card); }

/* "Embed in file" action — pushed to the right of the export pills */
.tft-export-action { margin-left: auto; }

/* Processing-state row */
.tft-processing {
  flex-direction: row;
  align-items: center;
  font-size: 14px;
  color: var(--tft-ink-3);
}

/* v1.5.x — phase-aware processing card. Replaces the spinner+text row with
   a labeled indeterminate bar so the user knows which pipeline stage is
   running and roughly how long it's taken. */
.tft-processing-v2 {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.tft-phase-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--tft-ink-2);
}
.tft-phase-label { flex: 1 1 auto; font-weight: 500; }
.tft-phase-elapsed {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--tft-ink-3);
}
.tft-phase-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.tft-phase-bar-stripe {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 35%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--tft-accent), var(--tft-accent-2, var(--tft-accent)));
  will-change: transform;
  animation: tft-phase-bar-flow 1.6s ease-in-out infinite;
}
.tft-phase-bar.is-retry .tft-phase-bar-stripe {
  background: linear-gradient(90deg, #f59e0b, #ea580c);
}
@keyframes tft-phase-bar-flow {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(385%); }
}
.tft-phase-hint {
  font-size: 12px;
  color: var(--tft-ink-3);
  margin: 0;
}
/* v1.6 — determinate Demucs progress bar */
.tft-phase-bar--determinate {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.tft-phase-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--tft-accent), var(--tft-accent-2, var(--tft-accent)));
  transition: width 0.8s ease;
}
/* v1.6 — percentage badge next to elapsed time */
.tft-demucs-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--tft-accent);
  margin-left: auto;
  padding-left: 8px;
}

/* v1.5.x — byte-level upload progress bar in the drop zone. Determinate
   (driven by XHR upload.onprogress), unlike the indeterminate phase bar. */
.tft-upload-bar {
  margin-top: 8px;
  height: 6px;
  width: 200px;
  max-width: 100%;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.tft-upload-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--tft-accent), var(--tft-accent-2, var(--tft-accent)));
  transition: width 120ms ease-out;
}

/* ── Modals (token-based) ───────────────────────────────────── */

.tft-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(21, 22, 26, 0.45);
}
.tft-modal {
  background: var(--tft-card);
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-lg);
  box-shadow: var(--tft-shadow-md);
  padding: 24px;
  width: 100%;
  max-width: 384px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: var(--tft-display);
  color: var(--tft-ink);
  max-height: 88vh;
  overflow-y: auto;
}
.tft-modal-lg { max-width: 560px; }
.tft-modal-xl { max-width: 768px; }
.tft-modal-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--tft-ink);
}
.tft-modal-sub {
  font-size: 13px;
  color: var(--tft-ink-3);
  margin: 4px 0 0;
  line-height: 1.5;
}
.tft-modal-hint {
  font-size: 13px;
  color: var(--tft-mute);
  text-align: center;
  padding: 16px 0;
}
.tft-modal-cancel {
  text-align: center;
  padding: 4px 0;
  width: 100%;
}

.tft-alert-error {
  background: oklch(96% 0.05 25);
  border: 1px solid oklch(60% 0.20 25);
  color: oklch(38% 0.18 25);
  border-radius: var(--tft-r-md);
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.4;
}

/* Pack grid in Buy modal */
.tft-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.tft-pack-card {
  background: var(--tft-card);
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-md);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  text-align: left;
  font-family: var(--tft-display);
  color: var(--tft-ink);
}
.tft-pack-card:hover:not(:disabled) {
  border-color: var(--tft-ink);
  transform: translateY(-1px);
  box-shadow: var(--tft-shadow-md);
}
.tft-pack-card:disabled { opacity: 0.5; cursor: not-allowed; }
.tft-pack-card.is-featured {
  border-color: var(--tft-signal);
  background: var(--tft-signal-soft);
}
.tft-pack-card.is-featured:hover:not(:disabled) {
  border-color: var(--tft-signal-ink);
}
.tft-pack-name {
  font-family: var(--tft-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tft-mute);
  font-feature-settings: "zero", "ss02";
  margin-bottom: 2px;
}
.tft-pack-card.is-featured .tft-pack-name { color: var(--tft-signal-ink); }
.tft-pack-credits {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 22px;
  font-weight: 600;
  color: var(--tft-ink);
  letter-spacing: -0.02em;
}
.tft-pack-credits-label {
  font-size: 12px;
  font-weight: 400;
  color: var(--tft-ink-3);
  letter-spacing: 0;
}
.tft-pack-price {
  font-size: 14px;
  color: var(--tft-ink-2);
  font-weight: 500;
}
.tft-pack-unit {
  font-family: var(--tft-mono);
  font-size: 11px;
  color: var(--tft-mute);
  font-feature-settings: "zero", "ss02";
}
.tft-pack-loading {
  font-size: 11px;
  color: var(--tft-signal-ink);
  margin-top: 4px;
}

/* Non-refundable terms block */
.tft-buy-terms {
  border-top: 1px solid var(--tft-line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tft-buy-terms-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--tft-ink-2);
  cursor: pointer;
  line-height: 1.4;
}
.tft-buy-terms-check input[type="checkbox"] {
  margin-top: 1px;
  width: 14px; height: 14px;
  accent-color: var(--tft-ink);
  flex-shrink: 0;
}

.tft-stripe-notice {
  font-size: 11px;
  color: var(--tft-mute);
  text-align: center;
  margin: 0;
}

/* Tabs inside auth modal */
.tft-modal-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--tft-line);
  padding-bottom: 8px;
  margin: 0 0 4px;
}
.tft-modal-tab {
  font-family: var(--tft-display);
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 6px 2px;
  margin-bottom: -10px;
  color: var(--tft-mute);
  cursor: pointer;
}
.tft-modal-tab:hover { color: var(--tft-ink-3); }
.tft-modal-tab.is-active {
  color: var(--tft-ink);
  font-weight: 600;
  border-bottom-color: var(--tft-ink);
}

/* Forms */
.tft-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tft-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tft-field > span {
  font-size: 12px;
  font-weight: 500;
  color: var(--tft-ink-3);
  font-family: var(--tft-display);
}
.tft-input {
  width: 100%;
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-sm);
  padding: 8px 12px;
  font-size: 14px;
  font-family: var(--tft-display);
  color: var(--tft-ink);
  background: var(--tft-card);
  outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.tft-input:focus {
  border-color: var(--tft-ink);
  box-shadow: 0 0 0 3px var(--tft-paper-2);
}
.tft-btn-block { width: 100%; padding: 10px 14px; }
.tft-form-footnote {
  font-size: 11px;
  color: var(--tft-mute);
  text-align: center;
  margin: 4px 0 0;
  line-height: 1.4;
}
.tft-form-forgot {
  background: none;
  border: 0;
  padding: 4px 0;
  font-size: 12px;
  text-align: center;
  width: 100%;
  cursor: pointer;
}

/* v1.5 — audio mode pill row + premium badge on the upload page. */
.tft-audio-mode-row {
  margin-top: 8px;
  align-items: center;
}
.tft-audio-mode-label {
  margin-right: 8px;
  color: var(--tft-mute);
}
.tft-pill-badge {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--tft-signal-soft);
  color: var(--tft-signal-ink, var(--tft-ink));
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tft-audio-mode-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--tft-mute);
  max-width: 720px;
  line-height: 1.4;
}

/* v1.5 — track-detected card on the done-state job. */
.tft-track-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid var(--tft-line);
  border-radius: 10px;
  background: var(--tft-paper-2);
  font-size: 13px;
}
.tft-track-card.is-success {
  background: var(--tft-signal-soft);
  border-color: var(--tft-signal);
}
.tft-track-card.is-no-match {
  border-style: dashed;
  color: var(--tft-mute);
}
.tft-track-card.is-failed {
  border-color: #c0392b;
  background: #fdecea;
  color: #5c1f1a;
}
.tft-track-card .tft-track-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.tft-track-card .tft-track-name {
  font-weight: 500;
}
.tft-track-disclaimer {
  display: block;
  font-size: 11px;
  color: var(--tft-mute);
  margin-top: 2px;
}
.tft-track-card .tft-track-link {
  color: inherit;
  font-size: 11px;
  text-decoration: underline;
  white-space: nowrap;
}

/* Admin logs viewer — preserves whitespace from multi-line tracebacks
   and caps height so the page scroll stays in the right place. */
.tft-log-viewer {
  max-height: 70vh;
  white-space: pre-wrap;
  word-break: break-word;
}

/* v1.3 Personal Access Tokens UI in the account modal. */
.tft-pat-reveal {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.tft-pat-plaintext {
  flex: 1;
  font-family: var(--tft-mono);
  font-size: 12px;
  background: var(--tft-paper);
  border: 1px solid var(--tft-line);
  border-radius: 6px;
  padding: 6px 8px;
  word-break: break-all;
  -webkit-user-select: all;
  user-select: all;
}
.tft-pat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}
.tft-pat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--tft-line);
  border-radius: 8px;
  background: var(--tft-paper);
}
.tft-pat-row.is-revoked { opacity: .55; }
.tft-pat-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; overflow: hidden; }
.tft-pat-name { font-weight: 500; color: var(--tft-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tft-pat-row .tft-caption-mono { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tft-pat-create {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.tft-pat-create .tft-input { flex: 1; min-width: 180px; }
.tft-pat-scope {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--tft-ink-2);
  -webkit-user-select: none;
  user-select: none;
}

/* Per-attempt audit table — collapsible under done jobs. */
.tft-attempt-details {
  margin-top: 12px;
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-md);
  background: var(--tft-paper-2);
  padding: 8px 12px;
}
.tft-attempt-summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  color: var(--tft-ink-2);
  -webkit-user-select: none;
  user-select: none;
}
.tft-attempt-summary::-webkit-details-marker { color: var(--tft-mute); }
.tft-attempt-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 12px;
}
.tft-attempt-table th,
.tft-attempt-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--tft-line);
}
.tft-attempt-table th {
  font-weight: 500;
  color: var(--tft-mute);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tft-attempt-good { color: var(--tft-signal-ink, var(--tft-ink)); font-weight: 500; }
.tft-attempt-warn { color: #b45309; font-weight: 500; }
.tft-attempt-bad  { color: #c0392b; font-weight: 500; font-family: var(--tft-mono); font-size: 11px; }

/* Transient toast — fixed top-center, auto-dismiss after a few seconds. */
.tft-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 40px 12px 16px;
  border-radius: var(--tft-r-md);
  background: var(--tft-paper);
  border: 1px solid var(--tft-line);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
  font-size: 14px;
  line-height: 1.4;
  color: var(--tft-ink);
}
.tft-toast.is-success {
  border-color: var(--tft-signal);
  background: var(--tft-signal-soft);
  color: var(--tft-signal-ink, var(--tft-ink));
}
.tft-toast.is-error {
  border-color: #c0392b;
  background: #fdecea;
  color: #5c1f1a;
}
.tft-toast-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: 0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: .55;
}
.tft-toast-close:hover { opacity: 1; }
.tft-captcha { display: flex; justify-content: center; }

/* Modal header row with action button */
.tft-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* Account modal sections */
.tft-account-section {
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--tft-card);
}
.tft-account-section.is-danger { border-color: oklch(78% 0.14 25); }
.tft-referral-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tft-referral-code {
  font-family: var(--tft-mono);
  font-size: 12px;
  background: var(--tft-paper-2);
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-sm);
  padding: 6px 10px;
  flex: 1;
  min-width: 0;
  word-break: break-all;
  color: var(--tft-ink);
  font-feature-settings: "zero", "ss02";
}
.tft-account-section-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  color: var(--tft-ink);
}
.tft-account-section.is-danger .tft-account-section-title { color: oklch(45% 0.18 25); }
.tft-account-section-body {
  font-size: 12px;
  color: var(--tft-ink-3);
  line-height: 1.5;
  margin: 0;
}

/* Danger button (delete) */
.tft-btn-danger {
  background: oklch(60% 0.20 25);
  color: var(--tft-paper);
  border: 0;
  padding: 8px 14px;
  border-radius: var(--tft-r-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--tft-display);
}
.tft-btn-danger:hover { background: oklch(52% 0.20 25); }
.tft-btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }
.tft-btn-row { display: flex; gap: 8px; }

/* History table */
.tft-history-table-wrap { overflow-x: auto; }
.tft-history-table {
  width: 100%;
  font-family: var(--tft-display);
  font-size: 13px;
  border-collapse: collapse;
}
.tft-history-table thead tr {
  border-bottom: 1px solid var(--tft-line);
}
.tft-history-table thead th {
  font-family: var(--tft-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tft-mute);
  text-align: left;
  padding: 8px 12px 8px 0;
  font-weight: 500;
  font-feature-settings: "zero", "ss02";
}
.tft-history-table tbody tr {
  border-bottom: 1px solid var(--tft-line-2);
}
.tft-history-table tbody td {
  padding: 8px 12px 8px 0;
  vertical-align: top;
  color: var(--tft-ink);
}
.tft-history-cell-mono {
  font-family: var(--tft-mono);
  font-size: 12px;
  color: var(--tft-ink-3);
  font-feature-settings: "zero", "ss02";
}
.tft-history-filename {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--tft-ink);
}
.tft-history-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tft-paper-2);
  color: var(--tft-ink-3);
  border: 1px solid var(--tft-line);
}
.tft-history-status.is-done {
  background: var(--tft-signal-soft);
  color: var(--tft-signal-ink);
  border-color: var(--tft-signal);
}
.tft-history-status.is-error {
  background: oklch(96% 0.05 25);
  color: oklch(38% 0.18 25);
  border-color: oklch(78% 0.14 25);
}
.tft-history-fmts { display: flex; flex-wrap: wrap; gap: 4px; }
.tft-export-btn-mini { padding: 3px 8px; font-size: 11px; }

/* Export format group: download btn + copy-to-clipboard btn side by side */
.tft-export-group {
  display: inline-flex;
  align-items: stretch;
  border-radius: 8px;
  overflow: hidden;
}
.tft-export-group .tft-export-btn {
  border-radius: 0;
  border-right: 0;
}
.tft-export-group .tft-export-btn-mini {
  border-radius: 0;
  border-right: 0;
}
.tft-export-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  background: var(--tft-card);
  color: var(--tft-ink-3);
  border: 1px solid var(--tft-line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transition: all .15s;
}
.tft-export-copy:hover { background: var(--tft-paper-2); color: var(--tft-ink-2); }
.tft-export-copy.is-copied { color: var(--tft-signal); background: var(--tft-signal-soft); }
/* Icon toggle: clipboard shown by default, checkmark on copy */
.tft-export-copy .icon-check    { display: none; }
.tft-export-copy.is-copied .icon-clipboard { display: none; }
.tft-export-copy.is-copied .icon-check    { display: block; }
.tft-export-copy-mini { width: 22px; }
.tft-export-btn.is-no-timestamps { opacity: 0.45; }
.tft-fmt-info-divider { border: none; border-top: 1px solid var(--tft-line); margin: 6px 0; }

/* Export format info — ℹ button + expandable description panel */
.tft-fmt-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;   /* larger tap target */
  border-radius: 50%;
  background: transparent;
  color: var(--tft-ink-3);
  border: 1px solid var(--tft-line);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.tft-fmt-info-btn:hover,
.tft-fmt-info-btn.is-active {
  background: var(--tft-paper-2);
  border-color: var(--tft-ink-3);
  color: var(--tft-ink);
}
.tft-fmt-info-panel {
  background: var(--tft-paper-2);
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.tft-fmt-info-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: baseline;
}
.tft-fmt-info-key {
  font-family: var(--tft-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tft-ink-2);
  font-feature-settings: "zero", "ss02";
}
.tft-fmt-info-val {
  font-size: 12px;
  color: var(--tft-ink-3);
  line-height: 1.4;
}

.tft-history-unavailable {
  font-size: 11px;
  color: var(--tft-mute);
  font-style: italic;
}

/* Save tagged-audio options */
.tft-save-options { display: flex; flex-direction: column; gap: 8px; }
.tft-save-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: var(--tft-card);
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-md);
  cursor: pointer;
  text-align: left;
  font-family: var(--tft-display);
  transition: border-color .15s, background .15s;
}
.tft-save-option:hover {
  border-color: var(--tft-ink);
  background: var(--tft-paper-2);
}
.tft-save-option-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  color: var(--tft-ink-3);
}
.tft-save-option-text { min-width: 0; flex: 1; }
.tft-save-option-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--tft-ink);
  margin: 0;
}
.tft-save-option-sub {
  font-family: var(--tft-mono);
  font-size: 11px;
  color: var(--tft-mute);
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-feature-settings: "zero", "ss02";
}

/* Awaiting-payment quote list */
.tft-quote-banner {
  background: var(--tft-paper-2);
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tft-quote-banner-body {
  margin: 0;
  font-size: 12px;
  color: var(--tft-ink-3);
  line-height: 1.5;
}
.tft-quote-list {
  margin: 0;
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-md);
  overflow: hidden;
  font-size: 13px;
}
.tft-quote-list > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--tft-line-2);
}
.tft-quote-list > div:last-child { border-bottom: 0; }
.tft-quote-list > div:nth-child(odd) { background: var(--tft-paper-2); }
.tft-quote-list dt {
  font-family: var(--tft-display);
  font-size: 12px;
  color: var(--tft-ink-3);
  font-weight: 500;
  margin: 0;
}
.tft-quote-list dd {
  margin: 0;
  color: var(--tft-ink);
  min-width: 0;
  overflow-wrap: anywhere;
}
.tft-quote-credits {
  color: var(--tft-signal-ink);
  font-weight: 600;
}
.tft-quote-preview {
  font-family: var(--tft-mono);
  font-size: 12px;
  color: var(--tft-ink-3);
  background: var(--tft-paper-2);
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-sm);
  padding: 10px 12px;
  white-space: pre-wrap;
  margin: 6px 0 0;
  font-feature-settings: "zero", "ss02";
}

/* Refund-confirmation badge in error state */
.tft-refund-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--tft-signal-soft);
  color: var(--tft-signal-ink);
  border: 1px solid var(--tft-signal);
  font-size: 12px;
  font-weight: 500;
  width: fit-content;
}

/* Block variant of error alert (icon + body) */
.tft-alert-error-block {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.tft-alert-error-block .tft-alert-title { color: oklch(38% 0.18 25); }
.tft-alert-error-block .tft-alert-body { color: oklch(45% 0.18 25); }

/* ── Marketing landing (anonymous visitors) ─────────────────── */

.tft-landing-hero {
  text-align: center;
  padding: 24px 0 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Launch-offer banner — shown above the hero on the public landing */
.tft-launch-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--tft-signal-soft);
  color: var(--tft-signal-ink);
  border: 1px solid var(--tft-signal);
  font-family: var(--tft-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.tft-launch-banner strong { font-weight: 700; }

/* Locked-state landing dropzone — hint that auth is required */
.tft-landing-dropzone.is-locked {
  border-style: dashed;
  position: relative;
}
.tft-landing-dropzone.is-locked::before {
  content: "🔒";
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 14px;
  opacity: 0.4;
}
.tft-landing-hero .tft-hero-h1 { max-width: 720px; }
.tft-landing-hero .tft-hero-sub { max-width: 600px; margin-bottom: 24px; }
.tft-landing-cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin-bottom: 32px;
}
.tft-btn-block-md { padding: 12px 22px; font-size: 14px; }

.tft-landing-dropzone {
  width: min(640px, 100%);
  margin: 0 auto;
  background: var(--tft-card);
  border: 2px dashed var(--tft-line);
  border-radius: 18px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
  outline: 0;
}
.tft-landing-dropzone:hover,
.tft-landing-dropzone.is-dragging,
.tft-landing-dropzone:focus-visible {
  background: var(--tft-signal-soft);
  border-color: var(--tft-signal);
}
.tft-landing-dropzone:hover .tft-eq svg rect,
.tft-landing-dropzone.is-dragging .tft-eq svg rect {
  fill: var(--tft-signal);
  animation: tft-eq 1.1s ease-in-out infinite;
  transform-origin: bottom;
}

/* Generic landing section frame */
.tft-landing-section {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--tft-line);
}
.tft-landing-section h2 { margin-top: 0; }

/* Steps grid */
.tft-landing-steps,
.tft-landing-cases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.tft-landing-steps article,
.tft-landing-cases article {
  background: var(--tft-card);
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--tft-shadow-sm);
}
.tft-landing-steps article h3,
.tft-landing-cases article h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--tft-ink);
}
.tft-landing-steps article p,
.tft-landing-cases article p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--tft-ink-3);
}

/* Pricing strip */
.tft-landing-pricing-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.tft-landing-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 18px;
}
/* Pack cards inside the landing — non-interactive, slightly smaller */
.tft-landing-pricing-grid .tft-pack-card {
  cursor: default;
  pointer-events: none;
}

/* Final CTA */
.tft-landing-cta-final { text-align: center; }
.tft-landing-cta-final .tft-hero-h1 { font-size: 36px; max-width: 640px; margin: 0 auto 8px; }
.tft-landing-cta-final .tft-hero-sub { max-width: 560px; margin: 0 auto 22px; }

/* Disclaimer */
.tft-landing-disclaimer {
  margin-top: 56px;
  padding: 18px 20px;
  background: var(--tft-paper-2);
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-md);
  font-size: 12px;
  color: var(--tft-mute);
  line-height: 1.5;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.tft-landing-disclaimer p { margin: 0; }

/* ── How it works animation (landing) ───────────────────────── */

.tft-howit-anim-section .tft-section-h { margin-bottom: 18px; }
.tft-howit-anim {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--tft-card);
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-lg);
  padding: 24px 18px;
  margin-bottom: 18px;
  color: var(--tft-mute);
}
.tft-howit-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 140px;
}
.tft-howit-label {
  font-family: var(--tft-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tft-mute);
  font-feature-settings: "zero", "ss02";
}
.tft-howit-arrow { color: var(--tft-line-2); flex-shrink: 0; }

.tft-howit-eq-bars rect { fill: var(--tft-ink-2); transform-origin: bottom; }
.tft-howit-eq-bars rect:nth-child(1) { animation: tft-howit-bar 1.6s ease-in-out infinite; }
.tft-howit-eq-bars rect:nth-child(2) { animation: tft-howit-bar 1.6s ease-in-out infinite .1s; }
.tft-howit-eq-bars rect:nth-child(3) { animation: tft-howit-bar 1.6s ease-in-out infinite .2s; fill: var(--tft-signal); }
.tft-howit-eq-bars rect:nth-child(4) { animation: tft-howit-bar 1.6s ease-in-out infinite .3s; }
.tft-howit-eq-bars rect:nth-child(5) { animation: tft-howit-bar 1.6s ease-in-out infinite .4s; fill: var(--tft-signal); }
.tft-howit-eq-bars rect:nth-child(6) { animation: tft-howit-bar 1.6s ease-in-out infinite .5s; }
.tft-howit-eq-bars rect:nth-child(7) { animation: tft-howit-bar 1.6s ease-in-out infinite .6s; }
.tft-howit-eq-bars rect:nth-child(8) { animation: tft-howit-bar 1.6s ease-in-out infinite .7s; }

@keyframes tft-howit-bar {
  0%, 100% { transform: scaleY(0.4); }
  50%      { transform: scaleY(1); }
}

.tft-howit-text {
  width: 220px;
  align-items: stretch;
}
.tft-howit-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
}
.tft-howit-line .ts {
  font-family: var(--tft-mono);
  font-size: 10px;
  color: var(--tft-mute);
  font-feature-settings: "zero", "ss02";
}
.tft-howit-line .text {
  font-size: 13px;
  color: var(--tft-ink-2);
  flex: 1;
  height: 12px;
  background: linear-gradient(to right, var(--tft-ink-2) 50%, var(--tft-line) 50%);
  background-size: 200% 100%;
  background-position: 100% 0;
  animation: tft-howit-type 4s linear infinite;
  border-radius: 2px;
}
.tft-howit-line:nth-child(2) .text { animation-delay: 0.6s; }
.tft-howit-line:nth-child(3) .text { animation-delay: 1.2s; background-image: linear-gradient(to right, var(--tft-signal-ink) 50%, var(--tft-line) 50%); }

@keyframes tft-howit-type {
  0%   { background-position: 100% 0; }
  50%  { background-position: 0 0; }
  90%  { background-position: 0 0; }
  100% { background-position: 100% 0; }
}

.tft-howit-exports {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 6px;
  align-items: center;
}
.tft-howit-pill {
  font-family: var(--tft-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-sm);
  color: var(--tft-ink-3);
  background: var(--tft-card);
  font-feature-settings: "zero", "ss02";
  animation: tft-howit-pill 4.8s ease-in-out infinite;
}
.tft-howit-pill[data-i="0"] { animation-delay: 0s; }
.tft-howit-pill[data-i="1"] { animation-delay: .3s; }
.tft-howit-pill[data-i="2"] { animation-delay: .6s; }
.tft-howit-pill[data-i="3"] { animation-delay: .9s; }
.tft-howit-exports .tft-howit-label { grid-column: 1 / -1; margin-top: 4px; }

@keyframes tft-howit-pill {
  0%, 60%, 100% {
    background: var(--tft-card);
    color: var(--tft-ink-3);
    border-color: var(--tft-line);
  }
  20%, 40% {
    background: var(--tft-signal-soft);
    color: var(--tft-signal-ink);
    border-color: var(--tft-signal);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tft-howit-eq-bars rect,
  .tft-howit-line .text,
  .tft-howit-pill { animation: none; }
  .tft-howit-line .text { background-position: 0 0; }
  .tft-howit-pill[data-i="0"],
  .tft-howit-pill[data-i="2"] {
    background: var(--tft-signal-soft);
    color: var(--tft-signal-ink);
    border-color: var(--tft-signal);
  }
}

/* ── Profile dropdown (avatar menu) ─────────────────────────── */

.tft-profile-menu {
  position: relative;
  display: inline-block;
}
.tft-profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: var(--tft-card);
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-md);
  box-shadow: var(--tft-shadow-md);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 40;
  font-family: var(--tft-display);
}
.tft-profile-header {
  padding: 10px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid var(--tft-line-2);
  margin-bottom: 4px;
}
.tft-profile-email {
  font-size: 13px;
  color: var(--tft-ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.tft-profile-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--tft-ink-2);
  font-family: var(--tft-display);
  text-decoration: none;
  border-radius: var(--tft-r-sm);
  cursor: pointer;
}
.tft-profile-item:hover { background: var(--tft-paper-2); color: var(--tft-ink); }
.tft-profile-item.is-danger { color: oklch(45% 0.18 25); }
.tft-profile-item.is-danger:hover { background: oklch(96% 0.05 25); color: oklch(38% 0.18 25); }
.tft-profile-divider {
  border-top: 1px solid var(--tft-line-2);
  margin: 4px 0;
}

/* Signal-coloured success alert */
.tft-alert-signal {
  background: var(--tft-signal-soft);
  color: var(--tft-signal-ink);
  border: 1px solid var(--tft-signal);
  border-radius: var(--tft-r-md);
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.4;
}

/* ── Guide / How-it-works modal ─────────────────────────────── */

/* Size variant */
.tft-modal-guide { max-width: 600px; padding: 20px; gap: 12px; }

/* Close icon button in header */
.tft-guide-close-btn {
  width: 28px; height: 28px;
  border-radius: var(--tft-r-sm);
  border: 1px solid var(--tft-line);
  background: transparent;
  color: var(--tft-mute);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.tft-guide-close-btn:hover { background: var(--tft-paper); color: var(--tft-ink); }

/* Scrollable content area */
.tft-guide-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: calc(80vh - 140px);
  padding-right: 2px;
}

/* Intro paragraph */
.tft-guide-intro {
  font-size: 13px;
  color: var(--tft-ink-3);
  line-height: 1.55;
  margin: 0;
}

/* Audio mode cards */
.tft-guide-card {
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: var(--tft-paper);
}
.tft-guide-card.is-featured {
  background: var(--tft-card);
  border-color: var(--tft-ink-2);
}
.tft-guide-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tft-guide-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--tft-ink);
}
.tft-guide-badge {
  font-family: var(--tft-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
}
.tft-guide-badge.is-rec {
  background: var(--tft-signal-soft);
  color: var(--tft-signal-ink);
  border: 1px solid var(--tft-signal);
}
.tft-guide-badge.is-prem {
  background: var(--tft-ink);
  color: var(--tft-paper);
}
.tft-guide-card-desc {
  font-size: 13px;
  color: var(--tft-ink-3);
  line-height: 1.55;
  margin: 0;
}
.tft-guide-feats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tft-guide-feat {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--tft-ink-3);
  line-height: 1.4;
}
.tft-guide-feat .icon {
  width: 13px; height: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}
.tft-guide-feat.is-ok   .icon { color: var(--tft-signal); }
.tft-guide-feat.is-warn .icon { color: var(--tft-amber); }
.tft-guide-feat.is-cond .icon { color: var(--tft-mute); }
.tft-guide-privacy-note {
  font-size: 11px;
  color: var(--tft-mute);
  line-height: 1.5;
  margin: 0;
  border-top: 1px solid var(--tft-line-2);
  padding-top: 8px;
}

/* Format list */
.tft-guide-fmt-list {
  border: 1px solid var(--tft-line);
  border-radius: var(--tft-r-md);
  overflow: hidden;
  background: var(--tft-card);
}
.tft-guide-fmt-card {
  padding: 12px 16px;
  border-bottom: 1px solid var(--tft-line-2);
}
.tft-guide-fmt-card:last-child { border-bottom: none; }
.tft-guide-fmt-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}
.tft-guide-fmt-key {
  font-family: var(--tft-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--tft-r-xs);
  background: var(--tft-ink);
  color: var(--tft-paper);
  flex-shrink: 0;
}
.tft-guide-fmt-key.is-embed {
  background: var(--tft-signal-soft);
  color: var(--tft-signal-ink);
  border: 1px solid var(--tft-signal);
}
.tft-guide-fmt-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--tft-ink);
}
.tft-guide-fmt-desc {
  font-size: 12px;
  color: var(--tft-ink-3);
  line-height: 1.55;
  margin: 0 0 4px;
}
.tft-guide-fmt-use {
  font-size: 10px;
  color: var(--tft-mute);
  letter-spacing: 0.06em;
  margin: 0;
}

/* Timestamp warning note */
.tft-guide-ts-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: oklch(97% 0.04 75);
  border: 1px solid var(--tft-amber);
  border-radius: var(--tft-r-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--tft-ink-3);
  line-height: 1.5;
}

/* Help (?) button next to section labels */
.tft-help-btn {
  width: 18px; height: 18px;
  border-radius: 9px;
  border: 1.5px solid var(--tft-line);
  background: transparent;
  color: var(--tft-mute);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--tft-display);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all .15s;
  flex-shrink: 0;
}
.tft-help-btn:hover {
  background: var(--tft-ink);
  color: var(--tft-paper);
  border-color: var(--tft-ink);
}

/* ── PR4 — Result card + mobile export bar ─────────────────────── */

/* Mobile: compact export row, larger min tap targets */
@media (max-width: 600px) {
  .tft-export-row { gap: 6px; }
  .tft-export-btn { padding: 9px 10px; min-height: 44px; }
  .tft-export-copy { min-width: 44px; min-height: 44px; }
  .tft-segments-scroll { max-height: 60vh; }
  .tft-card-header { padding: 12px 14px; }
  .tft-card-body { padding: 14px; }
}

/* Sticky export bar — fixed to bottom of screen on narrow viewports so the
   buttons remain reachable without scrolling down past a long transcript.
   Only activates when the result card has a .is-done class. */
@media (max-width: 600px) {
  .tft-card.is-done .tft-export-row {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    z-index: 20;
    background: var(--tft-ink);
    border-radius: 14px;
    padding: 10px 14px;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
    /* Flip button colours so they read on the dark background */
    --tft-ink: #F6F4EE;
    --tft-ink-2: rgba(246,244,238,.7);
    --tft-ink-3: rgba(246,244,238,.5);
    --tft-paper: #15161A;
    --tft-paper-2: #1e1f24;
    --tft-card: #23242a;
    --tft-line: rgba(246,244,238,.15);
    --tft-line-2: rgba(246,244,238,.08);
  }
  /* Push the transcript up so the fixed bar doesn't overlap the last line */
  .tft-card.is-done .tft-card-body {
    padding-bottom: 80px;
  }
}
