:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #5a5a5a;
  --border: #d6d6d0;
  --accent: #1d4ed8;
  --accent-text: #ffffff;
  --you: #e8eefc;
  --pat: #eef6ea;
  --danger: #b42318;
  --waiting: #8a5a00;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141414;
    --surface: #1f1f1f;
    --text: #f2f2f2;
    --muted: #b0b0b0;
    --border: #3a3a3a;
    --accent: #7aa2ff;
    --accent-text: #0b1020;
    --you: #1d2740;
    --pat: #1f2f1c;
    --danger: #ff8a80;
    --waiting: #f0c060;
  }
}
:root[data-theme="dark"] {
  --bg: #141414; --surface: #1f1f1f; --text: #f2f2f2; --muted: #b0b0b0; --border: #3a3a3a;
  --accent: #7aa2ff; --accent-text: #0b1020; --you: #1d2740; --pat: #1f2f1c; --danger: #ff8a80; --waiting: #f0c060;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 18px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
main { max-width: 820px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; min-height: 100vh; }
main.narrow { justify-content: center; }
h1 { font-size: 1.3rem; margin: 0 0 8px; }
button, select, textarea { font: inherit; color: inherit; }
button {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 16px; cursor: pointer;
}
button:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { color: var(--danger); }
#banner {
  padding: 12px 16px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border);
  font-weight: 600; font-size: 1.1rem;
}
#transcript-wrap { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-y: auto; max-height: 55vh; }
#transcript { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#transcript li { padding: 8px 12px; border-radius: 8px; max-width: 85%; }
#transcript li.you { background: var(--you); align-self: flex-end; }
#transcript li.pat { background: var(--pat); align-self: flex-start; }
#transcript li.system { align-self: center; color: var(--muted); font-size: 0.9rem; }
.who { font-weight: 600; margin-right: 6px; }
.pace { display: block; font-size: 0.8rem; color: var(--muted); }
.pace.waiting { color: var(--waiting); }
.pace.ondisplay { color: var(--accent); }
#live { color: var(--muted); font-style: italic; min-height: 1.5em; margin: 8px 0 0; }
#controls { display: flex; flex-direction: column; gap: 12px; }
.mic { font-size: 1.2rem; padding: 18px; }
.mic[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
#type-form { display: flex; gap: 8px; }
#type-box { flex: 1; min-width: 0; padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); resize: vertical; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
select { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px; margin-left: 4px; }
.note { color: var(--muted); font-size: 0.9rem; margin: 0; }
details { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.overlay[hidden] { display: none; }
.card { background: var(--surface); border-radius: 12px; padding: 24px; max-width: 520px; width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 520px) { #type-form { flex-direction: column; } }
