:root {
  --surface-0: #f6f5f1;
  --surface-1: #fcfcfb;
  --line: #e4e3df;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #77766f;
  --golf: #2a78d6;
  --cem: #eb6834;
  --mid: #f0efec;
  --div-golf: #1c5cab;
  --div-cem: #c0302f;
  --accent: #1c5cab;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface-0: #121211; --surface-1: #1a1a19; --line: #2f2f2c;
    --text-primary: #f0efec; --text-secondary: #c3c2b7; --text-muted: #9a998f;
    --golf: #3987e5; --cem: #d95926; --mid: #383835; --div-golf: #5598e7; --div-cem: #e66767;
    --accent: #86b6ef; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface-0: #121211; --surface-1: #1a1a19; --line: #2f2f2c;
  --text-primary: #f0efec; --text-secondary: #c3c2b7; --text-muted: #9a998f;
  --golf: #3987e5; --cem: #d95926; --mid: #383835; --div-golf: #5598e7; --div-cem: #e66767;
  --accent: #86b6ef; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--surface-0); color: var(--text-primary);
  font: 16px/1.55 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 700; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: -.01em; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; font-weight: 500; }
a { color: var(--accent); }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: var(--text-muted); margin: 0 0 .6rem; }
.lede { font-size: 1.15rem; color: var(--text-secondary); max-width: 46rem; }
.top { padding: 56px 0 24px; border-bottom: 1px solid var(--line); background: var(--surface-1); }
.toc { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 20px; font-size: .9rem; }
.toc a { color: var(--text-secondary); text-decoration: none; border-bottom: 1px solid transparent; }
.toc a:hover { border-color: currentColor; }
.section { padding: 44px 0 8px; }
.card { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 16px 0; }
.note { color: var(--text-muted); font-size: .9rem; margin: .25rem 0 .75rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.grid2 .card { margin: 0; }

/* Hero */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hero .stat { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.hero .stat .label { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-secondary); }
.hero .stat .swatch { width: 12px; height: 12px; border-radius: 3px; }
.hero .stat .big { font-family: Fraunces, Georgia, serif; font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 700; line-height: 1.05; margin: 8px 0 4px; }
.hero .stat .sub { color: var(--text-muted); font-size: .92rem; }
.hero .ratio { grid-column: 1 / -1; text-align: left; }
.hero .ratio .big { font-size: clamp(1.8rem, 5vw, 2.6rem); }
@media (max-width: 640px) { .hero { grid-template-columns: 1fr; } }

/* Tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { font-weight: 600; color: var(--text-secondary); font-size: .82rem; }
table.data td.text { text-align: left; white-space: normal; }
#versions td:first-child { white-space: normal; min-width: 9rem; }
@media (max-width: 640px) { table.data { font-size: .84rem; } table.data th, table.data td { padding: 7px 6px; } }
table.sortable th { cursor: pointer; user-select: none; }
table.sortable th[aria-sort="ascending"]::after { content: " ▲"; font-size: .7em; }
table.sortable th[aria-sort="descending"]::after { content: " ▼"; font-size: .7em; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: baseline; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem; border: 1px solid var(--line); color: var(--text-secondary); }

/* Controls */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 12px; }
.controls label { color: var(--text-secondary); font-size: .9rem; }
select, input[type="search"] {
  font: inherit; color: var(--text-primary); background: var(--surface-1);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-width: 220px;
}
.tab { font: inherit; background: var(--surface-1); color: var(--text-secondary); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.tab[aria-selected="true"] { color: var(--text-primary); border-color: var(--text-secondary); font-weight: 600; }

/* Map */
.map-wrap { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
#usmap { width: 100%; height: auto; display: block; }
#usmap path.state { stroke: var(--surface-1); stroke-width: 1; cursor: pointer; }
#usmap path.state:hover, #usmap path.state:focus { stroke: var(--text-primary); stroke-width: 1.5; outline: none; }
#usmap path.state.selected { stroke: var(--text-primary); stroke-width: 2; }
.legend { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .82rem; color: var(--text-secondary); padding: 6px 4px 2px; }
.legend .bar { height: 10px; width: 240px; max-width: 60vw; border-radius: 3px; }
.statecard dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 20px; margin: 0; }
.statecard dt { color: var(--text-muted); font-size: .8rem; }
.statecard dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Charts */
.chart svg { width: 100%; height: auto; display: block; }
.chart text, #usmap text { fill: var(--text-secondary); font: 12px Inter, system-ui, sans-serif; }
.chart .grid line { stroke: var(--line); }
.chart .domain { display: none; }

/* Tooltip */
.tooltip {
  position: fixed; pointer-events: none; z-index: 10; max-width: 280px;
  background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; font-size: .85rem; box-shadow: 0 6px 24px rgb(0 0 0 / .12);
}
.tooltip .t-title { font-weight: 600; margin-bottom: 4px; }
.tooltip .t-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .t-row .k { color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.tooltip .t-row .k i { display: inline-block; width: 12px; height: 2px; }
.tooltip .t-row .v { font-weight: 600; font-variant-numeric: tabular-nums; }

.prose { max-width: 50rem; }
.prose li { margin: .35rem 0; }
.foot { color: var(--text-muted); font-size: .82rem; padding: 32px 16px 48px; border-top: 1px solid var(--line); margin-top: 40px; }
