/* =========================================================================
   Auris-1 — in-browser Uzbek speech-to-text

   The design tokens below are taken from Hugging Face's own stylesheet
   (huggingface.co /front/build/kube-<hash>/ style.css, a Tailwind v4 build) so that a
   visitor arriving from the model page meets the same greys, radii, borders
   and type. Layout is ours; the system is theirs.
   ========================================================================= */

:root {
  color-scheme: light dark;

  /* ---- HF neutral ramp (Tailwind v4 `gray`, as HF ships it) ------------- */
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5dc;
  --gray-400: #99a1af;
  --gray-500: #6a7282;
  --gray-600: #4a5565;
  --gray-700: #364153;
  --gray-800: #1e2939;
  --gray-900: #101828;
  --gray-950: #0b0f19;          /* HF overrides Tailwind's gray-950 to this */

  /* ---- roles ------------------------------------------------------------ */
  --bg:          #ffffff;       /* HF body: bg-white                        */
  --surface:     var(--gray-50);
  --ink:         var(--gray-900);
  --ink-2:       var(--gray-700);
  --ink-3:       var(--gray-500);
  --rule:        var(--gray-200);
  --rule-soft:   var(--gray-100);

  --accent:      #155dfc;       /* HF blue-600: links and actions           */
  --accent-hi:   #1447e6;       /* blue-700: hover                          */
  --accent-wash: #eff6ff;       /* blue-50                                  */
  --accent-ink:  #ffffff;
  --brand:       #ffd21e;       /* the HF yellow, used the way they use it  */

  --danger:      #c10007;       /* red-700                                   */
  --danger-wash: #fef2f2;       /* red-50                                    */

  /* ---- type (HF font stacks and text scale) ----------------------------- */
  --sans: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
          "Liberation Mono", "Courier New", monospace;

  --fs-xs:   0.75rem;    /* HF text-xs   */
  --fs-sm:   0.875rem;   /* HF text-sm   */
  --fs-base: 1rem;       /* HF text-base */
  --fs-lg:   1.125rem;   /* HF text-lg   */
  --fs-xl:   1.25rem;    /* HF text-xl   */

  --fs-2xl:  1.5rem;     /* HF text-2xl  */
  --fs-3xl:  1.875rem;   /* HF text-3xl  */

  /* both land on HF sizes rather than on a number we picked */
  --fs-lede: var(--fs-2xl);
  --fs-transcript: var(--fs-xl);
  --measure: 30rem;        /* the transcript column measure, shared          */

  /* ---- spacing (HF --spacing: .25rem) ----------------------------------- */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;

  /* ---- shape and motion (HF --radius-*, --default-transition-*) --------- */
  --r-sm: 0.25rem;
  --r-md: 0.375rem;
  --r-lg: 0.5rem;
  --r-pill: 9999px;
  --ctl-h: 2.5rem;        /* HF .form-input-alt is h-10                     */
  --ring: 0 0 0 3px rgb(43 127 255 / 0.5);   /* HF .btn:focus ring, blue-500/50 */
  --shadow-tag: 0 3.5px 3.5px #00000002, 0 2px 2px #00000002, 0 0 1px #00000002;
  --shadow-inset: inset 0 2px 4px 0 #0000000d;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 0.15s;

  --gutter: 1rem;          /* HF pages use px-4 on .container */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          var(--gray-950);   /* HF dark body: #0b0f19              */
    --surface:     var(--gray-900);
    --ink:         var(--gray-100);
    --ink-2:       var(--gray-300);
    --ink-3:       var(--gray-400);
    --rule:        var(--gray-800);
    --rule-soft:   #16202f;

    --accent:      #50a2ff;           /* HF dark links: blue-400            */
    --accent-hi:   #8ec5ff;           /* blue-300                           */
    --accent-wash: #16253f;
    --accent-ink:  #06101f;

    --danger:      #ff8a85;
    --danger-wash: #2a1416;
  }
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.011em; margin: 0; }
p { margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 2px; }

/* HF uses box-shadow: 0 0 0 3px blue-500/50 and outline:none on :focus.
   Same ring, but bound to :focus-visible so it is a keyboard affordance. */
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}
a:focus-visible, summary:focus-visible { border-radius: var(--r-sm); }

code {
  font-family: var(--mono);
  font-size: 0.875em;
  color: var(--ink-2);
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* HF's Tailwind .container, step for step */
.shell {
  width: 100%;
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}
@media (width >= 40rem) { .shell { max-width: 40rem; } }
@media (width >= 48rem) { .shell { max-width: 48rem; } }
@media (width >= 64rem) { .shell { max-width: 64rem; } }
@media (width >= 80rem) { .shell { max-width: 80rem; } }
@media (width >= 96rem) { .shell { max-width: 96rem; } }

/* ----------------------------------------------------------------- icons */

.ico {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.ico-sm { width: 14px; height: 14px; }
.ico-inline { vertical-align: -0.16em; }

/* Small caps label, used for every section heading in the workspace. */
.label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  margin: 0;
}

.fine {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  line-height: 1.5;
  max-width: 76ch;
}

/* -------------------------------------------------------------- masthead */

.masthead { border-bottom: 1px solid var(--rule); }

.masthead-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2) var(--s-5);
  min-height: 4rem;              /* HF header: h-16 */
  padding-block: var(--s-2);
  padding-top: max(var(--s-2), env(safe-area-inset-top));
}

.ident { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }

.mark { width: 18px; height: 18px; color: var(--ink); flex: none; }
.mark .bar-hi { color: var(--brand); stroke: var(--brand); }

.wordmark {
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.tagline {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  padding-left: var(--s-2);
  border-left: 1px solid var(--rule);
  margin-left: var(--s-1);
}

.masthead-side { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }

.masthead-links {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  font-size: var(--fs-sm);
}
.masthead-links a {
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}
.masthead-links a .ico { color: var(--ink-3); }
.masthead-links a:hover { color: var(--accent); }
.masthead-links a:hover .ico { color: var(--accent); }
.masthead-links .lic { color: var(--ink-3); }

/* HF .tag: h-7, rounded-lg, 1px border at 70% gray-200 */
.chip {
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding-inline: var(--s-2);
  border: 1px solid color-mix(in oklab, var(--rule) 70%, transparent);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: var(--shadow-tag);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--ink-2);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gray-400);
  flex: none;
}
.chip.chip-warn::before { background: #e17100; }
.chip.chip-bad::before  { background: var(--danger); }
.chip.chip-ok::before   { background: #00a63e; }

/* ------------------------------------------------------------------ lede */

.lede { border-bottom: 1px solid var(--rule); }
.lede-in { padding-block: 0.625rem; }

.lede[data-state="loading"],
.lede[data-state="error"] { background: var(--surface); }

.lede[data-state="offer"] .lede-in,
.lede[data-state="error"] .lede-in { padding-block: var(--s-5); }
.lede[data-state="loading"] .lede-in { padding-block: var(--s-4); }

/* collapsed by default; three states open it */
.lede .lede-main,
.lede .lede-loading { display: none; }
.lede[data-state="offer"] .lede-main,
.lede[data-state="error"] .lede-main { display: block; }
.lede[data-state="loading"] .lede-loading { display: block; }
.lede[data-state="offer"] .gate-line,
.lede[data-state="loading"] .gate-line,
.lede[data-state="error"] .gate-line { display: none; }

.gate-line {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.gate-line .ico { color: var(--ink-3); }
.lede[data-state="ready"] .gate-line .ico { color: #00a63e; }
.lede[data-state="error"] .gate-line .ico { color: var(--danger); }

.lede-title {
  font-size: var(--fs-lede);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
  max-width: 24ch;
  text-wrap: balance;
}
.lede-title-sm {
  font-size: var(--fs-lg);
  letter-spacing: -0.01em;
  max-width: none;
  margin-bottom: var(--s-4);
}

.lede-body {
  margin-top: var(--s-3);
  color: var(--ink-2);
  max-width: 62ch;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-4);
  margin-top: var(--s-5);
}
.cta-note {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  max-width: 34ch;
}

/* segmented control, built from HF's .btn geometry */
.seg-wrap {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.seg-label { font-size: var(--fs-sm); color: var(--ink-3); }
.seg {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
}
.seg-btn {
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 0.3rem 0.7rem;
  min-height: 1.85rem;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.seg-btn[aria-checked="true"] {
  background: var(--bg);
  border-color: var(--rule);
  color: var(--ink);
}
.seg-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
@media (hover: hover) {
  .seg-btn:hover:not([aria-checked="true"]):not([aria-disabled="true"]) { color: var(--ink); }
}

.gate-warn {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  margin-top: var(--s-4);
  padding: var(--s-2) var(--s-3);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  max-width: 72ch;
}
.gate-warn strong { color: var(--ink); font-weight: 600; }

/* disclosure — everything that used to be a wall of grey paragraphs */
.disclosure { margin-top: var(--s-5); }
.disclosure > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-radius: var(--r-sm);
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary:hover { color: var(--accent); }
.disclosure > summary .ico { transition: transform var(--dur) var(--ease); }
.disclosure[open] > summary .ico { transform: rotate(90deg); }
.disclosure-in {
  margin-top: var(--s-3);
  padding-left: var(--s-4);
  border-left: 1px solid var(--rule);
  display: grid;
  gap: var(--s-3);
  max-width: 76ch;
}

/* the three download numbers, as an HF-style metadata list */
.facts { margin: 0; display: grid; max-width: 26rem; }
.fact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2) var(--s-4);
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: var(--fs-sm);
}
.fact:last-child { border-bottom: 0; }
.fact dt { color: var(--ink-3); }
.fact dd { margin: 0; color: var(--ink-2); }

/* progress ---------------------------------------------------------------*/

#progress-block { max-width: 52rem; }

.progress {
  height: 6px;
  background: var(--rule);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: var(--r-pill);
  transition: width 0.25s linear;
}
.progress-fill.indeterminate {
  width: 28% !important;
  animation: slide 1.5s ease-in-out infinite;
}
@keyframes slide {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(400%); }
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-4);
  margin-top: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--ink-2);
}

.filelist {
  list-style: none;
  margin: var(--s-3) 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.filelist li { display: flex; justify-content: space-between; gap: var(--s-4); }
.filelist li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lede-loading .fine { margin-top: var(--s-4); }

/* the embedded-frame notice is actionable, so it stays out of the disclosure
   and visible in every gate state */
.env-note-out {
  margin-top: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--ink-3);
  max-width: 82ch;
}
.lede[data-state="ready"] .env-note-out,
.lede[data-state="probe"] .env-note-out { margin-top: var(--s-1); }

/* ------------------------------------------------------------- workspace */

main#app { flex: 1 0 auto; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-6);
  align-items: start;
  padding-block: var(--s-5) var(--s-8);
}

/* two columns as soon as there is room — this covers the 900×600 iframe */
@media (min-width: 50rem) {
  .workspace {
    grid-template-columns: clamp(15rem, 23%, 20rem) minmax(0, 1fr);
    gap: var(--s-5);
    padding-block: var(--s-5) var(--s-7);
  }
  .notes { grid-column: 1 / -1; }
}

/* three columns before the middle gets wastefully wide */
@media (min-width: 50rem) {
  :root { --fs-lede: var(--fs-3xl); --fs-transcript: var(--fs-2xl); --measure: 36rem; }
}

@media (min-width: 75rem) {
  .workspace {
    grid-template-columns: clamp(15rem, 19%, 19rem) minmax(0, 1fr) clamp(14rem, 19%, 18rem);
    gap: var(--s-5) var(--s-6);
  }
  .notes { grid-column: auto; }
}

/* ----------------------------------------------------------------- input */

.io {
  display: grid;
  gap: var(--s-3);
  align-content: start;
}

/* the one tinted surface: the controls rail, against the white output canvas */
@media (min-width: 50rem) {
  .io {
    display: flex;
    flex-direction: column;     /* gap still applies; lets .clip use order */
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    padding: var(--s-3);
  }
  .io .clip {
    order: -1;
    border-top: 0;
    padding-top: 0;
    border-bottom: 1px solid var(--rule);
    padding-bottom: var(--s-3);
  }
  .io .dropzone, .io .btn, .io .example-list { background-color: var(--bg); }
  .io .example-btn { background: transparent; }
}

.io-group { display: grid; gap: var(--s-2); }
.io-group + .io-group {
  border-top: 1px solid var(--rule);
  padding-top: var(--s-3);
}

.io-meta {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  white-space: nowrap;
}
.io-note { font-size: var(--fs-sm); color: var(--ink-3); line-height: 1.45; }

/* buttons — HF .btn geometry: rounded-lg, 1px border, inline-flex ---------*/

/* HF .btn: rounded-lg, 1px border, px-3 py-1, a to-bottom white→gray-100
   gradient, gray-800 text, and an inset shadow on hover. */
.btn {
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.45;
  color: var(--gray-800);
  background-image: linear-gradient(to bottom, #fff, var(--gray-100));
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding-inline: var(--s-3);
  padding-block: var(--s-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: box-shadow var(--dur) var(--ease), background-image var(--dur) var(--ease);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
@media (hover: hover) {
  .btn:hover:not(:disabled) { box-shadow: var(--shadow-inset); }
}
@media (prefers-color-scheme: dark) {
  .btn {
    background-image: linear-gradient(to bottom, var(--gray-800), var(--gray-950));
    color: var(--gray-200);
    border-color: #141c2e;      /* HF's dark .btn border */
  }
  @media (hover: hover) {
    .btn:hover:not(:disabled) {
      background-image: linear-gradient(to bottom, var(--gray-700), var(--gray-950));
    }
  }
}

/* HF's primary action: .btn with from-gray-800 to-black, white text. */
.btn-primary {
  background-image: linear-gradient(to bottom, var(--gray-800), #000);
  border-color: var(--gray-800);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .btn-primary {
    background-image: linear-gradient(to bottom, var(--gray-800), #000);
    /* HF uses gray-900 here, but our rail is gray-900: step one stop up so the
       primary action stays findable on it. Same ramp, one shade. */
    border-color: var(--gray-700);
    color: #fff;
  }
}

/* HF .btn-lg: px-4 py-1.5 */
.btn-lg { padding-inline: var(--s-4); padding-block: 0.375rem; }
.btn-block { width: 100%; }

/* HF's own controls are small; on a touch screen they still need to be 44 px. */
@media (pointer: coarse) {
  .btn { min-height: 2.75rem; }
  .example-btn { min-height: 2.75rem; }
}

.btn-quiet {
  border-color: transparent;
  background-image: none;
  background-color: transparent;
  color: var(--ink-3);
  padding-inline: var(--s-2);
  margin-right: calc(-1 * var(--s-2));
}
@media (hover: hover) {
  .btn-quiet:hover:not(:disabled) {
    box-shadow: none;
    background-color: var(--surface);
    color: var(--ink);
  }
}

/* record -----------------------------------------------------------------*/

.btn-record { width: 100%; padding-block: 0.375rem; }
.btn-record .ico-stop { display: none; }
.btn-record.recording {
  background-image: linear-gradient(to bottom, var(--accent), var(--accent-hi));
  border-color: var(--accent);
  color: #fff;
}
.btn-record.recording .ico-mic { display: none; }
.btn-record.recording .ico-stop { display: block; }

.level { display: none; }
.io-group:has(.recording) .level { display: block; }
.level {
  height: 4px;
  background: var(--rule);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.level-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.08s linear;
}

/* upload -----------------------------------------------------------------*/

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  text-align: center;
  min-height: 6rem;
  padding: var(--s-4);
  border: 1px dashed var(--gray-300);
  border-radius: var(--r-lg);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.dropzone .ico { color: var(--ink-3); margin-bottom: var(--s-1); }
.dropzone .dz-main { font-size: var(--fs-sm); }
.dropzone .dz-sub { font-size: var(--fs-xs); color: var(--ink-3); font-family: var(--mono); }
.dropzone.over, .dropzone:focus-within {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-wash) !important;
  color: var(--ink);
}
.dropzone.over .ico, .dropzone:focus-within .ico { color: var(--accent); }
@media (hover: hover) {
  .dropzone:hover { border-color: var(--gray-400); }
}

/* examples ---------------------------------------------------------------*/

.example-list {
  display: grid;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.example-btn {
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 0 var(--s-3);
  min-height: var(--ctl-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.example-btn:last-child { border-bottom: 0; }
.example-btn .ex-dur { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-3); }
.example-btn:disabled { opacity: 0.5; cursor: progress; }
@media (hover: hover) {
  .example-btn:hover:not(:disabled) { background: var(--accent-wash) !important; color: var(--accent); }
  .example-btn:hover:not(:disabled) .ex-dur { color: var(--accent); }
}
.example-btn[aria-current="true"] {
  background: var(--accent-wash) !important;
  color: var(--accent);
  font-weight: 600;
}
.example-btn[aria-current="true"] .ex-dur { color: var(--accent); }

/* selected clip ----------------------------------------------------------*/

.clip .clip-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clip .clip-detail {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  font-family: var(--mono);
  line-height: 1.5;
}
.clip .clip-hint { font-size: var(--fs-sm); color: var(--ink-3); }
.clip audio { width: 100%; height: 36px; display: block; }

/* ---------------------------------------------------------------- output */

.out { min-width: 0; }
@media (min-width: 50rem) {
  .out { min-height: 15rem; padding-top: var(--s-1); }
}

.empty { max-width: 46ch; }
.empty-lead {
  font-size: var(--fs-xl);
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}
.empty-hint { margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--ink-3); }

.out-head {
  max-width: min(100%, var(--measure));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: 2rem;
}

.transcript {
  font-size: var(--fs-transcript);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.012em;
  margin-top: var(--s-2);
  max-width: min(100%, var(--measure));
  text-wrap: pretty;
  overflow-wrap: break-word;
  -webkit-user-select: text;
  user-select: text;
}
.transcript.working,
.transcript.empty {
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
  color: var(--ink-3);
  max-width: 58ch;
}

/* the timing numbers: a quiet row under the transcript, not a tile shelf */
.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  margin-top: var(--s-5);
  padding-top: var(--s-3);
  border-top: 1px solid var(--rule);
}
.metric { display: grid; gap: 2px; }
.metric-label {
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.metric-value { font-size: var(--fs-sm); color: var(--ink); font-family: var(--mono); }
.metric-wide { min-width: 11rem; }

.caveat, .run-note {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  max-width: 62ch;
  margin-top: var(--s-4);
  line-height: 1.5;
}
.run-note {
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: var(--s-2) var(--s-3);
}

/* ----------------------------------------------------------------- notes */

.notes { display: grid; gap: var(--s-3); align-content: start; }

.note-list {
  margin: 0;
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
}
.note dt { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.note dd {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--ink-3);
  line-height: 1.5;
  max-width: 54ch;
}

/* ---------------------------------------------------------------- errors */

.inline-error {
  display: flex;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  background: var(--danger-wash);
  border: 1px solid color-mix(in oklab, var(--danger) 35%, transparent);
  border-radius: var(--r-lg);
  padding: var(--s-3);
  max-width: 72ch;
  margin-top: var(--s-4);
}
.inline-error .ico { color: var(--danger); margin-top: 2px; }
.inline-error strong { display: block; color: var(--danger); font-weight: 600; }
.inline-error .detail {
  display: block;
  margin-top: var(--s-2);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

.hardstop, .noscript { padding-block: var(--s-7); max-width: 44rem; margin-inline: auto; }
.hardstop h2, .noscript h2 { font-size: var(--fs-lg); color: var(--danger); margin-bottom: var(--s-2); }
.hardstop p, .noscript p { color: var(--ink-2); }

.crash {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--danger-wash);
  border-bottom: 1px solid var(--danger);
  color: var(--ink);
  font-size: var(--fs-sm);
  padding: var(--s-3) var(--gutter);
}

/* ---------------------------------------------------------------- footer */

.foot { border-top: 1px solid var(--rule); }
.foot-in {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  justify-content: space-between;
  padding-block: var(--s-4);
  padding-bottom: max(var(--s-4), env(safe-area-inset-bottom));
  font-size: var(--fs-sm);
  color: var(--ink-3);
}

/* ---------------------------------------------------------- narrow tweaks */

@media (max-width: 36rem) {
  .masthead-in { align-items: flex-start; }
  .tagline { display: none; }
  .masthead-side { width: 100%; justify-content: space-between; gap: var(--s-3); }
  .cta { gap: var(--s-2); }
  .cta > .btn-primary { width: 100%; }
  .cta-note { max-width: none; }
  .seg { width: 100%; }
  .seg-btn { flex: 1; }
  .workspace { padding-block: var(--s-5) var(--s-7); }
  .lede[data-state="offer"] .lede-in,
  .lede[data-state="error"] .lede-in { padding-block: var(--s-5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .progress-fill.indeterminate { width: 100% !important; opacity: 0.3; }
}
