/* Copyright (c) 2026 Damon Townsend. All Rights Reserved. */
/* Civic Washington. Interface tokens follow the brand package (D:\TGO Elections\Branding\BRAND-GUIDELINES.md,
   20 Nov 2026): Navy #0B2D4D ink, Evergreen #2E7D5B emphasis and actions, Light gray #E6E9EE panels, White
   backgrounds, Segoe UI type. Brand Blue #4A90C2 is decorative only and isn't used next to data. Election data
   colors (party, results, turnout) are unchanged, as the guidelines require. */
:root {
  --ink: #0B2D4D; --ink-2: #2E4560; --muted: #4F5B69; --navy: #0B2D4D; --green: #2E7D5B; --error: #8A1C1C;
  --paper: #FFFFFF; --paper-2: #E6E9EE; --white: #FFFFFF; --rule: #B7C0CB; --edge: #D6DBE2;
  --sans: "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  /* One page width for masthead, menu, content, footer and dashboards (package 2, 20 Nov 2026). */
  --page: 1140px; --gutter: clamp(16px, 4vw, 40px);
  --inset: max(var(--gutter), calc((100% - var(--page)) / 2 + var(--gutter)));
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 1rem; line-height: 1.5; }
a { color: var(--navy); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; border-radius: 3px; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: .75rem 0 .5rem; overflow-wrap: anywhere; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; line-height: 1.3; margin: 1.75rem 0 .5rem; }
@media (min-width: 768px) { h1 { font-size: 2.25rem; } h2 { font-size: 1.375rem; } }
h3 { font-size: 1.0625rem; margin: 0; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.note { font-size: .9375rem; color: var(--ink-2); }

.skip { position: absolute; left: -10000px; top: 0; }
.skip:focus { left: 8px; top: 8px; z-index: 10; background: var(--white); padding: 10px 14px; border: 2px solid var(--navy); }
.sample-banner { margin: 0; padding: 6px var(--inset); background: var(--paper-2); border-bottom: 1px solid var(--rule); font-size: .875rem; color: var(--ink-2); }

/* masthead (Navigation V4) */
.mast { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 10px var(--inset); border-bottom: 1px solid var(--edge); background: var(--white); }
/* Logo: horizontal color lockup, at least 210 px wide (guidelines); its own artwork carries the clear space. */
.wm { display: inline-flex; align-items: center; min-height: 44px; min-width: 0; text-decoration: none; }
.wm img { display: block; width: 210px; height: auto; }
@media (min-width: 768px) { .wm img { width: 250px; } }
@media (max-width: 420px) { .mast { gap: 6px; } .mast .hctl { gap: 4px; } .mast .hbtn { padding: 0 8px; font-size: .9375rem; } }
.hctl { display: flex; gap: 6px; }
.hbtn { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1.5px solid var(--ink-2); border-radius: 6px; background: var(--white); color: var(--ink); text-decoration: none; font: inherit; font-weight: 600; cursor: pointer; }
.langsw { flex-basis: 100%; display: flex; gap: 14px; font-size: .9375rem; }
.langsw a { min-height: 44px; display: inline-flex; align-items: center; }
.langsw a[aria-current] { font-weight: 700; color: var(--ink); text-decoration: none; border-bottom: 3px solid var(--green); }
.gnav { background: var(--white); border-bottom: 1px solid var(--rule); padding: 4px var(--inset) 8px; }
.gnav ul { list-style: none; margin: 0; padding: 0; }
.gnav a { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.gnav a[aria-current=page] { font-weight: 700; color: var(--ink); text-decoration: none; border-left: 4px solid var(--green); padding-left: 8px; }
.gnav a[aria-current=location] { font-weight: 700; }
.gnav .curtag { font-size: .8125rem; font-weight: 400; color: var(--ink-2); }
/* Menu grouped by pillar (19 Nov 2026) */
.gnav .ggroup { padding: 4px 0; }
.gnav .ggroup + .ggroup { border-top: 1px solid var(--edge); }
.gnav .glabel { display: inline-block; font-size: .875rem; font-weight: 700; color: var(--green); margin-top: 6px; padding-top: 2px; border-top: 3px solid var(--green); }
.crumb ol { list-style: none; margin: 0; padding: 8px var(--inset) 0; display: flex; flex-wrap: wrap; gap: 0 6px; font-size: .9375rem; }
.crumb li { overflow-wrap: anywhere; min-width: 0; }
.crumb li + li::before { content: "/"; margin-right: 6px; color: var(--muted); }
.crumb a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
.crumb li[aria-current] { display: inline-flex; align-items: center; min-height: 44px; }
main { display: block; padding: 4px var(--inset) 32px; }
/* Comfortable reading length for running text; tables, lists of cards and dashboards use the full width. */
main > p, main > section > p, main > ul:not(.rlist):not(.elist):not(.lbls):not(.jump):not(.cols):not(.cands), main > ol:not(.rlist):not(.cols) { max-width: 72ch; }
main:focus { outline: none; }

/* footer */
.foot { background: var(--ink); color: var(--white); padding: 24px var(--inset) 28px; font-size: .9375rem; display: grid; gap: 14px; }
.foot .footlogo { grid-column: 1 / -1; margin: 0 0 4px; }
.foot .footlogo img { display: block; width: 210px; height: auto; }
.foot h2 { font-size: .875rem; color: var(--white); margin: 0; }
.foot a { color: var(--white); }
.foot :focus-visible { outline-color: var(--white); }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 14px; }
.foot a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
.foot p { margin: 0; color: var(--white); }

/* status and labels */
.stage, .cmeta { color: var(--ink-2); margin: 0; }
.lbls { list-style: none; padding: 0; margin: 8px 0; }
.status { display: inline-block; font-size: .875rem; font-weight: 700; border-radius: 4px; padding: 1px 8px; margin-right: 6px; }
.st-upcoming { color: var(--ink); background: var(--paper-2); border: 1.5px solid var(--ink-2); }
.st-voting { color: var(--ink); background: var(--paper); border: 2px solid var(--green); }
.st-unofficial, .st-counting { color: var(--ink); background: transparent; border: 1.5px dashed var(--ink-2); }
.st-certified { color: var(--paper); background: var(--green); border: 1.5px solid var(--green); }
.facts { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 4px 14px; margin: 8px 0; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.gapbox { background: var(--white); border: 1.5px solid var(--ink-2); border-left-width: 6px; border-radius: 6px; padding: 8px 12px; margin: 10px 0; }
.links { padding-left: 18px; }
.links a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }

/* buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 6px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--green); color: var(--white); border: 2px solid var(--green); }
.search { display: grid; gap: 8px; max-width: 36rem; margin: 8px 0; }
.search .l { font-weight: 700; }
.search input, .search select { font: inherit; font-size: 1rem; min-height: 44px; border: 1.5px solid var(--ink-2); border-radius: 6px; padding: 0 10px; background: var(--white); width: 100%; min-width: 0; }
.search input[aria-invalid=true] { border: 3px solid var(--error); }
.search .btn { justify-self: start; }
.ferr { color: var(--error); font-weight: 700; margin: 0; }
.search .note { margin: 0; }

/* lists */
.elist, .rlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.elist li, .rlist li { background: var(--white); border: 1px solid var(--edge); border-radius: 6px; padding: 6px 12px; min-width: 0; }
.elist h3 a, .rlist h3 a, .rlist h4 a { display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.rlist h4 { margin: 0; font-size: 1.0625rem; }
.print-only { display: none; }
.esnote { margin: 0; padding: 6px var(--inset); background: var(--paper-2); font-size: .9375rem; color: var(--ink-2); }
.rlist .ex { margin: 2px 0 4px; font-size: .9375rem; overflow-wrap: anywhere; }
.countline { font-weight: 700; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.pager a { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1.5px solid var(--ink-2); border-radius: 6px; background: var(--white); }
.pager a[aria-current] { background: var(--green); color: var(--white); border-color: var(--green); font-weight: 700; text-decoration: none; }

/* tables */
.tscroll { overflow-x: auto; max-width: 100%; }
table.rt { border-collapse: collapse; background: var(--white); min-width: 18rem; }
table.rt caption { text-align: left; font-size: .9375rem; color: var(--ink-2); padding: 4px 0; }
table.rt th, table.rt td { border-bottom: 1px solid var(--edge); padding: 6px 10px; text-align: left; vertical-align: top; }
table.rt thead th { border-bottom: 2px solid var(--ink-2); }
table.rt .r { text-align: right; }
.cue { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; font-weight: 700; vertical-align: -3px; }
.cands { list-style: none; padding: 0; display: grid; gap: 8px; }
.pref { display: inline-flex; gap: 6px; align-items: flex-start; }
.pref svg { flex: none; margin-top: 3px; }
.cue svg, .pref svg { forced-color-adjust: none; }
.ballot-title { background: var(--white); border-left: 4px solid var(--ink-2); padding: 4px 12px; max-width: 65ch; }
.st-snapshot, .st-no_results { color: var(--ink); background: var(--paper-2); border: 1.5px dashed var(--ink-2); }
.cue-plain { min-width: 18px; height: 18px; justify-content: center; border: 2px solid var(--ink-2); border-radius: 3px; font-size: .8125rem; background: var(--white); }
.pager .gap { display: inline-flex; align-items: center; padding: 0 4px; }

.lede { max-width: 65ch; }
.h3 { font-size: 1.0625rem; margin: 0; }
.h3 a { display: inline-flex; align-items: center; min-height: 44px; }
.dashboard { margin: 12px 0; }
@media (max-width: 479px) {
  .facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .facts dd { margin-bottom: 8px; }
}
@media (min-width: 768px) {
  .menu { display: none !important; }
  /* Logo, then Search and the language links on one row, in the same order as the page source. */
  .hctl { margin-left: auto; }
  .langsw { flex-basis: auto; }
  .gnav ul { display: flex; flex-wrap: wrap; gap: 0 14px; }
  .gnav .ggroups { align-items: flex-end; gap: 4px 24px; }
  .gnav .ggroup { padding: 0; }
  .gnav .ggroup + .ggroup { border-top: 0; }
  .gnav .glabel { margin-top: 4px; }
  .gnav .ggroup.gplain:last-child { margin-left: auto; }   /* About and Sign in sit apart, on the right */
  .foot { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media print {
  /* Print the content, compactly: only screen controls are hidden (search and filter forms, menus, pager). */
  body { font-size: 11pt; }
  .sample-banner { border: 0; }
  .hctl, .langsw, .gnav, .foot, .search[role=search], .pager, .skip, .esnote, .maptable { display: none !important; }
  main { padding: 0; }
  h1, h2, h3, h4 { break-after: avoid; }
  table.rt thead { display: table-header-group; }
  table.rt tr { break-inside: avoid; }
  .tscroll, .rt .table-wrap { overflow: visible !important; }   /* the vendored dashboard styles load later */
  .print-only { display: block !important; }
  /* Status chips print as dark text in an outline, readable with backgrounds off. */
  .status { color: #000 !important; background: #fff !important; border: 1.5px solid #000 !important; }
  .lead { background: none; padding: 0; }
  .rlist { gap: 0; }
  .rlist li { border: 0; border-bottom: 1px solid #999; border-radius: 0; padding: 2px 0; break-inside: avoid; }
  .rlist h3 a, .rlist h4 a, .elist h3 a { min-height: 0; }
  .rlist .cmeta, .rlist .ex { margin: 0; }
  a { color: #000; }
}

/* Closest contests (decision 8), inside the results explorer. Party-blind: no party colors. */
.closest .cl-list { margin: 0.25rem 0 0.75rem; padding-left: 1.4rem; }
.closest .cl-list li { margin: 0.35rem 0; line-height: 1.45; }
.closest .cl-gap { display: block; font-variant-numeric: tabular-nums; }
.closest h3 { font-size: 1rem; margin: 1rem 0 0.25rem; }

/* Places: county list and jump links. */
.cols { columns: 3 12rem; column-gap: 2rem; padding-left: 1.2rem; }
.cols li { break-inside: avoid; margin: 0.2rem 0; }
.jump { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; list-style: none; padding: 0; }
.jump a { display: inline-block; min-height: 44px; line-height: 44px; }

/* About: facts awaiting verification. */
.pending { font-style: italic; }
.srccard { border-top: 1px solid var(--line, #ccc); padding-top: 0.5rem; }

/* Run for Office guide. */
.stepper { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin-top: 1.5rem; }
.stepper a, .stepnav summary { display: inline-block; min-height: 44px; line-height: 44px; }

/* milestone 5 forms */
.btn-sec { background: var(--white); color: var(--green); border: 2px solid var(--green); }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.btnrow .btn { text-align: left; height: auto; padding: 8px 16px; }
.choices { border: 0; padding: 0; margin: 4px 0; display: grid; gap: 8px; min-width: 0; }
.choices legend { padding: 0; margin-bottom: 4px; }
.check { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; }
.check input { width: 24px; height: 24px; min-height: 24px; margin: 10px 0 0; }
.check label { display: block; min-height: 44px; padding: 8px 0; }
.errsum { border: 3px solid var(--error); border-radius: 6px; padding: 8px 12px; margin: 10px 0; background: var(--white); }
.errsum ul { margin: 4px 0; padding-left: 18px; }
.errsum a { color: var(--error); font-weight: 700; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.mailhdr, .mailbody { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .875rem; background: var(--white); border: 1px solid var(--edge); padding: 8px; }

/* "Get updates" invitation: bottom card on phones, corner card on wider screens. */
.invite { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--white); border-top: 2px solid var(--green); padding: 10px 16px; box-shadow: 0 -2px 8px rgba(0,0,0,.12); }
.invite h2 { margin: 0 0 4px; }
.invite p { margin: 0 0 6px; }
.invite .btnrow { margin: 0; }
@media (min-width: 768px) {
  .invite { left: auto; right: 16px; bottom: 16px; width: 22rem; border: 2px solid var(--green); border-radius: 8px; }
}
@media print { .invite { display: none; } }

/* discussion boards */
.board { margin-top: 24px; border-top: 2px solid var(--ink-2); padding-top: 8px; }
.board .comments { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.board .comments li { background: var(--white); border: 1px solid var(--edge); border-radius: 6px; padding: 6px 12px; min-width: 0; }
.board .by { margin: 0; font-size: .9375rem; color: var(--ink-2); }
.board .body p { margin: 4px 0; overflow-wrap: anywhere; white-space: pre-line; }
.board .removed { margin: 0; color: var(--muted); font-style: italic; }
.board .mine { font-weight: 700; }
.board textarea, .draft, .search select { font: inherit; font-size: 1rem; border: 1.5px solid var(--ink-2); border-radius: 6px; padding: 8px 10px; width: 100%; box-sizing: border-box; background: var(--white); }
.board details summary { min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; }
.btnrow select { font: inherit; min-height: 44px; }
.board .answers { border-left: 3px solid var(--edge); padding-left: 10px; margin: 6px 0 2px; }
.board .ans { margin: 4px 0; }

/* Data dashboards: the same page layout as the tgo-returns tracker pages. */
main:has(.dash-page) { padding: 0 0 24px; }
.dash-page .rt.wrap, .dash-page .rt-hero, .dash-tools { max-width: var(--page); margin-left: auto; margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); box-sizing: border-box; }
.dash-tools { display: flex; gap: .5rem; padding-top: .6rem; padding-bottom: .6rem; overflow-x: auto; }
.tool-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--paper-2); color: var(--ink-2); font-size: .85rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.tool-chip:hover, .tool-chip[aria-current="page"] { border-color: var(--green); color: var(--green); background: var(--white); }
.rt-hero { padding-top: 1rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--edge); margin-bottom: 1.5rem; }
.rt-hero .section-label { display: block; font-size: .9375rem; font-weight: 700; color: var(--green); margin-bottom: .25rem; }
.rt-hero h1 { margin: 0; }
.rt-hero .lede { font-size: 1.0625rem; line-height: 1.5; color: var(--ink-2); max-width: 65ch; margin-top: .5rem; }
.rt-hero .rt-update { max-width: 62ch; margin-top: 1rem; padding: .75rem 1rem; border-left: 4px solid var(--green); background: var(--paper-2); border-radius: 6px; }
@media (max-width: 540px) { .tool-chip { font-size: .8rem; padding: .3rem .7rem; } }


/* Home: tagline and the three pillars (brand direction, 19 Nov 2026) */
.hero { margin: 8px 0 20px; padding: 0 0 16px; border-bottom: 1px solid var(--rule); }
.tagline { margin: 0; font-weight: 700; letter-spacing: .02em; color: var(--green); }
.hero .lede { font-size: 1.0625rem; color: var(--ink-2); margin: .25rem 0 0; }
.pillars { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 24px; }
.pillars > h2 { margin: 0 0 4px; }
.pillar { background: var(--white); border: 1px solid var(--edge); border-top: 4px solid var(--green); border-radius: 6px; padding: 14px 16px; min-width: 0; }
.pillar h3 { font-size: 1rem; line-height: 1.35; font-weight: 600; color: var(--ink-2); }
.pillar .pword { display: block; font-size: 1.375rem; font-weight: 800; color: var(--ink); margin-bottom: 2px; }
.pillar ul { margin: 10px 0 0; padding: 0; list-style: none; }
.pillar li { padding: 6px 0; border-top: 1px solid var(--edge); }
.pillar li:first-child { border-top: 0; }
.pillar a { display: inline-block; min-height: 24px; }
@media (min-width: 760px) {
  .pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pillars > h2 { grid-column: 1 / -1; }
}
/* Home lead block and the hub's summary line (package 2). */
.lead { background: var(--paper-2); border-radius: 8px; padding: 4px 18px 16px; margin: 0 0 8px; }
.lead h2 { margin-top: .75rem; }
.calnote { color: var(--ink-2); }
.hubband { background: var(--paper-2); border-radius: 8px; padding: 2px 16px; margin: 10px 0 4px; max-width: 72ch; }
.hubband p { margin: 8px 0; }
.onpage .jump { margin: 4px 0 8px; }
/* Result share bars: one neutral ink for every choice (no party or ranking color); the numbers carry the meaning. */
td.share { white-space: nowrap; }
.sharebar { display: inline-block; vertical-align: middle; width: 6rem; height: 10px; margin-right: 10px; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; }
.sharebar i { display: block; height: 100%; background: var(--ink-2); }
@media (max-width: 479px) { .sharebar { width: 3.5rem; margin-right: 6px; } }
@media print { .sharebar { border-color: #000; } .sharebar i { background: #000; print-color-adjust: exact; -webkit-print-color-adjust: exact; } }
/* Election hub filters: one row on wider screens. */
.filters .f { display: grid; gap: 4px; min-width: 0; }
@media (min-width: 900px) {
  .search.filters { max-width: none; grid-template-columns: minmax(14rem, 2fr) repeat(3, minmax(8rem, 1fr)) auto; align-items: end; column-gap: 12px; }
  .filters .note { grid-column: 1 / -1; grid-row: 2; }
}

/* Vendored dashboards: only their text inks follow the brand. Their --axis, --grid, --border and --accent also
   draw chart marks and badges, so they stay as vendored with the data ramps (Codex REPLY-20261121-3200). */
body .rt, body .tip { --ink: #0B2D4D; --ink-2: #2E4560; }
.brandline { color: var(--ink-2); }
