﻿/* ─────────────────────────────────────────────────────────────────────────────
   audio2text.io — central design tokens (THE single source of truth for the look).
   Apple-grade: one cool accent, near-white tinted neutrals, soft depth, SF type.
   Every surface reads these vars; retune here and the whole site follows.
   ──────────────────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;

  /* Surfaces — near-white, tinted a hair toward the accent hue (264). Never #fff. */
  --page:    oklch(0.987 0.003 264);
  --paper:   oklch(0.998 0.0015 264);
  --paper-2: oklch(0.968 0.004 264);

  /* Ink — near-black, tinted. Never #000. */
  --ink:   oklch(0.23 0.012 264);
  --ink-2: oklch(0.36 0.013 264);
  --muted: oklch(0.54 0.014 264);
  --quiet: oklch(0.70 0.010 264);

  /* Hairlines */
  --line:        oklch(0.915 0.004 264);
  --line-strong: oklch(0.855 0.006 264);

  /* THE accent — one only (Apple blue). ≤10% of the surface. */
  --signal:       oklch(0.605 0.175 256);
  --accent:       oklch(0.605 0.175 256);
  --accent-press: oklch(0.545 0.170 256);
  --accent-soft:  oklch(0.605 0.175 256 / 0.10);
  --link:         oklch(0.455 0.150 256);
  --link-hover:   oklch(0.385 0.140 256);

  /* Supporting hues, muted (status only, never decorative) */
  --cyan:   oklch(0.72 0.09 230);
  --coral:  oklch(0.66 0.14 30);
  --violet: oklch(0.58 0.11 292);
  --warn:   oklch(0.76 0.13 80);
  --danger: oklch(0.585 0.165 25);

  /* Depth — soft, layered, low-contrast. Apple shadows are felt, not seen. */
  --shadow-sm: 0 1px 2px oklch(0.23 0.04 264 / 0.06), 0 1px 1px oklch(0.23 0.04 264 / 0.04);
  --shadow:    0 4px 14px oklch(0.23 0.04 264 / 0.08), 0 18px 48px oklch(0.23 0.04 264 / 0.10);
  --shadow-lg: 0 8px 28px oklch(0.23 0.04 264 / 0.12), 0 40px 80px oklch(0.23 0.04 264 / 0.14);

  /* Radii */
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 22px;
  --r-pill: 980px;

  /* Spacing scale (8pt-based, with a 4 and a few large steps for breathing room) */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  /* Motion — ease-out only, exponential. No bounce. */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);

  --max: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  /* Clean Apple canvas: a single, barely-there vertical wash. No grid, no noise. */
  background:
    radial-gradient(120% 60% at 50% -10%, var(--accent-soft) 0%, transparent 60%),
    linear-gradient(180deg, var(--page) 0%, var(--paper-2) 100%);
  /* background-attachment: fixed removed — forces a full-viewport repaint on
     every scroll frame (costly on mobile). Gradient scrolls with the page now. */
  color: var(--ink-2);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
textarea,
input[type="range"] {
  accent-color: var(--signal);
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

:focus-visible {
  outline: 3px solid oklch(0.72 0.13 195 / 0.42);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 74px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 18px;
  /* Full-width bar: brand flush far-left, theme toggle flush far-right. */
  padding: 0 28px;
  border-bottom: 3px solid var(--signal);
  background: var(--ink);
  color: var(--paper);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  text-decoration: none;
  font-weight: 950;
}

.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  /* The cut-out rainbow logo. Works on both light and dark navs. */
  background: url("/assets/logo-nav@2x.png") center / contain no-repeat;
  font-size: 0;
  color: transparent;
}

.brand-name {
  font-size: 22px;
  letter-spacing: 0;
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.topnav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: oklch(0.965 0.014 92 / 0.78);
  text-decoration: none;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 820;
}

.topnav a:hover,
.topnav a[aria-current="page"] {
  border-color: oklch(0.79 0.185 125 / 0.5);
  background: oklch(0.79 0.185 125 / 0.13);
  color: var(--paper);
}

/* Dark-topbar theme toggle — logo left, toggle right */
.theme-toggle {
  justify-self: end;
  align-self: center;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid oklch(0.60 0.01 264 / 0.38);
  border-radius: 999px;
  background: oklch(0.50 0.01 264 / 0.22);
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s var(--ease);
}

.theme-toggle:hover {
  background: oklch(0.60 0.01 264 / 0.36);
}

.theme-toggle-mark {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: linear-gradient(90deg, currentColor 0 50%, transparent 50% 100%);
}

.shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 22px auto 52px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.breadcrumb a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--cyan);
}

.hero {
  /* Tighten the dead space above the H1 and below the lede. */
  padding: var(--s5) 0 var(--s4);
}

.hero-copy {
  /* Span the shell so the lede lines up edge-to-edge with the tool below it,
     instead of wrapping in a narrow 760px column. H1 keeps its own max-width. */
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
/* neutralise the old grid placement (flex ignores these, kept explicit for clarity) */
.hero-copy .eyebrow,
.hero-copy h1,
.hero-copy .lede {
  grid-column: auto;
  grid-row: auto;
  margin-bottom: 0;
  padding-top: 0;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 20ch;
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(34px, 5.4vw, 56px);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.022em;
}

.lede {
  /* Match the tool's width (the shell) so the intro and the tool share edges. */
  max-width: 100%;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.support-notice,
.startup-error {
  margin: 0 0 16px;
  padding: 13px 15px;
  border: 1px solid oklch(0.66 0.18 30 / 0.42);
  border-radius: 6px;
  background: oklch(0.97 0.035 55);
  color: var(--ink-2);
}

.startup-error {
  width: min(940px, calc(100% - 32px));
  margin: 18px auto;
}

/* The above-fold subtitle line: clean, borderless, native script in the accent. */
.bilingual-strip {
  margin: 0 auto var(--s5);
  max-width: 720px;
  text-align: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.bilingual-strip strong {
  color: var(--accent);
  font-weight: 600;
}

/* Dedicated centered translate widget (orb skin): curved output-lang dropdown + green button */

/* ═══════════ ORB (translate record widget) — light re-skin ═══════════
   The recorder kernel reads --ar-* from .vr-panel. We feed it audio2text's
   themed tokens so the orb matches the page AND follows light/dark, then
   override the few red/dark bits the kernel hardcodes (mic glow, aura rings).
   Doubled class (.vr-panel.vr-panel) outranks the kernel's base .vr-panel. */
.vr-panel.vr-panel {
  --ar-bg: linear-gradient(160deg, var(--paper) 0%, var(--paper-2) 100%);
  --ar-bg-glow: radial-gradient(120% 80% at 78% 18%, var(--accent-soft) 0%, transparent 60%);
  --ar-fg: var(--ink);
  --ar-fg-dim: var(--muted);
  --ar-fg-faint: var(--quiet);
  --ar-surface: var(--paper-2);
  --ar-border: var(--line);
  --ar-glass: var(--paper-2);
  --ar-glass-border: var(--line);
  --ar-accent: var(--accent);
  --ar-accent-2: var(--accent);
  --ar-mic-bg: linear-gradient(180deg, var(--accent) 0%, var(--accent-press) 100%);
  --ar-note-fg: var(--accent);
  --ar-interim: var(--muted);
}
/* Mic glow + aura rings: brand blue, not the kernel's hardcoded red */
.vr-panel .ar-mic {
  box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 42%, transparent),
              inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.vr-panel .ar-mic:hover:not(:disabled) {
  box-shadow: 0 8px 30px color-mix(in srgb, var(--accent) 58%, transparent),
              inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.vr-panel .ar.is-idle .ar-mic { animation-name: ar2-breathe; }
@keyframes ar2-breathe {
  0%, 100% { box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 42%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
  50%      { box-shadow: 0 6px 34px color-mix(in srgb, var(--accent) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
}
.vr-panel .ar-a1 { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.vr-panel .ar-a2 { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.vr-panel .ar-a3 { background: color-mix(in srgb, var(--accent) 6%, transparent); }
/* Glass pills / control buttons hover on a light card */
.vr-panel .ar-ctrl:hover,
.vr-panel .ar-retry:hover { background: var(--paper); }

/* Override the kernel's hardcoded dark popups (kernel file stays vendored/untouched) */
.vr-panel .vr-lang-btn:hover { background: var(--paper-2) !important; }
.vr-panel .vr-lang-menu {
  background: var(--paper);
  border-color: var(--line);
  box-shadow: var(--shadow-lg);
  /* Locked dimensions: the popover never resizes or shifts when the list is
     filtered — the visible items reduce inside a fixed frame (CLS-safe, no jump). */
  width: 248px;
  max-height: none;
  height: 340px;
}
.vr-panel .vr-lang-opt { color: var(--ink-2); }
.vr-panel .vr-lang-opt:hover { background: var(--paper-2); }
.vr-panel .vr-lang-opt.sel { background: var(--accent-soft); color: var(--accent); }
.vr-panel .ar-sel option { background: var(--paper); color: var(--ink); }
.vr-panel .ar-modal-box {
  background: var(--paper);
  border-color: var(--line);
  box-shadow: var(--shadow-lg);
}
.vr-panel .ar-modal-cancel:hover { background: var(--paper-2); }

.vr-xlate-float {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 46px;
  z-index: 21;
  /* Opt-in translate feature: hidden by default on every page; the rule below
     reveals it only in translate mode, so a transcription page shows no translate
     control. Controlled per page via the tool-shell data-tool-mode flag. */
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: var(--ar-radius-pill, 40px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  box-shadow: var(--shadow-sm);
}
/* the curved dropdown menu opens UPWARD from this bottom-anchored widget */
.vr-xlate-float .vr-lang-menu { top: auto; bottom: calc(100% + 8px); }
/* Searchable language menus — sticky filter box pinned to the top of the popover. */
.vr-lang-search-row {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -6px -6px 6px;
  padding: 8px 8px 7px;
  background: var(--paper);   /* matches the menu, in every theme */
  list-style: none;
}
.vr-lang-search {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.vr-lang-search::placeholder { color: var(--muted); }
.vr-lang-search:focus { border-color: var(--accent); background: var(--paper); }
/* keep the native select in the DOM for app.js, but visually hidden */
.vr-hidden-select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  opacity: 0;
  pointer-events: none;
}
/* circular green-arrow Translate button */
.vr-panel .vr-xlate-go {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 3px 14px oklch(0.605 0.175 256 / 0.5);
  transition: background 0.18s var(--ease), transform 0.12s var(--ease);
}
.vr-panel .vr-xlate-go:hover { background: var(--accent-press); }
.vr-panel .vr-xlate-go:active { transform: scale(0.93); }
.vr-panel .vr-xlate-go svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* float widget now holds only the centered dropdown + green arrow */
.vr-xlate-float { flex-wrap: nowrap; }
/* Flag that turns the translate feature ON — set only on translate pages/presets
   (data-tool-mode='transcribe-translate', on the tool-shell pre-JS and on <body>
   at runtime). Any other mode keeps the float hidden. */
[data-tool-mode='transcribe-translate'] .vr-xlate-float { display: inline-flex; }
/* Translation result modal — opens on Translate; dark-glass, share/download inside */
.vr-result-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 10, 25, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.vr-result-modal[hidden] { display: none; }
.vr-result-box {
  position: relative;
  width: min(80vw, 1040px);
  height: 80vh;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  overflow: hidden;
}
.vr-result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.vr-result-title { font-weight: 700; font-size: 16px; }
.vr-result-head .output-panel-status { margin-left: auto; font-size: 12px; color: var(--muted); }
.vr-result-close {
  width: 30px; height: 30px; flex-shrink: 0;
  border: none; border-radius: 50%;
  background: var(--paper-2); color: var(--ink-2);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.vr-result-close:hover { background: var(--line); }
.vr-result-body {
  padding: 20px 18px;
  overflow-y: auto;
  font-size: 21px;
  line-height: 1.7;
  min-height: 90px;
  flex: 1;
}
.vr-result-body:empty::before {
  content: "Your translation will appear here.";
  color: var(--quiet);
  font-size: 15px;
}
.vr-result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.vr-result-actions .vr-dl-menu { top: auto; bottom: calc(100% + 8px); right: 0; left: auto; }

/* Labeled, colourful share/copy buttons. Each icon keeps a brand colour; the label
   (the [data-tip] text, reused as an always-visible inline label) is dark grey.
   kernel already gives WhatsApp green + Telegram blue; we relabel, recolour the
   rest, and turn the icon-circles into icon+text pills. */
.vr-result-actions { flex-wrap: wrap; gap: 9px 12px; }
.vr-result-actions .vr-act {
  width: auto;
  height: 36px;
  gap: 8px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}
.vr-result-actions .vr-act::after {
  content: attr(data-tip);
  position: static;     /* override the kernel hover-tooltip ::after -> inline label */
  opacity: 1;
  transform: none;
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font: inherit;
  white-space: nowrap;
  pointer-events: none;
}
.vr-result-actions .vr-act:hover { background: var(--line); transform: translateY(-1px); }
.vr-result-actions .vr-sh-em svg { fill: #ea4335; }   /* email — red */
.vr-result-actions .vr-copy svg { fill: #8b5cf6; }    /* copy — purple */
.vr-result-actions .vr-dl-btn { background: var(--paper-2); }
.vr-result-actions .vr-dl-btn svg { fill: #0ea5a4; }  /* download — teal */

/* Quick Copy pinned to the result box's top-right, below the close button —
   mirrors the Paste overlay on the transcript box. */
.vr-result-copy-top {
  position: absolute;
  top: 56px;
  right: 18px;
  z-index: 3;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.vr-result-copy-top:hover { background: var(--line); color: var(--ink); }
.vr-result-copy-top.copied { color: #1a7f4b; border-color: #1a7f4b; }

/* Translate modal — processing + done states (driven by data-state on the box). */
.vr-result-processing {
  display: none;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px;
}
.vr-result-box[data-state="processing"] .vr-result-processing { display: flex; }
.vr-result-box[data-state="processing"] #convertText { display: none; }
.vr-proc-spin {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(37, 99, 235, 0.18);
  border-top-color: #2563eb;
  animation: vr-proc-spin 0.8s linear infinite;
}
@keyframes vr-proc-spin { to { transform: rotate(360deg); } }
.vr-proc-label {
  color: #2563eb;
  font-size: 16px;
  font-weight: 600;
  animation: vr-proc-breathe 1.6s ease-in-out infinite;
}
@keyframes vr-proc-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
/* Done: header shows "Translated" with an online-style green dot. */
.vr-result-box[data-state="done"] .output-panel-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1a7f4b;
  font-weight: 700;
}
.vr-result-box[data-state="done"] .output-panel-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}
@media (prefers-reduced-motion: reduce) {
  .vr-proc-spin, .vr-proc-label { animation: none; }
}

/* Draft-restored toast — brief, centered, auto-dismissing notice. */
.draft-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  z-index: 80;
  max-width: min(92vw, 460px);
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.96);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.draft-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) {
  .draft-toast { transform: translate(-50%, 0); transition: opacity 0.25s ease; }
}

.tool-shell {
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: clip;
}

/* The mic/lang/timer/restart tooltips live at the very top of the panel, where the
   default "above" placement is clipped by the tool-shell's overflow:clip (only a
   sliver shows). Render them BELOW the control instead, fully inside the tool. */
.vr-panel .vr-top [data-tip]::after {
  top: calc(100% + 9px);
  bottom: auto;
}

.tool-shell-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border-bottom: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.tool-shell-head h2 {
  margin-bottom: 0;
  color: var(--paper);
  font-size: 27px;
  line-height: 1.16;
}

.tool-shell-head > span {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid oklch(0.79 0.185 125 / 0.55);
  border-radius: 4px;
  background: oklch(0.79 0.185 125 / 0.12);
  color: var(--signal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: stretch;
}

.tool-panel {
  padding: 20px;
}

.primary-panel {
  border-right: 2px solid var(--ink);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: start;
  margin-bottom: 14px;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field select,
.field input[type="range"] {
  min-height: 42px;
  min-width: 210px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 10px;
}

.compact-field select {
  min-width: 100%;
}

.toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink-2);
  font-weight: 820;
}

.tool-button,
.editor-actions button,
.side-actions button,
.convert-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 900;
}

.tool-button:hover,
.editor-actions button:hover,
.side-actions button:hover,
.convert-btn:hover {
  transform: translateY(-1px);
}

.convert-btn {
  margin-left: auto;
  white-space: nowrap;
}

.tool-button.primary,
.editor-actions button:first-child {
  background: var(--signal);
  color: var(--ink);
}

.tool-button.danger {
  background: var(--danger);
  color: var(--paper);
}

.tool-button span:first-child {
  font-size: 12px;
  opacity: 0.78;
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.live-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 820;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--quiet);
}

.dot.live {
  background: var(--coral);
  box-shadow: 0 0 0 8px oklch(0.66 0.18 30 / 0.16);
}

.divider {
  width: 1px;
  height: 15px;
  background: var(--line-strong);
}

textarea {
  width: 100%;
  min-height: 360px;
  margin-top: 14px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: oklch(0.995 0.006 94);
  color: var(--ink);
  padding: 16px;
  line-height: 1.65;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.editor-actions button:nth-child(2),
.side-actions button:nth-child(2) {
  background: var(--paper-2);
  color: var(--ink);
}

.export-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

[data-tool-mode='transcribe'] .record-control,
[data-tool-mode='transcribe'] .speak-control,
[data-tool-mode='record-transcribe'] .speak-control,
[data-tool-mode='record'] .language-field,
[data-tool-mode='record'] .transcribe-control,
[data-tool-mode='record'] .speak-control,
[data-tool-mode='record'] #noteText,
[data-tool-mode='record'] .editor-actions,
[data-tool-mode='speak'] .transcribe-control,
[data-tool-mode='speak'] .record-control,
[data-tool-mode='speak'] .live-control,
.convert-control {
  display: none;
}

[data-tool-mode='transcribe-translate'] .convert-control {
  display: grid;
}

[data-tool-mode='transcribe-translate'] .record-control,
[data-tool-mode='transcribe-translate'] .speak-control {
  display: none;
}

.output-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  overflow: hidden;
}

.output-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.output-panel-status {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  text-align: right;
}

.output-panel-body {
  padding: 12px;
  min-height: 80px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

[data-tool-mode='record'] .primary-panel {
  min-height: 0;
}

.side-panel {
  display: grid;
  gap: 14px;
  background: var(--paper-2);
}

.mini-section {
  display: grid;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.mini-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.mini-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.mini-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.mic-button {
  min-height: 128px;
  display: grid;
  place-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
}

.mic-button.recording {
  border-color: var(--coral);
  background: oklch(0.955 0.035 28);
}

.mic-button.paused {
  border-color: var(--warn);
  background: oklch(0.97 0.04 84);
}

.mic-core {
  width: 38px;
  height: 54px;
  border-radius: 20px;
  background: var(--cyan);
  box-shadow: inset 0 -12px 0 oklch(0.205 0.038 239 / 0.18);
}

.wave {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  background: var(--paper);
}

.wave span {
  width: 8px;
  height: 22px;
  border-radius: 999px;
  background: var(--cyan);
  opacity: 0.76;
}

.wave.active span {
  animation: wave 900ms ease-in-out infinite;
}

.wave span:nth-child(2) {
  animation-delay: 90ms;
}

.wave span:nth-child(3) {
  animation-delay: 180ms;
}

.wave span:nth-child(4) {
  animation-delay: 270ms;
}

.wave span:nth-child(5) {
  animation-delay: 360ms;
}

@keyframes wave {
  0%,
  100% {
    transform: scaleY(0.55);
  }

  50% {
    transform: scaleY(1.6);
  }
}

.download-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 6px;
  color: var(--ink);
  background: var(--signal);
  text-decoration: none;
  font-weight: 900;
}

.download-link.disabled {
  opacity: 0.5;
  pointer-events: none;
  color: var(--muted);
  background: var(--paper);
}

.side-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.command-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.soft {
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
}

.app-only-controls[hidden],
[hidden] {
  display: none !important;
}

/* ═══════════ CONTENT / EDITORIAL — clean light variant (u2k-aligned) ═══════════
   Single confident accent (blue), soft hairlines, rounded cards, real type
   hierarchy. Replaces the prior heavy two-column / 900-weight treatment. */

/* Section headings */
.content-band h2,
.faq-section h2,
.related h2,
.references-card h2 {
  color: var(--ink);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* "How to" answer band — three soft cards */
.content-band {
  counter-reset: content-block;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s4);
  margin-top: var(--s7);
}

.content-band article {
  counter-increment: content-block;
  position: relative;
  min-height: 100%;
  padding: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.content-band article::before {
  content: counter(content-block, decimal-leading-zero);
  display: inline-flex;
  margin-bottom: var(--s3);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
  font-variant-numeric: tabular-nums;
}

.content-band p {
  margin-bottom: 0;
  line-height: 1.65;
  color: var(--ink-2);
}

/* Answer card — inverted callout */
.answer-card {
  margin-top: var(--s6);
  padding: var(--s6);
  border-radius: var(--r-lg);
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
}

.answer-card p {
  margin-bottom: 0;
  color: var(--paper);
  font-size: 18px;
  line-height: 1.68;
}

/* Defer below-the-fold sections' layout/paint until scrolled into view.
   All sit below the hero + tool-shell; cuts first-paint render cost. Crawlers
   still see the content (it stays in the HTML). */
.howto-card,
.article-guide,
.faq-section,
.content-section,
.references-card,
.related,
.site-footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}

/* Editorial cards — how-to / references */
.howto-card,
.references-card {
  margin-top: var(--s6);
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.howto-card h2,
.references-card h2 {
  margin-bottom: var(--s3);
}

.howto-card ol,
.references-card ul {
  margin: var(--s3) 0 0;
  padding-left: 22px;
}

.howto-card li,
.references-card li {
  margin-top: var(--s2);
  color: var(--ink-2);
  line-height: 1.68;
}

.references-card a {
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.references-card a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

.article-guide a,
.content-section a {
  color: var(--link);
  font-weight: 650;
  text-decoration-color: var(--accent-soft);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.article-guide a:hover,
.content-section a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

.references-card > p {
  margin-top: var(--s4);
  color: var(--muted);
  line-height: 1.7;
}

/* Article guide — SINGLE-COLUMN prose (was a cramped 220px/1fr grid) */
.article-guide {
  max-width: 100%;
  margin: var(--s7) auto 0;
  display: block;
}

.article-guide article {
  display: block;
  max-width: none;
  padding: var(--s5) 0;
  border-bottom: 1px solid var(--line);
}

.article-guide article:first-child {
  padding-top: 0;
}

.article-guide article:last-child {
  border-bottom: 0;
}

.article-guide h2 {
  margin-bottom: var(--s3);
  color: var(--ink);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.018em;
}

.article-guide p {
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.75;
}

/* Example media figure */
.example-media {
  max-width: 760px;
  margin: var(--s6) auto 0;
}

.example-media img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.example-media figcaption {
  margin-top: var(--s3);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Keyword strip — quiet pills */
.keyword-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  max-width: 760px;
  margin: var(--s5) auto 0;
}

.keyword-strip span {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--paper-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

/* FAQ — clean disclosure list */
.faq-section {
  max-width: 100%;
  margin: var(--s7) auto 0;
  display: grid;
  /* Comfortable, elegant breathing between Q&A cards within a group; the category
     <h3> margin below adds a much larger break between groups. */
  gap: 16px;
}

.faq-section h2 {
  margin-bottom: 4px;
}

.faq-section h3 {
  /* Big, deliberate break ABOVE a new category (grid gap 16 + 40 = 56px) vs the
     16px between cards — so groups read as distinct blocks; tight below so the
     label clearly belongs to the group it introduces. */
  margin: 40px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.faq-section h2 + h3 {
  margin-top: 0;   /* first category sits right under the title */
}

.faq-section details {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  padding: var(--s4) var(--s5);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.faq-section details[open] {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.faq-section summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
  list-style: none;
}

.faq-section summary::-webkit-details-marker {
  display: none;
}

.faq-section summary::after {
  content: "+";
  float: right;
  margin-left: 12px;
  color: var(--accent);
  font-weight: 600;
}

.faq-section details[open] summary::after {
  content: "\2212";
}

.faq-section p {
  margin: var(--s3) 0 0;
  color: var(--ink-2);
  line-height: 1.7;
}

/* Content sections — single-column prose, same max-width as FAQ/howto */
.content-section {
  max-width: 100%;
  margin: var(--s7) auto 0;
}

.content-section h2 {
  color: var(--ink);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: var(--s3);
}

.content-section h3 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  margin-top: var(--s5);
  margin-bottom: var(--s2);
}

.content-section p {
  color: var(--ink-2);
  line-height: 1.75;
}

.content-section ul,
.content-section ol {
  margin: var(--s3) 0;
  padding-left: 22px;
  color: var(--ink-2);
}

.content-section li {
  margin-top: var(--s2);
  line-height: 1.75;
}

/* Diagnostic list (e.g. accuracy conditions) — left-border cards */
.condition-list {
  list-style: none;
  padding-left: 0;
  margin: var(--s4) 0;
}

.condition-list li {
  padding: var(--s3) var(--s4);
  border-left: 3px solid var(--accent);
  background: var(--paper);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin-top: var(--s3);
}

.condition-list li strong {
  display: block;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 3px;
}

/* Info table (extract-audio-from-video and similar pages) */
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: var(--s4) 0;
}

.info-table th,
.info-table td {
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  color: var(--ink-2);
  line-height: 1.6;
}

.info-table th {
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
}

/* FAQ — always-visible (no accordion collapse) */
.faq-section details > *:not(summary) {
  display: block !important;
}

.faq-section summary {
  pointer-events: none;
  cursor: default;
}

.faq-section summary::after,
.faq-section details[open] summary::after {
  display: none;
}

/* Related tools */
.related {
  max-width: 100%;
  margin: var(--s7) auto 0;
}

.related div {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s4);
}

.related a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--paper);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}

.related a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.site-footer {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto 34px;
  padding: 18px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  border-top: 2px solid var(--ink);
  color: var(--muted);
  font-size: 14px;
}

.site-footer span {
  color: var(--ink);
  font-weight: 950;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}

.site-footer a:hover {
  color: var(--ink);
}
@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .topnav {
    justify-content: start;
    width: 100%;
  }

  .hero {
    padding: 32px 0 34px;
  }

  .hero-copy {
    grid-template-columns: 1fr;
    max-width: 780px;
  }

  .hero-copy .eyebrow,
  .hero-copy h1,
  .hero-copy .lede {
    grid-column: 1;
    grid-row: auto;
  }

  .hero-copy .lede {
    padding-top: 0;
  }

  h1 {
    max-width: 760px;
    font-size: 52px;
    margin-bottom: 8px;
  }

  .lede {
    max-width: 72ch;
  }

  .tool-grid,
  .content-band {
    grid-template-columns: 1fr;
  }

  .primary-panel {
    border-right: 0;
    border-bottom: 2px solid var(--ink);
  }

  .article-guide article {
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 22px, var(--max));
    margin-top: 16px;
  }

  .topnav {
    flex-wrap: wrap;
    overflow: visible;
  }

  .topnav a {
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
  }

  .hero {
    padding: 24px 0 28px;
  }

  h1 {
    font-size: 38px;
    line-height: 1.06;
  }

  .lede {
    font-size: 17px;
    line-height: 1.62;
  }

  .tool-shell-head {
    align-items: start;
    flex-direction: column;
    padding: 16px;
  }

  .tool-panel {
    padding: 14px;
  }

  .field,
  .field select {
    width: 100%;
    min-width: 100%;
  }

  .tool-button,
  .editor-actions button {
    flex: 1 1 140px;
  }

  .divider {
    display: none;
  }

  textarea {
    min-height: 300px;
  }

  .side-actions {
    grid-template-columns: 1fr;
  }

  .article-guide {
    margin-top: var(--s6);
  }

  .answer-card,
  .howto-card,
  .references-card {
    padding: var(--s5);
  }
}
.template-switcher {
  position: fixed;
  right: 18px;
  top: 92px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid oklch(0.985 0.008 94 / 0.28);
  border-radius: 999px;
  background: oklch(0.205 0.038 239 / 0.94);
  box-shadow: 0 12px 34px oklch(0.205 0.038 239 / 0.18);
  color: var(--paper);
}

.template-switcher span {
  padding: 0 7px;
  color: oklch(0.965 0.014 92 / 0.72);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.template-switcher button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: oklch(0.965 0.014 92 / 0.76);
  font-size: 12px;
  font-weight: 900;
}

.template-switcher button:hover,
.template-switcher button.active {
  border-color: oklch(0.79 0.185 125 / 0.5);
  background: var(--signal);
  color: var(--ink);
}

body[data-template='rally'] {
  --page: oklch(0.17 0.026 245);
  --paper: oklch(0.94 0.018 92);
  --paper-2: oklch(0.88 0.026 92);
  --ink: oklch(0.17 0.026 245);
  --ink-2: oklch(0.23 0.032 245);
  --muted: oklch(0.47 0.026 245);
  --line: oklch(0.78 0.036 92);
  --line-strong: oklch(0.62 0.045 92);
  --signal: oklch(0.77 0.19 126);
  --cyan: oklch(0.68 0.14 205);
  --coral: oklch(0.66 0.18 30);
  --warn: oklch(0.76 0.16 82);
  --shadow: 0 24px 70px oklch(0.08 0.02 245 / 0.36);
  background:
    linear-gradient(90deg, oklch(0.98 0.008 92 / 0.055) 1px, transparent 1px),
    linear-gradient(180deg, oklch(0.98 0.008 92 / 0.045) 1px, transparent 1px),
    linear-gradient(180deg, oklch(0.17 0.026 245), oklch(0.22 0.032 240) 520px, oklch(0.94 0.018 92) 520px);
  background-size: 48px 48px, 48px 48px, auto;
}

body[data-template='rally'] .topbar {
  border-bottom-color: var(--signal);
  background: oklch(0.13 0.025 245);
}

body[data-template='rally'] .shell {
  margin-top: 28px;
}

body[data-template='rally'] .breadcrumb,
body[data-template='rally'] .breadcrumb a {
  color: oklch(0.94 0.018 92);
}

body[data-template='rally'] .hero {
  min-height: 360px;
  padding: 56px 0 58px;
}

body[data-template='rally'] .hero-copy {
  grid-template-columns: minmax(300px, 0.52fr) minmax(440px, 0.96fr);
}

body[data-template='rally'] .hero h1,
body[data-template='rally'] .hero .lede {
  color: oklch(0.97 0.011 92);
}

body[data-template='rally'] .hero h1 {
  font-size: clamp(64px, 7vw, 112px);
  line-height: 0.88;
  text-transform: uppercase;
}

body[data-template='rally'] .hero .lede {
  max-width: 70ch;
  padding-top: 14px;
  font-size: 20px;
}

body[data-template='rally'] .tool-shell {
  border-radius: 2px;
  border-width: 1px;
}

body[data-template='rally'] .tool-shell-head {
  border-bottom-width: 1px;
  background: oklch(0.13 0.025 245);
}

body[data-template='rally'] .answer-card {
  border-radius: 2px;
  background: oklch(0.13 0.025 245);
}

body[data-template='rally'] .article-guide article {
  grid-template-columns: minmax(190px, 0.28fr) minmax(0, 1fr);
}

body[data-template='eduwell'] {
  --page: oklch(0.982 0.014 116);
  --paper: oklch(0.998 0.004 110);
  --paper-2: oklch(0.947 0.022 114);
  --ink: oklch(0.25 0.06 235);
  --ink-2: oklch(0.34 0.04 230);
  --muted: oklch(0.53 0.032 225);
  --line: oklch(0.87 0.032 120);
  --line-strong: oklch(0.76 0.054 125);
  --signal: oklch(0.72 0.15 156);
  --cyan: oklch(0.72 0.13 205);
  --coral: oklch(0.68 0.16 35);
  --warn: oklch(0.78 0.13 76);
  --shadow: 0 22px 64px oklch(0.3 0.05 230 / 0.14);
  background:
    radial-gradient(ellipse at 18% 0%, oklch(0.89 0.08 156 / 0.36), transparent 42%),
    linear-gradient(180deg, var(--page), oklch(0.96 0.018 96));
}

body[data-template='eduwell'] .topbar {
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  background: oklch(0.998 0.004 110 / 0.94);
  color: var(--ink);
  backdrop-filter: blur(14px);
}

body[data-template='eduwell'] .brand,
body[data-template='eduwell'] .topnav a {
  color: var(--ink);
}

body[data-template='eduwell'] .brand-mark {
  background: oklch(0.92 0.045 155);
  color: var(--ink);
}

body[data-template='eduwell'] .topnav a:hover,
body[data-template='eduwell'] .topnav a[aria-current='page'] {
  border-color: transparent;
  background: oklch(0.72 0.15 156 / 0.16);
  color: var(--ink);
}

body[data-template='eduwell'] .hero {
  padding: 52px 0 48px;
}

body[data-template='eduwell'] .hero-copy {
  grid-template-columns: minmax(320px, 0.7fr) minmax(420px, 0.9fr);
  gap: 26px 56px;
}

body[data-template='eduwell'] h1 {
  font-size: clamp(52px, 6vw, 82px);
  line-height: 0.96;
}

body[data-template='eduwell'] .lede {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

body[data-template='eduwell'] .tool-shell,
body[data-template='eduwell'] .faq-section details,
body[data-template='eduwell'] .answer-card,
body[data-template='eduwell'] .references-card {
  border-radius: 18px;
}

body[data-template='eduwell'] .tool-shell {
  border: 1px solid var(--line);
}

body[data-template='eduwell'] .tool-shell-head {
  border-bottom: 0;
  background: linear-gradient(135deg, var(--ink), oklch(0.32 0.08 205));
}

body[data-template='eduwell'] .answer-card {
  background: oklch(0.25 0.06 235);
}

body[data-template='eduwell'] .article-guide article {
  border-bottom-color: var(--line);
}

body[data-template='crafto'] {
  --page: oklch(0.965 0.024 82);
  --paper: oklch(0.992 0.008 82);
  --paper-2: oklch(0.925 0.03 78);
  --ink: oklch(0.205 0.033 55);
  --ink-2: oklch(0.31 0.035 58);
  --muted: oklch(0.49 0.032 60);
  --line: oklch(0.81 0.038 78);
  --line-strong: oklch(0.64 0.052 78);
  --signal: oklch(0.67 0.18 34);
  --cyan: oklch(0.62 0.13 190);
  --coral: oklch(0.67 0.18 34);
  --warn: oklch(0.78 0.15 86);
  --shadow: 0 30px 80px oklch(0.205 0.033 55 / 0.18);
  background:
    linear-gradient(90deg, oklch(0.205 0.033 55 / 0.045) 1px, transparent 1px),
    linear-gradient(180deg, oklch(0.205 0.033 55 / 0.035) 1px, transparent 1px),
    linear-gradient(180deg, var(--page), oklch(0.95 0.024 80));
  background-size: 58px 58px, 58px 58px, auto;
}

body[data-template='crafto'] .topbar {
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  margin: 16px auto 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(0.992 0.008 82 / 0.96);
  color: var(--ink);
  box-shadow: var(--shadow);
}

body[data-template='crafto'] .brand,
body[data-template='crafto'] .topnav a {
  color: var(--ink);
}

body[data-template='crafto'] .topnav a:hover,
body[data-template='crafto'] .topnav a[aria-current='page'] {
  border-color: transparent;
  background: var(--ink);
  color: var(--paper);
}

body[data-template='crafto'] .brand-mark {
  border-color: var(--line-strong);
  background: var(--ink);
  color: var(--paper);
}

body[data-template='crafto'] .hero {
  padding: 64px 0 52px;
}

body[data-template='crafto'] .hero-copy {
  grid-template-columns: minmax(320px, 0.78fr) minmax(420px, 0.86fr);
  column-gap: 76px;
}

body[data-template='crafto'] h1 {
  font-size: clamp(58px, 7vw, 96px);
  line-height: 0.94;
}

body[data-template='crafto'] .lede {
  padding: 28px 0 28px 34px;
  border-left: 1px solid var(--line-strong);
  font-size: 20px;
}

body[data-template='crafto'] .tool-shell {
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background: var(--paper);
}

body[data-template='crafto'] .tool-shell-head {
  padding: 26px 30px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--ink);
}

body[data-template='crafto'] .tool-panel {
  background: var(--paper);
}

body[data-template='crafto'] .tool-button.primary,
body[data-template='crafto'] .mic-button .mic-core {
  background: var(--signal);
}

body[data-template='crafto'] .answer-card {
  border-radius: 28px;
  background: var(--ink);
}

body[data-template='crafto'] .keyword-strip span {
  border-radius: 999px;
  background: var(--paper);
}

body[data-template='crafto'] .faq-section details {
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 12px 38px oklch(0.205 0.033 55 / 0.08);
}

body[data-template='rally'] .template-switcher,
body[data-template='eduwell'] .template-switcher,
body[data-template='crafto'] .template-switcher {
  position: fixed;
  right: 18px;
  top: 92px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid oklch(0.985 0.008 94 / 0.28);
  border-radius: 999px;
  background: oklch(0.205 0.038 239 / 0.94);
  box-shadow: 0 12px 34px oklch(0.205 0.038 239 / 0.18);
  color: var(--paper);
}

@media (max-width: 980px) {
  body[data-template='rally'] .hero-copy,
  body[data-template='eduwell'] .hero-copy,
  body[data-template='crafto'] .hero-copy {
    grid-template-columns: 1fr;
  }

  body[data-template='rally'] .hero h1,
  body[data-template='eduwell'] .hero h1,
  body[data-template='crafto'] .hero h1 {
    font-size: clamp(42px, 10vw, 64px);
  }

  body[data-template='rally'] .hero-copy .lede,
  body[data-template='eduwell'] .hero-copy .lede,
  body[data-template='crafto'] .hero-copy .lede {
    grid-column: 1;
    grid-row: auto;
  }

  body[data-template='crafto'] .topbar {
    border-radius: 22px;
  }
}

@media (max-width: 620px) {
  .template-switcher {
  position: fixed;
  right: 18px;
  top: 92px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid oklch(0.985 0.008 94 / 0.28);
  border-radius: 999px;
  background: oklch(0.205 0.038 239 / 0.94);
  box-shadow: 0 12px 34px oklch(0.205 0.038 239 / 0.18);
  color: var(--paper);
}

  .template-switcher span {
    display: none;
  }

  body[data-template='crafto'] .topbar {
    width: min(100% - 22px, var(--max));
    margin-top: 11px;
  }

  body[data-template='crafto'] .lede {
    padding-left: 18px;
  }
}
/* structural template rebuild */
body[data-template] {
  transition: background-color 180ms ease-out, color 180ms ease-out;
}

body[data-template] .topbar,
body[data-template] .tool-shell,
body[data-template] .hero-copy,
body[data-template] .answer-card,
body[data-template] .article-guide article,
body[data-template] .faq-section details {
  transition: background-color 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out, transform 180ms ease-out;
}

body[data-template='rally'] {
  --page: oklch(0.12 0.026 245);
  --paper: oklch(0.95 0.012 88);
  --paper-2: oklch(0.88 0.018 88);
  --ink: oklch(0.14 0.032 245);
  --ink-2: oklch(0.22 0.032 245);
  --muted: oklch(0.61 0.02 238);
  --line: oklch(0.94 0.012 88 / 0.18);
  --line-strong: oklch(0.94 0.012 88 / 0.34);
  --signal: oklch(0.79 0.19 126);
  --cyan: oklch(0.72 0.13 205);
  --coral: oklch(0.68 0.19 30);
  --warn: oklch(0.77 0.16 82);
  --shadow: 0 28px 90px oklch(0.06 0.02 245 / 0.48);
  background:
    linear-gradient(90deg, oklch(0.94 0.012 88 / 0.045) 1px, transparent 1px),
    linear-gradient(180deg, oklch(0.94 0.012 88 / 0.036) 1px, transparent 1px),
    var(--page);
  background-size: 52px 52px, 52px 52px, auto;
}

body[data-template='rally'] .topbar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 294px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 48px;
  padding: 32px 26px;
  border-right: 1px solid var(--line-strong);
  border-bottom: 0;
  background: oklch(0.095 0.022 245 / 0.98);
  color: var(--paper);
}

body[data-template='rally'] .brand {
  align-items: start;
  gap: 16px;
}

body[data-template='rally'] .brand-name {
  max-width: 150px;
  font-size: 30px;
  line-height: 0.98;
}

body[data-template='rally'] .brand-mark {
  flex: 0 0 auto;
}

body[data-template='rally'] .topnav {
  counter-reset: navitem;
  width: 100%;
  display: grid;
  gap: 0;
  align-content: start;
  overflow: visible;
}

body[data-template='rally'] .topnav a {
  counter-increment: navitem;
  width: 100%;
  min-height: 48px;
  justify-content: start;
  padding: 0;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  color: oklch(0.94 0.012 88 / 0.7);
  font-size: 14px;
  text-transform: uppercase;
}

body[data-template='rally'] .topnav a::before {
  content: counter(navitem, decimal-leading-zero);
  width: 38px;
  color: var(--signal);
  font-size: 12px;
}

body[data-template='rally'] .topnav a:hover,
body[data-template='rally'] .topnav a[aria-current='page'] {
  background: transparent;
  color: var(--paper);
}

body[data-template='rally'] .shell {
  width: min(1320px, calc(100% - 348px));
  margin: 0 28px 64px 322px;
  padding-top: 42px;
}

body[data-template='rally'] .breadcrumb {
  color: oklch(0.94 0.012 88 / 0.62);
}

body[data-template='rally'] .breadcrumb a {
  color: var(--paper);
}

body[data-template='rally'] .hero {
  min-height: 520px;
  display: grid;
  align-items: center;
  padding: 54px 0 74px;
}

body[data-template='rally'] .hero-copy {
  display: grid;
  grid-template-columns: minmax(340px, 0.72fr) minmax(420px, 1fr);
  align-items: end;
  column-gap: 72px;
  color: var(--paper);
}

body[data-template='rally'] .hero-copy .eyebrow {
  grid-column: 1 / -1;
  color: var(--coral);
}

body[data-template='rally'] .hero h1 {
  color: var(--paper);
  font-size: clamp(76px, 10vw, 142px);
  line-height: 0.82;
  text-transform: uppercase;
}

body[data-template='rally'] .hero .lede {
  max-width: 780px;
  color: oklch(0.94 0.012 88 / 0.9);
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.52;
}

body[data-template='rally'] .tool-shell {
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--paper);
  box-shadow: 0 40px 120px oklch(0.03 0.018 245 / 0.62);
}

body[data-template='rally'] .tool-shell-head {
  min-height: 128px;
  padding: 32px;
  background: oklch(0.075 0.022 245);
  border-bottom: 1px solid var(--line-strong);
}

body[data-template='rally'] .tool-shell-head h2 {
  max-width: 740px;
  font-size: 38px;
}

body[data-template='rally'] .answer-card,
body[data-template='rally'] .article-guide,
body[data-template='rally'] .howto-card,
body[data-template='rally'] .references-card {
  border: 1px solid var(--line-strong);
  border-radius: 0;
}

body[data-template='rally'] .answer-card {
  background: oklch(0.075 0.022 245);
}

body[data-template='rally'] .article-guide article {
  grid-template-columns: minmax(230px, 0.28fr) minmax(0, 1fr);
  padding: 34px 0;
  border-bottom-color: oklch(0.14 0.032 245 / 0.2);
}

body[data-template='rally'] .template-switcher {
  top: 22px;
  right: 24px;
}

body[data-template='eduwell'] {
  --page: oklch(0.982 0.014 116);
  --paper: oklch(0.998 0.004 110);
  --paper-2: oklch(0.945 0.026 115);
  --ink: oklch(0.235 0.06 234);
  --ink-2: oklch(0.34 0.04 228);
  --muted: oklch(0.52 0.032 224);
  --line: oklch(0.87 0.032 120);
  --line-strong: oklch(0.74 0.058 130);
  --signal: oklch(0.72 0.15 156);
  --cyan: oklch(0.72 0.13 205);
  --coral: oklch(0.68 0.16 35);
  --warn: oklch(0.78 0.13 76);
  --shadow: 0 22px 64px oklch(0.3 0.05 230 / 0.14);
  background:
    radial-gradient(ellipse at 12% 0%, oklch(0.86 0.09 156 / 0.52), transparent 42%),
    radial-gradient(ellipse at 90% 10%, oklch(0.88 0.08 72 / 0.35), transparent 38%),
    linear-gradient(180deg, var(--page), oklch(0.96 0.018 96));
}

body[data-template='eduwell'] .topbar {
  position: sticky;
  inset: auto;
  width: auto;
  min-height: 78px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  margin: 0;
  padding: 0 max(16px, calc((100vw - var(--max)) / 2 + 16px));
  border-right: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: oklch(0.998 0.004 110 / 0.94);
  color: var(--ink);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

body[data-template='eduwell'] .brand,
body[data-template='eduwell'] .topnav a {
  color: var(--ink);
}

body[data-template='eduwell'] .brand-mark {
  background: oklch(0.9 0.06 155);
  color: var(--ink);
}

body[data-template='eduwell'] .topnav {
  display: flex;
  justify-content: flex-end;
}

body[data-template='eduwell'] .topnav a:hover,
body[data-template='eduwell'] .topnav a[aria-current='page'] {
  border-color: transparent;
  background: oklch(0.72 0.15 156 / 0.16);
  color: var(--ink);
}

body[data-template='eduwell'] .shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 22px auto 52px;
}

body[data-template='eduwell'] .hero {
  min-height: 390px;
  padding: 56px 0 50px;
}

body[data-template='eduwell'] .hero-copy {
  grid-template-columns: minmax(320px, 0.72fr) minmax(420px, 0.9fr);
  gap: 28px 58px;
}

body[data-template='eduwell'] .hero h1 {
  font-size: clamp(56px, 7vw, 92px);
  line-height: 0.93;
}

body[data-template='eduwell'] .hero .lede {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

body[data-template='eduwell'] .tool-shell {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
}

body[data-template='eduwell'] .tool-shell-head {
  padding: 26px 30px;
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  background: linear-gradient(135deg, var(--ink), oklch(0.32 0.08 205));
}

body[data-template='eduwell'] .answer-card,
body[data-template='eduwell'] .faq-section details,
body[data-template='eduwell'] .references-card,
body[data-template='eduwell'] .howto-card {
  border-radius: 22px;
}

body[data-template='eduwell'] .content-band article,
body[data-template='eduwell'] .faq-section details {
  background: var(--paper);
  box-shadow: 0 14px 44px oklch(0.3 0.05 230 / 0.08);
}

body[data-template='eduwell'] .template-switcher {
  top: 92px;
}

body[data-template='crafto'] {
  --page: oklch(0.962 0.025 82);
  --paper: oklch(0.994 0.008 82);
  --paper-2: oklch(0.925 0.03 78);
  --ink: oklch(0.19 0.035 55);
  --ink-2: oklch(0.31 0.035 58);
  --muted: oklch(0.49 0.032 60);
  --line: oklch(0.81 0.038 78);
  --line-strong: oklch(0.62 0.052 78);
  --signal: oklch(0.67 0.18 34);
  --cyan: oklch(0.62 0.13 190);
  --coral: oklch(0.67 0.18 34);
  --warn: oklch(0.78 0.15 86);
  --shadow: 0 30px 80px oklch(0.205 0.033 55 / 0.18);
  background:
    linear-gradient(90deg, oklch(0.205 0.033 55 / 0.045) 1px, transparent 1px),
    linear-gradient(180deg, oklch(0.205 0.033 55 / 0.035) 1px, transparent 1px),
    linear-gradient(180deg, var(--page), oklch(0.95 0.024 80));
  background-size: 58px 58px, 58px 58px, auto;
}

body[data-template='crafto'] .topbar {
  position: sticky;
  top: 16px;
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  grid-template-columns: auto minmax(0, 1fr);
  margin: 16px auto 0;
  padding: 0 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(0.994 0.008 82 / 0.96);
  color: var(--ink);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

body[data-template='crafto'] .brand,
body[data-template='crafto'] .topnav a {
  color: var(--ink);
}

body[data-template='crafto'] .brand-mark {
  border-color: var(--line-strong);
  background: var(--ink);
  color: var(--paper);
}

body[data-template='crafto'] .topnav {
  display: flex;
  justify-content: flex-end;
}

body[data-template='crafto'] .topnav a:hover,
body[data-template='crafto'] .topnav a[aria-current='page'] {
  border-color: transparent;
  background: var(--ink);
  color: var(--paper);
}

body[data-template='crafto'] .shell {
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 52px;
}

body[data-template='crafto'] .hero {
  min-height: 430px;
  padding: 62px 0 56px;
}

body[data-template='crafto'] .hero-copy {
  grid-template-columns: minmax(320px, 0.78fr) minmax(420px, 0.86fr);
  column-gap: 76px;
}

body[data-template='crafto'] h1 {
  font-size: clamp(60px, 7vw, 104px);
  line-height: 0.92;
}

body[data-template='crafto'] .lede {
  padding: 30px 0 30px 38px;
  border-left: 1px solid var(--line-strong);
  font-size: 21px;
}

body[data-template='crafto'] .tool-shell {
  border: 1px solid var(--line-strong);
  border-radius: 34px;
  background: var(--paper);
}

body[data-template='crafto'] .tool-shell-head {
  padding: 30px 34px;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 34px 34px 0 0;
  background: var(--ink);
}

body[data-template='crafto'] .tool-panel {
  background: var(--paper);
}

body[data-template='crafto'] .tool-button.primary,
body[data-template='crafto'] .mic-button .mic-core {
  background: var(--signal);
}

body[data-template='crafto'] .answer-card {
  border-radius: 34px;
  background: var(--ink);
}

body[data-template='crafto'] .keyword-strip span {
  border-radius: 999px;
  background: var(--paper);
}

body[data-template='crafto'] .faq-section details {
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 12px 38px oklch(0.205 0.033 55 / 0.08);
}

@media (max-width: 1120px) {
  body[data-template='rally'] .topbar {
    position: sticky;
    inset: auto;
    width: auto;
    min-height: auto;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto;
    padding: 0 max(16px, calc((100vw - var(--max)) / 2 + 16px));
    border-right: 0;
    border-bottom: 3px solid var(--signal);
  }

  body[data-template='rally'] .brand-name {
    max-width: none;
    font-size: 22px;
  }

  body[data-template='rally'] .topnav {
    display: flex;
    justify-content: flex-end;
    overflow-x: auto;
  }

  body[data-template='rally'] .topnav a {
    width: auto;
    min-height: 38px;
    padding: 0 11px;
    border-bottom: 0;
  }

  body[data-template='rally'] .topnav a::before {
    content: none;
  }

  body[data-template='rally'] .shell {
    width: min(var(--max), calc(100% - 32px));
    margin: 22px auto 52px;
    padding-top: 0;
  }
}

@media (max-width: 980px) {
  body[data-template='rally'] .hero-copy,
  body[data-template='eduwell'] .hero-copy,
  body[data-template='crafto'] .hero-copy {
    grid-template-columns: 1fr;
  }

  body[data-template='rally'] .hero-copy .lede,
  body[data-template='eduwell'] .hero-copy .lede,
  body[data-template='crafto'] .hero-copy .lede {
    grid-column: 1;
    grid-row: auto;
  }

  body[data-template='rally'] .hero h1,
  body[data-template='eduwell'] .hero h1,
  body[data-template='crafto'] .hero h1 {
    font-size: clamp(42px, 10vw, 70px);
  }

  body[data-template='crafto'] .topbar {
    border-radius: 22px;
  }
}

@media (max-width: 620px) {
  body[data-template='rally'] .hero,
  body[data-template='eduwell'] .hero,
  body[data-template='crafto'] .hero {
    min-height: 0;
    padding: 30px 0;
  }

  body[data-template='crafto'] .topbar {
    width: min(100% - 22px, var(--max));
    margin-top: 11px;
  }

  body[data-template='crafto'] .lede {
    padding-left: 18px;
  }

  .template-switcher {
    left: 11px;
    right: 11px;
    top: auto;
    bottom: 11px;
    justify-content: center;
    overflow-x: auto;
  }

  .template-switcher span {
    display: none;
  }
}
/* listen white template */
body[data-template='listen'] {
  --page: oklch(0.995 0.004 95);
  --paper: oklch(0.998 0.003 95);
  --paper-2: oklch(0.968 0.012 95);
  --ink: oklch(0.17 0.03 250);
  --ink-2: oklch(0.28 0.025 250);
  --muted: oklch(0.55 0.018 250);
  --line: oklch(0.9 0.01 95);
  --line-strong: oklch(0.75 0.018 95);
  --signal: oklch(0.68 0.22 325);
  --cyan: oklch(0.68 0.16 205);
  --coral: oklch(0.66 0.21 22);
  --warn: oklch(0.78 0.15 78);
  --danger: oklch(0.58 0.18 28);
  --shadow: 0 26px 80px oklch(0.18 0.03 250 / 0.12);
  background:
    radial-gradient(circle at 50% 0%, oklch(0.72 0.18 300 / 0.08), transparent 34%),
    radial-gradient(circle at 2px 2px, oklch(0.18 0.03 250 / 0.11) 1px, transparent 1px),
    var(--page);
  background-size: auto, 18px 18px, auto;
}

body[data-template='listen'] .template-switcher {
  display: none;
}

body[data-template='listen'] .topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0 max(18px, calc((100vw - 1240px) / 2 + 18px));
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: oklch(0.995 0.004 95 / 0.92);
  color: var(--ink);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

body[data-template='listen'] .brand,
body[data-template='listen'] .topnav a {
  color: var(--ink);
}

body[data-template='listen'] .brand-mark {
  border: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--paper);
}

body[data-template='listen'] .brand-name {
  font-size: 24px;
}

body[data-template='listen'] .topnav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

body[data-template='listen'] .topnav a {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 850;
}

body[data-template='listen'] .topnav a:hover,
body[data-template='listen'] .topnav a[aria-current='page'] {
  background: oklch(0.68 0.22 325 / 0.1);
  color: var(--signal);
}

body[data-template='listen'] .shell {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto 56px;
}

body[data-template='listen'] .breadcrumb {
  padding-top: 22px;
  color: var(--muted);
}

body[data-template='listen'] .breadcrumb a {
  color: var(--ink);
  border-bottom-color: var(--signal);
}

body[data-template='listen'] .hero {
  min-height: 430px;
  display: grid;
  align-items: center;
  padding: 34px 0 52px;
}

body[data-template='listen'] .hero-copy {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  max-width: 100%;
  min-height: 360px;
  align-items: center;
  isolation: isolate;
}

body[data-template='listen'] .hero-copy .eyebrow {
  position: absolute;
  top: 18px;
  left: 0;
  z-index: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: none;
}

body[data-template='listen'] .hero h1 {
  position: relative;
  z-index: 1;
  max-width: none;
  margin: 0;
  color: transparent;
  background: linear-gradient(90deg, oklch(0.66 0.28 352), oklch(0.55 0.29 292));
  -webkit-background-clip: text;
  background-clip: text;
  font-size: clamp(112px, 15vw, 220px);
  font-weight: 950;
  line-height: 0.78;
  letter-spacing: 0;
  text-transform: lowercase;
  white-space: normal;
}

body[data-template='listen'] .hero .lede {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(0.998 0.003 95 / 0.88);
  box-shadow: 0 18px 60px oklch(0.18 0.03 250 / 0.1);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  backdrop-filter: blur(14px);
}

body[data-template='listen'] .tool-shell {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

body[data-template='listen'] .tool-shell-head {
  padding: 28px 32px;
  border-bottom: 1px solid var(--line);
  border-radius: 28px 28px 0 0;
  background: var(--ink);
  color: var(--paper);
}

body[data-template='listen'] .tool-shell-head h2 {
  font-size: 30px;
}

body[data-template='listen'] .tool-panel {
  background: var(--paper);
}

body[data-template='listen'] .tool-button.primary,
body[data-template='listen'] .mic-button .mic-core {
  background: var(--signal);
}

body[data-template='listen'] .answer-card {
  border: 0;
  border-radius: 26px;
  background: linear-gradient(120deg, oklch(0.66 0.28 352), oklch(0.55 0.29 292));
  box-shadow: var(--shadow);
}

body[data-template='listen'] .article-guide article {
  border-bottom-color: var(--line);
}

/* Theme-aware surfaces (was a hard-coded near-white that broke dark mode) */
body[data-template='listen'] .faq-section details,
body[data-template='listen'] .references-card,
body[data-template='listen'] .howto-card {
  background: var(--paper);
}

body[data-template='listen'] .keyword-strip span {
  background: var(--paper-2);
}

@media (max-width: 980px) {
  body[data-template='listen'] .hero-copy {
    min-height: 300px;
  }

  body[data-template='listen'] .hero h1 {
    font-size: clamp(74px, 18vw, 132px);
  }

  body[data-template='listen'] .hero .lede {
    position: relative;
    bottom: auto;
    max-width: 100%;
    margin-top: 20px;
    border-radius: 22px;
  }
}

@media (max-width: 620px) {
  body[data-template='listen'] .shell {
    width: min(100% - 22px, 1240px);
  }

  body[data-template='listen'] .hero {
    min-height: 0;
    padding: 28px 0 34px;
  }

  body[data-template='listen'] .hero-copy {
    min-height: 0;
  }

  body[data-template='listen'] .hero-copy .eyebrow {
    position: static;
    margin-bottom: 14px;
  }

  body[data-template='listen'] .hero h1 {
    font-size: clamp(58px, 19vw, 96px);
    line-height: 0.86;
  }
}
/* final simple recorder repair */
body[data-template='listen'] .hero {
  min-height: 0;
  padding: 30px 0 42px;
}

body[data-template='listen'] .hero-copy {
  display: block;
  min-height: 0;
}

body[data-template='listen'] .hero-copy .eyebrow {
  position: static;
  margin-bottom: 12px;
  color: oklch(0.50 0.18 315);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

body[data-template='listen'] .hero h1 {
  max-width: 100%;
  margin: 0;
  color: oklch(0.58 0.24 315);
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  font-size: clamp(58px, 7.5vw, 110px);
  font-weight: 950;
  line-height: 0.86;
  letter-spacing: 0;
  text-transform: lowercase;
}

body[data-template='listen'] .hero .lede {
  position: static;
  /* As wide as the tool (line under H1) — was pinned to 820px. */
  width: 100%;
  max-width: 100%;
  margin: 22px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: oklch(0.44 0.16 315);
  font-size: 19px;
  line-height: 1.62;
  text-align: left;
  transform: none;
  backdrop-filter: none;
}

body[data-template='listen'][data-page='voice-recorder'] .tool-shell {
  width: min(760px, 100%);
  margin-top: 14px;
  border: 1px solid oklch(0.82 0.08 315 / 0.45);
  border-radius: 999px;
  background: oklch(0.998 0.003 95 / 0.9);
  box-shadow: 0 20px 60px oklch(0.58 0.24 315 / 0.14);
  overflow: visible;
}

body[data-template='listen'][data-page='voice-recorder'] .tool-shell-head {
  display: none;
}

body[data-template='listen'][data-page='voice-recorder'] .tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

body[data-template='listen'][data-page='voice-recorder'] .primary-panel,
body[data-template='listen'][data-page='voice-recorder'] .side-panel {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body[data-template='listen'][data-page='voice-recorder'] .toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

body[data-template='listen'][data-page='voice-recorder'] .language-field,
body[data-template='listen'][data-page='voice-recorder'] .command-control,
body[data-template='listen'][data-page='voice-recorder'] .combo-control,
body[data-template='listen'][data-page='voice-recorder'] .transcribe-control:not(#startRecordButton),
body[data-template='listen'][data-page='voice-recorder'] #textFileButton,
body[data-template='listen'][data-page='voice-recorder'] .live-strip,
body[data-template='listen'][data-page='voice-recorder'] textarea,
body[data-template='listen'][data-page='voice-recorder'] .editor-actions,
body[data-template='listen'][data-page='voice-recorder'] .speak-control,
body[data-template='listen'][data-page='voice-recorder'] .command-control,
body[data-template='listen'][data-page='voice-recorder'] .soft,
body[data-template='listen'][data-page='voice-recorder'] .wave,
body[data-template='listen'][data-page='voice-recorder'] #recordingMeta,
body[data-template='listen'][data-page='voice-recorder'] .mini-section h2,
body[data-template='listen'][data-page='voice-recorder'] .mic-core,
body[data-template='listen'][data-page='voice-recorder'] #recordMicStateText {
  display: none !important;
}

body[data-template='listen'][data-page='voice-recorder'] .tool-button,
body[data-template='listen'][data-page='voice-recorder'] .download-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 900;
}

body[data-template='listen'][data-page='voice-recorder'] #startRecordButton {
  background: oklch(0.58 0.24 315);
  color: var(--paper);
}

body[data-template='listen'][data-page='voice-recorder'] #pauseRecordButton {
  background: oklch(0.9 0.06 315);
  color: oklch(0.36 0.16 315);
}

body[data-template='listen'][data-page='voice-recorder'] #stopButton {
  background: oklch(0.92 0.06 28);
  color: oklch(0.44 0.16 28);
}

body[data-template='listen'][data-page='voice-recorder'] .record-control.mini-section {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
}

body[data-template='listen'][data-page='voice-recorder'] .mic-button {
  width: auto;
  min-width: 104px;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: oklch(0.95 0.025 315);
  color: oklch(0.36 0.16 315);
  box-shadow: none;
  pointer-events: none;
}

body[data-template='listen'][data-page='voice-recorder'] #recordDurationText {
  font-size: 17px;
  font-weight: 950;
}

body[data-template='listen'][data-page='voice-recorder'] .download-link {
  min-width: 112px;
  background: oklch(0.2 0.04 250);
  color: var(--paper);
}

body[data-template='listen'][data-page='voice-recorder'] .download-link.disabled {
  background: oklch(0.86 0.012 250);
  color: oklch(0.55 0.018 250);
  opacity: 1;
}

@media (max-width: 760px) {
  body[data-template='listen'][data-page='voice-recorder'] .tool-shell {
    border-radius: 26px;
  }

  body[data-template='listen'][data-page='voice-recorder'] .tool-grid,
  body[data-template='listen'][data-page='voice-recorder'] .toolbar,
  body[data-template='listen'][data-page='voice-recorder'] .record-control.mini-section {
    grid-template-columns: 1fr;
    flex-wrap: wrap;
  }

  body[data-template='listen'][data-page='voice-recorder'] .tool-button,
  body[data-template='listen'][data-page='voice-recorder'] .download-link,
  body[data-template='listen'][data-page='voice-recorder'] .mic-button {
    flex: 1 1 140px;
  }
}

/* final mic-first voice recorder fold */
body[data-page='voice-recorder'] .hero {
  min-height: 0;
  padding: 34px 0 18px;
  text-align: center;
}

body[data-page='voice-recorder'] .hero-copy {
  display: block;
  width: min(1040px, 100%);
  min-height: 0;
  margin: 0 auto;
}

body[data-page='voice-recorder'] .hero-copy .eyebrow {
  display: none !important;
}

body[data-page='voice-recorder'] .hero h1 {
  max-width: none;
  margin: 0 auto;
  color: oklch(0.58 0.24 315);
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  font-size: clamp(50px, 6.4vw, 92px);
  font-weight: 950;
  line-height: 0.9;
  letter-spacing: 0;
  text-align: center;
  text-transform: lowercase;
}

body[data-page='voice-recorder'] .hero .lede {
  position: static;
  width: min(760px, 100%);
  max-width: none;
  margin: 18px auto 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #3f4650;
  font-size: clamp(17px, 1.45vw, 21px);
  line-height: 1.58;
  text-align: center;
  transform: none;
  backdrop-filter: none;
}

body[data-page='voice-recorder'] .answer-card {
  display: none !important;
}

body[data-page='voice-recorder'] .tool-shell {
  width: min(560px, 100%);
  margin: 24px auto 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

body[data-page='voice-recorder'] .tool-shell-head {
  display: none !important;
}

body[data-page='voice-recorder'] .tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  gap: 12px;
  padding: 0;
}

body[data-page='voice-recorder'] .side-panel {
  grid-row: 1;
  width: 100%;
}

body[data-page='voice-recorder'] .primary-panel {
  grid-row: 2;
  width: 100%;
}

body[data-page='voice-recorder'] .primary-panel,
body[data-page='voice-recorder'] .side-panel {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body[data-page='voice-recorder'] .toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  flex-wrap: wrap;
}

body[data-page='voice-recorder'] .language-field,
body[data-page='voice-recorder'] .command-control,
body[data-page='voice-recorder'] .combo-control,
body[data-page='voice-recorder'] .transcribe-control:not(#startRecordButton),
body[data-page='voice-recorder'] #textFileButton,
body[data-page='voice-recorder'] .live-strip,
body[data-page='voice-recorder'] textarea,
body[data-page='voice-recorder'] .editor-actions,
body[data-page='voice-recorder'] .speak-control,
body[data-page='voice-recorder'] .soft,
body[data-page='voice-recorder'] .wave,
body[data-page='voice-recorder'] #recordingMeta,
body[data-page='voice-recorder'] .mini-section h2,
body[data-page='voice-recorder'] #recordMicStateText {
  display: none !important;
}

body[data-page='voice-recorder'] .record-control.mini-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0;
  border: 0;
}

body[data-page='voice-recorder'] .mic-button {
  width: auto;
  min-width: 0;
  min-height: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #4b5563;
  box-shadow: none;
  cursor: pointer;
  pointer-events: auto;
}

body[data-page='voice-recorder'] .mic-core {
  position: relative;
  width: 76px;
  height: 76px;
  display: inline-block !important;
  border: 2px solid currentColor;
  border-radius: 999px;
  color: #4b5563;
  background: transparent;
  box-shadow: 0 12px 34px rgba(17, 24, 39, 0.08);
  transition: color 220ms ease, background-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

body[data-page='voice-recorder'] .mic-core::before {
  content: '';
  position: absolute;
  top: 17px;
  left: 50%;
  width: 17px;
  height: 27px;
  border: 3px solid currentColor;
  border-radius: 999px;
  transform: translateX(-50%);
}

body[data-page='voice-recorder'] .mic-core::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 17px;
  width: 26px;
  height: 18px;
  border-bottom: 3px solid currentColor;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
  border-top: 0;
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
}

body[data-page='voice-recorder'] #recordDurationText {
  display: block;
  color: #4b5563;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  transition: color 220ms ease;
}

body[data-page='voice-recorder'] .mic-button.recording .mic-core {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.08);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.24), 0 16px 42px rgba(22, 163, 74, 0.16);
  animation: a2tMicPulse 1.65s ease-in-out infinite;
}

body[data-page='voice-recorder'] .mic-button.recording #recordDurationText {
  color: #15803d;
}

body[data-page='voice-recorder'] .mic-button.paused .mic-core {
  color: #6b7280;
  background: rgba(107, 114, 128, 0.08);
  animation: none;
}

body[data-page='voice-recorder'] .tool-button,
body[data-page='voice-recorder'] .download-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 900;
}

body[data-page='voice-recorder'] #startRecordButton {
  background: oklch(0.58 0.24 315);
  color: #fff;
}

body[data-page='voice-recorder'] #pauseRecordButton {
  background: oklch(0.93 0.045 315);
  color: oklch(0.45 0.12 315);
}

body[data-page='voice-recorder'] #stopButton {
  background: oklch(0.94 0.045 24);
  color: oklch(0.45 0.13 24);
}

body[data-page='voice-recorder'] .download-link {
  min-width: 128px;
  background: #111827;
  color: #fff;
}

body[data-page='voice-recorder'] .download-link.disabled {
  background: #d8dee6;
  color: #65717e;
  opacity: 1;
}

@keyframes a2tMicPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.24), 0 16px 42px rgba(22, 163, 74, 0.16);
  }
  50% {
    transform: scale(1.045);
    box-shadow: 0 0 0 12px rgba(22, 163, 74, 0), 0 18px 48px rgba(22, 163, 74, 0.2);
  }
}

@media (max-width: 700px) {
  body[data-page='voice-recorder'] .hero {
    padding-top: 24px;
  }

  body[data-page='voice-recorder'] .hero h1 {
    font-size: clamp(48px, 17vw, 78px);
  }

  body[data-page='voice-recorder'] .hero .lede {
    font-size: 17px;
    line-height: 1.5;
  }

  body[data-page='voice-recorder'] .tool-shell {
    width: 100%;
  }

  body[data-page='voice-recorder'] .toolbar {
    gap: 8px;
  }

  body[data-page='voice-recorder'] .tool-button,
  body[data-page='voice-recorder'] .download-link {
    flex: 1 1 132px;
  }
}
/* high-specificity voice recorder mic repair */
body[data-template='listen'][data-page='voice-recorder'] .hero {
  min-height: 0;
  padding: 34px 0 18px;
  text-align: center;
}

body[data-template='listen'][data-page='voice-recorder'] .hero-copy {
  display: block;
  width: min(1040px, 100%);
  min-height: 0;
  margin: 0 auto;
}

body[data-template='listen'][data-page='voice-recorder'] .hero h1 {
  max-width: none;
  margin: 0 auto;
  color: oklch(0.58 0.24 315);
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  font-size: clamp(50px, 6.4vw, 92px);
  font-weight: 950;
  line-height: 0.9;
  letter-spacing: 0;
  text-align: center;
  text-transform: lowercase;
}

body[data-template='listen'][data-page='voice-recorder'] .hero .lede {
  position: static;
  width: min(760px, 100%);
  max-width: none;
  margin: 18px auto 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #3f4650;
  font-size: clamp(17px, 1.45vw, 21px);
  line-height: 1.58;
  text-align: center;
  transform: none;
  backdrop-filter: none;
}

body[data-template='listen'][data-page='voice-recorder'] .tool-shell {
  width: min(560px, 100%);
  margin: 24px auto clamp(92px, 15vh, 150px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

body[data-template='listen'][data-page='voice-recorder'] .tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  gap: 14px;
  padding: 0;
}

body[data-template='listen'][data-page='voice-recorder'] .side-panel,
body[data-template='listen'][data-page='voice-recorder'] .primary-panel {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body[data-template='listen'][data-page='voice-recorder'] .side-panel {
  grid-row: 1;
}

body[data-template='listen'][data-page='voice-recorder'] .primary-panel {
  grid-row: 2;
}

body[data-template='listen'][data-page='voice-recorder'] .record-control.mini-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  border: 0;
}

body[data-template='listen'][data-page='voice-recorder'] .toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  flex-wrap: wrap;
}

body[data-template='listen'][data-page='voice-recorder'] .mic-button {
  width: auto;
  min-width: 0;
  min-height: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #4b5563;
  box-shadow: none;
  cursor: pointer;
  pointer-events: auto;
}

body[data-template='listen'][data-page='voice-recorder'] .mic-core,
body[data-page='voice-recorder'] .mic-button .mic-core {
  position: relative;
  width: 76px;
  height: 76px;
  display: inline-block !important;
  border: 2px solid currentColor;
  border-radius: 999px;
  color: #4b5563;
  background: transparent;
  box-shadow: 0 12px 34px rgba(17, 24, 39, 0.08);
  transition: color 220ms ease, background-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

body[data-template='listen'][data-page='voice-recorder'] .mic-core::before,
body[data-page='voice-recorder'] .mic-button .mic-core::before {
  content: '';
  position: absolute;
  top: 17px;
  left: 50%;
  width: 17px;
  height: 27px;
  border: 3px solid currentColor;
  border-radius: 999px;
  transform: translateX(-50%);
}

body[data-template='listen'][data-page='voice-recorder'] .mic-core::after,
body[data-page='voice-recorder'] .mic-button .mic-core::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 17px;
  width: 26px;
  height: 18px;
  border-bottom: 3px solid currentColor;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
  border-top: 0;
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
}

body[data-template='listen'][data-page='voice-recorder'] #recordDurationText {
  display: block;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #4b5563;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  transition: color 220ms ease;
}

body[data-template='listen'][data-page='voice-recorder'] .mic-button.recording .mic-core {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.08);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.24), 0 16px 42px rgba(22, 163, 74, 0.16);
  animation: a2tMicPulse 1.65s ease-in-out infinite;
}

body[data-template='listen'][data-page='voice-recorder'] .mic-button.recording #recordDurationText {
  color: #15803d;
}

body[data-template='listen'][data-page='voice-recorder'] .mic-button.paused .mic-core {
  color: #6b7280;
  background: rgba(107, 114, 128, 0.08);
  animation: none;
}

body[data-template='listen'][data-page='voice-recorder'] .tool-button,
body[data-template='listen'][data-page='voice-recorder'] .download-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 900;
}

body[data-template='listen'][data-page='voice-recorder'] #startRecordButton {
  background: oklch(0.58 0.24 315);
  color: #fff;
}

body[data-template='listen'][data-page='voice-recorder'] #pauseRecordButton {
  background: oklch(0.93 0.045 315);
  color: oklch(0.45 0.12 315);
}

body[data-template='listen'][data-page='voice-recorder'] #stopButton {
  background: oklch(0.94 0.045 24);
  color: oklch(0.45 0.13 24);
}

body[data-template='listen'][data-page='voice-recorder'] .download-link {
  min-width: 128px;
  background: #111827;
  color: #fff;
}

body[data-template='listen'][data-page='voice-recorder'] .download-link.disabled {
  background: #d8dee6;
  color: #65717e;
  opacity: 1;
}
/* final fold isolation and paused mic state */
body[data-template='listen'][data-page='voice-recorder'] .tool-shell {
  margin-bottom: clamp(300px, 34vh, 380px);
}

body[data-template='listen'][data-page='voice-recorder'] .mic-button.paused .mic-core,
body[data-template='listen'][data-page='voice-recorder'] .mic-button.paused:not(.recording) .mic-core {
  color: #4b5563 !important;
  background: transparent !important;
  box-shadow: 0 12px 34px rgba(17, 24, 39, 0.08) !important;
  animation: none !important;
}

body[data-template='listen'][data-page='voice-recorder'] .mic-button.paused #recordDurationText {
  color: #4b5563 !important;
}

@media (max-width: 700px) {
  body[data-template='listen'][data-page='voice-recorder'] .tool-shell {
    margin-bottom: 120px;
  }
}
body[data-template='listen'][data-page='voice-recorder'] .mic-button.paused .mic-core,
body[data-template='listen'][data-page='voice-recorder'] .mic-button.paused:not(.recording) .mic-core {
  color: #4b5563 !important;
  border-color: #4b5563 !important;
  background-color: transparent !important;
  transition: none !important;
}
body[data-template='listen'][data-page='voice-recorder'] .mic-button.paused #recordDurationText {
  color: #4b5563 !important;
  transition: none !important;
}

/* U2K-inspired premium minimal shell with charcoal theme support. */
:root {
  --a2t-page: #fdfdfc;
  --a2t-page-2: #f7f7f6;
  --a2t-surface: #fdfdfc;
  --a2t-surface-soft: #f3f3f2;
  --a2t-ink: #1d1d20;
  --a2t-ink-soft: #333337;
  --a2t-muted: #62646b;
  --a2t-quiet: #8d9096;
  --a2t-line: #e7e7e5;
  --a2t-line-strong: #dedfdd;
  --a2t-accent: #ff3b16;
  --a2t-accent-soft: rgba(255, 59, 22, 0.1);
  --a2t-good: #159447;
  --a2t-shadow-soft: 0 1px 2px rgba(29, 29, 32, 0.08);
  --page: var(--a2t-page);
  --paper: var(--a2t-surface);
  --paper-2: var(--a2t-page-2);
  --ink: var(--a2t-ink);
  --ink-2: var(--a2t-ink-soft);
  --muted: var(--a2t-muted);
  --quiet: var(--a2t-quiet);
  --line: var(--a2t-line);
  --line-strong: var(--a2t-line-strong);
  --signal: var(--a2t-accent);
  --coral: var(--a2t-accent);
  --cyan: #1d1d20;
  --shadow: none;
}

body[data-theme='dark'] {
  color-scheme: dark;
  /* Premium dark: cool near-black, layered (same hue 264 as light), real
     elevation — page < surface < surface-soft. Never flat, never warm-muddy. */
  --a2t-page:         oklch(0.168 0.007 264);
  --a2t-page-2:       oklch(0.198 0.008 264);
  --a2t-surface:      oklch(0.232 0.009 264);
  --a2t-surface-soft: oklch(0.275 0.011 264);
  --a2t-ink:          oklch(0.968 0.004 264);
  --a2t-ink-soft:     oklch(0.865 0.007 264);
  --a2t-muted:        oklch(0.705 0.011 264);
  --a2t-quiet:        oklch(0.560 0.012 264);
  --a2t-line:         oklch(0.330 0.011 264);
  --a2t-line-strong:  oklch(0.430 0.014 264);
  /* Red-orange record signal, brightened for dark (mirrors light --signal). */
  --a2t-accent:       oklch(0.690 0.195 33);
  --a2t-accent-soft:  oklch(0.690 0.195 33 / 0.18);
  --a2t-good:         oklch(0.74 0.15 155);
  --a2t-shadow-soft:  0 1px 2px oklch(0 0 0 / 0.5);
  --page: var(--a2t-page);
  --paper: var(--a2t-surface);
  --paper-2: var(--a2t-page-2);
  --ink: var(--a2t-ink);
  --ink-2: var(--a2t-ink-soft);
  --muted: var(--a2t-muted);
  --quiet: var(--a2t-quiet);
  --line: var(--a2t-line);
  --line-strong: var(--a2t-line-strong);
  --signal: var(--a2t-accent);
  --coral: var(--a2t-accent);
  /* Interactive accent = brand BLUE, brightened for dark (mirrors light --accent). */
  --accent:       oklch(0.720 0.150 256);
  --accent-press: oklch(0.660 0.150 256);
  --accent-soft:  oklch(0.720 0.150 256 / 0.18);
  --link:         oklch(0.820 0.120 256);
  --link-hover:   oklch(0.900 0.070 256);
  --cyan: var(--a2t-ink);
  /* Dark-tuned depth — felt, layered, never harsh. */
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.55), 0 1px 1px oklch(0 0 0 / 0.4);
  --shadow:    0 10px 34px oklch(0 0 0 / 0.55), 0 2px 8px oklch(0 0 0 / 0.45);
  --shadow-lg: 0 28px 70px oklch(0 0 0 / 0.70), 0 8px 24px oklch(0 0 0 / 0.5);
}

html,
body,
body[data-template],
body[data-page='voice-recorder'] {
  background: var(--a2t-page);
  color: var(--a2t-ink);
  letter-spacing: 0;
}

body,
body[data-template],
body[data-page='voice-recorder'] {
  background:
    linear-gradient(180deg, var(--a2t-page), var(--a2t-page-2) 76vh, var(--a2t-page));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body[data-theme='dark'],
body[data-theme='dark'][data-template],
body[data-theme='dark'][data-page='voice-recorder'] {
  background:
    radial-gradient(120% 68% at 50% -8%, oklch(0.72 0.15 256 / 0.12) 0%, transparent 56%),
    radial-gradient(70% 44% at 86% 2%, oklch(0.69 0.195 33 / 0.05) 0%, transparent 52%),
    linear-gradient(180deg, var(--a2t-page) 0%, oklch(0.142 0.007 264) 82vh, var(--a2t-page) 100%);
}

/* Premium depth in dark: real lift + a hairline "lit-from-above" top edge on
   every raised surface. This is what separates premium dark from flat dark. */
body[data-theme='dark'] .tool-shell,
body[data-theme='dark'] .howto-card,
body[data-theme='dark'] .references-card,
body[data-theme='dark'] .content-band article,
body[data-theme='dark'] .faq-section details,
body[data-theme='dark'] .vr-result-box,
body[data-theme='dark'] .ar-modal-box {
  box-shadow: var(--shadow-sm), inset 0 1px 0 oklch(1 0 0 / 0.05);
}
body[data-theme='dark'] .faq-section details[open] {
  box-shadow: var(--shadow), inset 0 1px 0 oklch(1 0 0 / 0.06);
}
/* The orb is the hero on translate pages — give it slightly more presence. */
body[data-theme='dark'] .vr-panel {
  box-shadow: var(--shadow), inset 0 1px 0 oklch(1 0 0 / 0.06);
}

body[data-theme] .topbar {
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(170px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  /* Full-width bar: brand flush far-left, theme toggle flush far-right. */
  padding: 0 28px;
  border-bottom: 1px solid var(--a2t-line);
  background: color-mix(in srgb, var(--a2t-surface) 92%, transparent);
  color: var(--a2t-ink);
  box-shadow: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body[data-theme] .brand {
  gap: 9px;
  color: var(--a2t-ink);
  font-weight: 760;
}

body[data-theme] .brand-mark {
  width: 25px;
  height: 25px;
  border: 1px solid var(--a2t-line-strong);
  border-radius: 8px;
  background: var(--a2t-surface);
  box-shadow: none;
  color: var(--a2t-accent);
  font-size: 8px;
  font-weight: 850;
}

body[data-theme] .brand-name {
  color: var(--a2t-ink);
  font-size: 16px;
  font-weight: 760;
}

body[data-theme] .topnav {
  justify-content: flex-end;
  gap: 28px;
}

body[data-theme] .topnav a {
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--a2t-muted);
  font-size: 13px;
  font-weight: 540;
}

body[data-theme] .topnav a:hover,
body[data-theme] .topnav a[aria-current='page'] {
  background: transparent;
  color: var(--a2t-ink);
}

body[data-theme] .topnav a[aria-current='page'] {
  font-weight: 760;
}

body[data-theme] .theme-toggle {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--a2t-line-strong);
  border-radius: 999px;
  background: var(--a2t-surface-soft);
  color: var(--a2t-ink);
  box-shadow: var(--a2t-shadow-soft);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

body[data-theme] .theme-toggle-mark {
  width: 14px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: linear-gradient(90deg, currentColor 0 50%, transparent 50% 100%);
}

body[data-theme='dark'] .theme-toggle-mark {
  background: currentColor;
  box-shadow: inset -5px 0 0 var(--a2t-surface-soft);
}

body[data-theme] .shell {
  width: min(1200px, calc(100% - 32px));
  margin: 10px auto 54px;
}

body[data-theme] .breadcrumb {
  display: none;
}

body[data-theme] .hero,
body[data-template='listen'] .hero,
body[data-page='voice-recorder'] .hero {
  min-height: 0;
  padding: 24px 0 4px;
  background: transparent;
  text-align: center;
}

body[data-theme] .hero-copy,
body[data-template='listen'] .hero-copy,
body[data-page='voice-recorder'] .hero-copy {
  max-width: 860px;
  display: block;
  margin: 0 auto;
  text-align: center;
}

body[data-theme] .eyebrow,
body[data-template='listen'] .eyebrow {
  margin-bottom: 14px;
  color: var(--a2t-muted);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0;
  text-transform: none;
}

body[data-theme] h1,
body[data-template='listen'] h1,
body[data-page='voice-recorder'] .hero h1 {
  max-width: 880px;
  margin: 0 auto;
  background: none;
  color: var(--a2t-ink);
  -webkit-background-clip: initial;
  background-clip: initial;
  font-size: clamp(42px, 5.3vw, 68px);
  font-weight: 760;
  line-height: 1.03;
  letter-spacing: 0;
  text-align: center;
  text-transform: none;
}

body[data-theme] h1 em,
body[data-theme] h1 strong,
body[data-template='listen'] h1 em,
body[data-template='listen'] h1 strong {
  color: var(--a2t-accent);
  font-style: normal;
}

body[data-theme] .lede,
body[data-template='listen'] .lede,
body[data-page='voice-recorder'] .hero .lede {
  position: static;
  /* Match the tool panel width (body[data-theme] .tool-shell = min(100%, 1200px))
     so the intro line under the H1 spans edge-to-edge with the tool below it. */
  width: min(100%, 1200px);
  max-width: 1200px;
  margin: 14px auto 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--a2t-muted);
  font-size: 15px;
  font-weight: 430;
  line-height: 1.7;
  text-align: center;
  transform: none;
}

body[data-theme] .support-notice,
body[data-theme] .startup-error {
  border-color: var(--a2t-line-strong);
  border-radius: 12px;
  background: var(--a2t-surface);
  color: var(--a2t-ink);
  box-shadow: none;
}

body[data-theme] .tool-shell,
body[data-template='listen'] .tool-shell,
body[data-page='voice-recorder'] .tool-shell {
  width: min(100%, 1200px);
  margin: 28px auto 46px;
  border: 1px solid var(--a2t-line-strong);
  border-radius: 24px;
  background: var(--a2t-surface);
  box-shadow: none;
  overflow: hidden;
}

body[data-theme] .tool-shell-head,
body[data-template='listen'] .tool-shell-head,
body[data-page='voice-recorder'] .tool-shell-head {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--a2t-line-strong);
  background: var(--a2t-surface-soft);
  color: var(--a2t-ink);
}

body[data-theme] .tool-shell-head h2,
body[data-template='listen'] .tool-shell-head h2,
body[data-page='voice-recorder'] .tool-shell-head h2 {
  margin: 0;
  color: var(--a2t-ink);
  font-size: 14px;
  font-weight: 760;
}

body[data-theme] .tool-shell-head > span,
body[data-template='listen'] .tool-shell-head > span,
body[data-page='voice-recorder'] .tool-shell-head > span {
  color: var(--a2t-muted);
  font-size: 12px;
  font-weight: 620;
}

body[data-theme] .tool-grid,
body[data-template='listen'] .tool-grid,
body[data-page='voice-recorder'] .tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 0;
  padding: 0;
  background: var(--a2t-surface);
}

body[data-theme] .tool-panel,
body[data-template='listen'] .tool-panel,
body[data-page='voice-recorder'] .tool-panel {
  min-width: 0;
  padding: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-theme] .primary-panel,
body[data-template='listen'] .primary-panel,
body[data-page='voice-recorder'] .primary-panel {
  border-right: 1px solid var(--a2t-line-strong);
}

body[data-theme] .toolbar,
body[data-template='listen'] .toolbar,
body[data-page='voice-recorder'] .toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  background: transparent;
  flex-wrap: wrap;
}

body[data-theme] .field,
body[data-theme] .toggle,
body[data-theme] select,
body[data-theme] input[type='range'] {
  color: var(--a2t-ink);
}

body[data-theme] select {
  min-height: 36px;
  border: 1px solid var(--a2t-line-strong);
  border-radius: 999px;
  background: var(--a2t-surface);
  color: var(--a2t-ink);
}

body[data-theme] .tool-button,
body[data-theme] .editor-actions button,
body[data-theme] .side-actions button,
body[data-theme] .download-link,
body[data-template='listen'] .tool-button,
body[data-template='listen'] .download-link,
body[data-page='voice-recorder'] .tool-button,
body[data-page='voice-recorder'] .download-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--a2t-line-strong);
  border-radius: 999px;
  background: var(--a2t-surface-soft);
  color: var(--a2t-ink);
  box-shadow: none;
  text-decoration: none;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 720;
}

body[data-theme] .tool-button:hover,
body[data-theme] .editor-actions button:hover,
body[data-theme] .side-actions button:hover,
body[data-theme] .download-link:hover {
  border-color: color-mix(in srgb, var(--a2t-accent) 44%, var(--a2t-line-strong));
  color: var(--a2t-ink);
}

body[data-theme] .tool-button.primary,
body[data-template='listen'] .tool-button.primary,
body[data-page='voice-recorder'] #startRecordButton,
body[data-page='voice-recorder'] #startBothButton {
  border-color: var(--a2t-accent);
  background: var(--a2t-accent);
  color: #fff;
}

body[data-theme] .tool-button.danger,
body[data-template='listen'] #stopButton,
body[data-page='voice-recorder'] #stopButton {
  border-color: transparent;
  background: var(--a2t-accent-soft);
  color: var(--a2t-accent);
}

body[data-theme] .live-strip {
  border: 1px solid var(--a2t-line);
  border-radius: 999px;
  background: var(--a2t-surface-soft);
  color: var(--a2t-muted);
  box-shadow: none;
}

body[data-theme] .dot {
  background: var(--a2t-quiet);
}

body[data-theme] .dot.live {
  background: var(--a2t-good);
}

body[data-theme] textarea,
body[data-template='listen'] textarea,
body[data-page='voice-recorder'] textarea {
  min-height: 330px;
  border: 1px solid var(--a2t-line);
  border-radius: 18px;
  background: var(--a2t-surface);
  box-shadow: none;
  color: var(--a2t-ink);
  font-size: 16px;
  line-height: 1.65;
  resize: vertical;
}

body[data-theme] textarea::placeholder {
  color: var(--a2t-quiet);
}

body[data-theme] .editor-actions,
body[data-template='listen'] .editor-actions,
body[data-page='voice-recorder'] .editor-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  flex-wrap: wrap;
}

body[data-theme] .export-note {
  color: var(--a2t-quiet);
  font-size: 12px;
}

body[data-theme] .mini-section {
  border: 1px solid var(--a2t-line);
  border-radius: 18px;
  background: var(--a2t-surface-soft);
  box-shadow: none;
}

body[data-theme] .mini-section h2 {
  color: var(--a2t-ink);
  font-size: 14px;
}

body[data-theme] .mini-copy,
body[data-theme] .command-list {
  color: var(--a2t-muted);
}

body[data-theme] .mic-button,
body[data-page='voice-recorder'] .mic-button {
  border-color: var(--a2t-line-strong);
  background: var(--a2t-surface);
  color: var(--a2t-ink);
  box-shadow: none;
}

body[data-theme] .mic-core,
body[data-page='voice-recorder'] .mic-button .mic-core {
  color: var(--a2t-muted);
  box-shadow: none;
}

body[data-theme] .mic-button.recording .mic-core,
body[data-page='voice-recorder'] .mic-button.recording .mic-core {
  color: var(--a2t-good);
  background: color-mix(in srgb, var(--a2t-good) 12%, transparent);
  box-shadow: none;
}

body[data-theme] .content-band,
body[data-theme] .related {
  background: transparent;
}

body[data-theme] .content-band article,
body[data-theme] .faq-list,
body[data-theme] .related-grid a,
body[data-theme] .keyword-cloud {
  border-color: var(--a2t-line);
  background: var(--a2t-surface);
  color: var(--a2t-ink);
  box-shadow: none;
}

body[data-theme] .content-band h2,
body[data-theme] .content-band h3,
body[data-theme] .faq-list h2,
body[data-theme] .related h2 {
  color: var(--a2t-ink);
}

body[data-theme] .content-band p,
body[data-theme] .content-band li,
body[data-theme] .faq-list p,
body[data-theme] .related-grid a {
  color: var(--a2t-muted);
}

body[data-theme] .site-footer {
  border-top: 1px solid var(--a2t-line);
  background: var(--a2t-page);
  color: var(--a2t-muted);
}

body[data-theme] .site-footer span,
body[data-theme] .site-footer a {
  color: var(--a2t-muted);
}

body[data-theme] .site-footer a:hover {
  color: var(--a2t-ink);
}

body[data-theme] .template-switcher {
  border: 1px solid var(--a2t-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--a2t-surface) 94%, transparent);
  box-shadow: none;
}

body[data-theme] .template-switcher span {
  color: var(--a2t-muted);
}

body[data-theme] .template-switcher button {
  border: 1px solid var(--a2t-line-strong);
  background: var(--a2t-surface-soft);
  color: var(--a2t-ink);
}

body[data-theme] .template-switcher button:hover,
body[data-theme] .template-switcher button.active {
  background: var(--a2t-surface);
  color: var(--a2t-ink);
}

@media (max-width: 980px) {
  body[data-theme] .topbar {
    grid-template-columns: minmax(150px, 1fr) auto;
    gap: 12px;
  }

  body[data-theme] .topnav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-bottom: 10px;
    gap: 18px;
  }

  body[data-theme] .tool-grid,
  body[data-template='listen'] .tool-grid,
  body[data-page='voice-recorder'] .tool-grid {
    grid-template-columns: 1fr;
  }

  body[data-theme] .primary-panel,
  body[data-template='listen'] .primary-panel,
  body[data-page='voice-recorder'] .primary-panel {
    border-right: 0;
    border-bottom: 1px solid var(--a2t-line-strong);
  }
}

@media (max-width: 700px) {
  body[data-theme] .topbar {
    padding: 0 14px;
  }

  body[data-theme] .brand-name {
    font-size: 15px;
  }

  body[data-theme] .shell {
    width: min(100% - 20px, 1200px);
  }

  body[data-theme] .hero,
  body[data-template='listen'] .hero,
  body[data-page='voice-recorder'] .hero {
    padding: 34px 0 4px;
  }

  body[data-theme] h1,
  body[data-template='listen'] h1,
  body[data-page='voice-recorder'] .hero h1 {
    font-size: clamp(34px, 12vw, 46px);
  }

  body[data-theme] .tool-shell,
  body[data-template='listen'] .tool-shell,
  body[data-page='voice-recorder'] .tool-shell {
    border-radius: 18px;
  }

  body[data-theme] .tool-panel,
  body[data-template='listen'] .tool-panel,
  body[data-page='voice-recorder'] .tool-panel {
    padding: 14px;
  }

  body[data-theme] textarea,
  body[data-template='listen'] textarea,
  body[data-page='voice-recorder'] textarea {
    min-height: 260px;
  }
}

/* Palette lock: white, charcoal, black, orange. No template magenta bleed. */
.topbar,
body[data-template] .topbar,
body[data-template='listen'] .topbar,
body[data-theme] .topbar {
  min-height: 52px;
  grid-template-columns: minmax(170px, auto) minmax(0, 1fr) auto;
  gap: 20px;
  border-bottom: 1px solid var(--a2t-line);
  background: color-mix(in srgb, var(--a2t-surface) 92%, transparent);
  color: var(--a2t-ink);
  box-shadow: none;
}

.brand,
.topbar .brand,
.topbar .brand-name,
body[data-template='listen'] .brand,
body[data-template='listen'] .brand-name,
body[data-template='listen'] .topnav a {
  color: var(--a2t-ink);
}

.brand-mark,
body[data-template='listen'] .brand-mark {
  border-color: var(--a2t-line-strong);
  background: var(--a2t-surface);
  color: var(--a2t-accent);
}

.topnav a:hover,
.topnav a[aria-current='page'],
body[data-template='listen'] .topnav a:hover,
body[data-template='listen'] .topnav a[aria-current='page'] {
  background: transparent;
  color: var(--a2t-accent);
}

body,
body[data-template='listen'],
body[data-page='voice-recorder'] {
  --signal: var(--a2t-accent);
  --coral: var(--a2t-accent);
  --violet: var(--a2t-accent);
}

.hero,
body[data-template='listen'] .hero,
body[data-template='listen'][data-page='voice-recorder'] .hero,
body[data-theme] .hero {
  min-height: 0;
  display: block;
  padding: 24px 0 4px;
  background: transparent;
  text-align: center;
}

.hero-copy,
body[data-template='listen'] .hero-copy,
body[data-template='listen'][data-page='voice-recorder'] .hero-copy,
body[data-theme] .hero-copy {
  display: block;
  /* Match the tool width so the intro/lede line up edge-to-edge with the tool. */
  width: 100%;
  max-width: 100%;
  min-height: 0;
  margin: 0 auto;
  text-align: center;
}

.hero-copy .eyebrow,
body[data-template='listen'] .hero-copy .eyebrow,
body[data-template='listen'][data-page='voice-recorder'] .hero-copy .eyebrow,
body[data-theme] .hero-copy .eyebrow {
  position: static;
  margin: 0 0 14px;
  color: var(--a2t-accent);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0;
  text-align: center;
  text-transform: none;
}

.hero h1,
body[data-template='listen'] .hero h1,
body[data-template='listen'][data-page='voice-recorder'] .hero h1,
body[data-theme] .hero h1 {
  max-width: 880px;
  margin: 0 auto;
  background: none;
  color: var(--a2t-ink);
  -webkit-background-clip: initial;
  background-clip: initial;
  font-size: clamp(42px, 5.3vw, 68px);
  font-weight: 760;
  line-height: 1.03;
  letter-spacing: 0;
  text-align: center;
  text-transform: none;
  white-space: normal;
}

.hero .lede,
body[data-template='listen'] .hero .lede,
body[data-template='listen'][data-page='voice-recorder'] .hero .lede,
body[data-theme] .hero .lede {
  position: static;
  /* As wide as the tool (the line under H1). */
  width: 100%;
  max-width: 100%;
  margin: 14px auto 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--a2t-muted);
  font-size: 15px;
  font-weight: 430;
  line-height: 1.7;
  text-align: center;
  transform: none;
  backdrop-filter: none;
}

.byline,
.hero .byline,
body[data-template='listen'] .hero .byline,
body[data-theme] .hero .byline {
  width: min(840px, 100%);
  margin: 10px auto 0;
  color: var(--a2t-muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

body[data-template='listen'] .tool-shell,
body[data-template='listen'][data-page='voice-recorder'] .tool-shell,
body[data-theme] .tool-shell {
  border-color: var(--a2t-line-strong);
  background: var(--a2t-surface);
  box-shadow: none;
}

body[data-template='listen'] .tool-shell-head,
body[data-theme] .tool-shell-head {
  background: var(--a2t-surface-soft);
  color: var(--a2t-ink);
}

body[data-template='listen'] .tool-shell-head h2,
body[data-template='listen'] .tool-shell-head > span,
body[data-theme] .tool-shell-head h2,
body[data-theme] .tool-shell-head > span {
  color: var(--a2t-ink);
}

body[data-template='listen'] .tool-button.primary,
body[data-template='listen'] #startBothButton,
body[data-template='listen'] #startRecordButton,
body[data-template='listen'][data-page='voice-recorder'] #startRecordButton,
body[data-template='listen'][data-page='voice-recorder'] #startBothButton,
body[data-theme] .tool-button.primary {
  border-color: var(--a2t-accent);
  background: var(--a2t-accent);
  color: #fff;
}

body[data-template='listen'] #pauseRecordButton,
body[data-template='listen'][data-page='voice-recorder'] #pauseRecordButton,
body[data-template='listen'] #stopButton,
body[data-template='listen'][data-page='voice-recorder'] #stopButton {
  border-color: transparent;
  background: var(--a2t-accent-soft);
  color: var(--a2t-accent);
}

body[data-template='listen'] .mic-button .mic-core,
body[data-template='listen'][data-page='voice-recorder'] .mic-button .mic-core,
body[data-page='voice-recorder'] .mic-button .mic-core,
body[data-theme] .mic-button .mic-core {
  color: var(--a2t-muted);
  background: transparent;
  box-shadow: none;
}

body[data-template='listen'] .answer-card {
  background: var(--a2t-ink);
  color: var(--a2t-surface);
  box-shadow: none;
}

input[type='checkbox'],
input[type='radio'],
input[type='range'] {
  accent-color: var(--a2t-accent);
}

.wave span,
body[data-template='listen'] .wave span,
body[data-page='voice-recorder'] .wave span,
body[data-theme] .wave span {
  background: var(--a2t-accent);
}

.tool-shell-head > span,
body[data-template='listen'] .tool-shell-head > span,
body[data-theme] .tool-shell-head > span {
  border-color: color-mix(in srgb, var(--a2t-accent) 34%, var(--a2t-line-strong));
  background: var(--a2t-surface);
  color: var(--a2t-ink);
}

.download-link,
body[data-template='listen'] .download-link,
body[data-page='voice-recorder'] .download-link,
body[data-theme] .download-link {
  border-color: var(--a2t-line-strong);
  background: var(--a2t-surface-soft);
  color: var(--a2t-ink);
}

@media (max-width: 700px) {
  .hero,
  body[data-template='listen'] .hero,
  body[data-template='listen'][data-page='voice-recorder'] .hero,
  body[data-theme] .hero {
    padding: 34px 0 4px;
  }

  .hero h1,
  body[data-template='listen'] .hero h1,
  body[data-template='listen'][data-page='voice-recorder'] .hero h1,
  body[data-theme] .hero h1 {
    font-size: clamp(34px, 12vw, 46px);
  }
}

/* AEO info-gain table (shared, token-free) */
.info-table{width:100%;border-collapse:collapse;margin:14px 0 18px;font-size:15px;border:1px solid rgba(120,130,150,0.28);border-radius:12px;overflow:hidden}
.info-table th,.info-table td{padding:10px 14px;text-align:left;border-bottom:1px solid rgba(120,130,150,0.22);vertical-align:top}
.info-table thead th{background:rgba(120,130,150,0.12);font-weight:800}
.info-table tbody tr:last-child td{border-bottom:0}

/* ═══════════ BRAND MARK — cut-out rainbow logo ═══════════
   Final override: wins over the data-theme / data-template skins above so the
   nav shows the real logo in every state (pre-JS base, light, dark, listen). */
.brand .brand-mark,
body[data-theme] .brand-mark,
body[data-template] .brand-mark,
body[data-template='listen'] .brand-mark {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 0;
  background: url("/assets/logo-nav@2x.png") center / contain no-repeat;
  box-shadow: none;
  font-size: 0;
  color: transparent;
}

/* ── Orb listening-state feedback (classes set by vr-skin.js) ──────────────────
   Calm "listening" glow while armed but silent, a dynamic pulse when speech is
   recognized, a dark-red BLINKING alarm when nothing is heard, and a brief calm
   professional-red flash on stop. The .vr-panel.vr-panel… specificity is chosen
   to outrank the base orb rules in kernel/audio-recorder.css (which loads after
   this file), so the shared kernel stylesheet stays untouched. */

/* Listening (recording, no speech yet): slower, calmer breathing than the base. */
.vr-panel.vr-panel.is-recording:not(.vr-detecting):not(.vr-nosignal):not(.is-paused) .vr-hero {
  animation-duration: 2.4s;
}

/* Detecting (speech recognized): energetic pulse + brighter halo. */
.vr-panel.vr-panel.is-recording.vr-detecting .vr-hero {
  animation: vr-orb-detect 0.66s ease-in-out infinite;
  box-shadow: 0 6px 34px rgba(0, 210, 160, 0.62), 0 0 72px rgba(0, 130, 245, 0.40);
}
@keyframes vr-orb-detect {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

/* No signal ("can't hear you"): dark-red alarm orb + blinking caption — the
   focal point goes red and pulses so the user cannot miss it. */
.vr-panel.vr-panel.vr-nosignal .vr-hero {
  background: radial-gradient(circle at 32% 30%, #ffd29e 0%, #f59f45 45%, #e07d23 100%) !important;
  animation: vr-orb-alarm 2.4s ease-in-out infinite !important;
}
/* Gentle breathing glow — warm amber "attention" (caution, not error), slow 2.4s
   ease so it reads as a nudge to move closer, not an alarm. */
@keyframes vr-orb-alarm {
  0%, 100% { box-shadow: 0 6px 20px rgba(224, 125, 35, 0.26); }
  50%      { box-shadow: 0 8px 28px rgba(224, 125, 35, 0.44); }
}
.vr-panel.vr-panel.vr-nosignal .vr-interim {
  color: #c2410c !important;
  font-style: normal;
  font-weight: 600;
  animation: vr-caption-pulse 2.4s ease-in-out infinite;
}
/* Soft fade (no hard on/off steps blink), shallow dip — readable and calm. */
@keyframes vr-caption-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* Stopped (brief flash): professional, calm red — informs without alarming. */
.vr-panel.vr-panel.vr-just-stopped .vr-interim {
  color: #c0392b !important;
  font-style: normal;
  font-weight: 600;
}

/* Respect reduced-motion: keep the red colour as the signal, drop all pulsing. */
@media (prefers-reduced-motion: reduce) {
  .vr-panel.vr-panel.vr-nosignal .vr-hero,
  .vr-panel.vr-panel.vr-nosignal .vr-interim,
  .vr-panel.vr-panel.is-recording.vr-detecting .vr-hero {
    animation: none !important;
  }
}

/* ── FAQ: every answer ALWAYS visible, nothing collapsible (central, all pages) ──
   No accordion, no +/- toggle, no ability to hide. The <details>/<summary> markup
   stays for semantics, but the answer is force-shown and the summary is inert. */
.faq-section details,
body[data-theme] .faq-section details {
  /* open or not, show everything */
}
.faq-section details > *,
body[data-theme] .faq-section details > * {
  display: block !important;
}
.faq-section summary,
body[data-theme] .faq-section summary {
  pointer-events: none !important;
  cursor: default !important;
  list-style: none !important;
}
.faq-section summary::after,
.faq-section summary::-webkit-details-marker,
body[data-theme] .faq-section summary::after {
  content: none !important;
  display: none !important;
}

/* ── FINAL OVERRIDE: line under H1 spans the tool, in EVERY state ──────────────
   The lede/hero-copy width is pinned narrow by scattered body[data-template=
   'listen'] / body[data-theme] / body[data-page] rules. Until those variants are
   collapsed into one central template, this !important rule at end-of-file
   guarantees the intro line matches the tool width in light AND dark, every page. */
.hero-copy,
[data-template] .hero-copy,
[data-theme] .hero-copy,
[data-page] .hero-copy {
  width: 100% !important;
  max-width: 100% !important;
}
.hero .lede,
[data-template] .hero .lede,
[data-theme] .hero .lede,
[data-page] .hero .lede {
  width: 100% !important;
  max-width: 100% !important;
}

/* ==========================================================================
   Shared footer nav — was an inline style= on every page, now central.
   ========================================================================== */
.footer-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   Audio-converter tool UI (.ac-*) — was an identical embedded <style> block
   on each converter page (extract-audio / flac-to-mp3 / m4a-to-mp3 /
   m4a-to-wav / mp3-to-wav / reverse-audio / wav-to-mp3), now central.
   ========================================================================== */
.ac-wrap {
  max-width: 560px;
  margin: var(--s6) auto;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.ac-drop {
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-lg);
  padding: var(--s7) var(--s5);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.ac-drop.ac-over,
.ac-drop:focus-within {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.ac-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.ac-drop-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--s3);
  fill: var(--muted);
}
.ac-drop-text {
  color: var(--ink-2);
  font-size: 0.95rem;
}
.ac-drop-link {
  color: var(--link);
  font-weight: 700;
  text-decoration: underline;
}
.ac-file-name {
  display: block;
  margin-top: var(--s2);
  font-size: 0.85rem;
  color: var(--muted);
  word-break: break-all;
}
.ac-progress {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  overflow: hidden;
}
.ac-progress-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-pill);
  transition: width 0.3s;
}
.ac-status {
  font-size: 0.9rem;
  color: var(--ink-2);
  text-align: center;
}
.ac-status.ac-err {
  color: var(--danger);
}
.ac-btn-convert {
  width: 100%;
  padding: var(--s3) var(--s5);
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.ac-btn-convert:disabled {
  background: var(--quiet);
  cursor: not-allowed;
}
.ac-btn-convert:not(:disabled):hover {
  background: var(--accent-press);
}
.ac-download {
  text-align: center;
}
.ac-btn-download {
  display: inline-block;
  padding: var(--s3) var(--s6);
  background: oklch(0.52 0.16 145);
  color: #fff;
  border-radius: var(--r);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.ac-btn-download:hover {
  background: oklch(0.45 0.15 145);
}

/* ==========================================================================
   Orb input tools — Paste button + live character counter (vr-skin.js injects
   .vr-input-tools above #noteText on every orb page).
   ========================================================================== */
.vr-input-tools {
  display: flex;
  align-items: center;
  /* Counter moved up to the voice-commands row, so Paste sits alone on the right
     (where the counter used to be, directly under the voice-commands switch). */
  justify-content: flex-end;
  gap: 10px;
  margin: 0 0 8px;
}
.vr-paste-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--a2t-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.vr-paste-btn:hover {
  background: var(--a2t-surface-soft);
  color: var(--a2t-ink);
}

/* ── Maximise the work area (central, all orb pages) ──────────────────────────
   Fill the first screen, overlay Paste on the transcript instead of giving it a
   whole row, and tighten the box padding. */
body[data-theme] .vr-panel {
  min-height: max(440px, calc(100vh - 250px));
}
body[data-theme] .vr-panel .vr-body {
  padding: 0 14px 14px;
}
.vr-text-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.vr-text-wrap .vr-paste-btn {
  position: absolute;
  top: 7px;
  right: 12px;
  z-index: 3;
}
/* Char counter when it falls back onto the text box (mic-disabled pages whose
   voice-commands row is hidden) — pinned bottom-left, out of the way of typing. */
.vr-text-wrap > .vr-charcount {
  position: absolute;
  bottom: 8px;
  left: 14px;
  z-index: 2;
  pointer-events: none;
}

.vr-charcount {
  font-size: 12px;
  font-weight: 600;
  color: var(--a2t-muted);
  font-variant-numeric: tabular-nums;
}
.vr-charcount-full {
  color: #c0392b;
}

/* ── Voice-commands = label + iOS-style flip switch ───────────────────────────
   Central restyle of the kernel's pill button. kernel/audio-recorder.css is
   parity-locked AND loads after this file, so we outrank it with the .vr-panel
   prefix instead of editing the kernel. The existing status dot becomes the
   switch track; a pseudo-element is the sliding thumb. State = [aria-pressed]. */
.vr-panel .vr-cmds-btn {
  height: auto;
  padding: 4px 0;
  gap: 10px;
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--a2t-muted);
  font-weight: 600;
  font-size: 13px;
}
.vr-panel .vr-cmds-btn:hover { background: none; }
.vr-panel .vr-cmds-btn[aria-pressed="true"] { background: none; border: 0; color: var(--a2t-ink); }
.vr-panel .vr-cmds-btn[aria-pressed="false"] { opacity: 1; }
/* the status dot becomes the switch track (label stays left, switch goes right) */
.vr-panel .vr-cmds-btn .vr-cmds-dot {
  order: 2;
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--a2t-line-strong);
  box-shadow: none;
  transition: background 0.2s ease;
}
/* the thumb */
.vr-panel .vr-cmds-btn .vr-cmds-dot::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease;
}
/* ON: iOS green track, thumb slides right */
.vr-panel .vr-cmds-btn[aria-pressed="true"] .vr-cmds-dot {
  background: #34c759;
  box-shadow: none;
}
.vr-panel .vr-cmds-btn[aria-pressed="true"] .vr-cmds-dot::after {
  transform: translateX(16px);
}
/* OFF: grey track, thumb left (default) */
.vr-panel .vr-cmds-btn[aria-pressed="false"] .vr-cmds-dot {
  background: var(--a2t-line-strong);
}

/* Char counter pinned to the LEFT of the voice-commands row (vr-skin.js appends
   it into .vr-doc-head), mirroring the switch's absolute placement on the right. */
.vr-panel .vr-doc-head .vr-charcount {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

body[data-page='extract-audio-from-video'] .shell {
  display: flex;
  flex-direction: column;
}

body[data-page='extract-audio-from-video'] .shell > * {
  order: 10;
}

body[data-page='extract-audio-from-video'] .breadcrumb {
  order: 0;
}

body[data-page='extract-audio-from-video'] .hero {
  order: 1;
}

body[data-page='extract-audio-from-video'] .lede {
  order: 2;
}

body[data-page='extract-audio-from-video'] #tool {
  order: 3;
}

body[data-page='extract-audio-from-video'] .example-media {
  order: 4;
}

@media (max-width: 430px) {
  .shell,
  body[data-theme] .shell {
    width: min(100% - 16px, var(--max));
    margin-top: 6px;
  }

  .hero,
  body[data-theme] .hero {
    padding: 10px 0 2px !important;
  }

  .hero h1,
  body[data-theme] .hero h1 {
    font-size: clamp(28px, 9vw, 34px) !important;
    line-height: 1.06 !important;
  }

  .hero .lede,
  body[data-theme] .hero .lede {
    margin-top: 8px !important;
    font-size: 14px !important;
    line-height: 1.42 !important;
  }

  body[data-theme] .support-notice,
  body[data-theme] .startup-error {
    margin: 6px 0 8px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.35;
  }

  body[data-theme] .tool-shell {
    margin: 10px auto 34px !important;
    border-radius: 16px;
  }

  body[data-theme] .tool-shell-head {
    padding: 10px 12px !important;
  }

  body[data-theme] .tool-shell-head h2,
  body[data-theme] .tool-shell-head > span {
    font-size: 12px !important;
  }

  body[data-theme] .theme-toggle {
    min-height: 44px;
  }

  body[data-theme] .vr-panel .vr-top {
    padding: 12px 8px !important;
  }

  body[data-theme] .vr-panel .vr-ctrls {
    max-width: 100% !important;
    gap: 6px;
  }

  body[data-theme] .vr-panel .vr-side {
    flex: 0 1 104px;
    gap: 6px;
    padding: 0 !important;
  }

  body[data-theme] .vr-panel .vr-lang-btn,
  body[data-theme] .vr-panel .vr-rpill {
    width: 104px !important;
    min-width: 104px !important;
    max-width: 104px !important;
    height: 44px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
  }

  body[data-theme] .vr-panel .vr-cmds-btn,
  body[data-theme] .vr-paste-btn,
  body[data-theme] .vr-xlate-dd-btn {
    min-height: 44px;
  }

  body[data-theme] .vr-panel .vr-hero {
    width: 60px !important;
    min-width: 60px !important;
    height: 60px !important;
    flex: 0 0 60px !important;
  }

  body[data-theme] .vr-panel .vr-hero-ic svg {
    width: 24px !important;
    height: 24px !important;
  }

  body[data-theme] .vr-panel .vr-restart-corner {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
  }

  body[data-theme] .vr-panel #vr-restart,
  body[data-theme] .vr-panel .vr-btn-restart {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
  }

  body[data-theme] .vr-panel .vr-body {
    padding: 0 10px 12px !important;
  }

  body[data-theme] .vr-panel .vr-doc-head {
    padding: 8px 10px !important;
  }

  body[data-theme] .vr-panel .vr-text {
    min-height: 150px;
  }
}
