/* House of the People. Colours are tokens, declared for light, for dark by
 * device setting, and for dark by choice; scripts/check_contrast.py reads the
 * three blocks and measures every ink against every surface. Write no colour
 * as a literal outside these blocks. */
:root {
  --paper: #f6f4ee;
  --surface: #ffffff;
  --ink: #1d1c1a;
  --muted: #55524b;
  --rule: #c9c4b8;
  --accent: #0d5c63;        /* ink: links, labels */
  --fill: #0d5c63;          /* a surface carrying --on-fill */
  --on-fill: #ffffff;
  --mark: #f1e7c8;          /* highlight behind ink */
  --gain: #1f6a3a;          /* ink for a state that gains seats */
  --loss: #9a2f1f;          /* ink for a state that loses seats */
  --bar: #0d5c63;
  --bar-2: #b98b2c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Noto Serif", "Noto Serif Devanagari", "Noto Serif Tamil", "Noto Serif Telugu", "Noto Serif Kannada", "Noto Serif Malayalam", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Tamil", "Noto Sans Telugu", "Noto Sans Kannada", "Noto Sans Malayalam", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151514;
    --surface: #1e1e1c;
    --ink: #ecebe5;
    --muted: #b0aca2;
    --rule: #45433e;
    --accent: #7fcbc4;
    --fill: #0d5c63;
    --on-fill: #ffffff;
    --mark: #3b3420;
    --gain: #7fd39a;
    --loss: #f0a08f;
    --bar: #7fcbc4;
    --bar-2: #e0b45a;
  }
}
:root[data-theme="dark"] {
  --paper: #151514;
  --surface: #1e1e1c;
  --ink: #ecebe5;
  --muted: #b0aca2;
  --rule: #45433e;
  --accent: #7fcbc4;
  --fill: #0d5c63;
  --on-fill: #ffffff;
  --mark: #3b3420;
  --gain: #7fd39a;
  --loss: #f0a08f;
  --bar: #7fcbc4;
  --bar-2: #e0b45a;
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.6 var(--sans); overflow-x: clip;
}
html:lang(ta) body, html:lang(ml) body, html:lang(te) body, html:lang(kn) body { line-height: 1.75; }
[hidden] { display: none !important; }
a { color: var(--accent); }
p a, li a, td a, .notice a, .foot a { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.prefs, .masthead, main, .foot, .notice { max-width: 72rem; margin: 0 auto; padding: 0 16px; }
.prefs { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); font-size: 15px; }
.langs { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.langs a { text-decoration: none; color: var(--muted); }
.langs a[aria-current] { color: var(--ink); font-weight: 600; }
.theme { font: inherit; font-size: 14px; color: var(--ink); background: transparent; border: 1px solid var(--rule); padding: 6px 12px; min-height: 36px; cursor: pointer; }

.masthead { padding-top: 28px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.wordmark { font: 700 clamp(28px, 5vw, 44px)/1.1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.tagline { margin: 6px 0 16px; color: var(--muted); max-width: 46rem; }
.primary { display: flex; gap: 6px 22px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: thin; }
.primary a { white-space: nowrap; color: var(--ink); text-decoration: none; font-weight: 500; padding: 4px 0; border-bottom: 2px solid transparent; }
.primary a[aria-current] { border-bottom-color: var(--accent); }
.primary a:hover { color: var(--accent); }

.notice { margin-top: 16px; background: var(--mark); padding: 10px 14px; font-size: 15px; }

main { padding-top: 24px; padding-bottom: 48px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; }
h1 { font-size: clamp(30px, 5vw, 46px); margin: 8px 0 14px; max-width: 52rem; }
h2 { font-size: clamp(22px, 3.2vw, 30px); margin: 44px 0 10px; padding-top: 12px; border-top: 2px solid var(--ink); }
h3 { font-size: 20px; margin: 28px 0 6px; }
.lede { font-size: 20px; max-width: 46rem; }
main p, main li { max-width: 46rem; }
.kicker { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0; }
html:lang(hi) .kicker, html:lang(ta) .kicker, html:lang(te) .kicker, html:lang(kn) .kicker, html:lang(ml) .kicker { letter-spacing: 0; text-transform: none; font-size: 14px; }

.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin: 24px 0; border-top: 1px solid var(--rule); }
.figure { padding: 14px 14px 14px 0; border-bottom: 1px solid var(--rule); }
.figure b { display: block; font: 700 34px/1.1 var(--serif); }
.figure span { color: var(--muted); font-size: 15px; }

.source { color: var(--muted); font-size: 14px; }
blockquote { margin: 16px 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--rule); max-width: 46rem; }
blockquote footer { color: var(--muted); font-size: 14px; margin-top: 6px; }

.timeline { list-style: none; padding: 0; margin: 16px 0; border-top: 1px solid var(--rule); }
.timeline li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); max-width: none; }
.timeline time { font-weight: 700; font-family: var(--serif); }

.perspectives { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); border-top: 1px solid var(--rule); }
.perspective { padding: 16px 20px 20px 0; border-bottom: 1px solid var(--rule); }
.perspective h3 { margin-top: 4px; }

.table-wrap { overflow-x: auto; max-width: 100%; margin: 12px 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--paper); }
thead th { font-weight: 600; border-bottom: 2px solid var(--ink); vertical-align: bottom; }
td.gain { color: var(--gain); font-weight: 600; }
td.loss { color: var(--loss); font-weight: 600; }
tfoot td { font-weight: 700; border-top: 2px solid var(--ink); }
/* A table of sentences reads left to right and wraps. */
table.text th, table.text td { text-align: left; white-space: normal; vertical-align: top; min-width: 11rem; }
table.text th:first-child, table.text td:first-child { min-width: 9rem; }

.lab { display: grid; gap: 24px; }
/* A grid item's default min-width is its content, so without this the wide
   table sets the column's width and the results run off the page. */
.lab > * { min-width: 0; }

.lab-controls fieldset { border: 0; border-top: 1px solid var(--rule); margin: 0; padding: 12px 0; }
.lab-controls legend { font-weight: 600; padding: 0; }
.lab-controls label { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; cursor: pointer; }
.lab-controls input[type="radio"] { margin-top: 6px; flex: none; }
.lab-controls label > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lab-controls input[type="number"] { font: inherit; width: 7rem; padding: 8px; min-height: 44px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); }
.lab-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border-top: 1px solid var(--rule); }
.lab-summary div { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--rule); }
.lab-summary b { display: block; font: 700 28px/1.1 var(--serif); }
.lab-summary span { color: var(--muted); font-size: 14px; }
.lab-note { font-size: 15px; color: var(--muted); }
.bar { display: inline-block; height: 10px; background: var(--bar); vertical-align: middle; }

.foot { border-top: 2px solid var(--ink); padding-top: 16px; padding-bottom: 40px; color: var(--muted); font-size: 14px; }
.foot p { margin: 4px 0; max-width: 60rem; }

@media print { .prefs, .primary, .theme { display: none; } body { background: #fff; color: #000; } }

/* ---------------------------------------------------------------- story */
:root { --z-north: #257de0; --z-central: #f47230; --z-east: #00b894; --z-northeast: #f2a600; --z-west: #ee7fac; --z-south: #008a17;
  --gain-1: #c9dcef; --gain-2: #6f9fcb; --gain-3: #2d5f8f; --loss-1: #f1d2c2; --loss-2: #d38b67; --loss-3: #9b4a26; --even: #dcd8cf; --women: #1d1c1a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --z-north: #338ced; --z-central: #e76624; --z-east: #00a888; --z-northeast: #d28e05; --z-west: #e24d8b; --z-south: #0aac23;
  --gain-1: #27405a; --gain-2: #3f6f9e; --gain-3: #8cb6dd; --loss-1: #4d3023; --loss-2: #9a5a3c; --loss-3: #e3a585; --even: #3a3833; --women: #ecebe5; } }
:root[data-theme="dark"] { --z-north: #338ced; --z-central: #e76624; --z-east: #00a888; --z-northeast: #d28e05; --z-west: #e24d8b; --z-south: #0aac23;
  --gain-1: #27405a; --gain-2: #3f6f9e; --gain-3: #8cb6dd; --loss-1: #4d3023; --loss-2: #9a5a3c; --loss-3: #e3a585; --even: #3a3833; --women: #ecebe5; }

.hero h1 { font-size: clamp(34px, 6vw, 60px); max-width: 18ch; margin-top: 12px; }
.step { margin-top: 56px; }
.step h2 { border-top: 0; padding-top: 0; margin-top: 0; }
.step p { font-size: 18px; }
.chart { margin: 20px 0 24px; max-width: 760px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart figcaption { color: var(--muted); font-size: 15px; margin-top: 8px; max-width: 46rem; }
.seat { stroke: var(--paper); stroke-width: 0.6; }
.z-north { fill: var(--z-north); background: var(--z-north); }
.z-central { fill: var(--z-central); background: var(--z-central); }
.z-east { fill: var(--z-east); background: var(--z-east); }
.z-northeast { fill: var(--z-northeast); background: var(--z-northeast); }
.z-west { fill: var(--z-west); background: var(--z-west); }
.z-south { fill: var(--z-south); background: var(--z-south); }
.seat.w { stroke: var(--women); stroke-width: 1.6; }
.house-n { font: 700 44px var(--serif); fill: var(--ink); }
.house-l { font: 15px var(--sans); fill: var(--muted); }
.legend { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--ink); font-size: 15px; }
.legend li { max-width: none; }
.legend .key, .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend .pct { color: var(--muted); }
.swatch.w { background: transparent; border: 2px solid var(--women); }
.swatch.gain-3 { background: var(--gain-3); border-radius: 2px; }
.swatch.loss-3 { background: var(--loss-3); border-radius: 2px; margin-left: 4px; }
.chart .label { font: 14px var(--sans); fill: var(--ink); }
.chart .value { font: 600 13px var(--sans); fill: var(--ink); }
.chart .axis { font: 13px var(--sans); fill: var(--muted); }
.chart .stem { stroke: var(--rule); stroke-width: 2; }
.chart .ref { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.tiles { max-width: 560px; }
.tile.even { fill: var(--even); }
.tile.gain-1 { fill: var(--gain-1); } .tile.gain-2 { fill: var(--gain-2); } .tile.gain-3 { fill: var(--gain-3); }
.tile.loss-1 { fill: var(--loss-1); } .tile.loss-2 { fill: var(--loss-2); } .tile.loss-3 { fill: var(--loss-3); }
.tile-code { font: 600 11.5px var(--sans); fill: var(--ink); }
.tile-val { font: 700 20px var(--serif); fill: var(--ink); }
.tile-code.on-dark, .tile-val.on-dark { fill: #ffffff; }
.toggle { display: inline-flex; border: 1px solid var(--ink); margin: 8px 0 0; }
.toggle button { font: inherit; font-size: 15px; padding: 8px 16px; min-height: 40px; background: transparent; color: var(--ink); border: 0; cursor: pointer; }
.toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 28px 32px; margin-top: 16px; }
.quotes blockquote { margin: 0; border-left: 3px solid var(--accent); padding: 2px 0 2px 16px; }
.quotes blockquote p { font: 20px/1.4 var(--serif); margin: 0; }
.cta { padding: 28px 0; }
.button { display: inline-block; background: var(--fill); color: var(--on-fill); padding: 12px 20px; text-decoration: none; font-weight: 600; }
p a.button { text-decoration: none; }
.notes { margin-top: 56px; font-size: 14px; color: var(--muted); }
.notes h2 { font-size: 18px; }
.notes li { max-width: 52rem; margin-bottom: 4px; }
sup a { text-decoration: none; font-size: 12px; padding: 0 2px; }

.lab .presets { flex-wrap: wrap; }
details.rules, details.every-state { border-top: 1px solid var(--rule); padding: 10px 0; }
details > summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.lab-tiles { max-width: 520px; }
.lab .presets { justify-self: start; }

.tiles-scroll { overflow-x: auto; max-width: 100%; }
.tiles-scroll .tiles { min-width: 460px; }
@media (max-width: 600px) { .primary { flex-wrap: wrap; overflow-x: visible; gap: 4px 18px; } .house-n { font-size: 52px; } .house-l { font-size: 20px; } }

/* ---------------------------------------------------------------- map-led story */
.scrolly { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; margin-top: 24px; }
.map-tools { align-self: flex-start; }
.scrolly-map { position: sticky; top: 0; height: 100vh; padding: 16px 0; display: flex; flex-direction: column; align-self: start; }
.map-host { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.map-host svg.india { flex: 1; min-height: 0; width: 100%; height: 100%; }
.map-caption { font-size: 15px; color: var(--ink); margin: 6px 0; max-width: none; min-height: 3em; }
.map-readout { font-size: 15px; font-weight: 600; margin: 4px 0; min-height: 1.4em; max-width: none; }
.map-small { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; color: var(--muted); }
.map-small li { max-width: none; }
.map-small .key { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 2px; vertical-align: -1px; }
.st { stroke: var(--paper); stroke-width: 1.2; cursor: pointer; transition: fill .35s ease; }
.st:hover { stroke: var(--ink); stroke-width: 2; }
.st.even, .key.even { fill: var(--even); background: var(--even); }
.st.gain-1, .key.gain-1 { fill: var(--gain-1); background: var(--gain-1); }
.st.gain-2, .key.gain-2 { fill: var(--gain-2); background: var(--gain-2); }
.st.gain-3, .key.gain-3 { fill: var(--gain-3); background: var(--gain-3); }
.st.loss-1, .key.loss-1 { fill: var(--loss-1); background: var(--loss-1); }
.st.loss-2, .key.loss-2 { fill: var(--loss-2); background: var(--loss-2); }
.st.loss-3, .key.loss-3 { fill: var(--loss-3); background: var(--loss-3); }
.st-label { font: 700 22px var(--sans); fill: var(--ink); pointer-events: none; }
.st-label.on-dark, .on-dark .tl-name, .on-dark .tl-val { fill: #ffffff; }
.tl-name { font: 600 14px var(--sans); fill: var(--ink); pointer-events: none; }
.tl-val { font: 700 26px var(--serif); fill: var(--ink); pointer-events: none; }
.scrolly-steps { padding: 30vh 0 40vh; }
.step-card { min-height: 70vh; padding: 20px 0 20px 18px; border-left: 4px solid transparent; transition: border-color .3s; }
.step-card.on { border-left-color: var(--accent); }
.step-card h2 { border-top: 0; margin-top: 4px; padding-top: 0; }
.step-card p { font-size: 18px; }
.step-card .big, .big { font: 700 clamp(44px, 7vw, 76px)/1 var(--serif); margin: 0 0 4px; letter-spacing: -0.02em; }
.big span { font-size: .45em; color: var(--muted); font-weight: 400; vertical-align: .35em; }

@media (max-width: 880px) {
  .scrolly { display: block; }
  .scrolly-map { position: sticky; top: 0; height: 52vh; z-index: 2; background: var(--paper); padding: 6px 0 4px; border-bottom: 1px solid var(--rule); }
  .map-small { display: none; }
  .map-caption { font-size: 13px; min-height: 0; margin: 2px 0; }
  .map-readout { font-size: 13px; }
  .scrolly-steps { padding: 4vh 0 20vh; }
  .step-card { min-height: 60vh; padding-left: 0; border-left: 0; }
  /* The bold version for phones: one big number leads each step. */
  .step-card .big { font-size: 64px; color: var(--accent); }
  .st-label { font-size: 34px; }
  .step-card h2 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { .st, .step-card { transition: none; } }
.wordmark { display: inline-flex; align-items: center; gap: 12px; }
.logo { width: 46px; height: 26px; color: var(--accent); flex: none; }
.foot-links a { color: var(--muted); }
.prefs { justify-content: flex-end; }
.prefs .langs { margin-right: auto; }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 0; border-top: 2px solid var(--ink); margin: 28px 0; }
.compare .col { padding: 16px 20px 16px 0; border-bottom: 1px solid var(--rule); }
.compare .col.on .big { color: var(--accent); }
.big.small { font-size: 40px; }
.votebar { position: relative; margin: 32px 0 20px; }
.vb { display: flex; height: 48px; font-size: 15px; }
.vb span { display: flex; align-items: center; padding: 0 12px; white-space: nowrap; overflow: hidden; }
.vb b { margin-right: 6px; font-size: 20px; }
.vb-for { background: var(--fill); color: var(--on-fill); }
.vb-against { background: var(--even); color: var(--ink); }
.vb-line { position: absolute; top: -10px; height: 68px; border-left: 2px dashed var(--ink); }
.vb-line span { position: absolute; top: -22px; left: 6px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.facts { list-style: none; padding: 0; border-top: 1px solid var(--rule); }
.facts > div { display: grid; grid-template-columns: 12rem 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--muted); font-size: 15px; }
.facts dd { margin: 0; max-width: 46rem; }
@media (max-width: 600px) { .facts > div { grid-template-columns: 1fr; gap: 2px; } }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; margin: 16px 0; }
.card { background: var(--surface); padding: 18px 20px; border-top: 3px solid var(--accent); }
.card h3 { margin-top: 0; }
.articles { border-top: 2px solid var(--ink); margin-top: 24px; }
.article { border-bottom: 1px solid var(--rule); }
.article summary { display: grid; grid-template-columns: 5.5rem 1fr; gap: 16px; padding: 18px 0; cursor: pointer; list-style: none; font-weight: 400; }
.article summary::-webkit-details-marker { display: none; }
.art-no { font: 700 34px/1 var(--serif); color: var(--accent); }
.art-h { display: block; font-family: var(--serif); font-weight: 700; font-size: 19px; margin-bottom: 4px; }
.article blockquote { margin-left: 5.5rem; }
@media (max-width: 600px) { .article summary { grid-template-columns: 4rem 1fr; } .article blockquote { margin-left: 0; } .vb span { font-size: 13px; } }

/* ================================================================ Look C
 * Dark Lok Sabha green, saffron and cream, Fraunces for display. Chosen by the
 * owner on 29 November. Bands are full width; the dark and saffron bands keep
 * their colours in both themes, cream sections follow the theme. */
@font-face { font-family: "Fraunces"; src: url(../fonts/fraunces-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --serif: "Fraunces", Georgia, "Noto Serif", serif;
  --paper: #f4efe4; --surface: #fffdf8; --ink: #1b1a17; --muted: #57524a; --rule: #d8d0c0;
  --accent: #0f6b52; --fill: #0f2a22; --on-fill: #f4efe4; --rust: #b23a0b;
  --green: #0f2a22; --green-2: #1d4a3c; --sun: #f4b53f; --cream: #f4efe4; --on-green-muted: #cfc8b8;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #101a16; --surface: #17231e; --ink: #efe9dc; --muted: #b8b0a0; --rule: #34413a; --accent: #7fd1b3; --rust: #f0a47d; } }
:root[data-theme="dark"] { --paper: #101a16; --surface: #17231e; --ink: #efe9dc; --muted: #b8b0a0; --rule: #34413a; --accent: #7fd1b3; --rust: #f0a47d; }

body { background: var(--paper); }
.prefs { max-width: none; background: var(--green); color: var(--cream); border-bottom: 0; padding: 8px 24px; }
.prefs .theme { color: var(--cream); border-color: #4b6a5f; }
.masthead { max-width: none; background: var(--green); padding: 18px 24px 0; border-bottom: 0; }
.masthead > * { max-width: 72rem; margin-left: auto; margin-right: auto; }
.wordmark { color: var(--cream); font-family: var(--serif); font-weight: 700; display: flex; }
.logo { color: var(--sun); }
.tagline { color: var(--on-green-muted); }
.primary a { color: var(--cream); }
.primary a:hover { color: var(--sun); }
.primary a[aria-current] { border-bottom-color: var(--sun); }
main { max-width: none; padding: 0; }
main > :not(.band):not(script) { max-width: 72rem; margin-left: auto; margin-right: auto; padding-left: 16px; padding-right: 16px; }
main > h1:first-child, main > :first-child:not(.band) { padding-top: 32px; }
main > :last-child:not(.band) { padding-bottom: 56px; }
h1, h2, h3 { font-family: var(--serif); }
h1 { font-weight: 800; letter-spacing: -0.015em; }
h2 { border-top: 0; padding-top: 0; }
.big, .figure b, .house-n { font-family: var(--serif); }

.band { padding: 64px 0; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 16px; }
.band.dark { background: radial-gradient(ellipse at 50% 90%, var(--green-2) 0, var(--green) 62%); color: var(--cream); }
.band.dark a { color: var(--sun); }
.band.dark .kick { color: var(--sun); }
.band.dark .legend, .band.dark figcaption { color: var(--cream); }
.band.dark .legend .pct { color: var(--on-green-muted); }
.band.dark .house-n { fill: var(--sun); }
.band.dark .house-l { fill: var(--on-green-muted); }
.band.dark .seat { stroke: var(--green); }
.band.dark .seat.w { stroke: var(--cream); stroke-width: 1.8; }
.band.dark .swatch.w { border-color: var(--cream); }
.band.sun { background: var(--sun); color: #1b1a17; }
.band.sun .kick { color: #0f2a22; }
.band.sun a { color: #0f2a22; }
.band.sun .map-caption, .band.sun .map-readout, .band.sun .map-small { color: #1b1a17; }
.band.sun .st { stroke: var(--sun); }
.band.sun .st-label { fill: #1b1a17; }
.band.sun .toggle { border-color: #1b1a17; }
.band.sun .toggle button { color: #1b1a17; }
.band.sun .toggle button[aria-pressed="true"] { background: #1b1a17; color: var(--sun); }
.band.sun .step-card.on { border-left-color: #0f2a22; }
.band-h { font-size: clamp(32px, 5vw, 56px); line-height: 1.05; margin: 0 0 16px; max-width: 22ch; }
.kick { text-transform: uppercase; letter-spacing: .12em; font-size: 13px; font-weight: 700; margin: 0 0 10px; color: var(--accent); }

.hero-c { text-align: center; padding: 48px 0 40px; }
.hero-c h1 { font-size: clamp(42px, 7.5vw, 96px); line-height: 1; margin: 6px auto 16px; max-width: 16ch; }
.hero-c .lede { margin: 0 auto; color: var(--on-green-muted); max-width: 40rem; }
.hero-c .chart { margin: 28px auto 0; max-width: 820px; }
.hero-c .legend { justify-content: center; }
.hero-c .house-n { font-size: 64px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-c .actions { justify-content: center; }
.button { display: inline-block; padding: 13px 22px; font: 600 16px var(--sans); text-decoration: none; border: 2px solid transparent; cursor: pointer; }
.button.sun, .band.dark a.button.sun { background: var(--sun); color: #1b1a17; }
.button.ghost, .band.dark a.button.ghost { background: transparent; color: var(--cream); border-color: var(--cream); }
.band:not(.dark) .button.ghost { color: var(--ink); border-color: var(--ink); }

.figures.strip { border-top: 0; gap: 0; margin: 0 0 48px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.strip .figure { background: var(--surface); border: 1px solid var(--rule); padding: 20px; margin: -1px 0 0 -1px; }
.strip .figure b { font-size: 46px; color: var(--rust); font-weight: 800; }
.findings { list-style: none; padding: 0; margin: 16px 0 0; border-top: 2px solid var(--ink); counter-reset: f; }
.findings li { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; gap: 16px 24px; align-items: start; padding: 22px 0; border-bottom: 1px solid var(--rule); max-width: none; counter-increment: f; }
.findings li::before { content: counter(f, decimal-leading-zero); font: 13px ui-monospace, Menlo, monospace; color: var(--muted); padding-top: 6px; }
.findings p { font: 600 20px/1.4 var(--serif); margin: 0 0 6px; max-width: 40rem; }
.findings a { font-size: 15px; font-weight: 600; color: var(--ink); }
.findings b { font: 800 clamp(30px, 4vw, 46px)/1 var(--serif); color: var(--rust); white-space: nowrap; text-align: right; }
.findings b span { font-size: .45em; color: var(--muted); font-weight: 400; }
@media (max-width: 700px) { .findings li { grid-template-columns: 2rem 1fr; } .findings b { grid-column: 2; text-align: left; } }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px; align-items: center; }
@media (max-width: 880px) { .two-col { grid-template-columns: 1fr; } }
.on-dark-toggle { border-color: var(--cream); margin: 8px 0 24px; }
.on-dark-toggle button { color: var(--cream); }
.on-dark-toggle button[aria-pressed="true"] { background: var(--cream); color: var(--green); }
.band.dark p, .band.dark h3 { max-width: 40rem; }
.cta { text-align: left; }
.foot { max-width: none; background: var(--green); color: var(--on-green-muted); border-top: 0; padding: 28px 24px 40px; }
.foot p { max-width: 72rem; margin-left: auto; margin-right: auto; }
.foot a, .foot-links a { color: var(--cream); }
.scrolly { margin-top: 8px; }
@media (max-width: 880px) { .band.sun .scrolly-map { background: var(--sun); border-bottom-color: #1b1a17; } }
.notice { max-width: 72rem; }
/* The saffron band keeps the same inks in both themes. */
.band.sun .big, .band.sun .step-card .big { color: #0f2a22; }
.band.sun .big span { color: #3d3a33; }
.band.sun h3, .band.sun p { color: #1b1a17; }
@media (max-width: 600px) { .figures.strip { grid-template-columns: 1fr 1fr; } .strip .figure { padding: 14px; } .strip .figure b { font-size: 34px; } .strip .figure span { font-size: 13px; } }
/* Header controls: outline buttons on the green bar; the chosen one is marked
   by a saffron icon and ring, never a solid fill. */
.prefs { display: flex; align-items: center; gap: 10px; position: relative; }
.theme-switch { display: inline-flex; border: 1px solid #4b6a5f; border-radius: 999px; padding: 2px; gap: 2px; }
.theme-switch button { background: transparent; border: 0; border-radius: 999px; color: #cfd8d3; width: 34px; height: 32px; display: grid; place-items: center; cursor: pointer; }
.theme-switch button:hover { color: var(--cream); }
.theme-switch button[aria-pressed="true"] { background: rgba(244,181,63,.16); color: var(--sun); box-shadow: inset 0 0 0 1px var(--sun); }
.theme-switch svg, .a11y summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.a11y summary svg .dot { fill: currentColor; stroke: none; }
.a11y { position: static; }
.a11y summary { list-style: none; display: inline-flex; gap: 8px; align-items: center; color: #cfd8d3; border: 1px solid #4b6a5f; border-radius: 999px; padding: 0 14px 0 10px; height: 38px; cursor: pointer; font-size: 14px; }
.a11y summary:hover { color: var(--cream); }
.a11y summary::-webkit-details-marker { display: none; }
.a11y[open] summary { color: var(--sun); border-color: var(--sun); background: rgba(244,181,63,.12); }
.a11y-panel { position: absolute; right: 24px; top: calc(100% + 4px); z-index: 30; width: 340px; background: #12302a; color: var(--cream); border: 1px solid #4b6a5f; box-shadow: 0 12px 32px rgba(0,0,0,.35); padding: 6px 18px 14px; }
.a11y-head { margin: 8px 0 2px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--sun); font-weight: 700; }
.a11y-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid #2e4d43; background: none; color: inherit; font: inherit; font-size: 15px; text-align: left; }
.seg { display: inline-flex; border: 1px solid #6f8a80; border-radius: 999px; overflow: hidden; }
.seg button { font: inherit; font-size: 14px; background: transparent; color: var(--cream); border: 0; min-width: 44px; height: 36px; cursor: pointer; }
.seg button + button { border-left: 1px solid #6f8a80; }
.seg button:hover { background: rgba(255,255,255,.08); }
.a11y-row #dys-font-btn { font: inherit !important; font-size: 14px !important; height: 36px !important; min-width: 52px !important; padding: 0 12px !important; background: transparent !important; color: var(--cream) !important; border: 1px solid #6f8a80 !important; border-radius: 999px !important; opacity: 1 !important; box-shadow: none !important; }
.a11y-row #dys-font-btn[aria-pressed="true"] { color: #1b1a17 !important; background: var(--sun) !important; border-color: var(--sun) !important; }
.a11y-toggle { cursor: pointer; }
.a11y-toggle i { flex: none; position: relative; width: 44px; height: 26px; border-radius: 999px; background: #2e4d43; box-shadow: inset 0 0 0 1px #6f8a80; transition: background .15s; }
.a11y-toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--cream); transition: transform .15s; }
.a11y-toggle[aria-pressed="true"] i { background: var(--sun); box-shadow: none; }
.a11y-toggle[aria-pressed="true"] i::after { transform: translateX(18px); background: #1b1a17; }
.a11y-more { margin: 12px 0 0; font-size: 14px; }
.a11y-more a { color: var(--sun); }
.a11y-panel :focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }
@media (max-width: 560px) {
  .a11y summary { padding: 0; width: 38px; justify-content: center; }
  .a11y summary span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .a11y-panel { left: 0; right: 0; width: auto; top: 100%; border-left: 0; border-right: 0; padding: 4px 16px 16px; }
}
html.ul a { text-decoration: underline !important; text-underline-offset: 2px; }
html.still *, html.still *::before, html.still *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }

/* Text size from the accessibility menu: the whole page scales, so charts and
   their labels grow with the text. */
body { zoom: var(--zoom, 1); }
.state-hero h1 { font-size: clamp(40px, 7vw, 84px); line-height: 1; margin: 6px 0 14px; }
.state-hero .lede { color: var(--on-green-muted); }
.on-dark-strip { margin: 28px 0 0; }
.on-dark-strip .figure { background: rgba(255,255,255,.06); border-color: #35574a; }
.on-dark-strip .figure b { color: var(--sun); }
.on-dark-strip .figure span { color: var(--on-green-muted); }
.state-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0 24px; border-top: 1px solid var(--rule); }
.state-list li { max-width: none; border-bottom: 1px solid var(--rule); }
.state-list a { display: flex; align-items: center; gap: 10px; padding: 12px 0; color: var(--ink); text-decoration: none; font-weight: 600; }
.state-list a:hover { color: var(--accent); }
.sl-n { margin-left: auto; font: 700 18px var(--serif); color: var(--rust); white-space: nowrap; }
.zdot { width: 12px; height: 12px; border-radius: 50%; flex: none; }

/* Inside the state: districts and constituencies */
.inside h3 { font-family: var(--serif); font-size: 1.35rem; margin: 2rem 0 .5rem; }
.inside .lede-sm { font-size: 1.1rem; max-width: 46rem; }
.inside .note { font-size: .9rem; color: var(--muted); max-width: 46rem; }
.dist-single .table-scroll, .dist-single .note, .pcs-single .table-scroll, .pcs-single .note { display: none; }
.dtable, .ptable { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.dtable caption, .ptable caption { text-align: left; font-size: .85rem; color: var(--muted); padding-bottom: .4rem; }
.dtable th, .dtable td, .ptable th, .ptable td { padding: .45rem .5rem; border-bottom: 1px solid var(--rule); text-align: right; vertical-align: middle; }
.dtable th[scope="row"], .ptable th[scope="row"] { overflow-wrap: anywhere; }
.dtable th[scope="row"], .ptable th[scope="row"], .dtable thead th:first-child, .ptable thead th:first-child { text-align: left; font-weight: 500; }
.dtable thead th, .ptable thead th { font-size: .78rem; font-weight: 600; color: var(--muted); vertical-align: bottom; line-height: 1.25; }
.dtable td.hl { font-weight: 700; width: 34%; }
.ptable td.dev { width: 44%; }
.cellbar { display: flex; align-items: center; gap: .5rem; justify-content: flex-end; }
.cellbar .track { position: relative; flex: 1; height: .6rem; min-width: 2.5rem; }
.cellbar > span:last-child { flex: none; min-width: 2.6rem; text-align: right; }
.dtable .bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--sun); }
.track.mid::before { content: ""; position: absolute; left: 50%; top: -.3rem; bottom: -.3rem; border-left: 1px solid var(--muted); }
.ptable .dbar { position: absolute; top: 0; bottom: 0; }
.ptable .dev.up .dbar { left: 50%; background: #b5651d; }
.ptable .dev.down .dbar { right: 50%; background: #2f7d6b; }
.ptable .dnum { font-weight: 600; }
.ptable tr.nodata td { text-align: left; color: var(--muted); font-style: italic; }
@media (max-width: 560px) { .dtable, .ptable { font-size: .85rem; } .dtable th, .dtable td, .ptable th, .ptable td { padding: .4rem .3rem; } }
.dtable, .ptable { table-layout: fixed; }
.dtable th:nth-child(1) { width: 31%; } .dtable th:nth-child(2) { width: 17%; } .dtable th:nth-child(3) { width: 12%; } .dtable th:nth-child(4) { width: 28%; } .dtable th:nth-child(5) { width: 12%; }
.ptable th:nth-child(1) { width: 40%; } .ptable th:nth-child(2) { width: 20%; } .ptable th:nth-child(3) { width: 40%; }
.dtable td.hl, .ptable td.dev { width: auto; }
.cellbar .track { min-width: 1rem; }
.cellbar > span:last-child { min-width: 2.3rem; }
.dtable thead th, .ptable thead th { white-space: normal; overflow-wrap: break-word; }
.dtable th:nth-child(1) { width: 29%; } .dtable th:nth-child(2) { width: 16%; } .dtable th:nth-child(3) { width: 14%; } .dtable th:nth-child(4) { width: 26%; } .dtable th:nth-child(5) { width: 15%; }
.dnote { display: block; font-size: .78rem; color: var(--muted); font-weight: 400; }

/* Data page */
.dl-item, .dl-paper { border-top: 1px solid var(--rule); padding: 14px 0; }
.dl-item h3, .dl-paper h3 { font-family: var(--serif); font-size: 1.15rem; margin: 0 0 .3rem; }
.dl-item p, .dl-paper p { margin: .2rem 0; max-width: 46rem; }
.dl-meta { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.paper-none { display: none; }

/* Map labels use the ink of their actual fill, independent of the page band.
   The dark theme reverses the ramp, so its strongest fills need dark ink. */
:root { --map-ink: #161b19; --map-inverse: #ffffff; }
.label-even, .label-gain-1, .label-gain-2, .label-loss-1, .label-loss-2 { --map-label: var(--map-ink); }
.label-gain-3, .label-loss-3 { --map-label: var(--map-inverse); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.label-even,.label-gain-1,.label-gain-2,.label-loss-1,.label-loss-2) { --map-label: var(--map-inverse); }
  :root:not([data-theme="light"]) :is(.label-gain-3,.label-loss-3) { --map-label: var(--map-ink); }
}
:root[data-theme="dark"] :is(.label-even,.label-gain-1,.label-gain-2,.label-loss-1,.label-loss-2) { --map-label: var(--map-inverse); }
:root[data-theme="dark"] :is(.label-gain-3,.label-loss-3) { --map-label: var(--map-ink); }
.st-label, .band.sun .st-label, .tl-name, .tl-val, .tile-code, .tile-val { fill: var(--map-label, var(--ink)); }
.band.sun .st:hover { stroke: #0f2a22; }
.map-small[hidden] { display: none; }

/* A wider editorial canvas with readable individual text columns. */
:root { --page-width: 86rem; --gutter: clamp(1rem, 3vw, 3rem); }
.wrap, .masthead > *, .foot p, main > :not(.band):not(script), .notice {
  max-width: var(--page-width);
}
.wrap, main > :not(.band):not(script) { padding-inline: var(--gutter); }
.masthead, .prefs, .foot { padding-inline: var(--gutter); }
.hero-grid > *, .editorial-columns > *, .download-grid > *, .state-detail-grid > * { min-width: 0; }
.hero-copy .kick { margin-inline: auto; }
.band-h { max-width: 28ch; }
.figures.strip { gap: 12px; }
.strip .figure { margin: 0; border-radius: 6px; }
.button { border-radius: 4px; }
.button:hover { text-decoration: underline; text-underline-offset: 3px; }
.primary a { padding-block: 8px; }
.download-grid, .state-detail-grid { display: grid; gap: 16px; }
.download-grid .dl-item, .dl-paper, .state-detail-grid > section {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 20px;
}
.state-detail-grid > section h2 { margin-top: 0; }
.download-grid .dl-item h3 { overflow-wrap: anywhere; }
.articles .article { min-width: 0; }
@media (min-width: 881px) {
  .hero-c { padding-block: 68px; text-align: left; }
  .hero-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.15fr); align-items: center; gap: clamp(24px, 4vw, 64px); }
  .hero-copy .kick, .hero-c h1, .hero-c .lede, .hero-c .chart { margin-inline: 0; }
  .hero-c h1 { font-size: clamp(44px, 5.5vw, 88px); max-width: 15ch; }
  .hero-c .actions, .hero-c .legend { justify-content: flex-start; }
  .hero-c .chart { margin-top: 0; max-width: none; }
  .findings { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; border-top: 0; }
  .findings li { grid-template-columns: 2rem minmax(0,1fr); gap: 12px; padding: 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; }
  .findings b { grid-column: 2; text-align: left; white-space: normal; overflow-wrap: anywhere; }
  .findings li:last-child { grid-column: 1 / -1; }
  .editorial-columns, .download-grid, .state-detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
  .editorial-columns p { margin-block: 0 1rem; }
  .notes ol { columns: 2; column-gap: 3rem; }
  .notes li { break-inside: avoid; }
  .scrolly { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px,4vw,56px); }
  .lab { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 24px; }
  .lab > .presets, .lab > .lab-summary, .lab > .lab-out, .lab > .rules { grid-column: 1 / -1; }
  .lab > .chart { margin: 0; max-width: none; padding: 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; }
  .lab-house { grid-row: 3; grid-column: 1; }
  .lab > .lab-summary { grid-row: 2; }
  .lab > .chart:not(.lab-house) { grid-row: 3; grid-column: 2; }
  .lab-controls { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 20px; }
  .articles { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; border-top: 0; align-items: start; }
  .article { border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); padding-inline: 18px; }
  .article[open] { grid-column: 1 / -1; }
  .article blockquote { max-width: 70ch; }
}
@media (max-width: 880px) {
  .hero-grid { display: block; }
  .findings li b { white-space: normal; overflow-wrap: anywhere; }
  .map-host svg.india { min-width: 0; }
  .figures.strip { gap: 8px; }
}
@media print {
  .hero-grid, .findings, .editorial-columns, .download-grid, .state-detail-grid, .lab, .articles { display: block; }
}

.documentation-grid { display: grid; gap: 18px; margin-block: 24px 48px; }
.doc-panel { min-width: 0; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); padding: clamp(16px, 2.5vw, 28px); }
.doc-panel h2 { margin: 0 0 12px; }
.doc-panel ul { padding-inline-start: 1.3rem; }
.doc-panel li { overflow-wrap: anywhere; }
@media (min-width: 881px) { .documentation-grid { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; } }

/* Research atlas: data panels and native, keyboard-accessible controls. */
.atlas-section { margin-top: 56px; padding-bottom: 40px; scroll-margin-top: 24px; }
.atlas-grid { display: grid; gap: 20px; align-items: start; }
.atlas-panel { min-width: 0; padding: clamp(16px,2.5vw,28px); background: var(--surface); border: 1px solid var(--rule); border-top: 4px solid var(--accent); border-radius: 6px; }
.atlas-panel h3 { margin: 0 0 8px; font-size: 1.5rem; }
.atlas-panel label { display: block; color: var(--muted); font-weight: 600; font-size: .9rem; }
.atlas-panel select { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 10px; width: 100%; min-height: 44px; margin: 6px 0 18px; }
.atlas-stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(110px,1fr)); gap: 8px; margin-bottom: 16px; }
.atlas-metric { padding: 10px; background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; }
.atlas-metric b { display: block; font: 700 clamp(1rem,2vw,1.5rem)/1.2 var(--serif); color: var(--accent); overflow-wrap: anywhere; }
.atlas-metric span { font-size: .8rem; color: var(--muted); }
.atlas-rows { display: grid; gap: 12px; }
.atlas-panel:first-child .atlas-rows { max-height: 32rem; overflow-y: auto; padding: 4px 8px 4px 0; }
.atlas-row-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; font-size: .9rem; }
.atlas-row-head > div { min-width: 0; overflow-wrap: anywhere; }
.atlas-row-head b { text-align: right; font-variant-numeric: tabular-nums; }
.atlas-row-head small { display: block; color: var(--muted); }
.atlas-track { background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; height: 12px; margin-top: 5px; overflow: hidden; }
.atlas-track span { display: block; height: 100%; background: var(--bar); }
@media (min-width: 881px) { .atlas-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }

/* Compact desktop resource pages; keep reading order and mobile layout. */
@media screen and (min-width: 881px) {
  body[data-page="data"] .band { padding-block: 32px 40px; }
  body[data-page="data"] .wrap, body[data-page="sources"] main > :not(script) { max-width: 96rem; }
  body[data-page="data"] .lede, body[data-page="sources"] .lede { max-width: 75ch; }
  body[data-page="data"] .download-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%, 17rem),1fr)); gap: 12px; align-items: start; }
  body[data-page="data"] .download-grid .dl-item, body[data-page="data"] .dl-paper { padding: 14px 16px; }
  body[data-page="data"] .wrap > h2, body[data-page="data"] .wrap > div > h2 { margin-block: 24px 12px; }
  body[data-page="sources"] .documentation-grid { display: block; columns: 2; column-gap: 16px; margin-block: 20px 32px; }
  body[data-page="sources"] .doc-panel { display: inline-block; width: 100%; box-sizing: border-box; break-inside: avoid; margin: 0 0 16px; padding: 18px 20px; }
  body[data-page="sources"] .doc-panel :is(p,li) { max-width: none; overflow-wrap: anywhere; }
  body[data-page="sources"] .doc-panel p:last-child, body[data-page="sources"] .doc-panel ul:last-child { margin-bottom: 0; }
}
@media screen and (min-width: 1450px) {
  body[data-page="sources"] .documentation-grid { columns: 3; }
}

/* Editorial legal pages: continuous rows rather than uneven card grids. */
@media screen and (min-width: 881px) {
  body[data-page="the-law"] .articles { display: block; border-top: 2px solid var(--ink); margin-top: 20px; }
  body[data-page="the-law"] .article { border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; padding-inline: 0; background: transparent; }
  body[data-page="the-law"] .article summary { grid-template-columns: 6rem minmax(0,1fr); padding: 16px 0; gap: 20px; }
  body[data-page="the-law"] .article summary > span:last-child { max-width: 90ch; }
  body[data-page="the-law"] .article blockquote { margin-left: 7.25rem; max-width: 85ch; }
  body[data-page="the-bills"] .cards { display: block; columns: 2; column-gap: 16px; }
  body[data-page="the-bills"] .cards .card { display: inline-block; width: 100%; box-sizing: border-box; break-inside: avoid; margin-bottom: 16px; padding: 16px 20px; }
  body[data-page="the-bills"] .cards .card p:last-child { margin-bottom: 0; }
  body[data-page="the-bills"] .facts dd { max-width: 85ch; }
  body[data-page="the-bills"] .facts > div { grid-template-columns: minmax(12rem, 22%) minmax(0,1fr); }
  body[data-page="the-bills"] .chart.votebar { max-width: 64rem; }
}
/* Clear affordance only for expandable legal entries. */
.article summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.article:has(blockquote) summary .art-h::after { content: " +"; color: var(--accent); }
.article[open]:has(blockquote) summary .art-h::after { content: " −"; }

.map-profile { position: relative; margin: 8px 0 12px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); color: var(--ink); }
.map-profile[hidden] { display: none; }
.map-profile h3, .band.sun .map-profile h3 { color: var(--ink); margin: 0 0 6px; padding-right: 60px; }
.map-profile p, .band.sun .map-profile p { color: var(--ink); margin: 6px 0; font-size: .9rem; }
.map-profile a { color: var(--accent); }
.map-profile button { position: absolute; top: 10px; right: 10px; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); padding: 5px 9px; cursor: pointer; }
.map-host [role="button"] { cursor: pointer; }
.map-host [role="button"]:focus-visible { outline: 2px solid currentColor; }

/* Resource and metric rows distribute remaining width, including final rows. */
@media screen and (min-width: 881px) {
  body[data-page="data"] .download-grid, .lab-summary, .figures.strip { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
  body[data-page="data"] .download-grid > * { flex: 1 1 17rem; min-width: 0; }
  .lab-summary > * { flex: 1 1 10rem; min-width: 0; }
  .figures.strip > * { flex: 1 1 12rem; min-width: 0; }
  .quotes { display: block; columns: 2; column-gap: 24px; }
  .quotes blockquote { break-inside: avoid; margin: 0 0 18px; }
}

/* Legal reference: a single reading column with a clear article-number rail. */
body[data-page="the-law"] main > :not(script) { max-width: 76rem; }
body[data-page="the-law"] .articles { display: block; border-top: 1px solid var(--rule); margin-block: 24px; }
body[data-page="the-law"] .article { border: 0; border-bottom: 1px solid var(--rule); background: transparent; border-radius: 0; padding: 0; }
body[data-page="the-law"] .article summary, body[data-page="the-law"] .article-static { display: grid; grid-template-columns: clamp(3.5rem, 9vw, 6rem) minmax(0,1fr); gap: clamp(12px,2vw,24px); padding: 20px 0; align-items: start; }
body[data-page="the-law"] .article summary > span:last-child { max-width: none; }
body[data-page="the-law"] .art-no { font-size: clamp(24px,3vw,34px); }
body[data-page="the-law"] .art-h { font-size: 1.25rem; margin-bottom: 8px; }
body[data-page="the-law"] .article blockquote { margin: 0 0 20px calc(clamp(3.5rem, 9vw, 6rem) + clamp(12px,2vw,24px)); padding: 14px 18px; background: var(--surface); max-width: none; }
@media screen and (max-width: 600px) { body[data-page="the-law"] .article blockquote { margin-left: 0; } }

/* State index: labelled comparison figures, with room for long state names. */
.state-list { grid-template-columns: repeat(auto-fit,minmax(min(100%, 340px),1fr)); }
.state-list a { flex-wrap: wrap; }
.state-list .sl-n { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; width: 100%; margin: 2px 0 0; text-align: center; }
.sl-n small { display: block; font: 500 12px/1.4 system-ui,sans-serif; color: var(--ink); }

/* Off the Roll, in the footer */
.foot .otr { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; background: #0f2a22; color: #f6efe0; padding: 18px 20px; margin: 0 0 18px; border-left: 6px solid var(--sun); }
.foot .otr p { margin: 0; max-width: 40rem; font-size: 1rem; line-height: 1.45; color: #f6efe0; }
.foot .otr .button { flex: none; text-decoration: none; }

/* ---------------------------------------------------------------------------
   Restraint (30 November). Set beside Off the Roll the site read as loud:
   17px body, 20px ledes, 16px buttons, a three-row header 300px tall on a
   phone, and findings set in bold display type. This layer brings the scale
   down to Off the Roll's: 16px body, small tracked labels, one compact header,
   and display type kept for headlines and figures only.
   --------------------------------------------------------------------------- */
body { font-size: 16px; line-height: 1.6; }
h1 { font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -0.01em; }
h3 { font-size: 18px; }
.lede { font-size: 18px; line-height: 1.55; }
.kick, .kicker { font: 500 12px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; }
.button { font-size: 15px; padding: 10px 16px; border-radius: 6px; }
.note, .source, figcaption { font-size: 13.5px; line-height: 1.5; }

/* One compact header. */
.prefs { padding-block: 6px; font-size: 14px; }
.masthead { padding-top: 6px; }
.wordmark { font-size: 22px; gap: 9px; letter-spacing: -0.01em; }
.wordmark .logo { width: 30px; height: auto; }
.tagline { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.primary { flex-wrap: wrap; overflow-x: visible; gap: 0 20px; padding-bottom: 4px; margin-top: 4px; }
.primary::-webkit-scrollbar { display: none; }
.primary a { font-size: 15px; padding-block: 7px; }
.band-h { font-size: clamp(26px, 3.4vw, 40px); }
@media (min-width: 900px) {
  .prefs { position: absolute; top: 0; right: 0; left: auto; z-index: 30; background: transparent; padding-block: 12px; }
  .masthead { padding-top: 12px; }
  .masthead > .wordmark { display: inline-flex; vertical-align: middle; margin: 0 28px 0 0; }
  .masthead > .primary { display: inline-flex; vertical-align: middle; margin: 0; max-width: calc(100% - 290px); }
  .masthead { padding-bottom: 10px; padding-right: 270px; }
  .a11y-panel { right: var(--gutter); }
}

/* Hero: left-aligned, a calmer headline. */
.hero-c { text-align: left; padding-block: 36px 40px; }
.hero-copy .kick, .hero-c h1, .hero-c .lede { margin-inline: 0; }
.hero-c .actions, .hero-c .legend { justify-content: flex-start; }
.hero-c h1 { font-size: clamp(36px, 5.2vw, 68px); line-height: 1.04; max-width: 17ch; }
.state-hero h1 { font-size: clamp(34px, 5vw, 60px); }
@media (min-width: 881px) { .hero-c { padding-block: 52px; } .hero-c h1 { font-size: clamp(40px, 4.6vw, 68px); } }

/* Figures strip: flat cells divided by rules, as on Off the Roll. */
.strip .figure { border-radius: 0; }
.strip .figure b { font-size: clamp(26px, 3vw, 36px); font-weight: 700; }
.strip .figure span { font-size: 13px; line-height: 1.4; }

/* Findings: reading text, with the figure as the one accent. */
.findings { display: block; border-top: 2px solid var(--ink); }
.findings li, .findings li:last-child { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: 6px 20px; padding: 16px 0; background: none; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; }
.findings p { font: 400 16px/1.55 var(--sans); max-width: 44rem; }
.findings a { font-size: 14px; }
.findings b { font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; grid-column: auto; text-align: right; white-space: nowrap; }
@media (max-width: 700px) { .findings li, .findings li:last-child { grid-template-columns: 1.6rem minmax(0, 1fr); } .findings b { grid-column: 2; text-align: left; white-space: normal; } }

/* Fewer boxes: download and state panels sit on rules, not cards. */
.download-grid .dl-item, .dl-paper, .state-detail-grid > section { background: none; border: 0; border-top: 1px solid var(--rule); border-radius: 0; padding: 16px 0; }
.dl-item h3, .dl-paper h3 { font-size: 17px; }

/* Bills page: tracker and questions */
.tracker { width: 100%; }
.tracker th[scope="row"] { text-align: left; white-space: nowrap; font-weight: 600; }
.tracker td { text-align: left; }
.tag { display: inline-block; font: 600 12px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; padding: 4px 8px; border: 1px solid var(--rule); color: var(--muted); }
.tag.done { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tag.now { border-color: var(--accent); color: var(--accent); }
.faq { display: grid; gap: 0 32px; }
.faq > div { border-top: 1px solid var(--rule); padding: 12px 0 8px; }
.faq h3 { margin: 0 0 4px; font-size: 17px; }
.faq p { margin: 0 0 8px; max-width: 40rem; }
@media (min-width: 881px) { .faq { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tracker th, .tracker td { white-space: normal; }
.tracker th[scope="row"] { white-space: nowrap; width: 1%; }
.tracker td:last-child { white-space: nowrap; width: 1%; }
@media (max-width: 640px) {
  .tracker th, .tracker td { padding: 10px 6px; }
  .tracker th[scope="row"] { white-space: normal; width: 24%; font-size: 14px; }
  .tracker td:last-child { width: 24%; text-align: right; }
  .tracker thead th:last-child { text-align: right; }
  .tag { font-size: 10.5px; padding: 3px 5px; letter-spacing: .02em; }
}
.tracker thead th { text-align: left; } .tracker thead th:last-child { text-align: right; }

/* Indian scripts. No font is downloaded: each page uses the reader's own
 * font for the script (Nirmala UI on Windows, the system fonts on Apple and
 * Android, Noto elsewhere). Tracking and capitals are for Latin letters only. */
html:lang(hi) { --indic: "Noto Sans Devanagari", "Nirmala UI", "Kohinoor Devanagari", "Mangal", sans-serif; }
html:lang(ta) { --indic: "Noto Sans Tamil", "Nirmala UI", "Tamil Sangam MN", "Latha", sans-serif; }
html:lang(te) { --indic: "Noto Sans Telugu", "Nirmala UI", "Telugu Sangam MN", "Gautami", sans-serif; }
html:lang(kn) { --indic: "Noto Sans Kannada", "Nirmala UI", "Kannada Sangam MN", "Tunga", sans-serif; }
html:lang(ml) { --indic: "Noto Sans Malayalam", "Nirmala UI", "Malayalam Sangam MN", "Kartika", sans-serif; }
html:lang(hi) body, html:lang(ta) body, html:lang(te) body, html:lang(kn) body, html:lang(ml) body,
html:lang(hi) h1, html:lang(hi) h2, html:lang(hi) h3, html:lang(ta) h1, html:lang(ta) h2, html:lang(ta) h3,
html:lang(te) h1, html:lang(te) h2, html:lang(te) h3, html:lang(kn) h1, html:lang(kn) h2, html:lang(kn) h3,
html:lang(ml) h1, html:lang(ml) h2, html:lang(ml) h3,
html:lang(hi) .big, html:lang(ta) .big, html:lang(te) .big, html:lang(kn) .big, html:lang(ml) .big {
  font-family: var(--indic), var(--sans), sans-serif; letter-spacing: 0; }
html:lang(hi) body, html:lang(ta) body, html:lang(te) body, html:lang(kn) body, html:lang(ml) body { line-height: 1.75; }
html:lang(hi) h1, html:lang(hi) h2, html:lang(hi) h3, html:lang(ta) h1, html:lang(ta) h2, html:lang(ta) h3,
html:lang(te) h1, html:lang(te) h2, html:lang(te) h3, html:lang(kn) h1, html:lang(kn) h2, html:lang(kn) h3,
html:lang(ml) h1, html:lang(ml) h2, html:lang(ml) h3 { line-height: 1.45; }
html:lang(hi) .kick, html:lang(ta) .kick, html:lang(te) .kick, html:lang(kn) .kick, html:lang(ml) .kick,
html:lang(hi) .tag, html:lang(ta) .tag, html:lang(te) .tag, html:lang(kn) .tag, html:lang(ml) .tag,
html:lang(hi) .a11y-head, html:lang(ta) .a11y-head, html:lang(te) .a11y-head, html:lang(kn) .a11y-head, html:lang(ml) .a11y-head {
  letter-spacing: 0; text-transform: none; font-family: var(--indic), sans-serif; }

/* Language menu: one button showing the current language, a list beneath it. */
.langmenu { position: relative; }
.langmenu summary { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid currentColor; color: var(--cream, inherit); cursor: pointer; list-style: none; font-weight: 600; }
.langmenu summary::-webkit-details-marker { display: none; }
.langmenu summary::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
.langmenu[open] summary::after { transform: rotate(225deg); }
.langmenu summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.langmenu summary:focus-visible, .langlist a:focus-visible { outline: 3px solid var(--sun, #f2a541); outline-offset: 2px; }
.langlist { position: absolute; z-index: 30; left: 0; top: calc(100% + 4px); min-width: 180px; margin: 0; padding: 4px 0; list-style: none; background: var(--paper, #fff); color: var(--ink, #111); border: 2px solid var(--ink, #111); }
.langlist a { display: block; padding: 10px 16px; color: var(--ink, #111); text-decoration: none; }
.langlist a:hover, .langlist a:focus-visible { background: var(--sun, #f2a541); color: #111; }
.langlist a[aria-current] { font-weight: 700; }
.langlist a[aria-current]::before { content: "\2713\00a0"; }

/* Choose a state: a floating button on phones while the map is on screen,
   opening a list of every state and Union Territory. */
.state-fab { display: none; }
@media (max-width: 899px) {
  .state-fab.on:not([hidden]) { display: inline-flex; align-items: center; gap: 8px; position: fixed; right: 16px; bottom: 20px; z-index: 40; padding: 13px 20px; border: 0; border-radius: 999px; background: var(--fill); color: var(--on-fill); font: 600 1rem var(--sans); box-shadow: 0 6px 18px rgba(0,0,0,.28); cursor: pointer; }
  .state-fab:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
}
.state-sheet { width: min(32rem, calc(100vw - 24px)); max-height: 82vh; padding: 0; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); color: var(--ink); }
.state-sheet::backdrop { background: rgba(0,0,0,.45); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px 6px; position: sticky; top: 0; background: var(--surface); }
.sheet-head h2 { margin: 0; font-size: 1.1rem; }
.sheet-head button { background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: 6px; padding: 6px 12px; font: inherit; cursor: pointer; }
.sheet-search { display: block; padding: 6px 16px 10px; position: sticky; top: 48px; background: var(--surface); }
.sheet-search span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.sheet-search input { width: 100%; box-sizing: border-box; padding: 10px 12px; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; }
.sheet-list { list-style: none; margin: 0; padding: 0 8px 12px; }
.sheet-list li[hidden] { display: none; }
.sheet-list button { display: block; width: 100%; text-align: start; padding: 12px 10px; font: inherit; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--rule); cursor: pointer; }
.sheet-list button:hover, .sheet-list button:focus-visible { background: var(--paper); color: var(--accent); }

/* Install button: shown only when the browser says the site can be installed. */
.install-row { margin: 8px 0 0; }
[data-install][hidden] { display: none !important; }
.install-row { display: none; }

/* Documentation: a sidebar, the page, and an "on this page" list. Static
 * pages built from docs/*.md by scripts/docs.py; no script is needed to read them. */
.docs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; max-width: 1280px; margin: 0 auto; padding: 24px 16px 56px; }
.docs-side { min-width: 0; }
.docs-search input { width: 100%; box-sizing: border-box; min-height: 44px; padding: 8px 12px; font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 0; }
.docs-search input:focus-visible { outline: 3px solid var(--sun, #f2a541); outline-offset: 2px; }
.docs-results ul { list-style: none; margin: 10px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.docs-results li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.docs-results li a { font-weight: 700; }
.docs-results li p, .docs-none { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.docs-toc { margin-top: 14px; }
.docs-toc summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; border-bottom: 2px solid var(--ink); }
.docs-toc ul, .docs-on ul { list-style: none; margin: 0 0 8px; padding: 0; }
.docs-toc li a, .docs-on li a { display: block; padding: 7px 10px 7px 12px; text-decoration: none; color: var(--ink); border-left: 3px solid transparent; }
.docs-toc li a:hover, .docs-on li a:hover { background: var(--wash, rgba(127,127,127,.12)); }
.docs-toc li a[aria-current="page"] { border-left-color: var(--accent); font-weight: 700; color: var(--accent); }
.docs-group { margin: 18px 0 4px; font: 700 12px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.docs-body { min-width: 0; max-width: 820px; }
.docs-body h1 { margin: 0 0 16px; }
.docs-body h2 { margin: 2em 0 .5em; padding-top: .6em; border-top: 2px solid var(--ink); }
.docs-body h3 { margin: 1.6em 0 .4em; }
.docs-body p, .docs-body li { line-height: 1.7; }
.docs-body li { margin: .25em 0; }
.docs-body a { text-decoration: underline; text-underline-offset: 2px; }
.docs-body .anchor { margin-right: 6px; text-decoration: none; opacity: 0; color: var(--muted); }
.docs-body h2:hover .anchor, .docs-body h3:hover .anchor, .docs-body .anchor:focus { opacity: 1; }
.docs-body code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 1px 5px; background: var(--wash, rgba(127,127,127,.14)); }
.docs-body pre { margin: 1em 0; padding: 14px 16px; overflow-x: auto; background: var(--wash, rgba(127,127,127,.14)); border-left: 4px solid var(--accent); }
.docs-body pre code { padding: 0; background: none; }
.docs-body blockquote { margin: 1em 0; padding: 2px 16px; border-left: 4px solid var(--accent); background: var(--wash, rgba(127,127,127,.1)); }
.docs-table { overflow-x: auto; margin: 1em 0; }
.docs-table:focus-visible, .docs-body pre:focus-visible { outline: 3px solid var(--sun, #f2a541); outline-offset: 2px; }
.docs-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.docs-table th, .docs-table td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); white-space: normal; }
.docs-table th { border-bottom: 2px solid var(--ink); font-weight: 700; }
.docs-edit { margin-top: 2.5em; font-size: 14px; }
.docs-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.docs-pn a { display: block; padding: 12px 14px; border: 2px solid var(--ink); text-decoration: none; color: var(--ink); font-weight: 700; }
.docs-pn a:hover { background: var(--wash, rgba(127,127,127,.12)); }
.docs-pn small { display: block; font-weight: 400; color: var(--muted); }
.docs-pn .next { text-align: right; grid-column: 2; }
.docs-on { display: none; }
.docs-on .docs-group { margin-top: 0; }
@media (min-width: 900px) {
  .docs { grid-template-columns: 280px minmax(0, 1fr); gap: 40px; padding-top: 36px; }
  .docs-side { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow-y: auto; }
  .docs-toc summary { display: none; }
  .docs-toc { margin-top: 6px; }
}
@media (min-width: 1240px) {
  .docs { grid-template-columns: 280px minmax(0, 1fr) 220px; }
  .docs-on { display: block; position: sticky; top: 16px; align-self: start; font-size: 14px; }
}
.docs-body h2, .docs-body h3 { position: relative; }
.docs-body .anchor { position: absolute; left: -1.2em; margin: 0; }
@media (max-width: 899px) { .docs-body .anchor { display: none; } }

/* Read more: grouped lists of sources. */
.read-note { font-size: 14px; color: var(--muted); margin-top: -4px; }
.read-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.read-jump a { display: inline-block; padding: 8px 12px; border: 2px solid var(--ink); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; }
.read-jump a:hover, .read-jump a:focus-visible { background: var(--sun, #f2a541); color: #111; }
.read-group { margin: 40px 0; scroll-margin-top: 16px; }
.read-group > h2 { margin-bottom: 4px; padding-top: 14px; border-top: 2px solid var(--ink); }
.read-lede { color: var(--muted); margin: 0 0 6px; }
.read-list { list-style: none; margin: 0; padding: 0; }
.read-list li { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.read-title { font-weight: 700; font-size: 1.05rem; text-underline-offset: 2px; }
.read-meta { margin: 4px 0 6px; font-size: 14px; color: var(--muted); }
.read-list p { margin: 0 0 6px; }
.read-list blockquote { margin: 8px 0 0; padding: 2px 14px; border-left: 4px solid var(--accent); }
.read-badge { display: inline-block; margin: 4px 8px 0 0; padding: 2px 8px; font: 600 12px/1.5 var(--sans); border: 1px solid var(--rule); color: var(--muted); }

/* Section menu. From 900px the sections show in the header as before. Below
 * that, with scripts on, they fold behind a three-line button; the docs link and
 * the install button live in the menu. Without scripts the sections stay visible. */
.menu-btn, .nav-extra { display: none; }
@media (max-width: 1099px) {
  .masthead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
  .masthead > .wordmark { margin: 0; }
  .masthead > .primary { flex: 0 0 100%; }
  .menu-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 0 0 auto; padding: 0 14px; font: 700 15px/1 var(--sans); color: var(--cream, #fff); background: transparent; border: 2px solid currentColor; cursor: pointer; }
  .menu-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
  .menu-btn:focus-visible { outline: 3px solid var(--sun, #f2a541); outline-offset: 2px; }
  .js .masthead > .primary { display: none; }
  .js .masthead > .primary.open { display: flex; flex-direction: column; gap: 0; margin: 10px 0 6px; border-top: 1px solid currentColor; }
  .js .primary.open a, .js .primary.open .nav-extra { display: block; padding: 13px 4px; border-bottom: 1px solid rgba(255,255,255,.25); text-decoration: none; }
  .js .primary.open button.nav-extra { display: block; margin: 12px 0 4px; text-align: left; }
}
@media (min-width: 1100px) { .menu-btn, .primary .nav-extra { display: none !important; } }

/* The preference controls (language, accessibility, theme) are their own row
 * above the header, so they can never sit on top of the section links. */
@media (min-width: 900px) {
  .prefs { position: static; background: var(--green); padding-block: 8px; }
  .masthead { padding-right: var(--gutter); padding-top: 14px; }
  .masthead > .primary { max-width: calc(100% - 300px); }
}

/* Install prompt: a bar at the foot of the page when the browser says the site can be installed,
 * and a button in the top bar. Both stay hidden otherwise. */
.install-bar[hidden], .install-top[hidden] { display: none !important; }
.install-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px var(--gutter, 16px); background: var(--green, #0f2a22); color: var(--cream, #fff); border-top: 3px solid var(--sun, #f2a541); box-shadow: 0 -2px 0 rgba(0,0,0,.2); }
.install-bar p { margin: 0; flex: 1 1 260px; font-size: 15px; line-height: 1.5; color: inherit; }
.install-bar > div { display: flex; gap: 10px; flex-wrap: wrap; }
.install-bar .button.ghost { color: var(--cream, #fff); border-color: currentColor; background: transparent; }
.install-top { min-height: 38px; padding: 0 14px; font: 700 14px/1 var(--sans); color: var(--cream, #fff); background: transparent; border: 2px solid var(--sun, #f2a541); cursor: pointer; }
.install-top:focus-visible { outline: 3px solid var(--sun, #f2a541); outline-offset: 2px; }
@media (max-width: 1099px) { .install-top { display: none; } }
@media print { .install-bar { display: none; } }

/* The header band ends with a line, and the Menu button sits inside it with room below. */
.masthead { padding-bottom: 16px; border-bottom: 4px solid var(--sun, #f2a541); }
@media (min-width: 1100px) { .masthead { padding-bottom: 12px; } }
/* "Contents" on a phone is a control that opens the list: a chevron says so. */
.docs-toc summary { justify-content: space-between; gap: 12px; list-style: none; }
.docs-toc summary::-webkit-details-marker { display: none; }
.docs-toc summary::after { content: ""; width: 9px; height: 9px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
.docs-toc[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.docs-search { margin-bottom: 4px; }
.docs-toc { margin-top: 18px; }
@media (min-width: 900px) { .docs-toc summary::after { display: none; } }
