:root {
  color-scheme: light;
  --surface-1: #fcfcfb;
  --surface-2: #f3f2ef;
  --border: #dddcd7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #77756f;
  --accent: #2a78d6;
  /* Hail size bands: one violet hue, light to dark (ordinal). */
  --band-1: #a17adf;
  --band-2: #8654cc;
  --band-3: #6b30af;
  --band-4: #4c1b82;
  /* Status colors, always paired with an icon and label. */
  --good: #0ca30c;
  --warning: #fab219;
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text-primary);
  background: var(--surface-1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { display: flex; flex-direction: column; }

.bar {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-1);
}
.bar h1 { font-size: 17px; margin: 0; font-weight: 650; }
.filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
label { color: var(--text-secondary); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
select, input, button {
  font: inherit; color: var(--text-primary); background: #fff;
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px;
}
button { cursor: pointer; background: var(--surface-2); }
button:hover { border-color: var(--text-muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

main { flex: 1; display: flex; min-height: 0; }
.side {
  width: 360px; flex: none; display: flex; flex-direction: column;
  border-right: 1px solid var(--border); background: var(--surface-1);
}
.map { flex: 1; }

.search { display: flex; gap: 6px; padding: 12px; border-bottom: 1px solid var(--border); }
.search input { flex: 1; }
.list-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; color: var(--text-secondary); font-size: 13px;
}
.notice { margin: 0 12px 8px; padding: 8px 10px; border-radius: 6px; background: var(--surface-2); color: var(--text-secondary); font-size: 13px; }
.help { margin: 0; padding: 10px 12px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }

.days { list-style: none; margin: 0; padding: 0 8px 8px; overflow-y: auto; flex: 1; }
.days[aria-busy="true"] { opacity: 0.5; }
.day {
  display: block; width: 100%; text-align: left; margin: 0 0 6px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.day[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.day .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.day .date { font-weight: 600; }
.day .size { font-weight: 650; font-size: 15px; }
.day .meta { color: var(--text-secondary); font-size: 12.5px; margin-top: 2px; }
.badges { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; background: var(--surface-1);
}
.badge .icon {
  width: 14px; height: 14px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 10px; font-weight: 700; line-height: 1;
}
.badge.confirmed .icon { background: var(--good); color: #fff; }
.badge.warned .icon { background: var(--warning); color: var(--text-primary); }
.badge.radar .icon, .badge.report .icon { background: var(--surface-2); color: var(--text-secondary); box-shadow: inset 0 0 0 1px var(--border); }

.legend {
  background: rgba(252, 252, 251, 0.95); padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border); font-size: 12px; color: var(--text-secondary); line-height: 1.6;
}
.legend h2 { font-size: 12px; margin: 0 0 4px; color: var(--text-primary); font-weight: 600; }
.legend .item { display: flex; align-items: center; gap: 8px; }
.legend .swatch { width: 16px; height: 12px; border-radius: 2px; opacity: 0.8; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; background: #1f1f1f; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #999; margin: 0 3px; }
.legend .dash { width: 16px; border-top: 2px dashed var(--text-secondary); }
.legend input[type="range"] { width: 90px; padding: 0; }

.popup h3 { font-size: 13px; margin: 0 0 4px; }
.popup .sub { color: var(--text-secondary); font-size: 12px; margin-bottom: 6px; }
.popup ul { margin: 0; padding: 0; list-style: none; max-height: 220px; overflow-y: auto; }
.popup li { padding: 3px 0; border-top: 1px solid var(--surface-2); }
.popup a { color: var(--accent); cursor: pointer; }
.leaflet-tooltip { font: 12px/1.4 system-ui, sans-serif; }
