/* Plan: a calm, readable tool. Cool neutral paper, one deep teal accent, a fixed palette of
   person colours shared across all eight jurisdiction cards so the same person reads the same everywhere.
   Layout: inputs on the left, eight result cards on the right; one column on phones. */
:root {
  --paper: #f5f7f8;
  --surface: #ffffff;
  --ink: #18222c;
  --muted: #5b6875;
  --line: #d8dee4;
  --accent: #1d5f74;
  --accent-soft: #e3eff3;
  --warn: #8a5a00; --warn-bg: #fbf1dd;
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10161b; --surface: #172028; --ink: #e5eaee; --muted: #9eabb7; --line: #2b3741;
    --accent: #7cc3d8; --accent-soft: #1b3440; --warn: #f0be6a; --warn-bg: #2f2512;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font-body); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 28px 18px 56px; display: grid; gap: 28px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(32px, 5vw, 46px); line-height: 1.05; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
p { margin: 0; }
a { color: var(--accent); }
.top { display: grid; gap: 10px; max-width: 72ch; }
.lede { font-size: 18px; }
.note, .hint { color: var(--muted); font-size: 13.5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.inputs { display: grid; gap: 14px; position: sticky; top: 12px; }
@media (max-width: 900px) { .inputs { position: static; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.net { font: 600 14px var(--font-body); color: var(--accent); font-variant-numeric: tabular-nums; }
.slider { display: grid; gap: 4px; }
.slider label { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.slider output { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.check { font-size: 13px; color: var(--muted); display: flex !important; gap: 6px; align-items: center; justify-content: flex-start !important; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button, .add, .stepper button, .people button { font: inherit; font-size: 13px; cursor: pointer; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 3px 10px; }
.chips button:hover, .add:hover { border-color: var(--accent); color: var(--accent); }
.add { color: var(--accent); border-color: var(--accent); background: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.group { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.group:first-of-type { border-top: 0; padding-top: 0; }
.group-head, .group.row { display: flex; justify-content: space-between; align-items: center; font-weight: 500; font-size: 14px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 28px; padding: 2px 0; }
.stepper output { min-width: 14px; text-align: center; font-variant-numeric: tabular-nums; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.people li { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; font-size: 13px; background: var(--paper); border-radius: 8px; padding: 6px 8px; }
.people .dot { width: 10px; height: 10px; border-radius: 50%; }
.people .fields { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.people input[type="text"] { font: inherit; width: 9em; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; background: var(--surface); color: var(--ink); }
.people input[type="number"], .people select { font: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; background: var(--surface); color: var(--ink); }
.people input[type="number"] { width: 3.6em; }
.people .remove { border: 0; background: transparent; color: var(--muted); font-size: 16px; padding: 0 4px; }
.results { display: grid; gap: 12px; }
.results-head { display: grid; gap: 4px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 10px; align-content: start; }
.card h3 { display: flex; justify-content: space-between; align-items: baseline; }
.card h3 small { font: 400 12px var(--font-body); color: var(--muted); }
.card.pending { background: transparent; border-style: dashed; color: var(--muted); }
.bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line); }
.bar span { display: block; height: 100%; }
.shares { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
.shares li { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; }
.shares .dot { width: 10px; height: 10px; border-radius: 50%; }
.shares .amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.shares .pct { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 12px; }
details { font-size: 13px; }
summary { cursor: pointer; color: var(--accent); }
.steps { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.steps .cite { font: 12px var(--font-mono); color: var(--muted); }
.flag { background: var(--warn-bg); color: var(--warn); border-radius: 6px; padding: 6px 8px; font-size: 12.5px; }
.src { font-size: 11.5px; color: var(--muted); }
.tests { display: grid; gap: 8px; }
.tests > p { max-width: 72ch; color: var(--muted); }
.summary { font-weight: 600; color: var(--ink) !important; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--paper); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.id { font-family: var(--font-mono); white-space: nowrap; }
.pass { color: #1f7a4d; font-weight: 600; } .fail { color: #b3261e; font-weight: 600; }
footer { color: var(--muted); font-size: 13px; max-width: 80ch; border-top: 1px solid var(--line); padding-top: 14px; }
footer h2 { font-size: 15px; color: var(--ink); margin: 0 0 6px; }
footer h3 { font-size: 13px; color: var(--ink); margin: 14px 0 4px; }
footer .sources { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
footer b { color: var(--ink); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
