:root {
  --ink:#183b36; --text:#344b46; --muted:#687b74; --green:#225e50;
  --paper:#f5f5ee; --line:#dde4d9; --card:#fff;
  font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--text); font-synthesis:none;
}
* { box-sizing:border-box; }
html,body { width:100%; height:100%; margin:0; overflow:hidden; overscroll-behavior:none; }
body { height:100vh; height:100dvh; display:flex; flex-direction:column; background:var(--paper); font-size:14px; line-height:1.5; }
a { color:var(--green); text-decoration:none; }
a:hover { text-decoration:underline; }
button,input,select { font:inherit; }
button { color:var(--green); cursor:pointer; }
button,a,input,select,summary { -webkit-tap-highlight-color:transparent; }
button:disabled,select:disabled { opacity:.6; cursor:wait; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible { outline:3px solid #bc8c37; outline-offset:2px; }
h1,h2,h3,p { margin:0; }
h1,h2,h3 { color:var(--ink); line-height:1.2; }
h2 { font-size:23px; font-weight:600; letter-spacing:-.5px; }
h3 { font-size:14px; font-weight:650; }
p+p { margin-top:10px; }
select,input { width:100%; min-width:0; min-height:42px; padding:8px 11px; border:1px solid #ccd8ce; border-radius:7px; color:var(--ink); background:#fff; }
select { padding-right:28px; }
label,legend { display:block; font-size:11px; font-weight:650; color:var(--muted); margin-bottom:5px; }
fieldset { border:0; padding:0; margin:0; min-width:0; }
legend { padding:0; }
[hidden] { display:none!important; }
.site-header { flex:none; display:flex; align-items:center; gap:24px; min-width:0; padding:12px 20px; padding-top:max(12px,env(safe-area-inset-top)); border-bottom:1px solid var(--line); }
.brand { display:flex; align-items:center; flex-shrink:0; color:var(--ink); font-size:20px; font-weight:650; letter-spacing:-.6px; }
.brand>span:last-child { font-weight:400; }
.brand-mark { display:grid; place-items:center; width:32px; height:32px; margin-right:9px; padding-bottom:4px; border-radius:8px; background:var(--green); color:white; font:30px/1 Georgia,serif; }
.brand:hover { text-decoration:none; }
.project-title { flex:1; min-width:0; padding-left:22px; border-left:1px solid var(--line); }
.project-title h1 { font-size:16px; font-weight:600; }
.project-title span { display:block; margin-top:2px; color:var(--muted); font-size:10px; }
.header-actions { display:flex; align-items:center; gap:10px; margin-left:auto; }
.header-actions button,.download { display:inline-flex; align-items:center; justify-content:center; gap:12px; min-height:38px; white-space:nowrap; padding:7px 12px; border:1px solid #c6d6c7; border-radius:7px; background:#fff8; font-size:12px; }
.app-shell { flex:1; min-height:0; min-width:0; display:grid; grid-template-rows:auto minmax(0,1fr); gap:10px; padding:12px 20px max(14px,env(safe-area-inset-bottom)); }
.controls { display:grid; grid-template-columns:minmax(0,1.7fr) minmax(150px,.65fr) minmax(180px,.85fr); gap:18px; align-items:end; }
.controls>div { min-width:0; }
.controls select { font-size:13px; text-overflow:ellipsis; }
.controls:has(#areaControl[hidden]) { grid-template-columns:2fr 1fr; }
.segmented { display:flex; gap:4px; height:42px; padding:3px; background:#e6ebe2; border-radius:7px; }
.segmented label { position:relative; flex:1; margin:0; cursor:pointer; }
.segmented input { position:absolute; width:1px; height:1px; min-height:0; opacity:0; }
.segmented span { display:grid; place-items:center; height:36px; border-radius:5px; font-size:12px; font-weight:500; }
.segmented input:checked+span { background:white; color:var(--green); font-weight:650; box-shadow:0 1px 5px #23403115; }
.segmented input:focus-visible+span { outline:3px solid #bc8c37; }
#appContent { display:grid; grid-template-rows:auto minmax(0,1fr); min-height:0; min-width:0; }
.metric-heading { display:flex; align-items:center; gap:15px; min-width:0; padding:0 0 10px; }
.metric-copy { min-width:0; flex:1; }
.eyebrow { margin-bottom:7px; color:var(--green); font-size:10px; font-weight:700; letter-spacing:1.5px; text-transform:uppercase; }
.metric-heading .eyebrow { margin-bottom:3px; font-size:9px; line-height:1.2; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
.metric-heading h2 { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:20px; letter-spacing:-.4px; }
.source-note-button { flex-shrink:0; display:flex; align-items:center; gap:6px; min-height:34px; border:1px solid #e6d5ae; border-radius:6px; padding:6px 10px; color:#79551f; background:#fbf0dc; font-size:11px; }
.workspace { display:grid; grid-template-columns:minmax(0,1fr) 350px; grid-template-rows:44px minmax(0,1fr); gap:0 14px; min-height:0; min-width:0; }
.map-card { position:relative; grid-column:1; grid-row:1 / -1; display:flex; flex-direction:column; min-height:0; min-width:0; overflow:hidden; border:1px solid var(--line); border-radius:12px; background:#fff; }
.map-topline { flex:none; display:flex; align-items:center; justify-content:space-between; min-height:35px; padding:3px 13px; border-bottom:1px solid var(--line); font-size:10px; color:var(--muted); }
.live-dot { display:inline-block; width:5px; height:5px; margin-right:6px; border-radius:100%; background:var(--green); }
.map-topline button { align-self:stretch; border:0; background:none; padding:3px 0 3px 10px; font-size:11px; }
#map { flex:1 1 0; min-height:0; min-width:0; isolation:isolate; background:#eef1e8; background-image:radial-gradient(#bac8b75a .6px,transparent .6px); background-size:14px 14px; }
.leaflet-container { font:inherit; }
.leaflet-control-attribution { font-size:9px!important; background:#fff9!important; }
.leaflet-control-zoom a { color:var(--green)!important; font-weight:400!important; }
.leaflet-bar { border:1px solid var(--line)!important; box-shadow:0 2px 8px #123c1e0d!important; }
.atlas-tooltip { border:0!important; border-radius:8px!important; padding:9px 12px!important; color:var(--ink)!important; box-shadow:0 4px 20px #173c3020!important; font-size:12px; }
.atlas-tooltip strong { display:block; font-size:14px; }
.map-legend { flex:none; min-width:0; padding:8px 13px 9px; }
.legend-title { display:flex; justify-content:space-between; gap:10px; margin-bottom:5px; font-size:9px; color:var(--muted); }
.legend-swatches { display:flex; gap:3px; }
.legend-item { flex:1; min-width:0; color:var(--muted); font-size:9px; line-height:1.35; overflow-wrap:anywhere; }
.legend-item i { display:block; height:7px; margin-bottom:3px; border-radius:2px; }
.legend-missing { display:flex; align-items:center; gap:5px; margin-top:5px; color:var(--muted); font-size:9px; }
.legend-missing i { display:inline-block; width:12px; height:7px; border:1px dashed #8d998b; background:#cdd3ca; }
.selection-strip { display:none; }
.view-switch { grid-column:2; grid-row:1; display:flex; align-items:stretch; min-width:0; padding:4px; gap:4px; background:#e7ede2; border:1px solid var(--line); border-radius:10px 10px 0 0; }
.view-switch button { flex:1; min-width:0; border:0; border-radius:5px; padding:5px 7px; background:none; font-size:12px; font-weight:550; }
.view-switch button[aria-pressed="true"] { background:white; color:var(--green); box-shadow:0 1px 4px #23403110; font-weight:700; }
.inspector { grid-column:2; grid-row:2; min-width:0; min-height:0; overflow:hidden; background:white; border:1px solid var(--line); border-top:0; border-radius:0 0 12px 12px; }
.panel { height:100%; min-height:0; min-width:0; padding:21px; overflow:auto; overflow-x:hidden; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#b8c6b5 transparent; overflow-wrap:anywhere; }
.profile-heading .eyebrow { margin-bottom:5px; }
.profile-heading h2 { font-family:Georgia,serif; font-size:31px; font-weight:400; }
.profile-heading>p:last-child { margin-top:3px; font-size:11px; color:var(--muted); }
.selected-value { margin-bottom:17px; padding:17px 0; border-bottom:1px solid var(--line); }
.selected-value strong { color:var(--green); font-size:37px; font-weight:550; letter-spacing:-1.3px; line-height:1.1; font-variant-numeric:tabular-nums; }
.selected-value p { margin-top:5px; color:var(--muted); font-size:11px; }
.small { font-size:11px; line-height:1.6; }
.muted { color:var(--muted); }
.district-card h3+.small { margin-top:5px; }
.income-compare { margin-top:15px; }
.income-row { display:grid; grid-template-columns:38px 1fr 50px; gap:9px; align-items:center; margin-bottom:12px; font-size:11px; }
.income-row strong { color:var(--ink); text-align:right; font-size:12px; font-variant-numeric:tabular-nums; }
.bar-track { height:8px; overflow:hidden; background:#eaf0e5; border-radius:3px; }
.bar-track span { display:block; height:100%; background:var(--green); border-radius:3px; }
.income-row.rural .bar-track span { background:#ad8b52; }
.income-details { margin-top:17px; padding-top:12px; border-top:1px solid var(--line); }
.income-details summary { color:var(--green); font-size:12px; font-weight:600; cursor:pointer; }
.income-details table { width:100%; border-collapse:collapse; font-size:10px; margin:12px 0; }
.income-details th,.income-details td { padding:6px 0; border-bottom:1px solid #edf0e9; text-align:right; }
.income-details th:first-child,.income-details td:first-child { text-align:left; }
.profile-facts { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:17px; padding:17px 0; border-top:1px solid var(--line); }
.profile-facts strong { display:block; color:var(--ink); font-size:17px; font-weight:550; line-height:1.2; letter-spacing:-.3px; }
.profile-facts span { color:var(--muted); font-size:10px; }
.district-flags,.metric-warning { margin:14px 0; padding:10px 11px; border:1px solid #e8d4aa; border-radius:7px; color:#79551f; background:#fbf0dc; font-size:11px; line-height:1.6; }
.district-flags p+p { margin-top:7px; }
.section-title { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.section-title h2 { font-size:20px; }
.section-title .eyebrow { margin-bottom:5px; }
.sort-label { flex:none; width:112px; margin:0; font-size:10px; }
.sort-label select { min-height:35px; margin-top:3px; font-size:11px; }
.ranking-card>p { margin:15px 0 8px; }
.rank-row { display:grid; grid-template-columns:21px minmax(0,1fr) 64px; gap:7px; align-items:center; width:100%; padding:11px 6px; border:0; border-bottom:1px solid #eaf0e7; border-radius:4px; background:white; color:var(--text); text-align:left; font-size:12px; }
.rank-row:hover,.rank-row[aria-pressed="true"] { background:#f0f4eb; }
.rank-row .rank-number { color:var(--muted); font-size:10px; }
.rank-row strong { text-align:right; font-size:11px; font-variant-numeric:tabular-nums; }
.rank-bar { display:none; }
.reading-card>h2 { margin-bottom:12px; font-size:21px; }
.reading-card>p:not(.eyebrow):not(.metric-warning),.definition p { color:var(--muted); font-size:12px; line-height:1.65; }
.definition { margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }
.definition h3 { margin-bottom:8px; }
.definition .small { font-size:11px; }
.summary-grid { display:grid; gap:7px; margin:15px 0; }
.summary-stat { display:grid; grid-template-columns:88px 1fr; gap:2px 10px; align-items:center; padding:10px; border:1px solid #dde5d9; border-radius:7px; background:#edf1e8; }
.summary-stat strong { grid-row:1 / 3; color:var(--green); font-size:23px; font-weight:600; letter-spacing:-1px; font-variant-numeric:tabular-nums; }
.summary-stat span { font-size:11px; font-weight:600; }
.summary-stat small { color:var(--muted); font-size:9px; }
.source-links { margin-top:20px; border-top:1px solid var(--line); }
.source-links a,.source-links button { display:block; width:100%; padding:12px 0; border:0; border-bottom:1px solid var(--line); color:var(--green); background:none; text-align:left; font-size:12px; }
.loading { display:grid; place-items:center; min-height:0; padding:20px; color:var(--muted); text-align:center; }
.skip { position:fixed; top:-60px; left:15px; z-index:2000; padding:10px; background:white; }
.skip:focus { top:10px; }
.noscript { position:fixed; bottom:20px; left:20px; right:20px; padding:16px; background:white; border:1px solid var(--line); }
dialog { width:min(660px,calc(100vw - 28px)); height:min(650px,calc(100vh - 32px)); height:min(650px,calc(100dvh - 32px)); max-height:calc(100dvh - 32px); padding:22px; overflow:hidden; border:1px solid var(--line); border-radius:14px; color:var(--text); background:var(--paper); box-shadow:0 20px 80px #143c3333; }
dialog[open] { display:flex; flex-direction:column; gap:16px; }
dialog::backdrop { background:#16382f70; }
.controls-dialog { height:auto; max-width:440px; }
.compact-controls .app-shell { grid-template-rows:minmax(0,1fr); }
.compact-controls .header-actions .download { display:none; }
.controls-dialog .controls { grid-template-columns:1fr 1fr; gap:12px; }
.controls-dialog .question-control { grid-column:1 / -1; }
.controls-dialog .controls:has(#areaControl[hidden]) .question-control { grid-column:auto; }
.dialog-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.dialog-heading h2 { font-size:24px; }
.dialog-heading button { flex:none; width:40px; height:40px; border:1px solid var(--line); border-radius:7px; background:white; font-size:25px; }
.indicator-picker { display:flex; flex:1; flex-direction:column; min-height:0; }
.indicator-picker label:not(:first-child) { margin-top:14px; }
.indicator-picker input { flex:none; }
.indicator-picker select { flex:1; min-height:65px; padding:5px; font-size:12px; overflow:auto; }
.indicator-picker option { padding:5px; }
.indicator-picker p { flex:none; margin-top:8px; }
.primary-button { flex:none; min-height:44px; border:0; border-radius:7px; padding:10px 15px; color:white; background:var(--green); font-size:13px; font-weight:600; }
@media(max-width:1100px) {
  .workspace { grid-template-columns:minmax(0,1fr) 310px; gap:0 10px; }
  .site-header,.app-shell { padding-left:14px; padding-right:14px; }
  .panel { padding:17px; }
  .controls { gap:12px; }
  .project-title span { display:none; }
  .project-title { padding-left:17px; }
  .site-header { gap:17px; }
}
@media(max-width:820px) and (orientation:portrait) {
  .site-header { gap:9px; min-height:48px; padding:6px 10px; padding-top:max(6px,env(safe-area-inset-top)); }
  .brand { font-size:17px; }
  .brand-mark { width:27px; height:27px; margin-right:6px; font-size:25px; border-radius:7px; }
  .project-title { display:none; }
  .header-actions { gap:6px; }
  .header-actions button,.download { min-height:36px; padding:6px 8px; font-size:10.5px; gap:5px; }
  .app-shell { padding:8px 10px max(8px,env(safe-area-inset-bottom)); gap:8px; }
  .controls { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:6px 10px; }
  .question-control { grid-column:1 / -1; }
  .controls:has(#areaControl[hidden]) { grid-template-columns:1fr 1fr; }
  .controls:has(#areaControl[hidden]) .question-control { grid-column:auto; }
  label,legend { font-size:10px; line-height:1.2; margin-bottom:3px; }
  select,input,.controls select { min-height:40px; font-size:16px; padding:7px 9px; }
  select,.controls select { padding-right:25px; }
  .segmented { height:40px; }
  .segmented span { height:34px; font-size:12px; }
  .metric-heading { gap:8px; padding-bottom:8px; }
  .metric-heading h2 { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; white-space:normal; font-size:16px; letter-spacing:-.25px; line-height:1.3; }
  .metric-heading .eyebrow { font-size:8px; letter-spacing:1px; }
  .source-note-button { min-height:32px; padding:5px 7px; font-size:9px; gap:4px; }
  .workspace { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) 44px; gap:8px 0; }
  .map-card { grid-column:1; grid-row:1; border-radius:10px; }
  .map-topline { min-height:31px; padding:1px 10px; font-size:9px; }
  .map-topline button { font-size:10px; }
  .map-legend { padding:7px 10px; }
  .legend-title { font-size:8px; gap:4px; margin-bottom:4px; }
  .legend-item,.legend-missing { font-size:8px; }
  .legend-item i { height:6px; }
  .legend-missing { margin-top:4px; }
  .selection-strip { display:flex; flex:none; align-items:center; justify-content:space-between; gap:12px; min-height:44px; padding:6px 11px; border:0; border-top:1px solid var(--line); border-radius:0; background:#f7f9f3; text-align:left; }
  .selection-strip>span { display:flex; align-items:baseline; flex-wrap:wrap; gap:2px 9px; min-width:0; }
  .selection-strip>span strong { color:var(--ink); font-size:12px; line-height:1.2; }
  .selection-strip small { color:var(--muted); font-size:9px; }
  .selection-strip>strong { color:var(--green); font-size:20px; line-height:1; letter-spacing:-.6px; white-space:nowrap; }
  .view-switch { grid-column:1; grid-row:2; border-radius:8px; }
  .view-switch button { font-size:12px; }
  .inspector { grid-column:1; grid-row:1; border:1px solid var(--line); border-radius:10px; }
  .panel { padding:20px; }
  .sort-label { width:132px; }
  .sort-label select { font-size:16px; }
  dialog { padding:16px; gap:12px!important; }
  .dialog-heading h2 { font-size:22px; }
  .indicator-picker select { font-size:16px; }
  .indicator-picker p { font-size:10px; }
}
@media(max-width:360px) {
  .header-actions button,.download { padding-left:6px; padding-right:6px; font-size:10px; }
  .brand-mark { margin-right:5px; }
  .source-note-button { font-size:0; padding:5px 8px; }
  .source-note-button span { font-size:14px; }
  .metric-heading h2 { font-size:15px; }
}
@media(max-height:650px) and (max-width:600px) {
  .map-topline { position:absolute; inset:8px 8px auto auto; z-index:500; display:flex; min-height:30px; padding:0; border:1px solid var(--line); border-radius:6px; background:#fffffff2; }
  .map-topline>span { display:none; }
  .map-topline button { min-height:30px; padding:4px 8px; }
  .selection-strip { min-height:37px; }
  .legend-title span:last-child { display:none; }
  .map-legend { padding-top:5px; padding-bottom:5px; }
}
@media(max-height:480px) and (orientation:landscape) {
  .site-header { padding-top:5px; padding-bottom:5px; gap:12px; }
  .project-title { border:0; padding:0; }
  .project-title h1 { font-size:13px; }
  .project-title span { display:none; }
  .brand { font-size:17px; }
  .brand-mark { width:25px; height:25px; font-size:24px; }
  .header-actions button,.download { min-height:32px; padding:5px 8px; font-size:10px; }
  .app-shell { padding-top:6px; padding-bottom:6px; gap:6px; }
  .controls { grid-template-columns:minmax(0,1.5fr) minmax(120px,.6fr) minmax(150px,.8fr); gap:10px; }
  label,legend { margin-bottom:2px; font-size:9px; }
  select,.controls select { min-height:34px; padding-top:4px; padding-bottom:4px; font-size:12px; }
  .segmented { height:34px; }
  .segmented span { height:28px; }
  .metric-heading { padding-bottom:6px; }
  .metric-heading h2 { font-size:15px; }
  .metric-heading .eyebrow { font-size:8px; }
  .workspace { grid-template-columns:minmax(0,1fr) 260px; grid-template-rows:37px minmax(0,1fr); }
  .map-topline { position:absolute; inset:8px 8px auto auto; z-index:500; display:flex; min-height:30px; padding:0; border:1px solid var(--line); border-radius:6px; background:#fffffff2; }
  .map-topline>span { display:none; }
  .map-topline button { min-height:30px; padding:4px 8px; }
  .map-legend { padding:5px 10px; }
  .legend-title span:last-child { display:none; }
  .legend-title,.legend-item,.legend-missing { font-size:8px; }
  .legend-missing { margin-top:3px; }
  .panel { padding:14px; }
}
@media(pointer:coarse) {
  select,input,.controls select,.sort-label select { font-size:16px; }
}
@media(max-height:480px) {
  dialog { padding:12px; }
  dialog[open] { gap:8px!important; }
  .dialog-heading .eyebrow { display:none; }
  .dialog-heading h2 { font-size:20px; }
  .indicator-picker label:not(:first-child) { margin-top:8px; }
  .indicator-picker input { min-height:36px; padding-top:5px; padding-bottom:5px; }
  .indicator-picker p { margin-top:6px; font-size:10px; }
  .indicator-picker>p:last-child { display:none; }
  dialog .primary-button { min-height:40px; padding-top:8px; padding-bottom:8px; }
}
@media(prefers-reduced-motion:reduce) {
  * { scroll-behavior:auto!important; transition:none!important; }
}
