@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(fonts/source-serif-4-latin-opsz-normal.woff2) format("woff2-variations"); }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url(fonts/source-serif-4-latin-opsz-italic.woff2) format("woff2-variations"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-latin-wght-normal.woff2) format("woff2-variations"); }
:root {
  --ink: #1f2430; --muted: #646b78; --paper: #fbf9f4; --rule: #e6e0d3; --accent: #a8650f;
  --panel: #f3efe6; --panel-edge: #e2dbcb;
  --serif: "Source Serif 4", Charter, Georgia, serif; --sans: Inter, system-ui, sans-serif;
  --c1: #e9b949; --c2: #4a90d9; --c3: #d0533f; --c4: #4f9a5f; --c5: #8a5cc2;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
main { max-width: 820px; margin: 0 auto; padding: 40px 20px 72px; }
h1 { font: 650 2.4em/1.08 var(--serif); letter-spacing: -0.02em; margin: 0 0 0.3em; }
.dek { font: 400 1.2em/1.5 var(--serif); color: #3d4452; margin: 0 0 1.4em; max-width: 640px; }
a { color: #1e5b9c; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid #4a90d9; outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.levels { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.levels .stars { color: #7f4c06; font-size: 11px; margin-left: 4px; }
.panel { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 14px; padding: 20px 22px; }
.title { font: 650 1.45em/1.2 var(--serif); margin: 0 0 10px; }
.claim { font: italic 400 1.15em/1.5 var(--serif); margin: 0 0 12px; padding: 4px 0 4px 16px; border-left: 3px solid var(--ink); max-width: 640px; }
.claim::before { content: "The claim: "; font: 600 12px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-style: normal; display: block; margin-bottom: 6px; }
.setup { margin: 0 0 6px; color: #343a47; max-width: 660px; }
.goal { font-weight: 600; margin: 0 0 14px; }
.stage { background: #fff; border: 1px solid var(--panel-edge); border-radius: 10px; padding: 16px; }
.verdict { min-height: 1.6em; margin: 14px 0 4px; }
.verdict .broken { font: 650 1.25em/1.3 var(--serif); color: #1d7a48; margin: 0 0 6px; }
.verdict .why { margin: 0; max-width: 660px; }
.verdict .star { color: #7f4c06; font-weight: 600; }
.hint { background: #fff; border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 6px; margin: 4px 0 0; font-size: 15px; max-width: 660px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
button { font: 600 14px/1 var(--sans); background: #fff; color: var(--ink); border: 1px solid #d3cab6; border-radius: 999px;
  padding: 9px 15px; cursor: pointer; box-shadow: 0 1px 0 rgba(31,36,48,.06); }
button:hover:not(:disabled) { border-color: var(--accent); }
button.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
button:disabled { opacity: 0.4; cursor: default; }
button[aria-current="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
button.quiet { font-weight: 500; color: var(--muted); }
.muted { color: var(--muted); font-size: 14px; }
.good { color: #1d7a48; font-weight: 600; } .bad { color: #b42d22; font-weight: 600; }

/* coins */
.stepper { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.stepper input { font: 600 20px/1 var(--sans); width: 4.2em; padding: 6px 8px; text-align: center; border: 1px solid #d3cab6; border-radius: 8px; }
.payrow { display: grid; grid-template-columns: 7.5em 1fr; gap: 8px; align-items: center; margin: 6px 0; }
.coins { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.coin { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font: 650 14px/1 var(--sans);
  background: radial-gradient(circle at 35% 30%, #f6e2a8, #d9ad48); border: 2px solid #b8892a; color: #4d3608; }
.coin.c1 { width: 26px; height: 26px; font-size: 12px; background: radial-gradient(circle at 35% 30%, #f1d3bd, #c98e66); border-color: #a86f48; color: #4a2a14; }
.count { margin-left: 8px; font-weight: 600; }

/* colouring */
svg.graph { width: 100%; max-width: 560px; display: block; margin: 0 auto; }
svg.graph .edge { stroke: #9aa0aa; stroke-width: 2; }
svg.graph .v { cursor: pointer; }
svg.graph .v circle { stroke: #3a404c; stroke-width: 2; fill: #fff; }
svg.graph .v text { font: 700 15px var(--sans); text-anchor: middle; dominant-baseline: central; fill: #1f2430; pointer-events: none; }
svg.graph .v.done { cursor: default; }
svg.graph .v:focus { outline: none; } svg.graph .v:focus-visible circle { stroke: #4a90d9; stroke-width: 4; }
svg.graph .order { font: 500 11px var(--sans); fill: var(--muted); text-anchor: middle; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; font-size: 14px; }

/* fifo */
.typer { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.typer input { font: 600 18px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; padding: 7px 9px; border: 1px solid #d3cab6; border-radius: 8px; width: 100%; max-width: 22em; text-transform: uppercase; }
.typer button.page { min-width: 2.4em; font-family: ui-monospace, Menlo, monospace; }
.trace { overflow-x: auto; margin: 8px 0 4px; }
.trace table { border-collapse: separate; border-spacing: 3px 0; font: 600 13px/1 ui-monospace, Menlo, monospace; }
.trace th { font: 600 12px/1 var(--sans); color: var(--muted); text-align: left; padding-right: 8px; white-space: nowrap; }
.trace td { width: 22px; height: 22px; text-align: center; background: #f6f3ec; }
.trace td.req { background: none; color: var(--ink); font-size: 14px; height: 26px; }
.trace td.new { background: #fbe1c4; }
.trace td.empty { background: #faf8f3; }
.trace td.miss { background: none; color: #b42d22; font-size: 11px; height: 16px; }
.trace tr.gap td, .trace tr.gap th { height: 10px; background: none; }
.totals { display: flex; gap: 22px; flex-wrap: wrap; font-weight: 600; margin-top: 6px; }

footer { margin-top: 3em; color: var(--muted); font-size: 14.5px; border-top: 1px solid var(--rule); padding-top: 1.2em; max-width: 680px; }
@media (max-width: 600px) { main { padding-top: 28px; } h1 { font-size: 2em; } .panel { margin: 0 -10px; padding: 14px; } .stage { padding: 10px; } }

/* meetings */
.tl { user-select: none; display: grid; gap: 4px 2px; align-items: center; }
.ticks { position: relative; height: 16px; font-size: 11px; color: var(--muted); margin: 0 6px; }
.ticks span { position: absolute; transform: translateX(-50%); }
.track { position: relative; height: 30px; border-radius: 6px; background: #faf8f3 repeating-linear-gradient(90deg, #e9e3d6 0 1px, transparent 1px calc(100% / var(--hours, 10))); }
.bar { position: absolute; top: 3px; bottom: 3px; background: #4a6fa5; color: #fff; border-radius: 5px; font: 600 12px/24px var(--sans); text-align: center; overflow: hidden; white-space: nowrap; }
.track.new { background-color: #fff; border: 1px dashed #cfc6b3; cursor: crosshair; display: flex; align-items: center; justify-content: center; touch-action: none; }
.track.new .bar { background: #a8650f; opacity: .7; }
.mk { text-align: center; font: 600 13px/1 var(--sans); color: #c5bfb2; }
.mk.on { color: var(--ink); } .mk.best.on { color: #1d7a48; }
.mk.head { color: var(--muted); font-size: 10.5px; font-weight: 500; }
.x { padding: 4px 8px; font-size: 14px; }
.addform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; font-size: 14px; }
.addform select { font: inherit; padding: 4px; }
.mres p { margin: 10px 0 0; }
.scroll-cue { margin: 2px 0 0; }
@media (max-width: 600px) {
  .tl { gap: 4px 1px; }
  .ticks span:nth-child(even) { display: none; }
  .bar { font-size: 10.5px; letter-spacing: -0.02em; }
  .mk { font-size: 12px; }
  .x { padding: 3px 6px; }
  .track.new .muted { font-size: 12px; }
}
.mk.cnt { color: #a8650f; font-weight: 500; }

/* paths */
svg.paths .edge { stroke-width: 2.5; }
svg.paths .hl { stroke: transparent; stroke-width: 9; stroke-linecap: round; }
svg.paths .hl.true { stroke: #1d7a48; stroke-opacity: .3; }
svg.paths .edge.alg { stroke: #a8650f; stroke-width: 3; }
svg.paths .wt { font: 700 15px var(--sans); text-anchor: middle; dominant-baseline: central; fill: #1f2430; paint-order: stroke; stroke: #fff; stroke-width: 5px; }
svg.paths .v circle { fill: #fff; }
.weights { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; }
.wbox { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.wbox .wl { font: 600 14px ui-monospace, Menlo, monospace; margin-right: 2px; }
.wbox output { min-width: 2em; text-align: center; font-size: 16px; }
.wbox button { padding: 5px 10px; }
.wbox.fixed { color: var(--muted); }
.alg-t { color: #a8650f; font-weight: 600; } .true-t { color: #1d7a48; font-weight: 600; }
svg.paths .badge circle { fill: #1f2430; stroke: none; }
svg.paths .badge text { fill: #fff; font: 700 11px var(--sans); }

/* tour */
svg.tour { max-width: 420px; }
svg.tour .pt { cursor: pointer; }
svg.tour .pt .hit { fill: transparent; }
svg.tour .pt .dot { fill: #c9c1ae; }
svg.tour .pt .city { fill: #fff; stroke: #3a404c; stroke-width: 2; display: none; }
svg.tour .pt.on .city { display: inline; } svg.tour .pt.on .dot { display: none; }
svg.tour .pt.home .city { fill: #1f2430; }
svg.tour .pt text { font: 700 13px var(--sans); fill: #fff; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
svg.tour .pt:focus { outline: none; } svg.tour .pt:focus-visible .hit { stroke: #4a90d9; stroke-width: 3; }
svg.tour .band { stroke: #1d7a48; stroke-opacity: .28; stroke-width: 12; stroke-linecap: round; }
svg.tour .leg { stroke: #a8650f; stroke-width: 3; }
svg.tour .step { font: 700 13px var(--sans); fill: #a8650f; text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
svg [hidden] { display: none; }

/* Runoff */
.ballots { border-collapse: collapse; margin: 0 0 14px; }
.ballots th { font: 600 12px/1.3 var(--sans); color: var(--muted); text-align: left; padding: 0 10px 6px 0; }
.ballots td { padding: 3px 10px 3px 0; white-space: nowrap; }
.cand { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font: 700 13px/1 var(--sans); color: #fff; }
.kA { background: #a8650f; } .kB { background: #3b6fb0; } .kC { background: #5b8a4a; }
.gt { color: var(--muted); margin: 0 3px; }
.mini { display: inline-flex; gap: 4px; align-items: center; }
.mini button { padding: 5px 9px; }
.mini input { font: 600 15px/1 var(--sans); width: 3em; padding: 4px; text-align: center; border: 1px solid #d3cab6; border-radius: 6px; }
.counts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.counts h3 { font: 650 1.05em/1.3 var(--serif); margin: 0 0 4px; }
.rlabel { margin: 8px 0 4px; }
.vbar { display: grid; grid-template-columns: 28px 1fr 2.2em; align-items: center; gap: 6px; margin: 3px 0; }
.vbar .vfill { height: 14px; border-radius: 3px; min-width: 2px; }
.vbar .vnum { font-weight: 600; text-align: right; }
.win { font-weight: 650; margin: 8px 0 0; }
@media (max-width: 600px) {
  .counts { grid-template-columns: 1fr; }
  .ballots th:first-child, .ballots td:first-child { padding-right: 4px; }
  .mini button { padding: 5px 7px; } .mini input { width: 2.4em; }
  .ballots .cand { width: 19px; height: 19px; font-size: 11px; border-radius: 4px; } .ballots .gt { margin: 0 1px; }
  .ballots th { font-size: 11px; } .ballots td { padding-right: 3px; } .mini { gap: 2px; }
}
.seatform { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 14px; }
.seatform label { display: inline-flex; align-items: center; gap: 6px; font: 600 13px/1.3 var(--sans); }
.shares { border-collapse: collapse; margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.shares th { font: 600 12px/1.3 var(--sans); color: var(--muted); text-align: right; padding: 0 0 6px 10px; }
.shares td { text-align: right; padding: 3px 0 3px 10px; white-space: nowrap; }
.shares th:first-child, .shares td:first-child { text-align: left; padding-left: 0; }
.shares .sn { font-weight: 700; }
.shares .plus { color: var(--muted); font-size: 12px; }
.shares tr.lost td { background: #f6e3de; }
@media (max-width: 520px) { .shares th, .shares td { padding-left: 6px; } .shares th { font-size: 11px; } }
