:root {
  --paper: #eef1f0;
  --card: #ffffff;
  --ink: #16202c;
  --muted: #56616e;
  --line: #d5dbd9;
  --yes: #0a7566;
  --no: #9a4512;
  --hl: #ffe45c;
  --hl-ink: #4a3b00;
  --focus: #1f56d1;
  --said: #e3eefb;
  --radius-s: 6px;
  --radius-l: 14px;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12171d; --card: #1b222a; --ink: #e8edf1; --muted: #a3adb8; --line: #2f3944;
    --yes: #38b8a3; --no: #e08a4f; --hl: #6b5a00; --hl-ink: #fff3b0; --focus: #8fb0ff; --said: #1d2c3d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12171d; --card: #1b222a; --ink: #e8edf1; --muted: #a3adb8; --line: #2f3944;
  --yes: #38b8a3; --no: #e08a4f; --hl: #6b5a00; --hl-ink: #fff3b0; --focus: #8fb0ff; --said: #1d2c3d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
}
body.hasbar { padding-bottom: 76px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, p { margin: 0; }
button, select, input { font: inherit; color: inherit; }

.top, main, .foot { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.top { padding-top: 22px; padding-bottom: 14px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 30px; line-height: 1.1; letter-spacing: -0.01em; text-decoration: none; display: inline-block; }
.tagline { color: var(--muted); margin-top: 6px; max-width: 36em; }
.foot { color: var(--muted); font-size: 13px; padding-top: 28px; padding-bottom: 32px; display: grid; gap: 8px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px 16px; margin: 12px 0; }
.panel h2 { font-size: 19px; line-height: 1.3; }
.hint { color: var(--muted); font-size: 14px; margin-top: 6px; }
.sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* where */
.field { margin-top: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
select, input[type="search"] {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card);
}
select:focus, input:focus { border-color: var(--ink); }
input[type="search"] { margin-top: 10px; }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; margin-top: 10px; }
.dtile {
  display: grid; grid-template-columns: 2.2em 1fr; column-gap: 8px; text-align: left; align-items: center;
  padding: 8px 12px; min-height: 48px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer;
}
.dtile:hover { border-color: var(--ink); }
.dtile.on { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.dn { font-weight: 700; font-size: 20px; text-align: center; }
.dname { font-size: 15px; line-height: 1.3; }
.dtile .tagp { font-size: 12px; }
.where.done { padding: 14px 16px; }
.where-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.where-row h2 { font-size: 15px; font-weight: 600; color: var(--muted); }
.where-row .place { color: var(--ink); }
.mylist { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 2px; }
.mylist b { font-weight: 600; }
.tagp { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* buttons */
.btn { min-height: 44px; padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; cursor: pointer; font-weight: 600; }
.btn.ink { background: var(--ink); color: var(--card); }
.btn.plain { border-color: transparent; text-decoration: underline; text-underline-offset: 3px; padding: 6px 4px; min-height: 36px; }
.btn.small { font-size: 14px; }
.btn.wide { width: 100%; margin: 8px 0; }

/* issues */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  min-height: 40px; padding: 7px 13px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; text-align: left; line-height: 1.3;
}
.chip:hover { border-color: var(--ink); }
.chip .n { color: var(--muted); font-size: 13px; margin-left: 2px; }
.chip .cn { display: block; }
.chip .off { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.chip.on .off { color: inherit; opacity: .75; }
.off { font-size: 13px; color: var(--muted); }
.chip.on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.chip.on .n { color: inherit; opacity: .75; }
#issues .sub { margin-top: 16px; font-weight: 600; }
.events { margin-top: 4px; }
.eventcard {
  display: block; width: 100%; text-align: left; margin-top: 8px; padding: 12px 14px; cursor: pointer;
  border: 1.5px solid var(--ink); border-radius: 10px; background: var(--card);
  border-left-width: 8px; border-left-color: var(--hl);
}
.eventcard.on { box-shadow: inset 0 0 0 1.5px var(--ink); }
.ev-t { display: block; font-weight: 700; }
.ev-s { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }

/* results */
#results { scroll-margin-top: 8px; }
.res-head { padding: 22px 0 4px; }
.res-head h2 { font-family: var(--serif); font-size: 30px; line-height: 1.15; }
.seg { display: inline-flex; margin-top: 12px; border: 1.5px solid var(--ink); border-radius: 999px; padding: 3px; background: var(--card); }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 7px 16px; min-height: 38px; cursor: pointer; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--card); }

.msums { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
@media (min-width: 700px) { .msums { grid-template-columns: repeat(3, 1fr); } }
.msum { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 12px 14px; }
.msum-n b { font-weight: 700; }
.msum-c { font-size: 14px; margin-top: 4px; }
.msum-l { font-size: 13px; margin-top: 6px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.hl { background: var(--hl); color: var(--hl-ink); padding: 0 5px; border-radius: 3px; font-weight: 600; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.ok { color: var(--muted); }
.coverage { font-size: 13px; color: var(--muted); margin: 14px 0 4px; }

.group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 16px; margin: 12px 0; }
.gt { font-family: var(--serif); font-size: 20px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.vote { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.vote:first-of-type { border-top: 0; padding-top: 0; }
.vh { font-size: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.vh .ch { font-weight: 700; }
.vh .lbl { color: var(--muted); }
.vo { font-size: 14px; margin-top: 2px; }
.vo a { color: var(--muted); }
.pass, .fail { font-weight: 700; }
.explain { font-size: 14px; color: var(--muted); margin-top: 4px; max-width: 60ch; }
.purpose { font-size: 14px; margin-top: 6px; padding-left: 10px; border-left: 3px solid var(--line); }
.nochamber { margin-top: 12px; }

/* a member's recorded vote: a filled ballot bubble */
.row { display: grid; grid-template-columns: 28px 1fr auto; grid-template-areas: "mark who who" "mark pos react"; column-gap: 10px; align-items: center; padding: 10px 0 0; }
.row .mark { grid-area: mark; align-self: start; margin-top: 4px; }
.mark { display: inline-block; width: 26px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.row .who { grid-area: who; line-height: 1.3; }
.row .pos { grid-area: pos; font-weight: 700; font-size: 15px; }
.row .react { grid-area: react; }
.pY .mark { background: var(--yes); border-color: var(--yes); }
.row.pY .pos, .mini.pY b { color: var(--yes); }
.pN .mark { background: var(--no); border-color: var(--no); }
.row.pN .pos, .mini.pN b { color: var(--no); }
.pP .mark { background: linear-gradient(90deg, var(--muted) 50%, transparent 50%); }
.pX .mark { border-style: dashed; border-color: var(--muted); background: transparent; }
/* Missed is its own thing: an unfilled bubble in a grey outline. Yellow is kept for dodges. */
.row.pX .pos { color: var(--muted); }
.pO { opacity: .6; }
.pO .mark { border-color: var(--line); }

.react { display: flex; gap: 6px; }
.rbtn { min-height: 36px; min-width: 44px; padding: 5px 11px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); }
.rbtn:hover { border-color: var(--ink); color: var(--ink); }
.rbtn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--card); }

.vote.sub { margin-top: 10px; padding-top: 10px; }
.vote.sub .vh, .vote.sub .vo { font-size: 13px; }
.vote.sub .purpose { font-size: 14px; margin-top: 4px; }
.minis { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 14px; }
.mini { display: inline-flex; align-items: center; gap: 6px; }
.mini .mark { width: 16px; height: 10px; border-width: 1.5px; }
.tline { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; margin-top: 4px; color: var(--muted); }

.mtab { width: 100%; border-collapse: collapse; margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; font-size: 15px; }
.mtab caption { text-align: left; font-size: 13px; color: var(--muted); padding: 0 0 6px; caption-side: top; }
.mtab th, .mtab td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
.mtab tbody tr:last-child th, .mtab tbody tr:last-child td { border-bottom: 0; }
.mtab th[scope="row"], .mtab thead th:first-child { text-align: left; font-weight: 400; line-height: 1.3; }
.mtab thead th { font-size: 13px; color: var(--muted); font-weight: 600; padding-top: 8px; padding-bottom: 6px; }
.mtab td { font-weight: 700; width: 3.6em; }
.mtab td.none { font-weight: 400; color: var(--muted); text-align: left; width: auto; }
.vh-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mylist li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.mylist .call { font-size: 14px; color: var(--muted); padding: 4px 0; }

/* said / dodged evidence */
.stmt { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--said); }
.stmt.dodge { background: transparent; border: 2px dashed var(--ink); }
.stmt-h { font-size: 14px; line-height: 1.35; }
.stmt .kind { font-weight: 700; margin-right: 4px; }
.stmt.dodge .kind { background: var(--hl); color: var(--hl-ink); padding: 0 6px; border-radius: 3px; }
.stmt blockquote { margin: 8px 0 0; font-family: var(--serif); font-size: 16.5px; line-height: 1.45; }
.stmt-s { font-size: 14px; margin-top: 6px; }
.src { font-size: 13px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.stmt .react { margin-top: 10px; }

details.more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
details summary { cursor: pointer; font-size: 14px; font-weight: 600; padding: 6px 0; min-height: 36px; }
details summary .hl { font-weight: 600; margin-left: 4px; }
.more-body .vote:first-child { border-top: 0; }

/* everyone */
.tally { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.tally th, .tally td { padding: 6px 4px; text-align: right; border-bottom: 1px solid var(--line); }
.tally th:first-child { text-align: left; }
.tally thead th { font-weight: 600; color: var(--muted); font-size: 13px; }
.tally td.hlc { background: var(--hl); color: var(--hl-ink); font-weight: 700; }
.yours { font-size: 14px; margin-top: 8px; }
.names-body { columns: 2 220px; column-gap: 20px; font-size: 14px; }
.nl { break-inside: avoid-column; margin-bottom: 10px; }
.nl-h { font-weight: 700; margin-top: 8px; }
.nl ul, .silent { list-style: none; padding: 0; margin: 2px 0 0; }
.silent { columns: 2 220px; font-size: 14px; margin-top: 8px; }

.seeall { margin: 18px 0; padding: 18px 16px; border-radius: var(--radius-l); border: 1.5px dashed var(--ink); display: grid; gap: 10px; justify-items: start; }

/* the leader vote ledger: three kinds of evidence, never blended */
.ledger { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.ledger > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 12px; }
.ledger .dodge { border: 2px dashed var(--ink); }
.lk { font-weight: 700; font-size: 14px; }
.lv { font-family: var(--serif); font-size: 26px; font-weight: 700; line-height: 1.2; justify-self: start; }
.ledger .dodge .lv { background: var(--hl); color: var(--hl-ink); display: inline-block; padding: 0 6px; border-radius: 3px; }
.ld { font-size: 13px; color: var(--muted); margin-top: 2px; }
@media (max-width: 480px) { .ledger { grid-template-columns: 1fr; } .ledger > div { display: grid; grid-template-columns: 6em 1fr; column-gap: 8px; } .lk { grid-column: 1; } .lv { grid-column: 1; grid-row: 2; } .ld { grid-column: 2; grid-row: 1 / 3; align-self: center; } }
.evmine { display: grid; gap: 10px; margin-top: 12px; }
.evm { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 14px 16px; }
.evsec { margin-top: 18px; }
.evsec h3 { font-size: 18px; }
.evsec .stmt { background-color: var(--card); }
.evsec .stmt.said { background: var(--said); }

.shared { margin: 18px 0 0; padding: 16px; border-radius: var(--radius-l); background: var(--card); border: 2px solid var(--ink); }
.shared h2 { font-size: 17px; }
.shared ul { padding-left: 18px; margin: 8px 0 0; display: grid; gap: 6px; }
.loading p { color: var(--muted); }

/* take bar */
.takebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--card); border-top: 2px solid var(--ink);
}
.takebar[hidden] { display: none; }
.takebar p { font-size: 14px; }
@media (min-width: 800px) { .takebar { left: 50%; right: auto; transform: translateX(-50%); width: 728px; bottom: 12px; border: 2px solid var(--ink); border-radius: 999px; padding: 8px 8px 8px 22px; } }

dialog { border: 0; padding: 0; border-radius: var(--radius-l); width: min(560px, calc(100vw - 32px)); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(10, 16, 24, .5); }
.sharebox { padding: 18px; display: grid; gap: 10px; }
.sharebox h2 { font-size: 20px; }
.sharetext { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); max-height: min(52vh, 420px); overflow-y: auto; }
.sharebtns { display: flex; flex-wrap: wrap; gap: 8px; }

@media (min-width: 700px) {
  .brand { font-size: 36px; }
  .panel { padding: 22px 24px; }
  .group { padding: 20px 24px; }
  .res-head h2 { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.issues.done, .where.done { padding: 14px 16px; }
.issues.done .place { font-weight: 700; }
.nudge { display: grid; gap: 12px; justify-items: start; }
#where, #issues { scroll-margin-top: 8px; }

/* round 2 */
.res-head .off { margin-top: 2px; }
.billno { font-size: 13px; color: var(--muted); margin-top: 2px; }
.crs { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--paper); }
.crs-h { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.crs p:not(.crs-h):not(.src) { font-size: 15px; }
.own { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.own p { font-size: 14px; font-weight: 600; }
.with { font-size: 12px; font-weight: 600; color: var(--yes); margin-left: 6px; white-space: nowrap; }
.with.not { color: var(--no); }
.missed { color: var(--muted); font-weight: 600; margin-left: 4px; }
.missnote { margin-top: 6px; font-size: 13px; }
.row.compact { padding-top: 6px; }
.row.compact .who, .row.compact .pos { font-size: 14px; }
.row.compact .mark { width: 18px; height: 12px; margin-top: 3px; }
.row.compact .rbtn { min-height: 32px; font-size: 13px; padding: 4px 10px; }
.stmt-sec { margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--muted); }
details.morestmt { margin-top: 8px; }
.when { color: var(--ink); }
.nostmt { font-weight: 700; color: var(--muted); margin-top: 6px; }
.side { margin-top: 6px; font-size: 15px; }
.adddist { margin-top: 10px; }
.btn.inline { padding: 0 2px; min-height: 0; vertical-align: baseline; font-size: inherit; }
.or { color: var(--muted); font-size: 14px; margin-top: 10px; }
.label { font-weight: 600; margin-bottom: 4px; }
#zip { width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); font-size: 18px; letter-spacing: .08em; }
.vote.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { background: var(--hl); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .vote.flash { animation: none; outline: 3px solid var(--focus); } }
.sidetally { margin-top: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 14px; }
.sidetally .bar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; margin-top: 8px; gap: 2px; }
.s1 { background: #2f5d8a; } .s2 { background: #8a5a2f; } .s3 { background: #7c7f86; } .s4 { background: repeating-linear-gradient(45deg, var(--line) 0 4px, transparent 4px 8px); border: 1px solid var(--line); }
.sides { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.sides li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
