:root {
  --bg: #fbfaf7; --fg: #1d1d1b; --muted: #6b6b66; --line: #e2dfd8; --panel: rgba(251, 250, 247, 0.96);
  --accent: #b42318; --accent-fg: #fff;
  /* Marker colors: keep in step with TYPE_COLORS in app.js. */
  --falcon: #d92d20; --raven: #7a5af8; --wing: #0e9384; --condor: #dc6803; --other: #667085; --osm: #1570ef;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615; --fg: #ecebe6; --muted: #a09f98; --line: #34332f; --panel: rgba(22, 22, 21, 0.95);
    --accent: #f97066; --accent-fg: #1b0b09;
    --falcon: #f97066; --raven: #a48afb; --wing: #2ed3b7; --condor: #fdb022; --other: #98a2b3; --osm: #53b1fd;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.55; }
a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -10000px; }
.skip:focus { left: 1rem; top: 0.5rem; z-index: 10; background: var(--bg); padding: 0.25rem 0.5rem; }

header.top { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; padding: 0.6rem 1rem; border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 1.4rem; letter-spacing: -0.02em; color: var(--fg); text-decoration: none; }
.tagline { color: var(--muted); }
header nav { margin-left: auto; display: flex; gap: 1rem; }

.mapwrap { position: relative; height: min(78vh, 52rem); min-height: 26rem; border-bottom: 1px solid var(--line); }
#map { position: absolute; inset: 0; }
.panel {
  position: absolute; top: 0.75rem; left: 0.75rem; width: 17.5rem; max-height: calc(100% - 1.5rem); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0.75rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15); font-size: 0.92rem;
}
.search { display: flex; gap: 0.4rem; }
.search input { flex: 1; min-width: 0; }
input[type=text], input:not([type]), #zip { font: inherit; padding: 0.4rem 0.55rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: inherit; }
button { font: inherit; padding: 0.4rem 0.8rem; border: 0; border-radius: 6px; background: var(--accent); color: var(--accent-fg); cursor: pointer; }
.msg:empty { display: none; }
.msg { color: var(--muted); margin: 0.4rem 0 0; }
.count { font-weight: 600; margin: 0.6rem 0; }
.filters summary { cursor: pointer; font-weight: 600; }
.filters fieldset { border: 0; padding: 0; margin: 0.5rem 0 0; }
.filters legend { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0; }
.filters label { display: flex; align-items: center; gap: 0.4rem; padding: 0.1rem 0; }
.fine { color: var(--muted); font-size: 0.8rem; margin: 0.6rem 0 0; }
.key { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 50%; }
.key-inv { background: var(--falcon); }
.key-osm { border: 2px solid var(--osm); }

@media (max-width: 40rem) {
  .mapwrap { height: 70vh; }
  .panel { top: auto; bottom: 0.5rem; left: 0.5rem; right: 0.5rem; width: auto; max-height: 45%; }
  .filters:not([open]) { margin-bottom: 0; }
}

main { max-width: 46rem; margin: 0 auto; padding: 1.5rem 1rem 0; }
main h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); line-height: 1.15; letter-spacing: -0.02em; }
main h2 { margin-top: 2.5rem; }
main h3 { margin: 1.5rem 0 0.25rem; font-size: 1.05rem; }
.lead { font-size: 1.15rem; }
.disclaimer { border-left: 3px solid var(--accent); padding-left: 0.75rem; }
.legend { list-style: none; padding: 0; }
.legend li { padding: 0.15rem 0; }
.dot { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; vertical-align: -0.05rem; background: var(--other); }
.dot.falcon { background: var(--falcon); }
.dot.raven { background: var(--raven); }
.dot.wing { background: var(--wing); }
.dot.condor { background: var(--condor); }
.dot.ring { background: none; border: 2px solid var(--osm); }

footer { max-width: 46rem; margin: 3rem auto 0; padding: 1rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.3rem; color: var(--muted); font-size: 0.88rem; }

.maplibregl-popup-content { background: var(--bg); color: var(--fg); font: 0.9rem/1.45 system-ui, sans-serif; padding: 0.7rem 0.9rem; }
.maplibregl-popup-tip { border-top-color: var(--bg) !important; border-bottom-color: var(--bg) !important; }
.popup dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.1rem 0.75rem; margin: 0.25rem 0 0.5rem; }
.popup dt { color: var(--muted); }
.popup dd { margin: 0; }
.popup h3 { margin: 0; font-size: 1rem; }
