/* Who Serves — design tokens
   Newsprint + ink. One accent: red oxide, the colour of corrugated-iron roofs
   and stoep polish across the country. Used sparingly: links, counts, the metros. */
:root {
  --paper: #f3eee3;
  --paper-deep: #e9e2d3;
  --ink: #1d1b17;
  --ink-soft: #4f4a41;
  --rule: #cfc6b4;
  --rule-strong: #1d1b17;
  --accent: #9c3a1c;
  --accent-ink: #fff8ef;
  --stamp: #6b5d2e;
  --focus: #1f5f8b;
  --hover-fill: color-mix(in srgb, var(--accent) 30%, var(--paper));
  --has-fill: color-mix(in srgb, var(--ink) 11%, var(--paper));
  --metro-fill: color-mix(in srgb, var(--accent) 14%, var(--paper));
  --metro-has-fill: color-mix(in srgb, var(--accent) 30%, var(--paper));
  --sphere-national: var(--ink);
  --sphere-provincial: var(--accent);
  --sphere-local: #a99d85;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  /* type scale — 1.25 minor third on body, display jumps harder */
  --t-xs: 0.8rem;
  --t-sm: 0.9rem;
  --t-base: 1.0625rem;
  --t-lg: 1.3rem;
  --t-xl: 1.9rem;
  --t-2xl: clamp(2.4rem, 5.5vw, 4.4rem);

  /* 4px spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  --measure: 64ch;
  --page: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171613;
    --paper-deep: #211f1b;
    --ink: #ece6d8;
    --ink-soft: #b3ab9b;
    --rule: #3a362f;
    --rule-strong: #ece6d8;
    --accent: #e0835f;
    --accent-ink: #171613;
    --stamp: #c9b36b;
    --focus: #7cb8e0;
    --sphere-local: #6e675a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-base)/1.55 var(--sans);
  font-kerning: normal;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; line-height: 1.15; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 1px; }
.mono { font-family: var(--mono); font-feature-settings: "zero"; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s4); top: -100px; background: var(--ink); color: var(--paper); padding: var(--s2) var(--s4); z-index: 10; }
.skip:focus { top: var(--s4); }
main:focus { outline: none; }

/* ---------- Masthead ---------- */
.masthead {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--s6) var(--gutter) 0;
}
.masthead__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4);
  flex-wrap: wrap;
  border-bottom: 3px double var(--rule-strong);
  padding-bottom: var(--s3);
}
.wordmark {
  font: 700 2rem/1 var(--serif);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
}
/* The flag in line art — ink only, so it follows light/dark mode */
.logo {
  width: 57px;
  height: 38px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1px;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: miter;
}
@media (max-width: 520px) { .logo { width: 45px; height: 30px; } }
.masthead__dateline {
  display: flex; gap: var(--s4); flex-wrap: wrap;
  font-size: var(--t-xs); color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.masthead__nav {
  display: flex; gap: var(--s5); flex-wrap: wrap;
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--rule);
  font-size: var(--t-sm);
}
.masthead__nav a { color: var(--ink); text-decoration: none; }
.masthead__nav a:hover { color: var(--accent); }
.masthead__nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* ---------- Lede + search ---------- */
main { display: block; }
.lede {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--s8) var(--gutter) var(--s7);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--s7);
  align-items: end;
}
.lede h1 {
  font-size: var(--t-2xl);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 700;
  font-variation-settings: "opsz" 72;
}
.lede__sub {
  margin-top: var(--s5);
  max-width: 46ch;
  font-size: var(--t-lg);
  line-height: 1.45;
  color: var(--ink-soft);
  font-family: var(--serif);
}

.search { border-top: 2px solid var(--ink); padding-top: var(--s4); }
.search__label {
  display: block; margin-bottom: var(--s2);
  font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft);
}
.search__field input {
  width: 100%;
  font: 400 var(--t-lg)/1.3 var(--sans);
  color: var(--ink);
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  padding: var(--s3) var(--s4);
}
.search__field input::placeholder { color: var(--ink-soft); opacity: 0.8; }
.search__alt { margin-top: var(--s4); font-size: var(--t-sm); color: var(--ink-soft); }
.sphere { border: 0; padding: 0; margin: var(--s4) 0 0; display: flex; flex-wrap: wrap; gap: 0; }
.sphere label { position: relative; }
.sphere input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sphere span {
  display: block;
  padding: var(--s2) var(--s4);
  border: 1px solid var(--ink);
  margin-left: -1px;
  font-size: var(--t-sm);
  cursor: pointer;
}
.sphere label:first-child span { margin-left: 0; }
.sphere input:checked + span { background: var(--ink); color: var(--paper); }
.sphere input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; position: relative; z-index: 1; }

/* ---------- The roll (directory) ---------- */
.roll {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--s9);
}
.roll__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4);
  border-bottom: 1px solid var(--ink);
  padding-bottom: var(--s2);
}
.roll__head h2 { font-size: var(--t-xl); }
.roll__count { font-size: var(--t-sm); color: var(--ink-soft); }
.notice {
  margin: var(--s4) 0 0;
  padding: var(--s3) var(--s4);
  border-left: 3px solid var(--stamp);
  background: var(--paper-deep);
  font-size: var(--t-sm);
  max-width: var(--measure);
}
.roll__list { list-style: none; margin: 0; padding: 0; counter-reset: roll; }
.roll__list li { border-bottom: 1px solid var(--rule); }
.entry {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 2.2fr) minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--s4);
  align-items: baseline;
  padding: var(--s3) 0;
  color: inherit;
  text-decoration: none;
}
.entry__role, .entry__party { line-height: 1.4; }
.entry:hover .entry__name { color: var(--accent); }
.entry__no { font-size: var(--t-xs); color: var(--ink-soft); }
.entry__name { font: 600 var(--t-lg)/1.2 var(--serif); }
.entry__role { font-size: var(--t-sm); }
.entry__place { display: block; color: var(--ink-soft); }
.entry__party { font-size: var(--t-sm); color: var(--ink-soft); text-align: right; }
.stamp {
  display: inline-block;
  margin-left: var(--s2);
  font: 500 0.65rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stamp);
  border: 1px solid currentColor;
  padding: 3px 5px 2px;
  vertical-align: 0.3em;
}
.empty { padding: var(--s7) 0; color: var(--ink-soft); font-family: var(--serif); font-size: var(--t-lg); }

/* ---------- Structure (real counts, drawn) ---------- */
.structure {
  background: var(--paper-deep);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: var(--s8) max(var(--gutter), calc((100vw - var(--page)) / 2 + var(--gutter)));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s7) var(--s8);
}
.structure__intro { grid-column: 1 / -1; max-width: var(--measure); }
.structure__intro h2 { font-size: var(--t-xl); margin-bottom: var(--s3); }
.structure__intro p { color: var(--ink-soft); }
.tier { margin: 0; }
.tier--wide { grid-column: 1 / -1; }
.tier figcaption { display: grid; grid-template-columns: auto 1fr; column-gap: var(--s4); margin-bottom: var(--s4); }
.tier__n { grid-row: span 2; font-size: 2.6rem; line-height: 1; color: var(--accent); font-weight: 500; }
.tier__label { font: 600 var(--t-base)/1.3 var(--serif); font-size: 1.15rem; }
.tier__note { font-size: var(--t-sm); color: var(--ink-soft); }
.dots { display: grid; grid-template-columns: repeat(40, 1fr); gap: 3px; max-width: 520px; }
.dots[data-group] { grid-template-columns: repeat(9, auto); justify-content: start; gap: var(--s3); }
.dots i { display: block; aspect-ratio: 1; border-radius: 50%; background: var(--ink); }
.dots .grp { display: grid; grid-template-columns: repeat(2, 9px); gap: 3px; }
.dots .grp i { width: 9px; }
.dots .grp i.special { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
.provinces { list-style: none; padding: 0; margin: 0; columns: 3; column-gap: var(--s5); font-size: var(--t-sm); }
.provinces li { padding: var(--s1) 0; border-bottom: 1px solid var(--rule); break-inside: avoid; }
.squares { display: grid; grid-template-columns: repeat(auto-fill, minmax(14px, 1fr)); gap: 3px; }
.squares i { aspect-ratio: 1; background: var(--rule); }
.squares i.metro, .key--metro { background: var(--accent); }
.squares i.district, .key--district { background: var(--ink); }
.key { display: inline-block; width: 10px; height: 10px; margin: 0 var(--s1) 0 var(--s3); vertical-align: -1px; }
.key:first-child { margin-left: 0; }
.key--local { background: var(--rule); }

/* ---------- Principles ---------- */
.principles {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--s9) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: var(--s7);
}
.principles h2 { font-size: var(--t-xl); line-height: 1.15; }
.principles ol { margin: 0; padding: 0; list-style: none; counter-reset: p; }
.principles li { counter-increment: p; display: grid; grid-template-columns: 3rem 1fr; padding: var(--s5) 0; border-top: 1px solid var(--rule); }
.principles li::before { content: counter(p, decimal-leading-zero); font: 500 var(--t-sm)/1.8 var(--mono); color: var(--accent); grid-row: span 2; }
.principles h3 { font-size: var(--t-lg); margin-bottom: var(--s2); }
.principles p { color: var(--ink-soft); max-width: 56ch; }

/* ---------- Pages (profile, map, parties) ---------- */
.page {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--s7) var(--gutter) var(--s9);
}
.back { display: inline-block; font-size: var(--t-sm); margin-bottom: var(--s5); }
.page-head {
  padding-bottom: var(--s5);
  margin-bottom: var(--s6);
  border-bottom: 3px double var(--rule-strong);
}
.page-head h1 { font-size: var(--t-2xl); line-height: 1.05; letter-spacing: -0.02em; }
.page-head__sub { margin-top: var(--s3); max-width: 60ch; font: 400 var(--t-lg)/1.4 var(--serif); color: var(--ink-soft); }
.page .notice { margin: 0 0 var(--s6); }
.small { font-size: var(--t-xs); }
.panel-h { font-size: var(--t-lg); padding-bottom: var(--s2); border-bottom: 1px solid var(--ink); margin-bottom: var(--s1); display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.panel-h__n { font-size: var(--t-sm); font-weight: 400; color: var(--ink-soft); }
.panel-sec + .panel-sec { margin-top: var(--s7); }
.panel-note { margin-top: var(--s4); font-size: var(--t-sm); color: var(--ink-soft); max-width: 56ch; }
.gap { color: var(--ink-soft); font-style: italic; padding: var(--s3) 0; }

/* people lists adapt to the column they're in, not the viewport */
.roll__list { container-type: inline-size; }
@container (max-width: 620px) {
  .entry { grid-template-columns: 2.5rem minmax(0, 1fr); row-gap: var(--s1); }
  .entry__role, .entry__party { grid-column: 2; text-align: left; }
}

/* profile */
.profile__body {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: var(--s8);
}
.profile__body section + section { margin-top: var(--s7); }
.profile__body h2 { font-size: var(--t-lg); padding-bottom: var(--s2); border-bottom: 1px solid var(--ink); margin-bottom: var(--s3); }
.facts { margin: 0; }
.facts > div { display: grid; grid-template-columns: 11rem 1fr; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-size: var(--t-sm); color: var(--ink-soft); }
.facts dd { margin: 0; }
sup.cite a { font: 500 0.7rem var(--mono); text-decoration: none; margin-left: 2px; }
.sources { margin: 0; padding-left: 1.5rem; font-size: var(--t-sm); }
.sources li { padding: var(--s1) 0; }
.sources li:target { background: var(--paper-deep); }
.aside-box { border-top: 2px solid var(--ink); padding-top: var(--s3); font-size: var(--t-sm); }
.aside-box + .aside-box { margin-top: var(--s6); }
.aside-box p + p { margin-top: var(--s2); }
.aside-box h2 { border: 0; padding: 0; font-size: var(--t-base); }

/* ---------- Map ---------- */
.page--wide { max-width: calc(var(--page) + 120px); }
.page-head--map { margin-bottom: var(--s5); }
.crumbs { font-size: var(--t-xs); color: var(--ink-soft); min-height: 1.4em; margin-bottom: var(--s2); display: flex; flex-wrap: wrap; gap: var(--s2); }
.crumbs a { color: var(--ink-soft); }
.crumbs__sep { color: var(--rule); }
.atlas {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--s7);
  align-items: start;
}
.atlas__map { margin: 0; position: sticky; top: var(--s4); }
.atlas__map svg { display: block; width: 100%; height: auto; aspect-ratio: 1 / 0.86; max-height: calc(100vh - 80px); }
.atlas__credit { margin-top: var(--s2); font-size: var(--t-xs); color: var(--ink-soft); }
.atlas__panel { min-width: 0; }

svg a { cursor: pointer; }
svg a:focus { outline: none; }
.prov { fill: var(--paper-deep); stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.prov.is-current { fill: none; stroke-width: 2.5; pointer-events: none; }
.prov.is-dim { fill: var(--paper-deep); stroke: var(--rule); opacity: 0.55; }
a:hover > .prov:not(.is-current), a:focus-visible > .prov:not(.is-current) { fill: var(--hover-fill); opacity: 1; }
.muni { fill: var(--paper); stroke: var(--rule); stroke-width: 0.75; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.muni.has-people { fill: var(--has-fill); }
.muni--metro { fill: var(--metro-fill); }
.muni--metro.has-people { fill: var(--metro-has-fill); }
a:hover > .muni, a:focus-visible > .muni { fill: var(--hover-fill); }
a:focus-visible > .muni, a:focus-visible > .prov { stroke: var(--focus); stroke-width: 3; }
.muni.is-selected, a:hover > .muni.is-selected { fill: var(--accent); stroke: var(--ink); stroke-width: 1.5; }
.district { fill: none; stroke: var(--ink); stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; pointer-events: none; }
.map-labels { pointer-events: none; }
.map-label {
  font-family: var(--serif); font-weight: 600; fill: var(--ink);
  paint-order: stroke; stroke: var(--paper); stroke-width: 0.28em; stroke-linejoin: round;
}
.map-label--prov { font-weight: 500; fill: var(--ink-soft); }

.place-list { list-style: none; margin: 0; padding: 0; }
.place-list li { border-bottom: 1px solid var(--rule); }
.place-row {
  display: grid; grid-template-columns: 1fr auto; column-gap: var(--s4); row-gap: 2px;
  padding: var(--s3) 0; color: inherit; text-decoration: none;
}
.place-row__name { font: 600 var(--t-lg)/1.2 var(--serif); }
.place-row__count { color: var(--accent); font-size: var(--t-base); }
.place-row__detail { grid-column: 1 / -1; font-size: var(--t-xs); color: var(--ink-soft); }
.place-row:hover .place-row__name { color: var(--accent); }
.place-row--compact { padding: var(--s2) 0; }
.place-row--compact .place-row__name { font: 400 var(--t-base)/1.3 var(--sans); }
.place-row--compact .place-row__count { font-size: var(--t-sm); }
.district-block { margin-top: var(--s5); }
.district-block h4 {
  margin: 0; padding-bottom: var(--s1); border-bottom: 1px solid var(--ink-soft);
  font: 600 var(--t-sm)/1.4 var(--sans); display: flex; flex-wrap: wrap; gap: var(--s2); align-items: baseline;
}
.district-block h4 .mono { font-weight: 400; color: var(--ink-soft); font-size: var(--t-xs); }
.district-block__n { margin-left: auto; }

/* ---------- Parties ---------- */
.ledger { width: 100%; border-collapse: collapse; font-size: var(--t-base); }
.ledger th, .ledger td { padding: var(--s3) var(--s3) var(--s3) 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: baseline; }
.ledger thead th { font: 500 var(--t-xs)/1.3 var(--sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); border-bottom: 1px solid var(--ink); white-space: nowrap; }
.ledger tbody th { font: 600 var(--t-lg)/1.2 var(--serif); }
.ledger tbody th a { color: var(--ink); text-decoration: none; }
.ledger tbody th a:hover { color: var(--accent); }
.ledger .num { text-align: right; }
.ledger__barcol { width: 34%; padding-left: var(--s5) !important; }
.ledger__bar { display: flex; height: 12px; gap: 2px; }
.ledger__seg { display: block; }
.ledger__seg--national, .key-dot--national { background: var(--sphere-national); }
.ledger__seg--provincial, .key-dot--provincial { background: var(--sphere-provincial); }
.ledger__seg--local, .key-dot--local { background: var(--sphere-local); }
.key-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; vertical-align: 1px; }

.party__figures { display: flex; flex-wrap: wrap; gap: var(--s5) var(--s8); margin-bottom: var(--s7); }
.figure { display: flex; align-items: baseline; gap: var(--s2); }
.figure__n { font-size: 2.6rem; line-height: 1; color: var(--accent); }
.figure__label { font: 400 var(--t-lg)/1.2 var(--serif); color: var(--ink-soft); }
.party__body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: var(--s8); align-items: start; }
.party__where { position: sticky; top: var(--s4); }
.choropleth { display: block; width: 100%; height: auto; margin-top: var(--s4); }
.choro--0 { fill: var(--paper-deep); }
.choro--1 { fill: color-mix(in srgb, var(--accent) 25%, var(--paper)); }
.choro--2 { fill: color-mix(in srgb, var(--accent) 50%, var(--paper)); }
.choro--3 { fill: color-mix(in srgb, var(--accent) 75%, var(--paper)); }
.choro--4 { fill: var(--accent); }
.party__provs { list-style: none; margin: var(--s4) 0 0; padding: 0; font-size: var(--t-sm); }
.party__provs li { display: flex; justify-content: space-between; padding: var(--s1) 0; border-bottom: 1px solid var(--rule); }

/* ---------- Colophon ---------- */
.colophon {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--s6) var(--gutter) var(--s8);
  border-top: 3px double var(--rule-strong);
  font-size: var(--t-sm);
  color: var(--ink-soft);
}
.colophon p + p { margin-top: var(--s2); font-size: var(--t-xs); }
.colophon__credit { opacity: .7; }

/* ---------- Legal documents ---------- */
.legal { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: var(--s7); align-items: start; }
.legal__toc { position: sticky; top: var(--s4); font-size: var(--t-sm); border-top: 1px solid var(--ink); padding-top: var(--s3); }
.legal__toc h2 { font: 500 var(--t-xs)/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin: 0 0 var(--s2); }
.legal__toc h2 + * { margin-bottom: var(--s5); }
.legal__toc ol, .legal__toc ul { margin: 0; padding-left: 1.2em; }
.legal__toc ul { list-style: none; padding: 0; }
.legal__toc li { padding: 2px 0; }
.legal__body { max-width: 68ch; }
.legal__intro { font: 400 var(--t-lg)/1.5 var(--serif); margin: 0 0 var(--s6); }
.legal__body section { scroll-margin-top: var(--s4); }
.legal__body section + section { margin-top: var(--s6); }
.legal__body h2 { font: 600 var(--t-lg)/1.3 var(--serif); padding-bottom: var(--s2); border-bottom: 1px solid var(--rule); margin: 0 0 var(--s3); }
.legal__body p, .legal__body li { line-height: 1.6; }
.legal__body p + p, .legal__body p + ul, .legal__body ul + p, .legal__body p + ol { margin-top: var(--s3); }
.legal__body li + li { margin-top: var(--s2); }
.legal-list { list-style: none; margin: 0 0 var(--s6); padding: 0; max-width: 68ch; }
.legal-list li { padding: var(--s4) 0; border-bottom: 1px solid var(--rule); }
.legal-list a { font: 600 var(--t-lg)/1.3 var(--serif); }
.legal-list p { margin: var(--s1) 0 0; color: var(--ink-soft); font-size: var(--t-sm); }
@media (max-width: 860px) {
  .legal { grid-template-columns: 1fr; gap: var(--s5); }
  .legal__toc { position: static; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .lede { grid-template-columns: 1fr; padding-top: var(--s7); gap: var(--s6); }
  .structure { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; gap: var(--s4); padding: var(--s8) var(--gutter); }
  .profile__body, .party__body { grid-template-columns: 1fr; gap: var(--s7); }
  .atlas { grid-template-columns: 1fr; gap: var(--s5); }
  .atlas__map, .party__where { position: static; }
  .atlas__map svg { max-height: 62vh; }
  .ledger__barcol { display: none; }
}
@media (max-width: 520px) {
  .dots:not([data-group]) { grid-template-columns: repeat(25, 1fr); gap: 2px; max-width: 300px; }
  .provinces { columns: 2; }
  .facts > div { grid-template-columns: 1fr; gap: var(--s1); }
  .ledger th, .ledger td { padding-right: var(--s2); }
  .ledger tbody th { font-size: var(--t-base); }
  .ledger thead th .key-dot { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .entry__name, .masthead__nav a { transition: color 120ms ease; }
}

/* municipality office details on the map panel */
.muni-contact { margin: 0 0 var(--s2); display: grid; grid-template-columns: auto 1fr; gap: var(--s1) var(--s4); font-size: var(--t-sm); }
.muni-contact > div { display: contents; }
.muni-contact dt { color: var(--ink-soft); }
.muni-contact dd { margin: 0; overflow-wrap: anywhere; }
.muni-contact + .panel-note { margin: 0 0 var(--s6); }
.entry__party.is-unknown { color: var(--rule); }
.gap-inline { font-style: italic; }

/* declared interests on profiles */
.interests__intro { margin: 0 0 var(--s4); }
.interest-cat { font: 600 var(--t-base)/1.3 var(--sans); margin: var(--s5) 0 var(--s1); display: flex; justify-content: space-between; align-items: baseline; }
.interests { list-style: none; margin: 0; padding: 0; font-size: var(--t-sm); }
.interests li { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s2) 0; border-bottom: 1px solid var(--rule); }
.interests .sep { color: var(--ink-soft); }
.pg { flex: none; font-size: var(--t-xs); color: var(--ink-soft); text-decoration: none; white-space: nowrap; }
.pg:hover { color: var(--accent); text-decoration: underline; }
.coverage-gap { border-left: 3px solid var(--stamp); padding-left: var(--s3); }

/* accountability records on profiles */
.records__intro { margin: 0 0 var(--s4); }
.records { list-style: none; margin: 0; padding: 0; }
.record { padding: var(--s4) 0; border-bottom: 1px solid var(--rule); }
.record__meta { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: baseline; font-size: var(--t-xs); color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.record__stage { font: 500 0.72rem/1 var(--mono); padding: 4px 6px 3px; border: 1px solid currentColor; }
.record__stage--adverse { color: var(--accent); }
.record__stage--favourable { color: var(--ink); background: var(--paper-deep); }
.record__stage--neutral { color: var(--stamp); }
.record__title { font-size: var(--t-lg); margin: var(--s2) 0 var(--s1); }
.record__summary { max-width: 66ch; }
.record__sources { list-style: none; margin: var(--s3) 0 0; padding: 0; font-size: var(--t-sm); }
.record__sources li { padding: 2px 0; }
.record__sources .mono { font-size: var(--t-xs); color: var(--ink-soft); }
.stamp--primary { color: var(--ink-soft); vertical-align: 1px; }

/* pagination under the roll */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--ink); }
.pager button { font: 500 var(--t-sm)/1 var(--sans); color: var(--ink); background: none; border: 1px solid transparent; padding: var(--s2) var(--s3); cursor: pointer; }
.pager button:hover:not([disabled]) { border-color: var(--rule); color: var(--accent); }
.pager button[disabled] { color: var(--rule); cursor: default; }
.pager__pages { display: flex; flex-wrap: wrap; gap: var(--s1); list-style: none; margin: 0; padding: 0; }
.pager__num[aria-current] { background: var(--ink); color: var(--paper); }
.pager__gap { padding: var(--s2) var(--s1); color: var(--ink-soft); }
@media (max-width: 520px) { .pager__step { flex: 1 1 40%; } .pager__pages { order: 3; width: 100%; justify-content: center; } }

/* education & qualifications on profiles */
.creds { list-style: none; margin: 0; padding: 0; }
.cred { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s1) var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
.cred__main { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); align-items: baseline; }
.cred__level { font: 500 var(--t-xs)/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); min-width: 7.5rem; }
.cred__where, .cred__note { font-size: var(--t-sm); color: var(--ink-soft); }
.cred__note { font-style: italic; }
.cred__meta { font-size: var(--t-xs); color: var(--ink-soft); text-align: right; }
.cred__status { font: 500 0.7rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; border: 1px solid currentColor; padding: 3px 5px 2px; }
.cred__status--declared { color: var(--stamp); }
.cred__status--verified { color: var(--ink); background: var(--paper-deep); }
.cred__status--disputed { color: var(--accent); }
@container (max-width: 560px) { .cred { grid-template-columns: 1fr; } .cred__meta { text-align: left; } }
.profile__body section { container-type: inline-size; }

.submit { margin-top: var(--s4); border-top: 1px dashed var(--rule); padding-top: var(--s3); }
.submit summary { cursor: pointer; font-size: var(--t-sm); color: var(--accent); }
.submit__form { display: grid; gap: var(--s3); margin-top: var(--s3); max-width: 560px; }
.submit__form label { display: grid; gap: var(--s1); font-size: var(--t-sm); color: var(--ink-soft); }
.submit__form input, .submit__form select, .submit__form textarea {
  font: 400 var(--t-base)/1.4 var(--sans); color: var(--ink); background: var(--paper-deep);
  border: 1px solid var(--rule); border-bottom-color: var(--ink); border-radius: 0; padding: var(--s2) var(--s3); width: 100%;
}
.submit__btn { justify-self: start; font: 500 var(--t-sm)/1 var(--sans); padding: var(--s3) var(--s4); border: 1px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; }
.submit__btn:disabled { opacity: 0.5; }
.submit__msg { font-size: var(--t-sm); min-height: 1.2em; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- server-rendered pages & SEO blocks ---------- */
.ssr .crumbs { margin-bottom: var(--s3); }
.answer { font: 400 var(--t-lg)/1.5 var(--serif); max-width: 62ch; margin: 0 0 var(--s6); padding-left: var(--s4); border-left: 3px solid var(--accent); }
.glance { margin: 0; font-size: var(--t-sm); }
.glance > div { display: grid; grid-template-columns: 6.5rem 1fr; gap: var(--s2); padding: var(--s1) 0; border-bottom: 1px solid var(--rule); }
.glance dt { color: var(--ink-soft); }
.glance dd { margin: 0; }
.share { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: baseline; font-size: var(--t-sm); margin: var(--s5) 0 0; }
.share__label { font: 500 var(--t-xs)/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.share__wa { font-weight: 600; }
.faq { margin: 0; }
.faq > div { padding: var(--s4) 0; border-bottom: 1px solid var(--rule); }
.faq dt { font: 600 var(--t-lg)/1.3 var(--serif); margin-bottom: var(--s2); }
.faq dd { margin: 0; color: var(--ink-soft); max-width: 66ch; }
.muni-cols { columns: 2; column-gap: var(--s6); }
.muni-cols li { break-inside: avoid; }
.principles--page { padding: 0; grid-template-columns: 1fr; max-width: none; margin-bottom: var(--s7); }
.panel-h a { color: inherit; text-decoration: none; }
.panel-h a:hover { color: var(--accent); }
.browse { max-width: var(--page); margin: 0 auto; padding: var(--s8) var(--gutter) 0; }
.browse h2 { font-size: var(--t-xl); margin-bottom: var(--s4); }
.browse__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s6); }
.browse h3 { font: 600 var(--t-xs)/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin-bottom: var(--s3); }
.browse ul { list-style: none; margin: 0; padding: 0; }
.browse li { padding: var(--s1) 0; border-bottom: 1px solid var(--rule); }
.browse a { color: var(--ink); text-decoration: none; }
.browse a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 640px) { .muni-cols { columns: 1; } }

/* ---------- buy the developers a coffee ---------- */
.coffee--home { max-width: var(--page); margin: var(--s8) auto 0; padding: var(--s6) var(--gutter);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s6); align-items: start;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--paper-deep); }
.coffee--home h2 { font-size: var(--t-xl); margin-bottom: var(--s3); }
.coffee--page { max-width: 720px; }
.coffee__lede { font: 400 var(--t-lg)/1.5 var(--serif); color: var(--ink-soft); margin-bottom: var(--s5); }
.coffee--home .coffee__lede { font-size: var(--t-base); margin: 0; }
.coffee__sizes { border: 0; margin: 0 0 var(--s4); padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s2); }
.coffee__size { position: relative; cursor: pointer; }
.coffee__size > input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.coffee__size > span { display: grid; gap: 2px; height: 100%; padding: var(--s3) var(--s4); border: 1px solid var(--ink); background: var(--paper); }
.coffee__size strong { font: 600 var(--t-base)/1.2 var(--serif); }
.coffee__size .mono { color: var(--accent); font-size: var(--t-lg); }
.coffee__size em { font-size: var(--t-xs); color: var(--ink-soft); font-style: normal; }
.coffee__size > input:checked + span { background: var(--ink); color: var(--paper); }
.coffee__size > input:checked + span .mono, .coffee__size > input:checked + span em { color: var(--paper); }
.coffee__size > input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.coffee__custom { display: flex; align-items: center; gap: var(--s1); font-family: var(--mono); }
.coffee__custom input { width: 6.5rem; font: 400 var(--t-base)/1.2 var(--mono); padding: var(--s1) var(--s2); border: 1px solid var(--rule); background: var(--paper); color: var(--ink); position: relative; z-index: 1; }
.coffee__btn { font: 600 var(--t-base)/1 var(--sans); padding: var(--s3) var(--s5); border: 1px solid var(--ink); background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.coffee__btn:disabled { background: var(--paper); color: var(--ink-soft); border-color: var(--rule); cursor: default; }
.coffee__small { margin-top: var(--s3); color: var(--ink-soft); max-width: 60ch; }
@media (max-width: 860px) { .coffee--home { grid-template-columns: 1fr; } }
