/* ==========================================================================
   Transkryptomat × TranscriptMate — shared product design system · v2.2
   --------------------------------------------------------------------------
   One system, two brands. Transkryptomat (PL) and TranscriptMate (EN) run on
   the same tokens, the same components and the same interaction rules. Only
   the wordmark, the locale, the currency and the default plan differ.

   RULE 1 · palette
   Seven literals exist. Every other tone in this file is derived with
   color-mix() from those seven — never a new hex, never an invented hue.

   RULE 2 · accent budget
   Electric blue (--accent) is high-signal: eyebrow, one focused action, the
   focus ring, one selected state per decision cluster. Two appearances per
   screen, maximum. Violet (--signature) is the single signature — audio
   playhead, quote mark, "Unlimited" tag. Never ambient, never a wash.

   RULE 3 · structure
   1px borders create structure; shadows are reserved for floating layers.
   8px baseline grid; 4px only inside dense toolbars. Radii: 10 controls,
   16 cards, 24 immersive panels, pill for actions.

   RULE 4 · surfaces
   Cool white is the reading canvas, pearl white groups content, ink is the
   immersive panel (player, workspace, press band). Apply `.on-ink` to a
   section and every nested component re-maps itself.
   ========================================================================== */

/* ─── 1. TOKENS ─────────────────────────────────────────────────────────── */
:root {
  /* palette — the only colour literals in the system */
  --bg:         #f6f9fb;   /* oklch(98.0% 0.004 236.5) cool white canvas   */
  --surface:    #ffffff;   /* oklch(100% 0 90)        pearl, raised areas  */
  --fg:         #0e171e;   /* oklch(19.9% 0.019 242.3) ink blue text/panel */
  --muted:      #5a656d;   /* oklch(50.0% 0.019 239.4) slate mist          */
  --border:     #dbdfe2;   /* oklch(90.1% 0.006 239.8) cool line           */
  --accent:     #4a4dff;   /* electric blue, sampled from the original logo */
  --signature:  #7427fb;   /* violet, sampled from the original logo */

  /* derived tones — computed here so `.on-ink` cannot re-mix them */
  --accent-ink:       color-mix(in oklch, var(--accent) 85%, var(--fg)); /* derived contrast tone */
  --accent-hover:     color-mix(in oklch, var(--accent) 70%, var(--fg)); /* derived contrast tone */
  --accent-soft:      color-mix(in oklch, var(--accent) 12%, var(--surface));
  --accent-line:      color-mix(in oklch, var(--accent) 38%, var(--surface));
  --btn-primary-bg:   color-mix(in oklch, var(--accent) 85%, var(--fg)); /* derived contrast tone */
  --btn-primary-hover:color-mix(in oklch, var(--accent) 70%, var(--fg));
  --on-accent:        var(--surface);

  --alert-ink:  color-mix(in oklch, var(--signature) 60%, var(--fg));    /* derived contrast tone */
  --alert-soft: color-mix(in oklch, var(--signature) 18%, var(--surface));

  --fg-soft:    color-mix(in oklch, var(--fg) 6%, var(--surface));
  --line-strong:color-mix(in oklch, var(--fg) 42%, var(--surface));

  /* ink panel family */
  --panel:         var(--fg);
  --panel-fg:      var(--bg);
  --panel-muted:   color-mix(in oklch, var(--bg) 64%, var(--fg));
  --panel-border:  color-mix(in oklch, var(--bg) 18%, var(--fg));
  --panel-surface: color-mix(in oklch, var(--bg) 7%, var(--fg));
  --panel-soft:    color-mix(in oklch, var(--bg) 10%, transparent);

  --signature-on-dark: color-mix(in srgb, var(--signature) 50%, var(--panel-fg));
  --accent-on-dark: color-mix(in srgb, var(--accent) 45%, var(--panel-fg));
  --on-signature: var(--surface);
  --focus: var(--accent-ink);

  /* type — Söhne for display, system sans for UI, mono for numerics */
  --font-display: 'Söhne', 'Söhne Buch', 'Avenir Next', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;

  --fs-d1:   clamp(40px, 5.4vw, 66px);
  --fs-d2:   clamp(30px, 3.6vw, 44px);
  --fs-d3:   clamp(22px, 2.2vw, 28px);
  --fs-h3:   20px;
  --fs-lead: 19px;
  --fs-body: 16px;
  --fs-sm:   14px;
  --fs-meta: 13px;

  /* spacing — 8px baseline */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --gap-xs: 8px; --gap-sm: 12px; --gap-md: 20px; --gap-lg: 32px;
  --gap-xl: 56px; --gap-2xl: 96px;

  --container: 1160px;
  --gutter: 32px;

  --r-control: 10px;
  --r-tight:   8px;
  --r-card:    16px;
  --r-panel:   24px;
  --r-pill:    999px;

  --shadow-float: 0 18px 48px color-mix(in oklch, var(--fg) 18%, transparent);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ink surfaces — one class re-maps every nested component.
   NOTE: --bg and --fg are swapped here, so anything that needs the *light*
   value inside an ink panel must reference --panel-fg / --panel directly —
   those are computed at :root and are immune to this re-mapping. */
.on-ink {
  --signature: var(--signature-on-dark);
  --on-signature: var(--panel);
  --accent-ink: var(--accent-on-dark);
  --accent-hover: var(--panel-fg);
  background: var(--panel);
  color: var(--panel-fg);
  --bg: var(--panel);
  --surface: var(--panel-surface);
  --fg: var(--panel-fg);
  --muted: var(--panel-muted);
  --border: var(--panel-border);
  --fg-soft: var(--panel-soft);
  --line-strong: color-mix(in oklch, var(--panel-fg) 42%, var(--panel));
  --accent-soft: color-mix(in oklch, var(--accent) 22%, transparent);
  --accent-line: color-mix(in oklch, var(--accent) 55%, transparent);
  --alert-soft: color-mix(in oklch, var(--signature) 18%, transparent);
  --alert-ink: var(--signature);
  --focus: var(--signature);
}

/* ─── 2. RESET & BASE ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }
hr { border: 0; border-top: 1px solid var(--border); margin: 0; }
::selection { background: var(--accent-soft); color: var(--fg); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-tight); }
.on-ink :focus-visible { outline-color: var(--signature); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ─── 3. LAYOUT PRIMITIVES ──────────────────────────────────────────────── */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: 760px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 7vw, var(--gap-2xl)); }
.section + .section { border-top: 1px solid var(--border); }
.section-tight { padding-block: clamp(40px, 4vw, 64px); }
.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--gap-md); }
.stack-lg { display: flex; flex-direction: column; gap: var(--gap-lg); }
.row { display: flex; align-items: center; gap: var(--gap-md); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md); }
.row-wrap { display: flex; align-items: center; gap: var(--gap-md); flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap-md); }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap-xl); align-items: start; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: var(--gap-xl); align-items: start; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--gap-lg); }
.center { text-align: center; }
.mxa { margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border);
  padding: 10px 16px; border-radius: var(--r-pill); transition: top .16s var(--ease);
}
.skip-link:focus { top: 12px; }

@media (max-width: 1040px) {
  .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 920px) {
  :root { --gutter: 20px; }
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .hero-split { grid-template-columns: 1fr; gap: var(--gap-xl); }
}

/* ─── 4. TYPE ───────────────────────────────────────────────────────────── */
.h1, h1 { font-family: var(--font-display); font-size: var(--fs-d1); font-weight: 600; line-height: 1.05; letter-spacing: -0.025em; margin: 0; }
.h2, h2 { font-family: var(--font-display); font-size: var(--fs-d2); font-weight: 600; line-height: 1.1;  letter-spacing: -0.02em;  margin: 0; }
.h3, h3 { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 600; line-height: 1.3;  letter-spacing: -0.01em;  margin: 0; }
.h4     { font-size: var(--fs-body); font-weight: 600; margin: 0; }
.display-3 { font-family: var(--font-display); font-size: var(--fs-d3); font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; margin: 0; }
.lead   { font-size: var(--fs-lead); line-height: 1.55; color: var(--muted); max-width: 58ch; margin: 0; }
.small  { font-size: var(--fs-sm); color: var(--muted); margin: 0; }
.meta   { font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--muted); margin: 0; }
.num    { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent-ink); margin: 0 0 var(--gap-md);
}
.on-ink .eyebrow { color: var(--signature); }
.eyebrow-plain { color: var(--muted); }
.link {
  color: var(--accent-ink); text-decoration: underline;
  text-decoration-color: var(--accent-line); text-underline-offset: 3px;
  transition: color .16s var(--ease), text-decoration-color .16s var(--ease);
}
.link:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
.measure { max-width: 62ch; }
.measure-tight { max-width: 42ch; }

/* ─── 5. BRAND LOCKUP ───────────────────────────────────────────────────── */
.lockup { display: inline-flex; align-items: center; gap: 10px; }
.lockup img { height: 34px; width: auto; }
.lockup .lockup-word {
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
  letter-spacing: -0.015em; color: var(--fg);
}
.lockup-lg img { height: 46px; }
.on-ink .lockup .lockup-word { color: var(--panel-fg); }

/* ─── 6. CHROME ─────────────────────────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.topnav-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-lg); padding-block: 12px; }
.topnav nav { display: flex; gap: var(--s5); align-items: center; }
.topnav nav a { font-size: var(--fs-sm); color: var(--muted); transition: color .16s var(--ease); }
.topnav nav a:hover { color: var(--fg); }
.topnav nav a[aria-current="page"] { color: var(--fg); font-weight: 500; }
.topnav-actions { display: flex; align-items: center; gap: var(--s3); }
@media (max-width: 1040px) { .topnav nav { display: none; } }

.pagefoot { padding-block: var(--s7) var(--gap-lg); color: var(--muted); font-size: var(--fs-meta); }
.pagefoot .row-between { flex-wrap: wrap; gap: var(--gap-md); align-items: flex-start; }
.pagefoot h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s3); }
.pagefoot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.pagefoot a { color: var(--fg); font-size: var(--fs-sm); }
.pagefoot a:hover { color: var(--accent-ink); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--gap-lg); }
@media (max-width: 920px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

/* ─── 7. BUTTONS ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 500; letter-spacing: -0.005em; white-space: nowrap;
  transition: background .16s var(--ease), border-color .16s var(--ease),
              color .16s var(--ease), transform .06s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--btn-primary-bg); border-color: var(--btn-primary-bg); color: var(--on-accent); }
.btn-primary:hover { background: var(--btn-primary-hover); border-color: var(--btn-primary-hover); }

.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--fg); }
.btn-secondary:hover { border-color: var(--line-strong); background: var(--fg-soft); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--fg); padding-inline: var(--s3); }
.btn-ghost:hover { background: var(--fg-soft); color: var(--fg); }

.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn-quiet:hover { color: var(--fg); background: var(--fg-soft); }

.btn-lg { min-height: 48px; padding-inline: 28px; font-size: 16px; }
.btn-sm { min-height: 34px; padding-inline: var(--s4); font-size: var(--fs-sm); }
.btn-block { width: 100%; }
.btn-icon { min-height: 44px; width: 44px; padding: 0; }
.btn-icon svg { width: 18px; height: 18px; }
.btn-arrow::after { content: '→'; transition: transform .16s var(--ease); }
.btn-arrow:hover::after { transform: translateX(3px); }
.hero-cta { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }

/* ─── 8. SURFACES ───────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 28px; }
.card-flat { background: transparent; border: 0; border-radius: 0; padding: 0; }
.card-rule { background: transparent; border: 0; border-top: 1px solid var(--fg); border-radius: 0; padding: var(--s5) 0 0; }
.card-hover { transition: border-color .16s var(--ease), background .16s var(--ease); }
.card-hover:hover { border-color: var(--line-strong); }
.card-ink { background: var(--panel-surface); border-color: var(--panel-border); }
.panel { border-radius: var(--r-panel); padding: clamp(24px, 3vw, 40px); }
.panel-ink { background: var(--panel); color: var(--panel-fg); border-radius: var(--r-panel); }
.rule { border: 0; border-top: 1px solid var(--border); margin: 0; }
.rule-strong { border: 0; border-top: 1px solid var(--line-strong); margin: 0; }

/* ─── 9. FEATURE / MARK / METRIC ────────────────────────────────────────── */
.feature .feature-mark {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--r-control);
  color: var(--fg); background: var(--surface); margin-bottom: var(--gap-md);
}
.feature .feature-mark svg { width: 18px; height: 18px; }
.feature h3 { margin-bottom: 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }
.feature ul { margin: var(--s3) 0 0; padding-left: 18px; color: var(--muted); font-size: var(--fs-sm); }
.feature li + li { margin-top: 4px; }

.stat .stat-num {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(40px, 5vw, 64px); line-height: 0.95; letter-spacing: -0.035em;
  color: var(--fg);
}
.stat .stat-label { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s2); max-width: 30ch; }
.stat .stat-unit { font-size: 0.45em; color: var(--muted); margin-left: 4px; letter-spacing: 0; }

/* ─── 10. CHIPS / BADGES / TAGS ─────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-ink);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
}
.on-ink .pill { color: var(--signature); }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); color: var(--muted); font-size: 12px;
}
.badge-signature {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-pill);
  background: var(--signature); color: var(--on-signature);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.rating { display: inline-flex; gap: 2px; color: var(--signature); font-size: var(--fs-sm); letter-spacing: 0.08em; }

/* ─── 11. LISTS / TABLE / LOG ROW ───────────────────────────────────────── */
.ds-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.ds-table th, .ds-table td { padding: 14px; text-align: left; border-bottom: 1px solid var(--border); }
.ds-table th { color: var(--muted); font-weight: 500; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.ds-table tbody tr:hover { background: var(--fg-soft); }
.ds-table .num-col { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.table-scroll { overflow-x: auto; }

.log-row { display: grid; grid-template-columns: 120px 1fr 100px; gap: var(--gap-lg); padding: 22px 0; border-top: 1px solid var(--border); align-items: baseline; }
.log-row h3 { font-size: 19px; }
.log-row .pull { text-align: right; }
@media (max-width: 720px) { .log-row { grid-template-columns: 1fr; gap: var(--s2); } .log-row .pull { text-align: left; } }

.tick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.tick-list li { display: grid; grid-template-columns: 20px 1fr; gap: var(--s3); align-items: start; font-size: var(--fs-sm); color: var(--muted); }
.tick-list li::before { content: ''; width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; border: 1px solid var(--accent-line); background:
  radial-gradient(circle at center, var(--accent-ink) 0 3px, transparent 3px); }
.tick-list.is-avoid li::before { border-color: var(--border); background: none; }
.tick-list strong { color: var(--fg); font-weight: 500; }

/* ─── 12. FORMS ─────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: var(--fs-meta); color: var(--muted); font-weight: 500; }
.input, .textarea, .select-native {
  width: 100%; min-height: 46px; padding: 11px 14px;
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--r-control);
  font: inherit; font-size: 15px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:hover, .textarea:hover, .select-native:hover { border-color: var(--line-strong); }
.input:focus, .textarea:focus, .select-native:focus { outline: none; border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.hint { font-size: var(--fs-meta); color: var(--muted); }
.select { position: relative; }
.select select { appearance: none; padding-right: 40px; }
.select::after {
  content: ''; position: absolute; right: 16px; top: 50%; width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid var(--muted); transform: translateY(-30%); pointer-events: none;
}
.field.has-error .input, .field.has-error .select select { border-color: var(--alert-ink); box-shadow: 0 0 0 3px var(--alert-soft); }
.error-text { display: none; font-size: var(--fs-meta); color: var(--alert-ink); }
.field.has-error .error-text { display: block; }
.field.has-error .hint { display: none; }

.check { display: flex; gap: var(--s3); align-items: flex-start; font-size: var(--fs-sm); color: var(--fg); }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check span small { display: block; color: var(--muted); font-size: var(--fs-meta); }
.switch { display: inline-flex; align-items: center; gap: var(--s3); font-size: var(--fs-sm); color: var(--fg); }
.switch input { width: 40px; height: 24px; accent-color: var(--accent); }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--fg-soft); border-radius: var(--r-pill); border: 1px solid var(--border); }
.seg button {
  min-height: 34px; padding: 0 16px; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--muted); font-size: var(--fs-sm); font-weight: 500;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px color-mix(in oklch, var(--fg) 12%, transparent); }

.dropzone {
  border: 1px dashed var(--line-strong); border-radius: var(--r-card);
  background: var(--bg); padding: var(--s6) var(--s5); text-align: center;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent-ink); background: var(--accent-soft); }
.dropzone .dz-icon { width: 44px; height: 44px; margin: 0 auto var(--s3); color: var(--fg); }

/* ─── 13. STEPS / ORDER FLOW ────────────────────────────────────────────── */
.steps { display: flex; align-items: center; gap: var(--s3); }
.step { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-meta); color: var(--muted); }
.step .step-n {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface);
  font-family: var(--font-mono); font-size: 11px; color: var(--muted); flex: none;
}
.step[aria-current="step"] { color: var(--fg); }
.step[aria-current="step"] .step-n { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.step.is-done .step-n { border-color: var(--accent-line); color: var(--accent-ink); }
.step-line { flex: 1; height: 1px; background: var(--border); min-width: 16px; }

/* ─── 14. AUDIO: WAVEFORM, PLAYER, TRANSCRIPT ───────────────────────────── */
.wave { display: flex; align-items: center; gap: 2px; height: 64px; }
.wave-bar {
  flex: 1 1 0; min-width: 2px; border-radius: var(--r-pill);
  height: var(--h, 40%);
  background: color-mix(in oklch, var(--fg) 24%, transparent);
  transition: background .16s var(--ease);
}
.wave-bar.is-played { background: var(--accent); }
.on-ink .wave-bar { background: color-mix(in oklch, var(--panel-fg) 26%, transparent); }
.on-ink .wave-bar.is-played { background: var(--signature); }
.wave-sm { height: 32px; gap: 1px; }
.wave-sm .wave-bar { min-width: 1px; }

.player { display: flex; align-items: center; gap: var(--s4); }
.player-body { flex: 1; min-width: 0; }
.play-btn {
  width: 48px; height: 48px; flex: none; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--btn-primary-bg);
  background: var(--btn-primary-bg); color: var(--on-accent);
  transition: background .16s var(--ease);
}
.play-btn:hover { background: var(--btn-primary-hover); border-color: var(--btn-primary-hover); }
.play-btn svg { width: 18px; height: 18px; }
.timecode { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-meta); color: var(--muted); }
.on-ink .timecode { color: var(--panel-muted); }

.tx { display: flex; flex-direction: column; gap: 2px; }
.tx-line {
  display: grid; grid-template-columns: 68px 1fr; gap: var(--s4);
  padding: var(--s3) var(--s4); border: 1px solid transparent; border-radius: var(--r-control);
  transition: background .16s var(--ease), border-color .16s var(--ease);
}
.tx-line:hover { background: var(--fg-soft); }
.tx-line.is-active { background: var(--accent-soft); border-color: var(--accent-line); }
.tx-line .tx-text { font-size: var(--fs-sm); line-height: 1.6; color: var(--fg); }
.tx-line .tx-text mark { background: var(--accent-soft); color: var(--fg); border-radius: 3px; padding: 0 2px; }
.on-ink .tx-line .tx-text { color: color-mix(in oklch, var(--panel-fg) 88%, var(--panel)); }
.speaker {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 4px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--r-pill);
}
.sp-1 { background: var(--accent-soft); color: var(--accent-ink); }
.sp-2 { background: var(--fg-soft); color: var(--fg); }
.sp-3 { background: var(--alert-soft); color: var(--alert-ink); }
.on-ink .sp-1 { background: color-mix(in oklch, var(--accent) 24%, transparent); color: color-mix(in oklch, var(--accent) 45%, var(--panel-fg)); }
.on-ink .sp-2 { background: color-mix(in oklch, var(--panel-fg) 12%, transparent); color: var(--panel-fg); }
.on-ink .sp-3 { background: color-mix(in oklch, var(--signature) 20%, transparent); color: var(--signature); }
.on-ink .status-queued { color: var(--panel-muted); }
.on-ink .status-processing, .on-ink .status-done { color: color-mix(in oklch, var(--accent) 45%, var(--panel-fg)); }
.on-ink .status-failed { color: var(--signature); }
.on-ink .tick-list li::before {
  border-color: color-mix(in oklch, var(--panel-fg) 28%, transparent);
  background: radial-gradient(circle at center, var(--signature) 0 3px, transparent 3px);
}
.on-ink .tick-list strong { color: var(--panel-fg); }
.quote-line { font-family: var(--font-display); }

/* ─── 15. APP SHELL (workspace) ─────────────────────────────────────────── */
.appbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid var(--border);
}
.appbar-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s5); padding-block: 10px; }
.app-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr) 336px; min-height: calc(100vh - 66px); }
.app-shell > * { min-width: 0; }
.rail { border-right: 1px solid var(--border); padding: var(--s5) var(--s4); }
.rail-right { border-left: 1px solid var(--border); border-right: 0; }
.stage { padding: var(--s6) var(--s7); }
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: minmax(0, 1fr) 320px; }
  .rail-left { display: none; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .app-shell.show-rail-right .rail-right { display: block; border-left: 0; border-top: 1px solid var(--border); }
  .stage { padding: var(--s5) var(--s4); }
}
.rail-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s3); }
.job-row {
  display: grid; grid-template-columns: 1fr auto; gap: var(--s3);
  padding: var(--s3); border-radius: var(--r-control); border: 1px solid transparent;
  transition: background .16s var(--ease), border-color .16s var(--ease);
}
.job-row:hover { background: var(--fg-soft); }
.job-row[aria-current="true"] { background: var(--surface); border-color: var(--border); }
.job-row .job-name { font-size: var(--fs-sm); color: var(--fg); }
.job-row .job-sub { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 2px; }

.status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 8px; border-radius: var(--r-pill); }
.status-queued { background: var(--fg-soft); color: var(--muted); }
.status-processing { background: var(--accent-soft); color: var(--accent-ink); }
.status-done { background: var(--accent-soft); color: var(--accent-ink); }
.status-failed { background: var(--alert-soft); color: var(--alert-ink); }
.status-processing .dot { animation: pulse 1.4s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.tabs { display: flex; gap: var(--s5); border-bottom: 1px solid var(--border); }
.tab {
  position: relative; padding: 12px 2px; border: 0; background: none;
  color: var(--muted); font-size: var(--fs-sm); font-weight: 500;
  transition: color .16s var(--ease);
}
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { color: var(--fg); }
.tab[aria-selected="true"]::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent);
}
.tab-panel { padding-top: var(--s5); }
.toolbar { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.kbd {
  font-family: var(--font-mono); font-size: 11px; padding: 2px 6px;
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
  background: var(--surface); color: var(--muted);
}

/* ─── 16. FLOATING LAYERS ───────────────────────────────────────────────── */
.backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: color-mix(in oklch, var(--fg) 52%, transparent);
  backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: var(--s5);
}
.backdrop[hidden] { display: none; }
.dialog[hidden] { display: none; }
.dialog {
  width: min(560px, 100%); background: var(--surface); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--r-panel);
  padding: var(--s6); box-shadow: var(--shadow-float);
  max-height: 86vh; overflow-y: auto;
}
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.dialog-foot { display: flex; justify-content: flex-end; gap: var(--s3); margin-top: var(--s6); }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: var(--s3);
  background: var(--panel); color: var(--panel-fg);
  padding: 12px 20px; border-radius: var(--r-pill); box-shadow: var(--shadow-float);
  font-size: var(--fs-sm);
}
.toast[hidden] { display: none; }

/* ─── 17. IMAGERY ───────────────────────────────────────────────────────── */
.content-img {
  display: block; max-width: 100%; max-height: min(70vh, 720px);
  width: auto; height: auto; object-fit: contain;
  border-radius: var(--r-card);
}
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.ph-img {
  background: linear-gradient(135deg, var(--accent-soft), var(--fg-soft)), var(--surface);
  border: 1px dashed var(--border); border-radius: var(--r-card);
  aspect-ratio: 16 / 10; display: grid; place-items: center;
  color: var(--muted); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  text-align: center; padding: var(--s4);
}
.ph-img.wide { aspect-ratio: 16 / 9; }
.ph-img.square { aspect-ratio: 1 / 1; }
.ph-img.portrait { aspect-ratio: 3 / 4; }

/* logo wall — marks keep their own colours, laid on a calm plate */
.logo-wall { display: flex; align-items: center; gap: clamp(24px, 4vw, 56px); flex-wrap: wrap; }
.logo-wall img { height: 26px; width: auto; opacity: 0.92; transition: opacity .16s var(--ease); }
.logo-wall a:hover img { opacity: 1; }
.logo-wall .logo-tile { height: 34px; width: auto; border-radius: 6px; }
@media (max-width: 720px) { .logo-wall img { height: 22px; } }

/* ─── 18. TESTIMONIAL ───────────────────────────────────────────────────── */
.quote { font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 30px); line-height: 1.32; letter-spacing: -0.015em; max-width: 30ch; margin: 0; }
.quote-mark { font-family: var(--font-display); font-size: 96px; line-height: 0.6; color: var(--signature); margin-bottom: 8px; }
.quote-author { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s4); }
.tm-card { display: grid; gap: var(--s4); }
.tm-card blockquote { margin: 0; font-size: var(--fs-sm); line-height: 1.6; color: var(--fg); }
.tm-person { display: flex; align-items: center; gap: var(--s3); }
.tm-person .tm-name { font-size: var(--fs-sm); font-weight: 500; }
.tm-person .tm-role { font-size: var(--fs-meta); color: var(--muted); }

/* ─── 19. MOTION ────────────────────────────────────────────────────────── */
.fade-up { animation: fadeUp .5s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade-up { animation: none; } }

/* ─── 20. UTILITIES ─────────────────────────────────────────────────────────
   Last in the file on purpose: these must win over the component margins
   declared above (.lead, .small, .meta and friends all reset margin to 0). */
.mt-0 { margin-top: 0 !important; }
.mt-3 { margin-top: var(--s3) !important; }
.mt-4 { margin-top: var(--s4) !important; }
.mt-5 { margin-top: var(--s5) !important; }
.mt-6 { margin-top: var(--s6) !important; }
.mt-7 { margin-top: var(--s7) !important; }
