/* One stylesheet, no build step. Light and dark both defined explicitly. */
:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --ink: #16181d;
  --muted: #5f6672;
  --line: #e2e4e8;
  --accent: #1b5e9c;
  --accent-ink: #ffffff;
  --good: #1c7a4a;
  --warn: #a3670a;
  --bad: #a52b2b;
  --soft: #eef1f5;
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --panel: #1c1f25;
    --ink: #e8eaed;
    --muted: #9aa3b0;
    --line: #2c313a;
    --accent: #5b9fd8;
    --accent-ink: #10131a;
    --good: #4fbb85;
    --warn: #d9a441;
    --bad: #e0736b;
    --soft: #232830;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8rem; }
code, pre, .mono { font-family: var(--mono); font-size: .9em; }
pre { white-space: pre-wrap; word-break: break-word; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 1.2rem; }
.narrow { max-width: 720px; }
.reading { max-width: 820px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.panel.tight { padding: .7rem .8rem; }

header.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
header.topbar .wrap { display: flex; align-items: center; gap: 1rem; padding: .6rem 1.2rem; }
header.topbar nav { display: flex; gap: .9rem; flex-wrap: wrap; }
header.topbar nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
header.topbar nav a.on, header.topbar nav a:hover { color: var(--ink); }
.brand { font-weight: 700; letter-spacing: -.01em; }
.spacer { flex: 1; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .45rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:hover { background: var(--soft); }
.scroll { overflow-x: auto; }

.pill {
  display: inline-block; padding: .1rem .45rem; border-radius: 999px;
  font-size: .76rem; font-weight: 600; border: 1px solid var(--line);
  background: var(--soft); color: var(--muted); white-space: nowrap;
}
.pill.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.pill.bad  { color: var(--bad);  border-color: color-mix(in srgb, var(--bad) 40%, transparent); }

button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid transparent; border-radius: var(--radius);
  padding: .5rem .9rem; text-decoration: none; display: inline-block;
}
button.ghost, .btn.ghost {
  background: transparent; color: var(--ink); border-color: var(--line);
}
button.danger { background: var(--bad); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.small, .btn.small { padding: .28rem .6rem; font-size: .85rem; }

input, textarea, select {
  font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .5rem .6rem; width: 100%;
}
textarea { resize: vertical; min-height: 5rem; }
label { display: block; font-weight: 600; margin-bottom: .25rem; font-size: .92rem; }
.field { margin-bottom: .9rem; }
.help { color: var(--muted); font-size: .88rem; margin-top: .2rem; }
.row { display: flex; gap: .8rem; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; }
.grid { display: grid; gap: 1rem; }
@media (min-width: 860px) { .grid.two { grid-template-columns: 3fr 2fr; } }

.muted { color: var(--muted); }
.small { font-size: .88rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.stat { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.statline { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.statline > div { min-width: 88px; }

/* ---- candidate ---- */
.candidate-shell { max-width: 780px; margin: 0 auto; padding: 1.2rem; }
.clockbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 1rem; padding: .55rem 1.2rem;
}
.clock { font-family: var(--mono); font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock.low { color: var(--warn); }
.clock.out { color: var(--bad); }
.savestate { color: var(--muted); font-size: .85rem; }
.item { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.item:first-of-type { border-top: 0; margin-top: 0; }
.itemlabel { font-weight: 600; margin-bottom: .35rem; }
.choices label, .verdicts label { font-weight: 400; display: flex; gap: .5rem; align-items: flex-start; margin-bottom: .3rem; }
.choices input, .verdicts input { width: auto; }
.docblock { border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem; margin-bottom: .7rem; background: var(--soft); }
.prompt { background: var(--soft); border-radius: var(--radius); padding: .9rem 1rem; }
.prompt h1, .prompt h2, .prompt h3 { margin-top: .8rem; }
.callout { border-left: 3px solid var(--accent); padding: .5rem .8rem; background: var(--soft); border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 1rem; }
.callout.warn { border-left-color: var(--warn); }
.typing-target { background: var(--soft); padding: .8rem; border-radius: var(--radius); line-height: 1.7; }
.assets a { display: inline-block; margin-right: .8rem; }
.center { text-align: center; }
.codebox { font-family: var(--mono); font-size: 1.6rem; letter-spacing: .3em; text-align: center; }
.hidden { display: none !important; }
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list li { display: flex; gap: .5rem; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem .6rem; margin-bottom: .35rem; background: var(--panel); }
.rank-list button { padding: .1rem .45rem; font-size: .8rem; }
.likert { display: flex; gap: .4rem; flex-wrap: wrap; }
.likert label { font-weight: 400; text-align: center; font-size: .8rem; flex: 1 1 60px; border: 1px solid var(--line); border-radius: var(--radius); padding: .35rem .2rem; cursor: pointer; }
.likert input { display: none; }
.likert label.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
