/* ============ TOKENS ============ */
:root{
  --navy:#1F3864;
  --navy-deep:#111D33;
  --navy-mid:#2E4D82;
  --navy-soft:#E8ECF3;
  --gold:#BF9000;
  --gold-light:#E3B23C;
  --gold-pale:#F7EDCC;
  --paper:#F2F3F0;
  --surface:#FFFFFF;
  --ink:#181B20;
  --slate:#5B6472;
  --slate-light:#8A93A0;
  --line:#DFE2DE;
  --good:#2E6B4F;
  --good-bg:#E3EFE8;
  --warn:#9C3B2E;
  --warn-bg:#F5E4E1;
  --amber:#8A5A00;
  --amber-bg:#FBF0D9;
  --zone-north:#2E6B8F;
  --zone-central:#BF9000;
  --zone-east:#2E6B4F;
  --zone-west:#6B4C9A;
  --zone-south:#9C3B2E;
  --radius:10px;
  --shadow:0 1px 2px rgba(17,29,51,0.06), 0 8px 24px -12px rgba(17,29,51,0.18);
  --font-display:Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Noto Serif', 'URW Palladio L', serif;
  --font-body:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono:ui-monospace, 'SF Mono', 'Cascadia Mono', 'Segoe UI Mono', Consolas, 'Roboto Mono', monospace;
}
@media (prefers-reduced-motion: reduce){
  *{animation-duration:0.001ms !important; transition-duration:0.001ms !important;}
}
*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0; background:var(--paper); color:var(--ink);
  font-family:var(--font-body); font-size:14px; line-height:1.5;
  -webkit-font-smoothing:antialiased;
  zoom:1.06; /* a modest, sitewide bump — scales every font-size/spacing together rather
                than hand-editing each of the ~65 explicit font-size rules below */
}
::selection{background:var(--gold-pale); color:var(--navy-deep);}
a{color:inherit; text-decoration:none;}
:focus-visible{outline:2.5px solid var(--gold); outline-offset:2px; border-radius:3px;}
button, select, input{font-family:inherit;}

/* ============ TOP BAR ============ */
.topbar{
  background:linear-gradient(155deg, var(--navy) 0%, var(--navy-deep) 100%);
  color:#fff; padding:14px 32px; position:relative;
}
.topbar-inner{
  max-width:1280px; margin:0 auto; display:flex; align-items:center; justify-content:space-between;
  gap:16px; flex-wrap:wrap;
}
.brand{display:flex; align-items:center;}
.brand-title{font-family:var(--font-display); font-weight:600; font-size:18px; letter-spacing:-0.01em;}
.scrapebar{display:flex; align-items:center; gap:12px; flex-wrap:wrap;}
.scrape-btn{
  position:relative; overflow:hidden; isolation:isolate;
  border:1px solid var(--gold-light); background:rgba(255,255,255,0.06); color:#fff;
  border-radius:999px; padding:8px 18px; font-size:12px; font-weight:600; cursor:pointer;
  display:inline-flex; align-items:center; gap:8px; transition:all .15s ease;
}
.scrape-btn:hover{background:var(--gold); border-color:var(--gold); color:var(--navy-deep);}
.scrape-btn:disabled{opacity:0.55; cursor:not-allowed;}
.scrape-spinner{
  width:12px; height:12px; border-radius:50%; border:2px solid rgba(255,255,255,0.4);
  border-top-color:#fff; animation:spin .7s linear infinite; display:none;
}
.scrape-btn.loading .scrape-spinner{display:inline-block;}
@keyframes spin{to{transform:rotate(360deg);}}
.scrape-progress-fill{
  position:absolute; left:0; top:0; bottom:0; width:0%; z-index:-1;
  background:rgba(255,255,255,0.28); transition:width .3s ease;
}
.scrape-btn.loading .scrape-progress-fill{background:rgba(255,255,255,0.32);}
.scrape-status{font-family:var(--font-mono); font-size:10.5px; color:rgba(255,255,255,0.72); max-width:46ch;}
.scrape-status b{color:var(--gold-light); font-weight:600;}
.scrape-status.err{color:#F3B7AA;}

/* ============ NAVBAR ============ */
.navbar{
  position:sticky; top:0; z-index:50; background:var(--navy-deep); border-bottom:2px solid var(--gold);
}
.navbar-inner{
  max-width:1280px; margin:0 auto; padding:0 32px; display:flex; gap:2px; overflow-x:auto;
}
.nav-link{
  font-family:var(--font-body); font-weight:600; font-size:12.5px; color:rgba(255,255,255,0.68);
  padding:12px 16px; white-space:nowrap; border-bottom:3px solid transparent; cursor:pointer;
}
.nav-link:hover{color:#fff;}
.nav-link.active{color:#fff; border-bottom-color:var(--gold);}

/* ============ FILTER BAR ============ */
.filterbar{
  position:sticky; top:41px; z-index:40; background:rgba(255,255,255,0.97); backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line); box-shadow:0 1px 0 rgba(0,0,0,0.02);
}
.filterbar-inner{
  max-width:1280px; margin:0 auto; padding:10px 32px; display:flex; align-items:center;
  gap:18px; flex-wrap:wrap;
}
.filter-group{display:flex; align-items:center; gap:9px;}
.filter-label{
  font-family:var(--font-mono); font-size:10px; text-transform:uppercase; letter-spacing:0.08em;
  color:var(--slate-light); font-weight:600; white-space:nowrap;
}
.pill-group{display:flex; gap:5px; flex-wrap:wrap;}
.pill{
  border:1px solid var(--line); background:#fff; color:var(--slate); border-radius:999px;
  padding:5px 12px; font-size:12px; font-weight:500; cursor:pointer; transition:all .15s ease;
  white-space:nowrap;
}
.pill:hover{border-color:var(--navy-mid); color:var(--navy);}
.pill.active{background:var(--navy); border-color:var(--navy); color:#fff;}
.pill.active.tier-high{background:var(--amber); border-color:var(--amber);}
.pill.active.zone-north{background:var(--zone-north); border-color:var(--zone-north);}
.pill.active.zone-central{background:var(--zone-central); border-color:var(--zone-central); color:#3A2E00;}
.pill.active.zone-east{background:var(--zone-east); border-color:var(--zone-east);}
.pill.active.zone-west{background:var(--zone-west); border-color:var(--zone-west);}
.pill.active.zone-south{background:var(--zone-south); border-color:var(--zone-south);}
.pill.active.propose-yes{background:var(--good); border-color:var(--good);}
.pill.active.propose-no{background:var(--slate); border-color:var(--slate);}
.filter-select{
  border:1px solid var(--line); background:#fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6"><path d="M0 0l5 6 5-6z" fill="%235B6472"/></svg>') no-repeat right 10px center;
  border-radius:7px; padding:6px 28px 6px 11px; font-size:12px; color:var(--ink); appearance:none; cursor:pointer;
  min-width:130px; max-width:190px;
}
.ms-select{position:relative;}
.ms-button{text-align:left; font-family:inherit; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.ms-button.has-selection{border-color:var(--navy); color:var(--navy); font-weight:600; background-color:#EAF0F8;}
.ms-panel{
  position:absolute; top:calc(100% + 6px); left:0; z-index:60; background:#fff; border:1px solid var(--line);
  border-radius:9px; box-shadow:0 10px 30px -8px rgba(17,29,51,0.28); width:280px; max-width:80vw;
  padding:8px; animation:msIn .12s ease;
}
@keyframes msIn{from{opacity:0; transform:translateY(-4px);} to{opacity:1; transform:translateY(0);}}
.ms-panel-actions{display:flex; gap:6px; padding:2px 4px 8px; border-bottom:1px solid var(--line); margin-bottom:6px;}
.ms-action{
  border:none; background:var(--navy-soft); color:var(--navy); font-size:10.5px; font-weight:600;
  border-radius:5px; padding:4px 9px; cursor:pointer;
}
.ms-action:hover{background:var(--navy); color:#fff;}
.ms-options{max-height:280px; overflow-y:auto; display:flex; flex-direction:column; gap:1px;}
.ms-option{display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:6px; cursor:pointer; font-size:12px; color:var(--ink);}
.ms-option:hover{background:var(--paper);}
.ms-option input{accent-color:var(--navy); width:14px; height:14px; flex:0 0 auto; cursor:pointer;}
.ms-option span{overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.search-group{flex:1; min-width:160px; max-width:240px;}
#searchInput{width:100%; border:1px solid var(--line); border-radius:7px; padding:6px 12px; font-size:12px; background:#fff;}
#searchInput::placeholder{color:var(--slate-light);}
.reset-btn{border:1px solid var(--line); background:#fff; color:var(--slate); border-radius:7px; padding:6px 13px; font-size:11.5px; font-weight:600; cursor:pointer;}
.reset-btn:hover{border-color:var(--warn); color:var(--warn);}
.filter-count{margin-left:auto; font-family:var(--font-mono); font-size:11px; color:var(--slate-light); white-space:nowrap;}
.filter-count b{color:var(--navy); font-weight:600;}

/* ============ PAGE HEADER / BREADCRUMB ============ */
.page-header{max-width:1280px; margin:0 auto; padding:28px 32px 4px;}
.page-eyebrow{font-family:var(--font-mono); font-size:10.5px; letter-spacing:0.1em; text-transform:uppercase; color:var(--gold); font-weight:600; margin:0 0 6px;}
.page-title{font-family:var(--font-display); font-weight:600; font-size:28px; color:var(--navy-deep); margin:0 0 6px; letter-spacing:-0.01em;}
.page-desc{font-size:13px; color:var(--slate); max-width:80ch; margin:0;}
.breadcrumbs{display:flex; align-items:center; gap:6px; font-size:12px; color:var(--slate-light); margin-bottom:8px; flex-wrap:wrap;}
.breadcrumbs a{color:var(--navy-mid); font-weight:600; cursor:pointer;}
.breadcrumbs a:hover{text-decoration:underline;}
.breadcrumbs .sep{color:var(--slate-light);}

/* ============ SECTION TITLES ============ */
.section-title{font-family:var(--font-body); font-size:13px; font-weight:700; color:var(--navy); text-transform:uppercase; letter-spacing:0.05em; margin:0;}
.section-num{display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:50%; background:var(--navy); color:#fff; font-family:var(--font-mono); font-size:10px; font-weight:700; margin-right:8px;}
.section-head{display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:8px 20px; margin:36px 0 14px; padding-bottom:8px; border-bottom:2px solid var(--line);}
.section-head:first-of-type{margin-top:34px;}
.section-sub{font-size:11.5px; color:var(--slate-light); margin-top:2px;}
.zone-legend{display:flex; gap:14px; flex-wrap:wrap;}
.zl-item{display:inline-flex; align-items:center; gap:5px; font-family:var(--font-mono); font-size:10.5px; color:var(--slate); text-transform:uppercase; letter-spacing:0.03em;}
.zl-dot{width:8px; height:8px; border-radius:2px; flex:0 0 auto;}

/* ============ MAIN ============ */
.main{max-width:1280px; margin:0 auto; padding:0 32px 20px;}

/* ============ KPI STRIP ============ */
.kpi-strip{display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:10px; margin:20px 0;}
.kpi-card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:14px 14px 13px; position:relative; overflow:hidden; box-shadow:var(--shadow);}
.kpi-card::before{content:""; position:absolute; top:0; right:0; width:0; height:0; border-style:solid; border-width:0 16px 16px 0; border-color:transparent var(--gold-pale) transparent transparent;}
.kpi-label{font-family:var(--font-mono); font-size:10px; text-transform:uppercase; letter-spacing:0.07em; color:var(--slate-light); font-weight:600; margin:0 0 9px; display:block;}
.kpi-value{font-family:var(--font-mono); font-weight:700; font-size:clamp(13px,1.6vw,16px); color:var(--navy); letter-spacing:-0.01em; font-variant-numeric:tabular-nums; display:block; white-space:normal; overflow-wrap:break-word; line-height:1.25;}
.kpi-value.warn{color:var(--warn);}
.kpi-value.good{color:var(--good);}
.kpi-sub{font-size:10.5px; color:var(--slate-light); margin-top:4px; display:block;}

/* ============ CHARTS ============ */
.charts-grid{display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); grid-template-rows:auto auto; gap:16px; margin-bottom:12px;}
.charts-grid.grid2{grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto;}
.charts-grid.grid4{grid-template-columns:repeat(4,minmax(0,1fr)); grid-template-rows:auto;}
.charts-grid.grid3{grid-template-columns:repeat(3,minmax(0,1fr)); grid-template-rows:auto; margin-bottom:38px;}
.chart-card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:20px 22px; box-shadow:var(--shadow); min-width:0;}
.chart-card.span2{grid-column:1 / -1;}
.chart-card h3{font-family:var(--font-body); font-size:13px; font-weight:600; color:var(--navy); margin:0 0 4px;}
.chart-card p.hint{font-size:11.5px; color:var(--slate-light); margin:0 0 14px;}
.barchart{display:flex; flex-direction:column; gap:9px; padding-top:4px; min-width:0;}
.bar-row{display:flex; align-items:center; gap:8px; min-width:0;}
.bar-rank{flex:0 0 22px; height:22px; border-radius:50%; background:var(--navy); color:#fff; border:1.5px solid var(--gold); font-family:var(--font-mono); font-weight:600; font-size:9.5px; display:flex; align-items:center; justify-content:center;}
.bar-label{flex:1 1 auto; min-width:36px; font-size:11.5px; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:default;}
.bar-label.link{cursor:pointer; color:var(--navy-mid); text-decoration:underline; text-decoration-color:transparent;}
.bar-label.link:hover{text-decoration-color:var(--navy-mid);}
.bar-track{flex:1 1 40px; background:var(--navy-soft); border-radius:4px; height:14px; overflow:hidden; min-width:16px;}
.bar-fill{display:block; height:100%; border-radius:4px; background:var(--navy); transition:width .55s cubic-bezier(.16,1,.3,1); min-width:2px;}
.bar-fill.gold{background:var(--gold);}
.bar-fill.gold.dim{background:#DCD3B3;}
.bar-fill.mid{background:var(--navy-mid);}
.bar-fill.neg{background:var(--warn);}
.bar-value{flex:0 0 auto; font-family:var(--font-mono); font-size:11px; font-weight:700; color:var(--ink); min-width:76px; text-align:right; font-variant-numeric:tabular-nums;}
.bar-badge{flex:0 0 auto; font-family:var(--font-mono); font-size:8.5px; font-weight:700; color:#fff; padding:2.5px 6px; border-radius:4px; text-transform:uppercase; letter-spacing:0.03em; white-space:nowrap;}
.chart-card .barchart{max-height:280px; overflow-y:auto; padding-right:2px;}
.chart-card.tall .barchart{max-height:340px;}

/* ---- donut ---- */
.donut-slot{display:flex; align-items:center; gap:20px; padding-top:10px; min-height:170px;}
.donut{width:128px; height:128px; border-radius:50%; position:relative; flex:0 0 auto;}
.donut-hole{position:absolute; inset:20px; background:var(--surface); border-radius:50%; display:flex; align-items:center; justify-content:center; flex-direction:column;}
.donut-hole b{font-family:var(--font-mono); font-weight:600; color:var(--navy); font-size:13.5px; line-height:1.15; text-align:center; padding:0 4px;}
.donut-hole span{font-size:9px; color:var(--slate-light); text-transform:uppercase; letter-spacing:0.05em;}
.donut-legend{display:flex; flex-direction:column; gap:8px; font-size:11.5px; flex:1;}
.donut-legend-item{display:flex; align-items:center; justify-content:space-between; gap:10px;}
.donut-legend-item .lbl{display:flex; align-items:center; gap:7px; color:var(--ink);}
.donut-dot{display:inline-block; width:9px; height:9px; border-radius:2px; flex:0 0 auto;}
.donut-legend-item b{font-family:var(--font-mono); color:var(--navy); font-weight:600;}

.trend-axis-label{font-family:var(--font-mono); font-size:9.5px; fill:var(--slate-light); text-transform:uppercase; letter-spacing:0.04em;}

/* ---- vertical bar chart ---- */
.vbar-wrap{display:flex; align-items:flex-end; gap:14px; padding:10px 4px 0; overflow-x:auto;}
.vbar-col{display:flex; flex-direction:column; align-items:center; justify-content:flex-end; flex:1 1 78px; min-width:78px; height:100%; cursor:default;}
.vbar-value{font-family:var(--font-mono); font-size:10px; font-weight:700; color:var(--ink); margin-bottom:6px; text-align:center; white-space:normal; word-break:break-word; max-width:100%; line-height:1.25;}
.vbar-track{flex:1; width:30px; display:flex; align-items:flex-end; background:var(--navy-soft); border-radius:5px 5px 2px 2px; overflow:hidden;}
.vbar-bar{width:100%; border-radius:5px 5px 0 0; transition:height .5s cubic-bezier(.16,1,.3,1); min-height:2px;}
.vbar-badge{font-family:var(--font-mono); font-size:8px; font-weight:700; color:#fff; padding:2px 5px; border-radius:4px; margin-top:6px; white-space:nowrap;}
.vbar-label{font-size:10px; color:var(--slate); margin-top:6px; text-align:center; max-width:70px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.vbar-group{min-width:64px;}
.vbar-group-bars{flex:1; display:flex; align-items:stretch; gap:3px; width:100%; min-height:0;}
.vbar-group .vbar-track{width:auto; flex:1;}
.vbar-legend{display:flex; gap:16px; flex-wrap:wrap; margin-bottom:10px; font-size:11px; color:var(--slate);}
.vbar-legend-item{display:inline-flex; align-items:center; gap:6px;}
.vbar-legend-dot{width:9px; height:9px; border-radius:2px;}

/* ---- funnel ---- */
.funnel{display:flex; flex-direction:column; gap:8px; padding-top:6px;}
.funnel-row{display:flex; align-items:center; gap:12px;}
.funnel-label{flex:0 0 150px; font-size:11.5px; color:var(--ink); text-align:right;}
.funnel-bar-track{flex:1; background:var(--paper); border-radius:6px; height:28px; position:relative; overflow:hidden;}
.funnel-bar-fill{display:flex; height:100%; border-radius:6px; align-items:center; padding:0 12px; color:#fff; font-family:var(--font-mono); font-size:11.5px; font-weight:600; white-space:nowrap; transition:width .5s cubic-bezier(.16,1,.3,1);}

/* ---- scorecard ---- */
.scorecard-ring{width:56px; height:56px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex:0 0 auto; font-family:var(--font-mono); font-weight:700; font-size:14px; color:#fff;}

/* ---- diff / since-last-scrape panel ---- */
.diff-panel{background:var(--surface); border:1px solid var(--line); border-left:4px solid var(--gold); border-radius:var(--radius); box-shadow:var(--shadow); padding:18px 22px; margin:20px 0;}
.diff-panel h3{font-family:var(--font-body); font-size:13px; font-weight:600; color:var(--navy); margin:0 0 4px;}
.diff-panel-summary{font-family:var(--font-body); font-size:13px; font-weight:600; color:var(--navy); cursor:pointer; list-style:revert; margin:0 0 4px;}
.diff-panel-summary::marker{color:var(--gold);}
.diff-panel[open] .diff-panel-summary{margin-bottom:4px;}
.diff-panel p.hint{font-size:11.5px; color:var(--slate-light); margin:0 0 14px;}
.diff-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(160px,1fr)); gap:10px; margin-bottom:14px;}
.diff-stat{padding:10px 12px; background:var(--paper); border-radius:8px;}
.diff-stat-label{font-family:var(--font-mono); font-size:9.5px; text-transform:uppercase; letter-spacing:0.06em; color:var(--slate-light); display:block; margin-bottom:5px;}
.diff-stat-value{font-family:var(--font-mono); font-weight:600; font-size:14px; color:var(--navy);}
.diff-stat-delta{font-family:var(--font-mono); font-size:10.5px; margin-left:6px;}
.diff-stat-delta.up{color:var(--good);}
.diff-stat-delta.down{color:var(--warn);}
.diff-empty{color:var(--slate-light); font-size:12.5px; padding:6px 0;}
.changelog-run{padding:14px 0; border-top:1px solid var(--line);}
.changelog-run:first-of-type{border-top:none; padding-top:6px;}
.changelog-date{font-family:var(--font-body); font-weight:700; font-size:12.5px; color:var(--navy); margin-bottom:6px;}
.changelog-list{margin:0; padding-left:18px; display:flex; flex-direction:column; gap:5px;}
.changelog-list li{font-size:12.5px; color:var(--ink); line-height:1.5;}
.changelog-list b{color:var(--navy); font-weight:700;}

/* ============ DOSSIER / TABS ============ */
.dossier{margin-bottom:50px;}
.tab-bar{display:flex; gap:2px; border-bottom:2px solid var(--navy); flex-wrap:wrap;}
.tab-btn{font-family:var(--font-body); font-weight:600; font-size:12.5px; color:var(--slate); background:var(--navy-soft); border:none; border-radius:8px 8px 0 0; padding:11px 18px; cursor:pointer; position:relative; top:2px;}
.tab-btn .count{font-family:var(--font-mono); font-weight:500; color:var(--slate-light); margin-left:5px;}
.tab-btn.active{background:var(--navy); color:#fff;}
.tab-btn.active .count{color:var(--gold-light);}
.tab-toolbar{display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; padding:12px 2px; font-size:11.5px; color:var(--slate-light);}
.tab-toolbar .desc{max-width:60ch;}
.export-btn{border:1px solid var(--navy); background:#fff; color:var(--navy); font-weight:600; border-radius:7px; padding:6px 13px; font-size:11.5px; cursor:pointer; white-space:nowrap;}
.export-btn:hover{background:var(--navy); color:#fff;}
.table-wrap{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); overflow:auto; max-height:600px;}
table{width:100%; border-collapse:collapse; font-size:12.5px;}
table.has-freeze{table-layout:fixed;}
thead th{position:sticky; top:0; background:var(--navy); color:#fff; text-align:left; font-weight:600; padding:10px 12px; font-size:11px; white-space:nowrap; cursor:pointer; user-select:none; z-index:5; font-family:var(--font-body);}
thead th .arrow{opacity:0.45; margin-left:3px; font-size:9px;}
thead th.sorted .arrow{opacity:1; color:var(--gold-light);}
thead th.num, td.num{text-align:right;}
tbody td{padding:8px 12px; border-bottom:1px solid var(--line); white-space:nowrap; font-variant-numeric:tabular-nums; overflow:hidden; text-overflow:ellipsis;}
table.has-freeze thead th{overflow:hidden; text-overflow:ellipsis;}
tbody tr:nth-child(even){background:#FAFAF8;}
tbody tr:hover{background:var(--navy-soft);}
tbody tr.clickable{cursor:pointer;}
td.num{font-family:var(--font-mono);}

/* ---- frozen header + frozen District/State columns ---- */
table.has-freeze th.freeze, table.has-freeze td.freeze{position:sticky; z-index:2; background:var(--surface);}
table.has-freeze thead th.freeze{z-index:7; background:var(--navy);}
table.has-freeze tbody tr:nth-child(even) td.freeze{background:#FAFAF8;}
table.has-freeze tbody tr:hover td.freeze{background:#E4E9F2;}
table.has-freeze .freeze-end{box-shadow:3px 0 6px -3px rgba(17,29,51,0.25);}
table.has-freeze thead th.freeze-end{box-shadow:3px 0 6px -3px rgba(17,29,51,0.45);}
.truncate{overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.rank-badge{display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; border-radius:50%; background:var(--navy); color:#fff; border:2px solid var(--gold); font-family:var(--font-mono); font-weight:600; font-size:10.5px;}
.tag{display:inline-block; padding:3px 9px; border-radius:5px; font-size:10.5px; font-weight:600; font-family:var(--font-mono); letter-spacing:0.01em;}
.tag.propose{background:var(--good-bg); color:var(--good);}
.tag.no{background:transparent; color:var(--slate-light);}
.tag.high{background:var(--amber-bg); color:var(--amber);}
.tag.medium{background:var(--gold-pale); color:#7A5C00;}
.tag.standard{background:#EDEEEC; color:var(--slate);}
.tag.not-rec{background:transparent; color:var(--slate-light); font-weight:500;}
.tag.yes-asp{background:var(--navy-soft); color:var(--navy);}
.tag.zone-tag{color:#fff; font-weight:600;}
.tag.zone-tag.zone-north{background:var(--zone-north);}
.tag.zone-tag.zone-central{background:var(--zone-central); color:#3A2E00;}
.tag.zone-tag.zone-east{background:var(--zone-east);}
.tag.zone-tag.zone-west{background:var(--zone-west);}
.tag.zone-tag.zone-south{background:var(--zone-south);}
.neg{color:var(--warn);}
.pos{color:var(--good);}
.empty-state{padding:52px 20px; text-align:center; color:var(--slate-light);}
.empty-state b{display:block; font-family:var(--font-display); font-size:19px; color:var(--navy); margin-bottom:6px; font-weight:600;}

.subtable-title{font-family:var(--font-body); font-weight:600; font-size:12.5px; color:var(--navy); margin:22px 0 8px; padding:0 2px;}
.subtable-title:first-child{margin-top:2px;}

/* ---- quick tables under chart sections ---- */
.quick-table-card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:20px 22px 6px; margin-bottom:34px;}
.quick-table-head h3{font-family:var(--font-body); font-size:13px; font-weight:600; color:var(--navy); margin:0 0 4px;}
.quick-table-head p.hint{font-size:11.5px; color:var(--slate-light); margin:0 0 14px;}
.table-wrap.compact{border:none; box-shadow:none; max-height:520px; border-top:1px solid var(--line); border-radius:0;}

/* ---- state / district card grid (drill-down pages) ---- */
.card-grid{display:grid; grid-template-columns:repeat(auto-fill, minmax(220px,1fr)); gap:12px; margin:18px 0 30px;}
.state-card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:16px; cursor:pointer; transition:border-color .15s ease, transform .1s ease;}
.state-card:hover{border-color:var(--navy-mid); transform:translateY(-1px);}
.state-card-name{font-family:var(--font-body); font-weight:600; font-size:13.5px; color:var(--navy); margin-bottom:8px; display:flex; align-items:center; justify-content:space-between; gap:8px;}
.state-card-metrics{display:flex; flex-direction:column; gap:4px; font-size:11.5px; color:var(--slate);}
.state-card-metrics b{font-family:var(--font-mono); color:var(--ink); font-weight:600;}

/* ============ FOOTER ============ */
footer.footnote{border-top:1px solid var(--line); padding:30px 32px 60px; max-width:1280px; margin:0 auto; color:var(--slate); font-size:12px; line-height:1.7;}
footer.footnote h4{font-family:var(--font-body); font-size:12px; text-transform:uppercase; letter-spacing:0.06em; color:var(--navy); margin:0 0 10px;}
.footnote-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:28px; margin-bottom:20px;}
.footnote-grid dl{margin:0;}
.footnote-grid dt{font-weight:600; color:var(--ink); margin-top:9px;}
.footnote-grid dt:first-child{margin-top:0;}
.footnote-grid dd{margin:0 0 0; color:var(--slate);}
.footnote-bottom{border-top:1px solid var(--line); padding-top:16px; font-size:11px; color:var(--slate-light);}

/* ============ RESPONSIVE ============ */
@media (max-width:980px){
  .kpi-strip{grid-template-columns:repeat(3,1fr);}
  .charts-grid{grid-template-columns:1fr;}
  .charts-grid.grid4{grid-template-columns:repeat(2,1fr);}
  .charts-grid.grid3, .charts-grid.grid2{grid-template-columns:1fr;}
  .footnote-grid{grid-template-columns:1fr;}
  .filterbar{position:static;}
}
@media (max-width:640px){
  .topbar{padding:12px 16px;}
  .navbar-inner{padding:0 16px;}
  .page-header{padding:20px 16px 4px;}
  .main{padding:0 16px 16px;}
  .filterbar-inner{padding:10px 16px;}
  .filter-group{flex:1 1 auto; min-width:0;}
  .filter-select{min-width:0; max-width:280px; flex:1;}
  .kpi-strip{grid-template-columns:repeat(2,1fr); margin:16px 0;}
  .charts-grid.grid4{grid-template-columns:1fr;}
  footer.footnote{padding:24px 16px 44px;}
  .filter-count{width:100%; margin-left:0; order:10;}
  .funnel-label{flex-basis:100px; font-size:10.5px;}
  .chart-card{padding:14px 16px;}
  .donut-slot{flex-direction:column; align-items:flex-start; gap:14px;}
  .donut-legend{width:100%;}
}
/* Below ~420px even a single donut + legend side by side can outrun the viewport —
   this catches iPhone SE-class widths that the 640px breakpoint alone doesn't. */
@media (max-width:420px){
  .kpi-strip{grid-template-columns:1fr 1fr;}
  .vbar-col{flex:1 1 64px; min-width:64px;}
}
@media (max-width:640px){
  .table-wrap, .navbar-inner, .vbar-wrap, .ms-options, .chart-card .barchart{
    -webkit-overflow-scrolling:touch;
  }
}
