/* Alert colours follow the issuers' own green-yellow-orange-red scales (USGS PAGER, GDACS); every use also carries the
 * word, in tooltips, badges and tables. Fire detections use their own magenta ramp (--f1 to --f4) so they never read as
 * an alert. Checked with the dataviz validator against the land colour in both modes. */
:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #14181f; --muted: #5b6573; --line: #d9dee5; --soft: #eef1f5;
  --sea: #dfe8f1; --land: #f4f2ee; --border: #b7bec8; --link: #1f5fbf;
  --a-green: #2b8a3e; --a-yellow: #f0c419; --a-orange: #f76707; --a-red: #9b1c1c; --unrated: #7b8794;
  --on-green: #ffffff; --on-orange: #14181f; --on-red: #ffffff;
  --f1: #f06fa0; --f2: #d6338a; --f3: #a3136f; --f4: #5f0a4a;
  --cems: #0b7285; --nhc: #14181f; --mark-edge: rgba(20, 24, 31, .55); --bar: #3b5b85;
  --radius: 10px; --gap: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1318; --panel: #171c23; --ink: #e8ecf1; --muted: #9aa4b2; --line: #2b333d; --soft: #1e252e;
    --sea: #0d1b2a; --land: #232a33; --border: #4a5562; --link: #6aa3ff;
    --a-green: #40c057; --a-yellow: #fcc419; --a-orange: #fd7e14; --a-red: #e8364f; --unrated: #8b97a6;
    --on-green: #0f1318; --on-orange: #0f1318; --on-red: #0f1318;
    --f1: #a33a78; --f2: #cf4596; --f3: #f06cb4; --f4: #ffb3dd;
    --cems: #3bc9db; --nhc: #f3f4f6; --mark-edge: rgba(0, 0, 0, .6); --bar: #7fa6d9; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.5; }
a { color: var(--link); }
.wrap { max-width: 76rem; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.top-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; flex-wrap: wrap; }
.brand { display: flex; gap: 10px; align-items: baseline; }
.brand strong { font-size: 20px; letter-spacing: .02em; }
.top-nav { display: flex; gap: 14px; align-items: center; font-size: 14px; flex-wrap: wrap; }
.hero h1 { font-size: clamp(22px, 3.6vw, 32px); line-height: 1.2; margin: 24px 0 8px; max-width: 46ch; }
.lede { color: var(--muted); max-width: 72ch; margin: 0 0 16px; }
.mapcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: var(--gap); }
.map-tools { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.layers { border: 0; padding: 0; margin: 0; display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.layers label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.legend .lg-h { color: var(--ink); }
.legend .dt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; box-shadow: 0 0 0 1px var(--mark-edge); vertical-align: -1px; }
.legend .sq { display: inline-block; width: 11px; height: 11px; margin-right: 4px; vertical-align: -1px; }
.legend .ring { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--cems); margin-right: 4px; vertical-align: -2px; }
.legend .lg-icon { display: inline-block; width: 26px; margin-right: 4px; }
#map { height: min(62vh, 560px); min-height: 340px; background: var(--sea); }
.leaflet-container { background: var(--sea); font: inherit; }
.leaflet-tooltip { font-size: 13px; width: max-content; max-width: min(320px, 80vw); white-space: normal; }
.tip { white-space: pre-line; }
.gd-icon { border-radius: 4px; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  background: var(--unrated); color: var(--panel); box-shadow: 0 0 0 1.5px var(--panel); }
.gd-icon.a-green { background: var(--a-green); color: var(--on-green); font-size: 9px; line-height: 14px; opacity: .85; }
.gd-icon.a-orange { background: var(--a-orange); color: var(--on-orange); }
.gd-icon.a-red { background: var(--a-red); color: var(--on-red); }
.nhc-icon { border-radius: 50%; background: var(--nhc); color: var(--panel); font-size: 10px; font-weight: 700;
  line-height: 26px; text-align: center; box-shadow: 0 0 0 2px var(--panel); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: var(--gap); }
.card h2 { margin: 0 0 4px; font-size: 18px; }
.card p { margin: 0 0 10px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); }
@media (max-width: 820px) { .two { grid-template-columns: minmax(0, 1fr); } }
.card { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 5px 6px; border-top: 1px solid var(--soft); vertical-align: top; }
th { color: var(--muted); font-weight: 600; border-top: 0; }
td.num, th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 600px) { td.num, th.num { white-space: normal; } .card { padding: 12px; } }
.sub { display: block; color: var(--muted); font-size: 13px; }
.badge { white-space: nowrap; }
.badge::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px;
  vertical-align: -1px; background: var(--unrated); box-shadow: 0 0 0 1px var(--mark-edge); }
.badge.a-green::before { background: var(--a-green); } .badge.a-yellow::before { background: var(--a-yellow); }
.badge.a-orange::before { background: var(--a-orange); } .badge.a-red::before { background: var(--a-red); }
.bars { display: grid; grid-template-columns: minmax(0, 9rem) 1fr 3rem; gap: 6px 10px; align-items: center; font-size: 14px; margin: 4px 0 12px; }
.bar { height: 10px; border-radius: 3px; background: var(--bar); }
.empty { color: var(--muted); font-size: 14px; margin: 4px 0; }
.foot { padding-top: 6px; padding-bottom: 28px; }
.ok { color: inherit; } .bad { color: var(--a-red); font-weight: 600; }
