:root {
  --bg: #f6f7fb; --card: #ffffff; --ink: #1d2433; --muted: #5d6679; --line: #e2e6ef;
  --accent: #2f6fde; --accent-ink: #ffffff; --accent-soft: #e8f0fd;
  --good: #1f8a5b; --warn: #b86e00; --bad: #c4363a; --rec: #d93a3a;
  --radius: 14px; --shadow: 0 1px 2px rgba(20,30,60,.06), 0 4px 16px rgba(20,30,60,.06);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11151d; --card: #1a2030; --ink: #e8ecf4; --muted: #9aa4b8; --line: #2a3245;
    --accent: #6c9cff; --accent-ink: #0d1220; --accent-soft: #22304d; --good: #4cc38a; --warn: #f0b04a; --bad: #ff6b6f; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
button { font: inherit; cursor: pointer; }
main { max-width: 760px; margin: 0 auto; padding: 16px 16px 40px; outline: none; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { background: none; border: 0; font-weight: 700; font-size: 17px; color: var(--ink); padding: 4px 0; }
nav { display: flex; gap: 4px; }
.link { background: none; border: 0; color: var(--accent); padding: 6px 8px; border-radius: 8px; }
.link:hover { background: var(--accent-soft); }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 0 16px 24px; }
h1 { font-size: 26px; line-height: 1.25; margin: 16px 0 6px; }
h2 { font-size: 19px; margin: 22px 0 8px; }
h3 { font-size: 16px; margin: 14px 0 6px; }
p.lead, .muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin: 12px 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.choice { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); color: var(--ink); transition: border-color .15s, transform .15s; }
.choice:hover { border-color: var(--accent); transform: translateY(-1px); }
.choice .big { font-size: 20px; font-weight: 700; display: block; }
.choice .small { color: var(--muted); font-size: 14px; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 600; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: none; color: var(--accent); border: 1px solid var(--line); }
.btn.rec { background: var(--rec); color: #fff; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin: 0 6px 6px 0; }
.tag.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.banner { border-left: 4px solid var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--card)); padding: 10px 14px; border-radius: 8px; font-size: 14px; margin: 12px 0; }
.banner.error { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--card)); }
.prompt { font-size: 20px; line-height: 1.5; font-weight: 500; white-space: pre-wrap; }
.timer { font-variant-numeric: tabular-nums; font-size: 34px; font-weight: 700; }
.timer.low { color: var(--bad); }
.phase { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--accent); transition: width .5s linear; }
textarea { width: 100%; min-height: 180px; font: inherit; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); resize: vertical; }
input[type=text], input[type=password], select { font: inherit; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%; }
label.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--rec); font-weight: 600; }
.live::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--rec); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.interim { color: var(--muted); font-style: italic; }
.scores { display: grid; gap: 10px; }
.score { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: start; }
.dots { display: inline-flex; gap: 3px; margin-right: 8px; vertical-align: middle; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--accent); }
.overall { display: flex; gap: 16px; align-items: center; }
.ring { width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 800; flex: none;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); position: relative; }
.ring::after { content: ""; position: absolute; inset: 7px; background: var(--card); border-radius: 50%; }
.ring span { position: relative; z-index: 1; }
ul.clean { padding-left: 20px; margin: 6px 0; }
ul.clean li { margin: 4px 0; }
.exemplar { background: var(--accent-soft); border-radius: 10px; padding: 14px; white-space: pre-wrap; }
.list-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item button { flex: none; white-space: nowrap; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 520px) { .score { grid-template-columns: 1fr; gap: 2px; } h1 { font-size: 22px; } .prompt { font-size: 18px; } }
.topbar .link, .brand { white-space: nowrap; }
@media (max-width: 520px) { .brand { font-size: 15px; } .topbar { padding: 10px 10px; } .topbar .link { padding: 6px 5px; font-size: 15px; } }
.convo { max-height: 320px; overflow-y: auto; margin: 12px 0; display: grid; gap: 8px; }
.turn { padding: 10px 12px; border-radius: 12px; max-width: 90%; }
.turn.candidate { background: var(--accent-soft); justify-self: end; }
.turn.actor { background: var(--bg); border: 1px solid var(--line); justify-self: start; }
.stats, .countdown { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 12px 0; }
.stat, .cd { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stat-num, .cd-num { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.today { border-left: 4px solid var(--accent); }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr 34px; gap: 10px; align-items: center; font-size: 14px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 12px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.cols { display: flex; align-items: flex-end; gap: 2px; height: 120px; border-bottom: 1px solid var(--line); }
.col { flex: 1; height: 100%; display: flex; align-items: flex-end; max-width: 28px; }
.col i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.col:hover i { opacity: .7; }
@media print {
  .topbar, .foot, .no-print, button { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .exemplar { background: #f3f3f3; }
}
