:root {
  --navy: #18372b;
  --navy-2: #355844;
  --ink: #302b25;
  --gold: #9a6f3f;
  --ivory: #f3efe5;
  --paper: #fffdf7;
  --line: #d6cbbb;
  --muted: #6f675d;
  --blue-wash: #e7ece2;
  --shadow: 0 22px 60px rgba(44, 54, 39, 0.12);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--ivory);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, select { font: inherit; }

.site-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 4vw, 64px);
  background: var(--navy);
  color: white;
  border-bottom: 3px solid var(--gold);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.48);
  color: var(--ivory);
  font: 600 16px/1 Georgia, serif;
  letter-spacing: .08em;
}

.brand-copy { display: grid; text-transform: uppercase; letter-spacing: .12em; }
.brand-copy strong { font: 600 15px/1.3 Georgia, serif; }
.brand-copy small { margin-top: 2px; color: #d9d3c7; font-size: 10px; }
.header-label { color: #e4ded2; font: 14px Georgia, serif; letter-spacing: .08em; }

.county-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 clamp(16px, 3vw, 44px);
  background: #fffdf7;
  border-bottom: 1px solid var(--line);
}
.county-nav a {
  flex: 0 0 auto;
  padding: 13px 12px 11px;
  border-bottom: 3px solid transparent;
  color: var(--navy);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}
.county-nav a:hover, .county-nav a:focus-visible { border-bottom-color: var(--gold); }
.county-nav a[aria-current="page"] { border-bottom-color: var(--navy); }

main { width: min(1500px, 100%); margin: 0 auto; padding: 0 clamp(16px, 3vw, 44px) 64px; }

.intro { padding: clamp(32px, 6vw, 72px) 2px 28px; }
.eyebrow { margin: 0 0 8px; color: var(--gold); font-size: 13px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.intro-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; }
h1, h2, h3 { margin: 0; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { max-width: 800px; font-size: clamp(40px, 6vw, 76px); line-height: .98; letter-spacing: -.035em; }
.lede { max-width: 700px; margin: 18px 0 0; color: #536170; font-size: clamp(17px, 2vw, 21px); }
.source-stamp { display: grid; min-width: 220px; gap: 5px; padding: 18px 20px; border: 1px solid #254c3b; background: var(--navy); color: white; text-decoration: none; }
.source-stamp span, .source-stamp small { color: #ded7ca; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.source-stamp strong { max-width: 210px; color: white; font: 500 23px/1.08 Georgia, serif; }

.workspace { overflow: hidden; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.controls { display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: 18px; padding: 24px clamp(18px, 3vw, 36px); background: var(--navy); }
.controls label { display: grid; gap: 7px; color: #dce4eb; font-size: 13px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
select { width: 100%; min-height: 48px; padding: 0 40px 0 13px; border: 1px solid #bac3ca; border-radius: 0; background: white; color: var(--ink); font-size: 16px; }
select:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #d7b778; outline-offset: 2px; }

.result-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 30px clamp(18px, 3vw, 36px) 24px; border-bottom: 1px solid var(--line); }
.result-heading h2 { font-size: clamp(28px, 4vw, 48px); line-height: 1.05; }
.result-heading p:last-child { margin: 10px 0 0; color: var(--muted); }
.secondary-button, .pagination button { min-height: 44px; padding: 0 18px; border: 1px solid var(--navy); background: transparent; color: var(--navy); font-weight: 750; cursor: pointer; }
.secondary-button:hover, .pagination button:hover:not(:disabled) { background: var(--navy); color: white; }

.chart-panel { padding: 26px clamp(18px, 3vw, 36px) 30px; background: var(--blue-wash); border-bottom: 1px solid var(--line); }
.chart-copy h3 { font-size: clamp(23px, 3vw, 34px); }
.chart-copy p:last-child { margin: 8px 0 0; color: var(--muted); }
.chart-metric-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chart-metric-tabs button { min-height: 40px; padding: 0 14px; border: 1px solid var(--navy); background: transparent; color: var(--navy); cursor: pointer; font-weight: 760; }
.chart-metric-tabs button[aria-pressed="true"] { background: var(--navy); color: white; }
.chart-metric-tabs button:hover { border-color: var(--gold); }
.chart { display: grid; gap: 11px; margin-top: 22px; }
.bar-row { display: grid; grid-template-columns: minmax(150px, 250px) 1fr 120px; align-items: center; gap: 12px; }
.bar-label { overflow: hidden; color: var(--navy); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 20px; background: rgba(11,39,69,.1); }
.bar-fill { height: 100%; min-width: 3px; background: var(--navy-2); }
.bar-value { color: var(--navy); font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }

.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 58px; padding: 8px clamp(18px, 3vw, 36px); }
.table-toolbar p { margin: 0; color: var(--muted); }
.page-size { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.page-size select { min-height: 38px; width: 82px; font-size: 14px; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
table { width: 100%; min-width: 960px; border-collapse: collapse; }
th { background: #edf1f3; color: var(--navy); font-size: 13px; text-align: left; text-transform: uppercase; letter-spacing: .04em; }
th button { width: 100%; padding: 14px 12px; border: 0; background: transparent; color: inherit; font-weight: 800; text-align: inherit; cursor: pointer; }
th button span { color: var(--gold); }
td { padding: 13px 12px; border-top: 1px solid #e5e1d9; background: white; font-variant-numeric: tabular-nums; }
tbody tr:nth-child(even) td { background: #fbfaf7; }
tbody tr:hover td { background: #f1f5f7; }
.numeric { text-align: right; }
.county-name { color: var(--navy); font-weight: 720; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 18px; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination span { min-width: 92px; color: var(--muted); text-align: center; }

.trend-section { padding: clamp(28px, 4vw, 46px) clamp(18px, 3vw, 36px) 42px; border-top: 1px solid var(--line); background: #f8f6ef; }
.trend-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.trend-heading h3 { max-width: 780px; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.08; }
.trend-heading p:last-child { margin: 10px 0 0; color: var(--muted); }
.trend-legend { display: grid; flex: 0 0 auto; gap: 8px; color: var(--navy); font-size: 14px; font-weight: 720; }
.trend-legend span { display: flex; align-items: center; gap: 9px; }
.trend-legend i { display: inline-block; width: 26px; }
.legend-bar { height: 12px; border-radius: 2px; background: #9fb8aa; }
.legend-line { height: 3px; background: var(--gold); box-shadow: 8px 0 0 -1px var(--paper), 8px 0 0 2px var(--gold); }
.trend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.trend-card { min-width: 0; padding: 20px 20px 14px; border: 1px solid var(--line); background: var(--paper); box-shadow: 0 8px 24px rgba(44, 54, 39, .07); }
.trend-card-heading h4 { margin: 0; color: var(--navy); font: 600 clamp(19px, 2vw, 24px)/1.12 Georgia, "Times New Roman", serif; }
.trend-card-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.trend-figure { position: relative; margin: 14px 0 0; }
.trend-figure svg { display: block; width: 100%; height: auto; overflow: visible; }
.trend-gridline { stroke: #dcd6cb; stroke-width: 1; }
.trend-axis-label, .trend-year-label, .trend-break-label { fill: var(--muted); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 10px; }
.trend-axis-title { fill: var(--navy); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 11px; font-weight: 760; text-transform: uppercase; }
.trend-break-label { fill: #7e5c35; font-size: 9px; font-weight: 760; text-transform: uppercase; }
.trend-bar { fill: #9fb8aa; }
.trend-agi-line { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.trend-agi-point { fill: var(--paper); stroke: var(--gold); stroke-width: 3; }
.trend-break-line { stroke: #9a6f3f; stroke-width: 1.5; stroke-dasharray: 4 4; }
.trend-hit { fill: transparent; cursor: crosshair; }
.trend-hit:focus { outline: none; stroke: var(--navy); stroke-width: 1.5; stroke-dasharray: 3 3; }
.trend-tooltip { position: absolute; z-index: 2; top: 28px; display: grid; min-width: 148px; gap: 2px; padding: 9px 11px; transform: translateX(-50%); border: 1px solid #bca98d; background: rgba(24, 55, 43, .96); color: white; box-shadow: 0 8px 22px rgba(24, 55, 43, .2); pointer-events: none; font-size: 12px; }
.trend-tooltip[hidden] { display: none; }
.trend-tooltip strong { color: #f0d9ae; }
.trend-note { max-width: 1040px; margin: 22px 0 0; color: var(--muted); font-size: 13px; }

.county-history { margin-top: 32px; padding: clamp(28px, 4vw, 46px); border: 1px solid var(--line); background: #f8f6ef; box-shadow: var(--shadow); }
.history-section-heading { max-width: 930px; }
.history-section-heading h2 { font-size: clamp(30px, 4vw, 48px); line-height: 1.06; }
.history-section-heading > p:last-child, .crawlable-history-heading > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 17px; }
.history-sync-status { margin: 28px 0; padding: 15px 18px; border-left: 4px solid var(--gold); background: var(--navy); color: white; font-size: 14px; font-weight: 760; letter-spacing: .02em; }
.history-live-heading { margin: 0 0 22px; }
.history-live-heading h3 { font-size: clamp(25px, 3vw, 36px); }
.history-live-heading p { margin: 8px 0 0; color: var(--muted); }
.crawlable-history { margin-top: 42px; padding-top: 38px; border-top: 1px solid var(--line); }
.crawlable-history-heading { max-width: 900px; }
.crawlable-history-heading h3 { font-size: clamp(26px, 3.2vw, 40px); }
.history-source-flow { margin-top: 36px; }
.history-source-heading h4 { margin: 0; color: var(--navy); font: 500 clamp(23px, 2.7vw, 32px)/1.1 Georgia, "Times New Roman", serif; }
.history-ranking-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.history-ranking { padding: 18px; border: 1px solid var(--line); background: var(--paper); }
.history-ranking h5 { margin: 0; color: var(--navy); font: 600 18px/1.25 Georgia, "Times New Roman", serif; }
.history-ranking ol { display: grid; gap: 7px; margin: 14px 0 0; padding-left: 24px; }
.history-ranking li { padding-left: 2px; color: var(--gold); }
.history-ranking li span { color: var(--ink); }
.history-ranking li strong { float: right; margin-left: 16px; color: var(--navy); font-variant-numeric: tabular-nums; }
.history-data-details { margin-top: 16px; border: 1px solid var(--line); background: var(--paper); }
.history-data-details summary { padding: 16px 18px; color: var(--navy); font-weight: 800; cursor: pointer; }
.history-table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.history-table { min-width: 840px; }
.history-table caption { padding: 13px 12px; background: #edf1f3; color: var(--navy); font-size: 13px; font-weight: 800; text-align: left; text-transform: uppercase; letter-spacing: .04em; }
.history-table th { padding: 12px; }

.methodology { margin: 28px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.methodology summary { padding: 18px 2px; color: var(--navy); font-weight: 800; cursor: pointer; }
.methodology div { max-width: 900px; padding: 0 2px 18px; color: var(--muted); }
.methodology p { margin: 0 0 10px; }

footer { display: flex; justify-content: space-between; gap: 28px; padding: 26px clamp(20px, 4vw, 64px); background: var(--navy); color: #dce3e8; font-size: 13px; }

@media (max-width: 760px) {
  .header-label, .source-stamp { display: none; }
  .site-header { min-height: 72px; }
  .intro-row, .result-heading { align-items: stretch; flex-direction: column; }
  .controls { grid-template-columns: 1fr; }
  .secondary-button { width: 100%; }
  .chart-metric-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .chart-metric-tabs button { width: 100%; }
  .bar-row { grid-template-columns: minmax(110px, 150px) 1fr; }
  .bar-value { grid-column: 2; text-align: left; }
  .trend-heading { align-items: stretch; flex-direction: column; }
  .trend-grid { grid-template-columns: 1fr; }
  .trend-card { padding: 17px 12px 10px; }
  .county-history { padding: 26px 16px; }
  .history-sync-status { padding: 14px 15px; }
  .history-ranking-grid { grid-template-columns: 1fr; }
  .history-ranking li strong { float: none; display: block; margin: 2px 0 0; }
  footer { flex-direction: column; }
}

@media (min-width: 761px) and (max-width: 1120px) {
  .trend-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  .bar-fill { transition: width .35s ease; }
  button, select { transition: background-color .16s ease, color .16s ease, border-color .16s ease; }
}
.intro{padding-top:32px}.intro h1{font-size:clamp(36px,5vw,60px)}.lede{color:var(--muted);font-size:18px}.brand-copy small{font-size:12px}.source-stamp span,.source-stamp small{font-size:12px}.controls label{font-size:14px}.eyebrow,th{font-size:14px}input{width:100%;min-height:48px;padding:0 13px;font:inherit;border:1px solid #bac3ca;border-radius:0;color:var(--ink);background:white}input:focus-visible,a:focus-visible{outline:3px solid #d7b778;outline-offset:2px}.sort-label{min-width:220px;font-size:14px;color:var(--muted)}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;padding:24px 36px}.stat{border-left:3px solid var(--gold);padding-left:16px}.stat span{display:block;color:var(--muted);font-size:14px}.stat strong{font:500 clamp(24px,3vw,36px) Georgia,serif;color:var(--navy)}#status{padding:0 36px;color:#8b3020}.distribution{padding:28px 36px;border-top:1px solid var(--line)}.distribution h3{font-size:30px}.distribution p{color:var(--muted)}#detail{display:grid;gap:12px}.detail-row{display:grid;grid-template-columns:200px 1fr 200px;gap:12px;align-items:center}.zip-button{border:0;background:transparent;color:var(--navy);font:inherit;font-weight:750;text-decoration:underline;cursor:pointer;padding:5px}table{min-width:800px}.bar-row{grid-template-columns:100px 1fr 170px}.chart-panel{background:#e7ece2}a{color:var(--navy)}@media(max-width:760px){.stats{grid-template-columns:1fr;padding:24px 18px}.sort-label{min-width:0}.distribution{padding:24px 18px}.detail-row{grid-template-columns:1fr;gap:4px}.bar-row{grid-template-columns:70px 1fr}.table-toolbar{flex-wrap:wrap}#export{width:auto}.intro{padding-top:24px}footer{font-size:14px}} 
