@font-face {
  font-family: "Barlow";
  src: url("assets/fonts/Barlow-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("assets/fonts/Barlow-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("assets/fonts/Barlow-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --navy: #071d2b;
  --navy-top: #061824;
  --navy-mid: #0b2d40;
  --ink: #102d3d;
  --paper: #f2f4f3;
  --white: #fff;
  --line: #d4dfe2;
  --muted: #5d747f;
  --mint: #67ddbd;
  --mint-soft: #d7fff2;
  --green: #167763;
  --gold: #d8af63;
  --coral: #e86f58;
  --shadow: 0 12px 34px rgba(4, 28, 43, .09);
  --radius: 12px;
  font-family: "Barlow", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: hidden; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; overflow-x: hidden; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #28768c; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 40; background: var(--mint); color: #062019; padding: .65rem .9rem; border-radius: 8px; }
.skip-link:focus { top: 1rem; }

.site-header {
  height: 52px;
  padding: 0 max(1rem, calc((100vw - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--navy-top);
  color: #eaf4f2;
  border-bottom: 1px solid rgba(180, 219, 216, .14);
}
.brand { display: flex; align-items: baseline; gap: .55rem; color: inherit; text-decoration: none; }
.family-mark { font-size: 1rem; font-weight: 700; letter-spacing: -.025em; }
.family-mark span { color: var(--mint); }
.brand-copy { display: flex; align-items: baseline; gap: .35rem; line-height: 1; }
.brand-copy strong { font-size: .75rem; font-weight: 600; }
.brand-copy small { color: #8fa8b1; font-size: .64rem; }
.header-actions { display: flex; align-items: center; gap: 1.2rem; }
.text-button { border: 0; background: none; padding: .4rem 0; cursor: pointer; color: #b8ccd1; font-size: .74rem; font-weight: 600; }
.text-button:hover { color: var(--mint); }
.freshness { color: #91a8ae; font-size: .68rem; display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.freshness i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(216, 175, 99, .45); }
.freshness.ready i { background: var(--mint); box-shadow: 0 0 8px rgba(103, 221, 189, .5); }
.freshness.error i { background: var(--coral); }

.hero {
  min-height: 118px;
  padding: 1rem max(1rem, calc((100vw - 1120px) / 2)) 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(105deg, var(--navy-mid), #103a4e);
  color: #edf6f5;
}
.eyebrow, .kicker { margin: 0; color: var(--green); text-transform: uppercase; letter-spacing: .12em; font-size: .64rem; font-weight: 700; }
.hero .eyebrow { color: var(--mint); }
.hero h1 { margin: .35rem 0 .2rem; font-size: clamp(1.9rem, 3.2vw, 2.65rem); font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.hero p { margin: 0; max-width: 700px; color: #b4c7cb; font-size: .84rem; line-height: 1.4; }

.workspace { color: var(--ink); padding: .8rem 0 3rem; background: var(--paper); }
.program-tabs, .control-deck, .summary-grid, .map-card, .table-card, .news-section, .method-strip { width: min(1120px, calc(100% - 2rem)); margin-left: auto; margin-right: auto; }
.program-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #e8edef; }
.program-tabs button { min-width: 0; min-height: 54px; padding: .58rem 1rem; display: flex; flex-direction: column; justify-content: center; position: relative; border: 0; border-right: 1px solid var(--line); background: transparent; color: #526b77; text-align: left; cursor: pointer; }
.program-tabs button:last-child { border-right: 0; }
.program-tabs button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--green); transform: scaleX(0); }
.program-tabs button[aria-selected="true"] { color: #124e66; background: var(--white); }
.program-tabs button[aria-selected="true"]::after { transform: scaleX(1); }
.program-tabs span { font-size: .84rem; font-weight: 700; }
.program-tabs small { margin-top: .12rem; color: #73868d; font-size: .64rem; }
.program-tabs button[data-ready="false"] small::after { content: " · preparing"; color: #986c2c; }

.control-deck { padding: .8rem 0 .65rem; }
.control-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .65rem; }
.field { display: flex; flex-direction: column; gap: .32rem; min-width: 0; }
.field > span { color: #3e6171; font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.field select, .field input { width: 100%; height: 43px; min-width: 0; padding: 0 .72rem; border: 1px solid #c3d1d7; border-radius: 8px; outline: none; background: var(--white); color: #17364a; }
.field select:focus, .field input:focus, .search:focus-within { border-color: #28768c; box-shadow: 0 0 0 3px rgba(40, 118, 140, .14); }
.program-note { margin-top: .65rem; padding: .65rem .8rem; border-left: 3px solid var(--green); border-radius: 4px 9px 9px 4px; background: #e5efeb; color: #3e5f5c; font-size: .76rem; line-height: 1.4; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; margin-top: .1rem; margin-bottom: .65rem; }
.summary-card { min-width: 0; min-height: 98px; padding: .82rem .9rem; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.summary-card.primary { border-color: #123d55; background: #123d55; color: var(--white); }
.summary-card > span { color: #55717d; font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.summary-card.primary > span { color: #9bcdd2; }
.summary-card strong { margin: auto 0 .18rem; overflow-wrap: anywhere; font-size: clamp(1.22rem, 1.9vw, 1.55rem); font-weight: 700; line-height: 1.06; }
.summary-card #statHigh, .summary-card #statRange { font-size: clamp(1.05rem, 1.55vw, 1.3rem); }
.summary-card small { color: #73868d; font-size: .68rem; line-height: 1.3; }
.summary-card.primary small { color: #c1d2d8; }

.map-card, .table-card { min-width: 0; margin-top: .65rem; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.panel-heading { min-height: 68px; padding: .78rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.panel-heading h2 { margin: .18rem 0 0; color: var(--ink); font-size: 1.22rem; font-weight: 700; line-height: 1.1; }
.map-tools { display: flex; align-items: center; gap: .45rem; }
.map-mode-toggle { height: 39px; padding: 3px; display: inline-flex; border: 1px solid #cbd8d3; border-radius: 8px; background: #edf2ef; }
.map-mode-toggle button { padding: 0 .65rem; border: 0; border-radius: 6px; background: transparent; color: #617875; cursor: pointer; font-size: .69rem; font-weight: 600; }
.map-mode-toggle button[aria-pressed="true"] { background: var(--white); color: var(--green); box-shadow: 0 1px 4px rgba(25, 65, 57, .12); }
.search { width: min(280px, 30vw); height: 39px; padding: 0 .62rem; display: flex; align-items: center; border: 1px solid #cbd8d3; border-radius: 8px; color: #64807d; }
.search input { width: 100%; min-width: 0; margin-left: .3rem; border: 0; outline: 0; background: transparent; color: #19363c; }
.icon-button { width: 39px; height: 39px; border: 1px solid #cbd8d3; border-radius: 8px; background: var(--white); color: #51706f; cursor: pointer; }
.map-wrap { position: relative; min-height: 380px; background: #071821; }
.map { display: block; width: 100%; height: auto; min-height: 380px; touch-action: manipulation; cursor: grab; }
.map.dragging { cursor: grabbing; }
.map-context path { fill: #172f39; stroke: #2b4a53; stroke-width: .7; vector-effect: non-scaling-stroke; }
.map-context.us-base path { fill: #1c3b46; stroke: none; }
.map-overlay path { fill: none; stroke: rgba(232, 246, 243, .88); stroke-width: .95; vector-effect: non-scaling-stroke; pointer-events: none; }
.boundary-layer path { cursor: pointer; stroke: rgba(4, 24, 30, .42); stroke-width: .48; vector-effect: non-scaling-stroke; transition: filter .12s, opacity .12s; }
.boundary-layer path.unmatched { fill: #1a333c; stroke: rgba(113, 151, 155, .25); }
.boundary-layer path:hover, .boundary-layer path:focus { filter: brightness(1.25); stroke: #f4fffc; stroke-width: 1.6; outline: none; }
.heat-surface, .choropleth-surface { image-rendering: auto; }
.map-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.map-zoom-controls { position: absolute; top: .75rem; right: .75rem; z-index: 4; display: grid; gap: .3rem; padding: .3rem; border: 1px solid rgba(205, 231, 226, .24); border-radius: 10px; background: rgba(4, 19, 27, .86); box-shadow: 0 6px 22px rgba(0, 0, 0, .2); }
.map-zoom-button { width: 36px; height: 36px; border: 1px solid rgba(221, 242, 238, .28); border-radius: 7px; background: rgba(24, 55, 63, .96); color: #effbf8; font-size: 1.05rem; line-height: 1; cursor: pointer; }
.map-zoom-button:hover, .map-zoom-button:focus-visible { border-color: var(--mint); background: #215d5a; outline: none; }
.map-gesture-note { position: absolute; left: .75rem; top: .75rem; z-index: 3; padding: .35rem .58rem; border: 1px solid rgba(157, 192, 194, .18); border-radius: 999px; background: rgba(4, 19, 27, .78); color: #b9cecd; font-size: .61rem; pointer-events: none; }
.map-tooltip { position: absolute; z-index: 5; max-width: 230px; padding: .62rem .75rem; border: 1px solid rgba(103, 221, 189, .42); border-radius: 8px; background: rgba(4, 19, 27, .96); box-shadow: var(--shadow); color: var(--white); font-size: .72rem; pointer-events: none; }
.map-tooltip strong, .map-tooltip span { display: block; }
.map-tooltip span { margin-top: .16rem; color: var(--mint); }
.map-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(5, 21, 29, .84); color: var(--white); }
.map-empty span { margin-top: .3rem; color: #aabdbf; font-size: .78rem; }
.legend { position: absolute; right: .75rem; bottom: .75rem; padding: .58rem .7rem; display: grid; grid-template-columns: auto 90px auto; align-items: center; gap: .4rem; border: 1px solid rgba(157, 192, 194, .2); border-radius: 8px; background: rgba(4, 19, 27, .88); color: #a9bcbe; font-size: .61rem; }
.legend i { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--mint), var(--gold), var(--coral)); }
.legend small { grid-column: 1 / -1; color: #71888d; }

.result-count { padding: .38rem .62rem; border-radius: 999px; background: #eff3f0; color: #657b82; font-size: .7rem; }
.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; contain: inline-size paint; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th { border-top: 1px solid #e3e8e4; border-bottom: 1px solid var(--line); background: #f4f6f3; text-align: left; }
th button { width: 100%; padding: .7rem 1rem; border: 0; background: transparent; color: #536f7b; text-align: inherit; text-transform: uppercase; letter-spacing: .07em; font-size: .64rem; font-weight: 700; cursor: pointer; }
th button span { opacity: .45; }
th.num, td.num { text-align: right; }
td { padding: .78rem 1rem; border-bottom: 1px solid #e7ebe8; color: #365154; font-size: .78rem; }
td strong { color: var(--ink); }
td small { display: block; margin-top: .12rem; color: #81908f; }
.component-tag { display: inline-block; padding: .2rem .38rem; border-radius: 999px; background: #e5efeb; color: #2f645c; font-size: .6rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.component-tag.one-time { background: #fff0d7; color: #805a1d; }
.row-open { width: 30px; height: 30px; border: 1px solid #d1ddd8; border-radius: 50%; background: var(--white); color: var(--green); cursor: pointer; }
tbody tr:hover { background: #f7fbf8; }
.show-more { display: block; margin: .9rem auto; padding: .58rem .9rem; border: 1px solid #c9d9d2; border-radius: 8px; background: var(--white); color: var(--green); font-weight: 600; cursor: pointer; }

.news-section { margin-top: .8rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #e8edef; }
.news-heading { margin-bottom: .75rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .85fr); gap: 1.25rem; align-items: end; }
.news-heading h2 { margin: .18rem 0 0; color: var(--ink); font-size: 1.22rem; font-weight: 700; }
.news-heading p { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.4; }
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.news-card { min-width: 0; min-height: 158px; padding: .9rem; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 9px; background: var(--white); }
.news-meta { display: flex; flex-wrap: wrap; gap: .35rem .55rem; color: #70848a; font-size: .59rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.news-type { color: var(--green); }
.news-card h3 { margin: .6rem 0 .35rem; color: var(--ink); font-size: 1rem; font-weight: 700; line-height: 1.18; }
.news-card p { margin: 0 0 .65rem; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.news-card a { margin-top: auto; color: #17657b; font-size: .7rem; font-weight: 600; text-decoration: underline; }
.news-policy, .news-loading { margin: .7rem 0 0; color: #70817e; font-size: .64rem; line-height: 1.4; }

.method-strip { margin-top: 2.1rem; margin-bottom: 2.1rem; padding: 1rem; display: grid; grid-template-columns: 1fr 1.35fr auto; gap: 1.3rem; align-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.method-strip h2 { margin: .2rem 0 0; color: var(--ink); font-size: 1.25rem; font-weight: 700; }
.method-strip p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.method-strip .text-button { color: #17657b; }

.drawer { position: fixed; right: 0; top: 0; z-index: 25; width: min(500px, 94vw); height: 100dvh; overflow-y: auto; visibility: hidden; padding: clamp(1.25rem, 4vw, 2.4rem); background: #f7f8f4; color: var(--ink); box-shadow: -20px 0 80px rgba(0, 0, 0, .28); transform: translateX(105%); transition: transform .25s ease, visibility 0s linear .25s; }
.drawer.open { visibility: visible; transform: translateX(0); transition-delay: 0s; }
.drawer-close, .dialog-close { float: right; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: #47605f; font-size: 1.2rem; cursor: pointer; }
.drawer h2 { margin: .45rem 0 .15rem; font-size: 1.8rem; font-weight: 700; letter-spacing: -.025em; }
.drawer > p { color: var(--muted); }
.detail-value { margin: 1.5rem 0 1rem; padding-left: .9rem; display: flex; flex-direction: column; border-left: 3px solid var(--green); }
.detail-value span { color: #104f46; font-size: 2.15rem; font-weight: 700; }
.detail-value small { color: #718682; }
.detail-facts { margin: 1.2rem 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.detail-facts div { padding: .72rem; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.detail-facts dt { color: #778987; text-transform: uppercase; letter-spacing: .08em; font-size: .58rem; font-weight: 700; }
.detail-facts dd { margin: .3rem 0 0; font-size: .82rem; font-weight: 600; }
.trend { margin: 1.5rem 0; }
.trend-heading { display: flex; align-items: center; justify-content: space-between; }
.trend h3 { font-size: 1.08rem; font-weight: 700; }
.trend-heading span { color: var(--green); font-size: .72rem; font-weight: 700; }
#trendChart { width: 100%; height: auto; overflow: visible; }
.trend-axis { display: flex; justify-content: space-between; color: #82928f; font-size: .65rem; }
.detail-caveat { padding: .75rem; border-radius: 8px; background: #e9efeb; font-size: .72rem; line-height: 1.45; }
.source-link { color: #17657b; font-weight: 600; text-decoration: underline; }
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(1, 11, 16, .65); backdrop-filter: blur(2px); }

dialog { width: min(700px, calc(100vw - 2rem)); max-height: 85dvh; overflow: auto; padding: 1.5rem; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(1, 11, 16, .68); backdrop-filter: blur(3px); }
dialog h2 { font-size: 1.65rem; font-weight: 700; }
#sourceContent { color: #496260; line-height: 1.55; }
#sourceContent h3 { margin-bottom: .2rem; color: var(--ink); }
#sourceContent a { color: #17657b; }
footer { padding: 1.6rem max(1rem, calc((100vw - 1120px) / 2)); display: flex; justify-content: space-between; gap: 2rem; background: var(--navy); color: #8ea5ad; font-size: .68rem; }
footer div { display: flex; flex-direction: column; gap: .15rem; }
footer strong { color: #dbe8e6; }
footer p { margin: 0; text-align: right; }

@media (max-width: 980px) {
  .control-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .site-header { padding-inline: 1rem; }
  .brand-copy small { display: none; }
  .control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-tools { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; width: 100%; }
  .method-strip { grid-template-columns: 1fr; gap: .35rem; }
  footer { flex-direction: column; gap: .7rem; }
  footer p { text-align: left; }
}

@media (max-width: 560px) {
  .site-header { height: 52px; padding-inline: .7rem; gap: .6rem; }
  .brand { gap: .35rem; }
  .family-mark { font-size: .92rem; }
  .brand-copy strong { font-size: .67rem; }
  .header-actions { gap: .7rem; }
  .header-actions .text-button { display: none; }
  .freshness { display: none; }
  .hero { min-height: 112px; padding: .85rem .75rem .95rem; }
  .hero h1 { font-size: 1.85rem; }
  .hero p { font-size: .78rem; }
  .program-tabs, .control-deck, .summary-grid, .map-card, .table-card, .news-section, .method-strip { width: calc(100% - 1rem); }
  .workspace { padding-top: .5rem; }
  .program-tabs button { min-height: 58px; padding: .4rem .18rem; text-align: center; align-items: center; }
  .program-tabs span { font-size: .67rem; line-height: 1.05; }
  .program-tabs small { font-size: .5rem; line-height: 1.05; }
  .program-tabs button[data-ready="false"] small::after { content: ""; }
  .control-deck { padding-top: .65rem; }
  .control-grid { gap: .5rem; }
  .field > span { font-size: .59rem; }
  .field select, .field input { height: 42px; padding-inline: .55rem; font-size: .78rem; }
  .program-note { font-size: .7rem; }
  .summary-grid { gap: .5rem; }
  .summary-card { min-height: 88px; padding: .7rem .72rem; }
  .summary-card strong, .summary-card #statHigh, .summary-card #statRange { font-size: 1.08rem; }
  .summary-card > span { font-size: .56rem; }
  .summary-card small { font-size: .62rem; }
  .panel-heading { padding: .7rem; align-items: flex-start; flex-direction: column; }
  .map-tools { width: 100%; }
  .map-mode-toggle { flex: 1; }
  .map-mode-toggle button { flex: 1; }
  .map-wrap, .map { min-height: 325px; }
  .map-gesture-note { top: auto; bottom: .6rem; max-width: calc(100% - 9.5rem); border-radius: 8px; white-space: normal; }
  .legend { grid-template-columns: auto 65px auto; }
  .news-section { padding: .75rem; }
  .news-heading { grid-template-columns: 1fr; gap: .3rem; }
  .news-grid { grid-template-columns: 1fr; }
  .news-card { min-height: 0; }
  .detail-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
