:root {
  color-scheme: light;
  --ink: #102238;
  --green-950: #0d3d2a;
  --green-800: #174f37;
  --green-700: #246747;
  --green-100: #e1eee5;
  --blue-700: #356f9f;
  --blue-100: #d9e8f4;
  --amber-700: #8a6422;
  --amber-100: #f1e5c8;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --muted: #5d6976;
  --line: #d9ddd8;
  --map-water: #edf2f0;
  --radius: 12px;
  --shadow: 0 18px 50px rgba(16, 34, 56, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.55;
}

a { color: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  min-height: 76px;
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(16, 34, 56, 0.09);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green-950);
  text-decoration: none;
}

.brand-mark { width: 36px; height: 40px; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-mark path:first-child { fill: none; stroke: currentColor; stroke-width: 1.8; }
.brand-mark path:last-child { fill: currentColor; }
.brand strong { display: block; font: 700 24px/1 Georgia, serif; letter-spacing: -0.02em; }
.brand small { display: block; margin-top: 3px; font-weight: 800; line-height: 1; letter-spacing: 0.16em; }

.site-header nav, footer nav { display: flex; align-items: center; gap: 30px; }
.site-header nav a, footer nav a { color: var(--ink); font-weight: 650; text-decoration: none; }
.site-header nav a { padding: 25px 2px 22px; border-bottom: 3px solid transparent; }
.site-header nav a[aria-current="page"] { color: var(--green-800); border-color: var(--green-800); }
.site-header nav a:hover, footer nav a:hover { color: var(--green-700); }

main { width: min(1480px, calc(100% - 48px)); margin: 0 auto; }

.hero { padding: clamp(52px, 8vw, 112px) 0 42px; }
.hero-copy { max-width: 1040px; }

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; color: var(--green-950); }
h1 { margin: 0; max-width: 1000px; font-size: clamp(42px, 6vw, 78px); line-height: 0.98; letter-spacing: -0.045em; }
.hero-copy > p:not(.evidence-caution) { max-width: 850px; margin: 25px 0 20px; color: #34445a; font-size: clamp(18px, 2vw, 24px); }
.evidence-caution { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--green-950); font-weight: 700; }
.evidence-caution svg { width: 22px; flex: 0 0 auto; fill: var(--green-800); }
.evidence-caution svg path:last-child { fill: none; stroke: white; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.coverage-explorer { padding: 38px 0 76px; border-top: 1px solid var(--line); }
.explorer-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.explorer-heading h2, .explanation h2, .source-register h2,
.supporting-sources h2, .correction-path h2 { margin: 0; font-size: clamp(30px, 3.6vw, 45px); line-height: 1.05; letter-spacing: -0.03em; }
.explorer-heading p { margin: 8px 0 0; color: var(--muted); }
.review-date { font-size: 14px; font-weight: 700; white-space: nowrap; }

.layer-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  border: 1px solid #b9c0ba;
  border-radius: 9px;
  overflow: hidden;
  background: var(--surface);
}

.layer-tabs button {
  min-height: 56px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--ink);
  border: 0;
  border-right: 1px solid #cfd4cf;
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.layer-tabs button:last-child { border-right: 0; }
.layer-tabs button[aria-selected="true"] { color: white; background: var(--green-950); }
.layer-tabs button:focus-visible { outline: 3px solid #87b7e1; outline-offset: -4px; }
.layer-tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.legend { margin: 22px 0; display: flex; flex-wrap: wrap; gap: 14px 28px; }
.legend > span { display: grid; grid-template-columns: 18px auto; column-gap: 9px; align-items: center; }
.legend small { grid-column: 2; color: var(--muted); font-size: 12px; }
.legend-swatch { display: inline-block; width: 17px; height: 17px; border-radius: 3px; border: 1px solid rgba(16, 34, 56, 0.14); }
.legend-swatch.enhanced { background: var(--green-700); }
.legend-swatch.baseline { background: var(--blue-100); border-color: #7ba2c2; }
.legend-swatch.limited { background: var(--amber-100); border-color: #cbb886; }

.explorer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 28px; align-items: stretch; }
.map-wrap { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--map-water); }
#coverage-map { min-height: 680px; height: 100%; width: 100%; background: var(--map-water); }
.map-status { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); z-index: 500; margin: 0; padding: 10px 14px; border-radius: 6px; background: rgba(255,255,255,.92); color: var(--muted); font-weight: 700; }
.map-status[hidden] { display: none; }
.map-help { position: absolute; left: 14px; bottom: 10px; z-index: 500; margin: 0; padding: 5px 8px; border-radius: 5px; background: rgba(255,255,255,.91); color: #4c5968; font-size: 12px; }
.leaflet-container { font: inherit; }
.leaflet-control-zoom a { color: var(--green-950); }
.leaflet-tooltip { border: 0; border-radius: 5px; box-shadow: var(--shadow); color: var(--ink); font: 700 13px/1.2 Inter, ui-sans-serif, system-ui, sans-serif; }
.leaflet-interactive:focus { outline: 3px solid #102238; outline-offset: 1px; }

.jurisdiction-detail {
  min-height: 680px;
  padding: 28px;
  border: 1px solid #8d9b91;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.detail-title { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.detail-title h3 { margin: 0; font-size: 32px; line-height: 1.05; }
.detail-title p { margin: 4px 0 0; color: var(--muted); font-weight: 800; }
.status-label { display: inline-flex; align-items: center; gap: 7px; max-width: 138px; font-size: 12px; font-weight: 850; line-height: 1.15; }
.status-label i { width: 11px; height: 11px; flex: 0 0 auto; border-radius: 50%; background: #8a9298; }
.status-label.enhanced i { background: var(--green-700); }
.status-label.baseline i { background: #72a4cf; }
.status-label.limited i { background: #c6a253; }
.layer-summary { margin: 22px 0; color: #34445a; font-size: 17px; }
.jurisdiction-detail section { margin-top: 25px; }
.jurisdiction-detail h4 { margin: 0 0 8px; color: var(--green-950); font-size: 14px; letter-spacing: 0.03em; text-transform: uppercase; }
.jurisdiction-detail ul { margin: 0; padding: 0; list-style: none; }
.jurisdiction-detail li { position: relative; margin: 9px 0; padding-left: 18px; }
.jurisdiction-detail li::before { content: ""; position: absolute; left: 0; top: .58em; width: 7px; height: 7px; border-radius: 50%; background: var(--green-700); }
.jurisdiction-detail section p { margin: 0; color: #455261; }
.detail-meta { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.detail-meta div { display: flex; justify-content: space-between; gap: 20px; margin: 7px 0; }
.detail-meta dt { color: var(--muted); }
.detail-meta dd { margin: 0; text-align: right; font-weight: 750; }

.boundary-attribution { margin: 15px 0 0; color: var(--muted); font-size: 12px; }
.boundary-attribution a { color: var(--green-800); text-underline-offset: 2px; }

.jurisdiction-browser { margin-top: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.jurisdiction-browser summary { padding: 16px 0; color: var(--green-950); font-weight: 800; cursor: pointer; }
.jurisdiction-list { padding: 0 0 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.jurisdiction-list button { padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); text-align: left; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.jurisdiction-list button:hover, .jurisdiction-list button:focus-visible { border-color: var(--green-700); color: var(--green-800); outline: none; }

.explanation { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(38px, 7vw, 100px); padding: 78px 0; border-top: 1px solid var(--line); }
.meaning dl { margin: 30px 0 0; }
.meaning dl div { display: grid; grid-template-columns: 185px 1fr; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.meaning dt { display: flex; align-items: center; gap: 11px; color: var(--green-950); font-weight: 850; }
.meaning dd { margin: 0; color: #465465; }
.decision ol { margin: 30px 0 0; padding: 0; list-style: none; counter-reset: steps; }
.decision li { position: relative; margin: 0 0 18px; padding-left: 46px; counter-increment: steps; }
.decision li::before { content: counter(steps); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green-950); font-size: 13px; font-weight: 850; }
.decision strong, .decision span { display: block; }
.decision span { margin-top: 2px; color: #465465; }

.source-register { display: grid; grid-template-columns: minmax(260px, .65fr) 1.35fr; gap: clamp(38px, 7vw, 100px); padding: 78px 0; border-top: 1px solid var(--line); }
.source-register p { color: var(--muted); }
.source-register ul { margin: 0; padding: 0; list-style: none; }
.source-register li { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.source-register li:first-child { border-top: 1px solid var(--line); }
.source-register li strong, .source-register li span,
.source-register li small { display: block; }
.source-register li span { margin-top: 3px; color: var(--muted); font-size: 14px; }
.source-register li small { margin-top: 5px; color: var(--green-800); font-weight: 750; }
.source-register a { align-self: center; color: var(--green-800); font-weight: 800; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.supporting-sources { display: grid; grid-template-columns: minmax(260px, .65fr) 1.35fr; gap: clamp(38px, 7vw, 100px); padding: 78px 0; border-top: 1px solid var(--line); }
.supporting-sources p, .supporting-sources span { color: var(--muted); }
.supporting-sources ul { margin: 0; padding: 0; list-style: none; }
.supporting-sources li { padding: 15px 0; border-bottom: 1px solid var(--line); }
.supporting-sources li:first-child { border-top: 1px solid var(--line); }
.supporting-sources strong, .supporting-sources span { display: block; }
.supporting-sources span { margin-top: 4px; }

.correction-path { margin: 0 0 30px; padding: clamp(30px, 5vw, 48px); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; border: 1px solid #8d9b91; border-radius: var(--radius); background: var(--surface); }
.correction-path h2 { font-size: clamp(26px, 3vw, 38px); }
.correction-path p { max-width: 820px; margin: 10px 0 0; color: var(--muted); }
.correction-path a { padding: 13px 18px; border-radius: 7px; color: white; background: var(--green-950); font-weight: 800; text-decoration: none; white-space: nowrap; }
.correction-path a:hover { background: var(--green-700); }

.safety-note { margin: 0 0 80px; padding: clamp(30px, 5vw, 56px); display: grid; grid-template-columns: 1.1fr 1fr auto; align-items: center; gap: 30px; border-radius: var(--radius); color: white; background: var(--green-950); }
.safety-note strong { font: 700 clamp(26px, 3vw, 38px)/1.08 Georgia, serif; }
.safety-note p { margin: 0; color: #dbe8df; }
.safety-note a { padding: 13px 18px; border: 1px solid rgba(255,255,255,.7); border-radius: 7px; color: white; font-weight: 800; text-decoration: none; white-space: nowrap; }
.safety-note a:hover { color: var(--green-950); background: white; }

footer { min-height: 94px; width: min(1480px, calc(100% - 48px)); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer nav { gap: 20px; }

@media (max-width: 980px) {
  .explorer-grid { grid-template-columns: 1fr; }
  #coverage-map { min-height: 600px; }
  .jurisdiction-detail { min-height: 0; }
  .explanation, .source-register, .supporting-sources { grid-template-columns: 1fr; gap: 36px; }
  .correction-path { grid-template-columns: 1fr; }
  .correction-path a { justify-self: start; }
  .safety-note { grid-template-columns: 1fr; }
  .safety-note a { justify-self: start; }
}

@media (max-width: 680px) {
  .site-header, main, footer { width: min(100% - 28px, 1480px); }
  .site-header { min-height: 66px; }
  .brand strong { font-size: 20px; }
  .brand-mark { width: 30px; height: 34px; }
  .site-header nav { gap: 16px; }
  .site-header nav a { padding: 20px 0 17px; font-size: 13px; }
  .hero { padding-top: 48px; }
  h1 { font-size: clamp(39px, 12vw, 58px); }
  .explorer-heading { align-items: start; flex-direction: column; }
  .layer-tabs { display: grid; width: 100%; grid-template-columns: repeat(3, 1fr); }
  .layer-tabs button { min-width: 0; padding: 0 8px; font-size: 14px; }
  .layer-tabs svg { width: 19px; }
  .legend { display: grid; grid-template-columns: 1fr; }
  #coverage-map { min-height: 500px; }
  .map-help { display: none; }
  .jurisdiction-detail { padding: 22px; }
  .detail-title { flex-direction: column; }
  .meaning dl div { grid-template-columns: 1fr; gap: 5px; }
  .explanation, .source-register, .supporting-sources { padding: 58px 0; }
  .source-register li { grid-template-columns: 1fr; }
  .safety-note { margin-bottom: 54px; }
  footer { padding: 28px 0; align-items: start; flex-direction: column; }
  footer p { margin: 0; }
  footer nav { align-items: start; flex-wrap: wrap; gap: 12px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
