:root {
  --bg: #fbf8f2;
  --card: #ffffff;
  --ink: #1d1b16;
  --muted: #6f6a5f;
  --line: #e7e0d2;
  --accent: #0b7a6b;
  --accent-soft: #e1f2ef;
  --warn: #9a5b10;
  --warn-soft: #fdf0dc;
  /* The running-totals chart's two series, validated as a pair for colour-blind readers. */
  --s1: #2a78d6;
  --s2: #eb6834;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14130f;
    --card: #1e1c17;
    --ink: #f1ece2;
    --muted: #a39d90;
    --line: #34302a;
    --accent: #8fe0cf;
    --accent-soft: #0e2a27;
    --warn: #f2ac5c;
    --warn-soft: #3a2a14;
    --s1: #3987e5;
    --s2: #d95926;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.45 system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
}
.top {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 1;
}
.grow {
  flex: 1;
}
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#board {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
#board[hidden] {
  display: none;
}
h2 {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.muted {
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.gate {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
}
input[type='password'] {
  font: inherit;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}
button {
  font: inherit;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: var(--card);
  cursor: pointer;
}
button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 6px 12px;
  font-weight: 600;
}
.error {
  color: var(--warn);
  margin: 0;
}
.pitch p {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.5;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.tile b {
  display: block;
  font-size: 26px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.tile span {
  color: var(--muted);
  font-size: 13px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
td,
th {
  text-align: left;
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
td.n,
th.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
}
.bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
  font-size: 11px;
  color: var(--muted);
}
.bar i {
  display: block;
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.message {
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.message:last-child {
  border-bottom: none;
}
.empty {
  color: var(--muted);
  margin: 0;
}
h3 {
  margin: 16px 0 8px;
  font-size: 14px;
}
.window {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.window button.on {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.verdicts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.verdict {
  border: 1px solid var(--line);
  border-left-width: 6px;
  border-radius: 12px;
  padding: 10px 12px;
}
.verdict b {
  display: block;
  font-size: 18px;
}
.verdict p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.verdict.green,
.verdict.valuable {
  border-left-color: #2f9e57;
}
.verdict.amber,
.verdict.used_not_important {
  border-left-color: #d9982b;
}
.verdict.red,
.verdict.negligible {
  border-left-color: #c8483b;
}
.agent {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 10px;
}
.agent summary {
  cursor: pointer;
  font-weight: 700;
}
.agent-head {
  margin: 6px 0;
  font-weight: 700;
}
.agent-items {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.agent-items li {
  font-size: 14px;
}
.kind {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent-soft);
  color: var(--accent);
}
.kind.inference,
.kind.hypothesis {
  background: var(--warn-soft);
  color: var(--warn);
}
.unchecked {
  opacity: 0.6;
}
.cites {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

/* The period picker (decision 055): presets in one row, a from–to pair under them. */
.span-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 10px;
}
.span-pick label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.span-pick input {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
}
.period .window {
  flex-wrap: wrap;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  color: var(--muted);
}
.key {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.key.s1 {
  background: var(--s1);
}
.key.s2 {
  background: var(--s2);
}
.cumulative svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 8px;
}
.cumulative .grid {
  stroke: var(--line);
  stroke-width: 1;
}
.cumulative .axis {
  fill: var(--muted);
  font-size: 11px;
}
.cumulative .series {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.cumulative .series.s1 {
  stroke: var(--s1);
}
.cumulative .series.s2 {
  stroke: var(--s2);
}
.cumulative .dot {
  stroke: var(--card);
  stroke-width: 2;
}
.cumulative .dot.s1 {
  fill: var(--s1);
}
.cumulative .dot.s2 {
  fill: var(--s2);
}
.cumulative .hit {
  fill: transparent;
}
.cumulative .end {
  fill: var(--ink);
  font-size: 12px;
}
details summary {
  cursor: pointer;
  margin-top: 8px;
}

/* The passphrase card is a grid, which beat the hidden attribute: it stayed on screen after the
   page had opened. */
.gate[hidden] {
  display: none;
}
/* Wide tables scroll inside their card on a phone instead of pushing the whole page sideways. */
.scroll {
  overflow-x: auto;
}
