/* Hazard Plain explorer. Independent product: neutral ink, one muted green
   accent, no agency colors. Light and dark themes from the same tokens. */
:root {
  color-scheme: light dark;
  --bg: #fbfbf9;
  --surface: #ffffff;
  --ink: #1b1b1a;
  --ink-2: #4d4c48;
  --rule: #d9d8d3;
  --rule-2: #ecebe7;
  --accent: #1f6b57;
  --accent-soft: #e4f0eb;
  --banner-bg: #fff3d4;
  --banner-ink: #3d2e00;
  --flag-bg: #fdecea;
  --flag-ink: #7a1c14;
  --b0: #c8322f;   /* lapsed or never covered */
  --b1: #f0a09a;   /* expires within 12 months */
  --b2: #86b6ef;   /* expires in 12 to 24 months */
  --b3: #256abf;   /* covered beyond 24 months */
  --b4: #d9d8d4;   /* absent from FEMA plan data (hatched) */
  --b4-hatch: #8f8e89;
  --map-line: #ffffff;
  --map-border: #3b3a37;
  --focus: #1f6b57;
  --swatch-edge: rgba(0, 0, 0, .25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413;
    --surface: #1d1d1b;
    --ink: #f1f0ea;
    --ink-2: #c3c2b7;
    --rule: #3c3b37;
    --rule-2: #2a2a27;
    --accent: #86d0b4;
    --accent-soft: #1f3530;
    --banner-bg: #3a3220;
    --banner-ink: #f5e6c0;
    --flag-bg: #43201c;
    --flag-ink: #ffc9c2;
    --b0: #e66767;
    --b1: #9a3534;
    --b2: #1c5cab;
    --b3: #6da7ec;
    --b4: #4a4945;
    --b4-hatch: #77766f;
    --map-line: #1d1d1b;
    --map-border: #d6d5cd;
    --focus: #86d0b4;
    --swatch-edge: rgba(255, 255, 255, .45);
  }
}
:root[data-theme="dark"] {
  --bg: #141413; --surface: #1d1d1b; --ink: #f1f0ea; --ink-2: #c3c2b7; --rule: #3c3b37; --rule-2: #2a2a27;
  --accent: #86d0b4; --accent-soft: #1f3530; --banner-bg: #3a3220; --banner-ink: #f5e6c0;
  --flag-bg: #43201c; --flag-ink: #ffc9c2; --b0: #e66767; --b1: #9a3534; --b2: #1c5cab; --b3: #6da7ec;
  --b4: #4a4945; --b4-hatch: #77766f; --map-line: #1d1d1b; --map-border: #d6d5cd; --focus: #86d0b4;
  --swatch-edge: rgba(255, 255, 255, .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: anywhere;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
h1 { font-size: 1.9rem; line-height: 1.2; margin: 1.2rem 0 .4rem; overflow-wrap: normal; }
h2 { font-size: 1.3rem; line-height: 1.3; margin: 2rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 0 0 .4rem; }
p { margin: .4rem 0 .7rem; }
.lede { font-size: 1.08rem; color: var(--ink-2); max-width: 70ch; }
.note, .muted { color: var(--ink-2); font-size: .93rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.preview-banner { background: var(--banner-bg); color: var(--banner-ink); font-size: .92rem; padding: 8px 0; border-bottom: 1px solid var(--rule); }
/* A-110e: site built with --allow-stale */
.nfr-banner { background: var(--flag-bg); color: var(--flag-ink); font-size: 1rem; padding: 10px 0; border-bottom: 2px solid var(--flag-ink); text-align: center; letter-spacing: .02em; }
.site-header { border-bottom: 1px solid var(--rule); background: var(--surface); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px; padding-top: 12px; padding-bottom: 12px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-footer { margin-top: 3rem; border-top: 1px solid var(--rule); background: var(--surface); color: var(--ink-2); font-size: .9rem; padding: 1rem 0 2rem; }
.site-footer .disclaimer { max-width: 80ch; }

.crumbs { font-size: .9rem; margin-top: 1rem; color: var(--ink-2); }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 16px; margin: 1rem 0; }
.card h2 { margin-top: .3rem; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px 20px; margin: .4rem 0 .6rem; }
.facts div { min-width: 0; }
.facts dt { font-size: .82rem; color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 600; }

.stat-tiles { list-style: none; padding: 0; margin: .5rem 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; }
.tile-n { display: block; font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-l { font-size: .9rem; color: var(--ink-2); }

.swatch { display: inline-block; width: .9em; height: .9em; border-radius: 2px; margin-right: .4em; vertical-align: -.08em; border: 1px solid var(--swatch-edge); }
.b-lapsed_or_never_covered { background: var(--b0); }
.b-expires_within_12_months { background: var(--b1); }
.b-expires_12_to_24_months { background: var(--b2); }
.b-covered_beyond_24_months { background: var(--b3); }
.b-absent_from_plan_data { background: repeating-linear-gradient(45deg, var(--b4) 0 3px, var(--b4-hatch) 3px 4px); }
.b-edge-lapsed_or_never_covered { border-left: 6px solid var(--b0); }
.b-edge-expires_within_12_months { border-left: 6px solid var(--b1); }
.b-edge-expires_12_to_24_months { border-left: 6px solid var(--b2); }
.b-edge-covered_beyond_24_months { border-left: 6px solid var(--b3); }
.b-edge-absent_from_plan_data { border-left: 6px solid var(--b4-hatch); }
.clock-status { font-size: 1.25rem; font-weight: 700; margin: .2rem 0 .5rem; }

/* tables scroll inside their own container, never the page */
.table-scroll { max-width: 100%; overflow-x: auto; margin: .6rem 0 1rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; overflow-wrap: normal; }
caption { text-align: left; font-weight: 600; padding: 8px 10px 4px; }
th, td { padding: 6px 10px; border-bottom: 1px solid var(--rule-2); text-align: left; vertical-align: top; }
thead th { background: var(--rule-2); font-size: .85rem; white-space: nowrap; }
tbody th { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th .unit { display: block; font-weight: 400; font-size: .75rem; color: var(--ink-2); white-space: normal; }
table.counts { width: auto; min-width: 280px; }
table.members td.wide { min-width: 16rem; }
table.members th[scope="row"] { min-width: 9rem; }
table.units td.dl { white-space: nowrap; }
table.units td.dl a { margin-right: .5em; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 20px; }

/* sortable headers */
th button.sort { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
th button.sort::after { content: " \2195"; color: var(--ink-2); }
th[aria-sort="ascending"] button.sort::after { content: " \2191"; }
th[aria-sort="descending"] button.sort::after { content: " \2193"; }

/* downloads */
.dl-bar { list-style: none; padding: 0; margin: .3rem 0 .6rem; display: flex; flex-wrap: wrap; gap: 8px; }
.dl-btn { display: inline-flex; flex-direction: column; min-width: 7.5rem; padding: 8px 14px; border: 1px solid var(--accent); border-radius: 6px; text-decoration: none; background: var(--accent-soft); color: var(--ink); }
.dl-btn:hover { background: var(--surface); }
.dl-label { font-weight: 700; color: var(--accent); }
.dl-size { font-size: .82rem; color: var(--ink-2); }

.section-sum { border-top: 1px solid var(--rule); padding: .8rem 0 .4rem; }
.section-sum ul { margin: .2rem 0 .6rem; padding-left: 1.2rem; }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); vertical-align: .1em; white-space: nowrap; }
.tag-muted { background: var(--rule-2); color: var(--ink-2); }
.flag { display: inline-block; background: var(--flag-bg); color: var(--flag-ink); font-weight: 600; font-size: .9rem; padding: 2px 10px; border-radius: 4px; }
.cite { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; background: var(--rule-2); padding: 8px 10px; border-radius: 4px; }
.biblio { font-size: .85rem; }
details summary { cursor: pointer; color: var(--accent); }
.quotes { padding-left: 1.2rem; }

/* home */
.state-list { list-style: none; padding: 0; columns: 3 16rem; column-gap: 24px; }
.state-list li { break-inside: avoid; padding: 3px 0; }
.map-figure { margin: .5rem 0 1rem; position: relative; }
.map { position: relative; width: 100%; aspect-ratio: 975 / 610; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.map svg { display: block; width: 100%; height: 100%; }
.map path.c { stroke: var(--map-line); stroke-width: .35; cursor: pointer; }
.map path.c:hover, .map path.c.on { stroke: var(--ink); stroke-width: 1.2; }
.map path.borders { fill: none; stroke: var(--map-border); stroke-width: .6; pointer-events: none; }
.map .f0 { fill: var(--b0); } .map .f1 { fill: var(--b1); } .map .f2 { fill: var(--b2); }
.map .f3 { fill: var(--b3); } .map .f4 { fill: url(#hatch); } .map .fx { fill: var(--rule); }
.map-loading { padding: 1rem; color: var(--ink-2); }
.map-tip { min-height: 1.6em; font-size: .92rem; margin: .3rem 0; }
.legend { list-style: none; padding: 0; margin: .4rem 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .9rem; }
figcaption p { font-size: .88rem; color: var(--ink-2); }

@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }
  .card { padding: 10px 12px; }
  .tile-n { font-size: 1.4rem; }
}
@media (forced-colors: active) {
  .swatch, .map path.c { forced-color-adjust: none; }
}
@media print {
  .preview-banner { border: 1px solid #000; }
  .site-header nav, .skip, .map-figure { display: none; }
}

/* footer links, search, downloads, methods (T5.2) */
.foot-links a { margin-right: 1em; display: inline-block; }
.search { margin: 1rem 0; }
.search label { display: block; font-weight: 600; margin-bottom: .3rem; }
.search-row { display: flex; gap: 8px; max-width: 36rem; }
.search input[type="search"] { flex: 1 1 auto; min-width: 0; font: inherit; padding: 8px 10px; border: 1px solid var(--ink-2); border-radius: 6px; background: var(--surface); color: var(--ink); }
.search-status { min-height: 1.4em; font-size: .9rem; color: var(--ink-2); margin: .4rem 0; }
.search-results { list-style: none; padding: 0; margin: 0; max-width: 46rem; }
.search-results li { padding: 6px 0; border-bottom: 1px solid var(--rule-2); }
.search-results a { font-weight: 600; }
.search-results .muted { display: block; }
table.files td.dl a, table.files td.dl span { white-space: nowrap; }
table.files td.desc { min-width: 16rem; }
details.cols { font-size: .85rem; }
details.cols code { overflow-wrap: anywhere; }
.rules { padding-left: 1.2rem; }
.rules li { margin: .35rem 0; max-width: 80ch; }
.prose { max-width: 80ch; }

/* A-73: hand-checked badge on jurisdiction pages */
.hand-checked { display: inline-block; margin: 0 0 1rem; padding: 0.2rem 0.6rem; border: 1px solid currentColor;
  border-radius: 3px; font-size: 0.9rem; }
