:root {
  --paper: #f5f2ec;
  --surface: #fbfaf7;
  --ink: #1f1d1a;
  --muted: #6b665e;
  --line: #d8d2c7;
  --accent: #9c4a26;
  --accent-ink: #ffffff;
  --rec: #8f2d1f;
  --h: 42px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171614;
    --surface: #1f1e1b;
    --ink: #ece7df;
    --muted: #a39d93;
    --line: #3a3732;
    --accent: #c9693f;
    --accent-ink: #171614;
    --rec: #d0604c;
  }
}
:root[data-theme="dark"] {
  --paper: #171614; --surface: #1f1e1b; --ink: #ece7df; --muted: #a39d93;
  --line: #3a3732; --accent: #c9693f; --accent-ink: #171614; --rec: #d0604c;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { width: 100%; max-width: 720px; margin: 0 auto; padding: 48px 16px 24px; flex: 1; }

h1 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; font-weight: 650; letter-spacing: -0.01em; }
.lede { margin: 0 0 10px; color: var(--muted); }
.model { color: var(--ink); font-size: 14px; text-underline-offset: 3px; }
a { color: var(--ink); }
a:hover { color: var(--accent); }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 32px 0 16px; }
button, .button {
  height: var(--h);
  padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 15px; font-weight: 550;
  border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
#record { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); min-width: 140px; }
#record.recording { background: var(--rec); border-color: var(--rec); }
button:hover:not(:disabled), .button:not(.disabled):hover { filter: brightness(0.95); }
button:disabled, .button.disabled { opacity: 0.45; cursor: not-allowed; }
button:focus-visible, .button:focus-within, a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
#file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.status { height: var(--h); display: inline-flex; align-items: center; color: var(--muted); font-size: 14px; }

.transcript {
  min-height: 140px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  font-size: 18px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere;
}
.transcript.empty { color: var(--muted); font-size: 16px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 14px; color: var(--muted); min-height: 22px; }
.hint { color: var(--muted); font-size: 14px; margin-top: 24px; }

footer { text-align: center; padding: 24px 16px 32px; font-size: 14px; }
footer a { color: var(--muted); }
