/* Fix the NC Legislature — site styles
   Mobile-first. No inline styles anywhere (the server CSP is default-src 'self'). */

:root {
  --navy: #0b2a5b;
  --navy-2: #143c7c;
  --gold: #f5b82e;
  --red: #bf0a30;

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --text: #1b2333;
  --muted: #5a6478;
  --line: #d9dee8;
  --link: #1a4fa3;
  --accent: var(--navy);
  --accent-text: #ffffff;
  --highlight: #fff4d6;

  --party-a: #1f8a7a;   /* teal   */
  --party-b: #d98a1c;   /* amber  */
  --party-c: #7a55b8;   /* violet */
  --party-d: #4f6d8f;   /* slate  */
  --party-e: #c0507a;   /* rose   */
  --party-f: #6b8e23;   /* olive  */
  --gold-voter: #e8a317;
  --purple-voter: #6d4bb0;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .06);
  --maxw: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1320;
    --surface: #161d2e;
    --surface-2: #1e2740;
    --text: #e6e9f2;
    --muted: #a3acc2;
    --line: #2b3550;
    --link: #8fb4ff;
    --accent: #f5b82e;
    --accent-text: #0e1320;
    --highlight: #3a3115;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: 2px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 5.5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3.6vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li { margin-bottom: .4em; }
strong { font-weight: 650; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--gold); color: #000; padding: .5rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy);
  color: #fff;
  border-bottom: 3px solid var(--gold);
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand img { width: 64px; height: auto; flex: none; background: #fff; border-radius: 6px; padding: 3px 4px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 750; font-size: 1.05rem; }
.brand-tag { font-size: .78rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.menu-btn {
  display: none;
  background: transparent; color: #fff;
  border: 1px solid rgba(255, 255, 255, .45); border-radius: 10px;
  padding: .45rem .8rem; font: inherit; font-size: .95rem; cursor: pointer;
}
.js .menu-btn { display: inline-flex; align-items: center; gap: .4rem; }
.menu-btn .bars, .menu-btn .bars::before, .menu-btn .bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
}
.menu-btn .bars::before, .menu-btn .bars::after { content: ""; position: absolute; left: 0; }
.menu-btn .bars::before { top: -6px; }
.menu-btn .bars::after { top: 6px; }

.site-nav ul { list-style: none; margin: 0; padding: 0 0 12px; display: flex; flex-wrap: wrap; gap: 4px; }
.js .site-nav { display: none; }
.js .nav-open .site-nav { display: block; }
.site-nav li { margin: 0; }
.site-nav a {
  display: block; color: #fff; text-decoration: none;
  padding: .6rem .8rem; border-radius: 8px; font-size: .98rem;
}
.js .site-nav ul { flex-direction: column; }
.site-nav a:hover { background: rgba(255, 255, 255, .1); }
.site-nav a[aria-current="page"] { background: rgba(255, 255, 255, .14); box-shadow: inset 3px 0 0 var(--gold); }

@media (min-width: 900px) {
  .js .menu-btn { display: none; }
  .js .site-nav, .site-nav { display: block; }
  .header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .site-nav ul, .js .site-nav ul { flex-direction: row; padding: 0; gap: 2px; }
  .site-nav a { padding: .45rem .7rem; font-size: .93rem; }
  .site-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--gold); }
}

/* ---------- Page structure ---------- */
main { padding: 28px 0 40px; }

.page-head { padding: 8px 0 18px; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .5rem;
}
.lede { font-size: clamp(1.08rem, 2.4vw, 1.25rem); color: var(--muted); max-width: 46rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 0 0 22px;
}
@media (min-width: 700px) { .card { padding: 28px 32px; } }
.card > :last-child { margin-bottom: 0; }

.prose { max-width: 46rem; }

.grid { display: grid; gap: 16px; }
@media (min-width: 700px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.grid > .card { margin: 0; }

.callout {
  border-left: 4px solid var(--gold);
  background: var(--highlight);
  padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 0 0 1em;
}
.callout > :last-child { margin-bottom: 0; }

.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: 36px 0 40px;
  margin-top: -28px;
  margin-bottom: 28px;
}
.hero h1 { color: #fff; max-width: 18ch; }
.hero h1 .hl { color: var(--gold); }
.hero p { color: rgba(255, 255, 255, .88); font-size: clamp(1.05rem, 2.6vw, 1.25rem); max-width: 40rem; }
.hero-grid { display: grid; gap: 24px; align-items: center; }
.hero-map { width: 100%; max-width: 420px; justify-self: center; background: #fff; border-radius: 12px; padding: 10px 12px; }
@media (min-width: 860px) {
  .hero { padding: 56px 0 60px; }
  .hero-grid { grid-template-columns: 1.3fr 1fr; }
}

.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 650;
  padding: .75rem 1.15rem; border-radius: 10px; border: 2px solid transparent;
  font: inherit; font-weight: 650; cursor: pointer; line-height: 1.2;
}
.btn-gold { background: var(--gold); color: #1b1300; }
.btn-gold:hover { filter: brightness(1.05); }
.btn-ghost { border-color: rgba(255, 255, 255, .6); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.btn-plain { background: var(--surface-2); color: var(--text); border-color: var(--line); padding: .5rem .85rem; font-size: .92rem; }
.btn-plain:hover { border-color: var(--muted); }
.btn-plain[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* ---------- Stats ---------- */
.stats { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 0 0 1em; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stat { background: var(--surface-2); border-radius: 12px; padding: 16px 18px; }
.stat-num { font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-label { font-size: .93rem; color: var(--muted); margin-top: 4px; }

/* ---------- Steps ---------- */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 14px; }
@media (min-width: 800px) { .steps.steps-row { grid-template-columns: repeat(3, 1fr); } }
.steps > li {
  counter-increment: step; position: relative; margin: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 18px 64px; box-shadow: var(--shadow);
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 16px; top: 16px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-text); font-weight: 800;
}
.steps h3 { margin-bottom: .35em; font-size: 1.08rem; }
.steps p { margin: 0; color: var(--muted); }
.steps p + p { margin-top: .6em; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 1em; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .95rem; }
th, td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { background: var(--surface-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--line); border-bottom: 0; }
td.win { background: var(--highlight); font-weight: 700; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }

/* ---------- Party colours (classes only) ---------- */
.p0 { background: var(--party-a); } .p1 { background: var(--party-b); } .p2 { background: var(--party-c); }
.p3 { background: var(--party-d); } .p4 { background: var(--party-e); } .p5 { background: var(--party-f); }

/* ---------- Seat dots ---------- */
.seats { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 4px; }
.seat { width: 18px; height: 18px; border-radius: 50%; background: var(--line); flex: none; }
.seats.lg .seat { width: 24px; height: 24px; }
.seat.empty { background: transparent; border: 2px dashed var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; color: var(--muted); margin: 6px 0 0; padding: 0; list-style: none; }
.legend li { margin: 0; }

/* ---------- Chamber diagram ---------- */
.districts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0; }
.district { background: var(--surface-2); border-radius: 10px; padding: 10px 6px; text-align: center; }
.district-name { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.district .seats { justify-content: center; gap: 3px; }
.district .seat { width: 10px; height: 10px; background: var(--accent); }
@media (min-width: 700px) { .district .seat { width: 13px; height: 13px; } }
.big-num { font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--accent); }

/* ---------- Gerrymander demo ---------- */
.gm-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.gm-layout { display: grid; gap: 18px; align-items: start; }
@media (min-width: 780px) { .gm-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.gm-grid {
  display: grid; grid-template-columns: repeat(10, 1fr);
  width: 100%; max-width: 460px; aspect-ratio: 2 / 1;
  border: 3px solid var(--text); border-radius: 4px; overflow: hidden;
}
.gm-cell { position: relative; display: grid; place-items: center; border: 0 solid var(--text); }
.gm-cell::after { content: ""; width: 56%; height: 56%; border-radius: 50%; }
.gm-cell.g::after { background: var(--gold-voter); }
.gm-cell.v::after { background: var(--purple-voter); border-radius: 3px; transform: rotate(45deg) scale(.85); }
.gm-cell.d0 { background: rgba(127, 127, 127, .05); } .gm-cell.d1 { background: rgba(127, 127, 127, .16); }
.gm-cell.d2 { background: rgba(127, 127, 127, .05); } .gm-cell.d3 { background: rgba(127, 127, 127, .16); }
.gm-cell.d4 { background: rgba(127, 127, 127, .28); }
.gm-cell.bt { border-top-width: 3px; } .gm-cell.bb { border-bottom-width: 3px; }
.gm-cell.bl { border-left-width: 3px; } .gm-cell.br { border-right-width: 3px; }
.gm-grid .gm-cell.edge-t { border-top-width: 0; } .gm-grid .gm-cell.edge-b { border-bottom-width: 0; }
.gm-grid .gm-cell.edge-l { border-left-width: 0; } .gm-grid .gm-cell.edge-r { border-right-width: 0; }
.gm-result { font-size: 1.6rem; font-weight: 800; margin: 0 0 .2em; }
.gm-result .g { color: var(--gold-voter); } .gm-result .v { color: var(--purple-voter); }
@media (prefers-color-scheme: dark) { .gm-result .v { color: #a98ae6; } }
.gm-key { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; padding: 0; margin: 10px 0 0; font-size: .92rem; color: var(--muted); }
.gm-key li { margin: 0; display: flex; align-items: center; gap: 6px; }
.dot-g, .dot-v { display: inline-block; width: 12px; height: 12px; }
.dot-g { background: var(--gold-voter); border-radius: 50%; }
.dot-v { background: var(--purple-voter); border-radius: 2px; transform: rotate(45deg) scale(.85); }
.gm-dlist { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; font-size: .95rem; font-variant-numeric: tabular-nums; }
.gm-dlist li { margin: 0; }

/* ---------- Ballot mock ---------- */
.ballot {
  max-width: 420px; background: #fffdf7; color: #1b1b1b;
  border: 2px solid #1b1b1b; border-radius: 6px; padding: 16px 18px;
  font-family: Georgia, "Times New Roman", serif;
}
.ballot h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid #1b1b1b; padding-bottom: 6px; }
.ballot .instr { font-size: .85rem; font-style: italic; margin-bottom: 10px; }
.ballot ul { list-style: none; padding: 0; margin: 0; }
.ballot li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px dotted #888; margin: 0; }
.ballot li:last-child { border-bottom: 0; }
.oval { flex: none; width: 26px; height: 16px; border: 2px solid #1b1b1b; border-radius: 50%; margin-top: 4px; }
.oval.filled { background: #1b1b1b; }
.ballot .names { font-size: .8rem; color: #555; display: block; }

/* ---------- Calculator ---------- */
.calc-controls { display: grid; gap: 14px; }
.field label, .field .label { display: block; font-size: .85rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
input[type="text"], input[type="number"], select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 9px; padding: .55rem .7rem;
}
input:focus, select:focus, .btn:focus-visible, .menu-btn:focus-visible, a:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}
.party-rows { display: grid; gap: 8px; }
.party-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) minmax(0, 1.2fr) 40px; gap: 8px; align-items: center; }
.party-row .swatch { margin: 0; width: 14px; height: 36px; border-radius: 4px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font-size: 1.2rem; cursor: pointer; line-height: 1;
}
.icon-btn:hover { border-color: var(--muted); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.quota-box { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; margin: 0 0 14px; font-variant-numeric: tabular-nums; }
.quota-box .formula { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95rem; word-break: break-word; }
.quota-box .q { font-size: 1.5rem; font-weight: 800; color: var(--accent); }
.calc-out { margin-top: 18px; }
.noscript-note { display: block; }
.js .noscript-note { display: none; }
.needs-js { display: none; }
.js .needs-js { display: block; }

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }

.formula-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface-2); border-radius: 10px; padding: 14px 16px; margin: 0 0 1em; overflow-x: auto; font-size: .98rem;
}

/* ---------- Compare ---------- */
.compare { display: grid; gap: 14px; }
@media (min-width: 700px) { .compare { grid-template-columns: 1fr 1fr; } }
.compare > div { border-radius: 12px; padding: 16px 18px; border: 1px solid var(--line); background: var(--surface-2); }
.compare h3 { font-size: 1rem; }
.compare .now { border-top: 4px solid var(--muted); }
.compare .new { border-top: 4px solid var(--gold); }
.compare ul { margin: 0; }

/* ---------- FAQ ---------- */
details.faq { border-bottom: 1px solid var(--line); padding: 4px 0; }
details.faq:last-of-type { border-bottom: 0; }
details.faq summary { cursor: pointer; font-weight: 650; padding: 10px 0; list-style-position: outside; }
details.faq[open] summary { color: var(--accent); }
details.faq > div { padding: 0 0 12px; color: var(--text); }
details.faq > div > :last-child { margin-bottom: 0; }

/* ---------- Pager / footer ---------- */
.pager { display: grid; gap: 10px; margin-top: 8px; }
@media (min-width: 640px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a {
  display: block; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow);
}
.pager a:hover { border-color: var(--accent); }
.pager .dir { display: block; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.pager .ttl { font-weight: 700; color: var(--link); }
.pager .next { text-align: right; }
@media (min-width: 640px) { .pager .next:only-child { grid-column: 2; } }

.site-footer { background: var(--navy); color: rgba(255, 255, 255, .8); padding: 22px 0; font-size: .9rem; border-top: 3px solid var(--gold); }
.site-footer a { color: #fff; }
.site-footer p { margin: 0 0 .4em; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media print {
  .site-header, .site-footer, .pager, .menu-btn, .needs-js { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  .hero { background: none; color: #000; }
  .hero h1, .hero p { color: #000; }
}

/* key/value table (wraps on small screens) */
table.kv td { white-space: normal; text-align: left; vertical-align: top; }
table.kv td:first-child { width: 34%; }

/* ---------- Fixes after visual review ---------- */
/* Party colours must beat the neutral .seat background */
.seat.p0 { background: var(--party-a); } .seat.p1 { background: var(--party-b); } .seat.p2 { background: var(--party-c); }
.seat.p3 { background: var(--party-d); } .seat.p4 { background: var(--party-e); } .seat.p5 { background: var(--party-f); }

/* Region diagrams: never wider than the card */
.districts { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.district { padding: 8px 4px; }
.district-name { font-size: .62rem; letter-spacing: 0; overflow-wrap: anywhere; }
.district .seats { gap: 2px; }
.district .seat { width: 8px; height: 8px; }
.district .small { font-size: .75rem; }
@media (min-width: 480px) { .district .seat { width: 10px; height: 10px; } .district-name { font-size: .72rem; } }
@media (min-width: 700px) { .district .seat { width: 12px; height: 12px; } .districts { gap: 8px; } }

#how { margin: 8px 0 26px; }
.hero .eyebrow { color: var(--gold); opacity: .9; }
@media (max-width: 479px) { .brand-tag { display: none; } .brand img { width: 52px; } }

.scroll-hint { display: none; font-size: .8rem; color: var(--muted); margin: -4px 0 6px; }
@media (max-width: 760px) { .scroll-hint { display: block; } }
.grid { margin-bottom: 22px; }

/* ---------- 2026 votes vs seats chart ---------- */
:root { --dem: #2a6fd1; --rep: #c8382e; --oth: #8a8f9c; }
@media (prefers-color-scheme: dark) { :root { --dem: #4a8cf0; --rep: #e0554a; --oth: #7d8496; } }
.vs-D { background: var(--dem); } .vs-R { background: var(--rep); } .vs-O { background: var(--oth); }
.vs-chart { margin: 8px 0 18px; }
.vs-chamber { margin: 0 0 14px; }
.vs-chamber h3 { font-size: 1.02rem; margin-bottom: .45em; }
.vs-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 8px; margin: 0 0 6px; }
.vs-lbl { font-size: .85rem; color: var(--muted); font-weight: 650; }
.vs-bar { position: relative; display: flex; gap: 2px; height: 34px; }
.vs-seg { position: relative; display: flex; align-items: center; justify-content: center; min-width: 3px; outline-offset: 2px; }
.vs-seg:first-child { border-radius: 4px 0 0 4px; } .vs-seg:last-of-type { border-radius: 0 4px 4px 0; }
.vs-val { font-size: .8rem; font-weight: 700; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.vs-maj { position: absolute; left: 50%; top: -5px; bottom: -5px; width: 0; border-left: 2px dashed var(--text); pointer-events: none; }
.vs-maj-key { display: inline-block; width: 0; height: 14px; border-left: 2px dashed var(--text); margin: 0 6px 0 4px; vertical-align: -2px; }
.vs-legend { margin-top: 10px; }
.vs-seg[data-tip]:hover::after, .vs-seg[data-tip]:focus::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); font-size: .8rem; font-weight: 600; line-height: 1.35;
  padding: 6px 9px; border-radius: 7px; width: max-content; max-width: 240px; white-space: normal; z-index: 5; pointer-events: none;
}
@media (min-width: 900px) { .stats.stats-4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 640px) and (max-width: 899px) { .stats.stats-4 { grid-template-columns: repeat(2, 1fr); } }
.stats-4 .stat-num { font-size: 1.7rem; }
/* segment widths (percent of bar), class-based because the CSP blocks style attributes */
.w0{flex:0 1 0} .w1{flex:1 1 0} .w2{flex:2 1 0} .w3{flex:3 1 0} .w4{flex:4 1 0} .w5{flex:5 1 0} .w6{flex:6 1 0} .w7{flex:7 1 0} .w8{flex:8 1 0} .w9{flex:9 1 0} .w10{flex:10 1 0} .w11{flex:11 1 0} .w12{flex:12 1 0} .w13{flex:13 1 0} .w14{flex:14 1 0} .w15{flex:15 1 0} .w16{flex:16 1 0} .w17{flex:17 1 0} .w18{flex:18 1 0} .w19{flex:19 1 0} .w20{flex:20 1 0} .w21{flex:21 1 0} .w22{flex:22 1 0} .w23{flex:23 1 0} .w24{flex:24 1 0} .w25{flex:25 1 0} .w26{flex:26 1 0} .w27{flex:27 1 0} .w28{flex:28 1 0} .w29{flex:29 1 0} .w30{flex:30 1 0} .w31{flex:31 1 0} .w32{flex:32 1 0} .w33{flex:33 1 0} .w34{flex:34 1 0} .w35{flex:35 1 0} .w36{flex:36 1 0} .w37{flex:37 1 0} .w38{flex:38 1 0} .w39{flex:39 1 0} .w40{flex:40 1 0} .w41{flex:41 1 0} .w42{flex:42 1 0} .w43{flex:43 1 0} .w44{flex:44 1 0} .w45{flex:45 1 0} .w46{flex:46 1 0} .w47{flex:47 1 0} .w48{flex:48 1 0} .w49{flex:49 1 0} .w50{flex:50 1 0} .w51{flex:51 1 0} .w52{flex:52 1 0} .w53{flex:53 1 0} .w54{flex:54 1 0} .w55{flex:55 1 0} .w56{flex:56 1 0} .w57{flex:57 1 0} .w58{flex:58 1 0} .w59{flex:59 1 0} .w60{flex:60 1 0} .w61{flex:61 1 0} .w62{flex:62 1 0} .w63{flex:63 1 0} .w64{flex:64 1 0} .w65{flex:65 1 0} .w66{flex:66 1 0} .w67{flex:67 1 0} .w68{flex:68 1 0} .w69{flex:69 1 0} .w70{flex:70 1 0} .w71{flex:71 1 0} .w72{flex:72 1 0} .w73{flex:73 1 0} .w74{flex:74 1 0} .w75{flex:75 1 0} .w76{flex:76 1 0} .w77{flex:77 1 0} .w78{flex:78 1 0} .w79{flex:79 1 0} .w80{flex:80 1 0} .w81{flex:81 1 0} .w82{flex:82 1 0} .w83{flex:83 1 0} .w84{flex:84 1 0} .w85{flex:85 1 0} .w86{flex:86 1 0} .w87{flex:87 1 0} .w88{flex:88 1 0} .w89{flex:89 1 0} .w90{flex:90 1 0} .w91{flex:91 1 0} .w92{flex:92 1 0} .w93{flex:93 1 0} .w94{flex:94 1 0} .w95{flex:95 1 0} .w96{flex:96 1 0} .w97{flex:97 1 0} .w98{flex:98 1 0} .w99{flex:99 1 0} .w100{flex:100 1 0}
.compare { margin-bottom: 18px; }

/* NC outline: no white box — trace the state's shape with a gold edge so the white and navy
   parts of the flag both stand out against the navy header/hero. */
.brand img {
  background: none; padding: 0; border-radius: 0;
  filter: drop-shadow(1px 0 0 var(--gold)) drop-shadow(-1px 0 0 var(--gold))
          drop-shadow(0 1px 0 var(--gold)) drop-shadow(0 -1px 0 var(--gold));
}
.hero-map {
  background: none; padding: 0; border-radius: 0;
  filter: drop-shadow(2px 0 0 var(--gold)) drop-shadow(-2px 0 0 var(--gold))
          drop-shadow(0 2px 0 var(--gold)) drop-shadow(0 -2px 0 var(--gold))
          drop-shadow(0 8px 18px rgba(0, 0, 0, .35));
}
