/* ── MRMS Pro — matches /v3/gdd_pro aesthetic ──────────────────────── */

:root {
  --bg: #F7F6F2;
  --card: #FFFFFF;
  --ink: #0f172a;
  --muted: #64748b;
  --ring: #E8E7E3;
  --brand: #047857;
  --brand-ink: #064e3b;
  --brand-tint: rgba(4, 120, 87, 0.08);
  --brand-tint-border: rgba(4, 120, 87, 0.30);
  --danger: #dc2626;
  --warn: #f59e0b;
}

* { box-sizing: border-box; }

html { overflow-x: hidden; }
body.page {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.5 Inter, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.wrap { max-width: 1400px; margin: 0 auto; padding: 0 16px; }
.section { padding: 16px 0; }
.section--map { padding-top: 8px; padding-bottom: 12px; }

/* ── Toolbar title (radar.php: h2 inline at the toolbar's left) ─────── */
.h2 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 1.5rem; font-weight: 800; margin: 0;
  display: flex; align-items: center; gap: 10px;
}
.h2 i { color: var(--brand); font-size: 1.25rem; }
.mv-toolbar__title {
  font-size: 1.4rem; font-weight: 650;
  margin: 0 14px 0 0; gap: 9px;
  white-space: nowrap;
}
.mv-toolbar__title i { font-size: 1.1rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── Card: toolbar header + map (radar.php's .radar-page-card) ─────── */
.mv-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--ring);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.mv-toolbar {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  margin: 0;
  border-bottom: 1px solid var(--ring);
}
.mv-toolbar__sep { width: 1px; height: 22px; background: var(--ring); margin: 0 4px; flex: 0 0 auto; }
.mv-toolbar__group {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
  margin: 0 -2px 0 6px;
  flex: 0 0 auto;
}
.mv-toolbar__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Shared 34px pill vocabulary — mirrors radar.php's .show-regions-btn /
   .region-select / .layer-chip so the two toolbars read as one family.
   Neutral gray (2026-09-11): the primary Load pill is the only brand-filled
   control in the row. */
.mv-pill, .mv-select, .mv-date, .mv-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; box-sizing: border-box;
  padding: 0 12px;
  background: transparent;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  color: #475569;
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.mv-pill:hover, .mv-select:hover, .mv-date:hover, .mv-toggle:hover {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.25);
  color: var(--ink);
}
.mv-pill:focus-visible, .mv-select:focus-visible, .mv-date:focus-visible, .mv-toggle:has(input:focus-visible) {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.mv-pill--icon { padding: 0 10px; gap: 0; }
.mv-pill--icon i { font-size: 14px; }
.mv-pill--primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 2px 8px rgba(4, 120, 87, 0.3);
}
.mv-pill--primary:hover {
  background: var(--brand-ink); border-color: var(--brand-ink);
  box-shadow: 0 3px 12px rgba(4, 120, 87, 0.4);
}
.mv-pill--primary i { font-size: 12px; }
.mv-pill:disabled { opacity: 0.55; cursor: wait; }

/* Range select: chevron matches radar's .region-select */
.mv-select {
  appearance: none; -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23475569' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.mv-select:hover { background-color: rgba(15, 23, 42, 0.04); }
/* Date inputs — calendar presets/custom only (viewer.js hides them on live) */
.mv-date { color: var(--ink); font-weight: 500; padding: 0 10px; cursor: text; }
.mv-date::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.6; }

/* Layer chips — radar.php's .layer-chip: text-only pill with a small state
   dot (gray off, brand on). The checkbox stays in the DOM (hidden) so
   viewer.js keeps reading .checked. Replaced the track/knob switches 2026-09-11. */
.mv-toggle { position: relative; user-select: none; padding: 0 13px 0 11px; gap: 7px; }
.mv-toggle input[type=checkbox] {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.mv-toggle::before {
  content: ''; flex: 0 0 auto;
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(100, 116, 139, 0.35);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.mv-toggle:has(input:checked) { background: rgba(4, 120, 87, 0.09); border-color: rgba(4, 120, 87, 0.35); color: var(--brand); }
.mv-toggle:has(input:checked)::before { background: var(--brand); box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.14); }
/* Report chips: the marker glyph is the state indicator (no dot), and they
   take their marker color when on (legend/marker parity) */
.mv-toggle--tornado::before, .mv-toggle--hail::before, .mv-toggle--wind::before { display: none; }
.mv-toggle--tornado, .mv-toggle--hail, .mv-toggle--wind { padding-left: 12px; }
.mv-toggle--tornado:has(input:checked) { border-color: rgba(220, 38, 38, 0.45); background: rgba(220, 38, 38, 0.06); color: #991b1b; }
.mv-toggle--hail:has(input:checked) { border-color: rgba(22, 163, 74, 0.5); background: rgba(22, 163, 74, 0.07); color: #166534; }
.mv-toggle--wind:has(input:checked) { border-color: rgba(37, 99, 235, 0.45); background: rgba(37, 99, 235, 0.06); color: #1e40af; }
.mv-toggle:has(input:disabled) { cursor: progress; opacity: 0.7; }
/* Report switches carry their map-marker glyph (same shapes as the legend
   and the markers), so "Hail" reports never read as the MESH "Hail" grid. */
.mv-toggle__glyph { flex: 0 0 auto; margin-right: -2px; opacity: 0.75; transition: opacity 0.15s ease; }
.mv-toggle:has(input:checked) .mv-toggle__glyph { opacity: 1; }
.mv-toggle--tornado .mv-toggle__glyph {
  width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 9px solid var(--danger);
}
.mv-toggle--hail .mv-toggle__glyph { width: 9px; height: 9px; border-radius: 50%; background: #16a34a; }
.mv-toggle--wind .mv-toggle__glyph { width: 9px; height: 9px; border-radius: 2px; background: #2563eb; }

/* ── Primary button ────────────────────────────────────────────────── */
.mv-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.mv-btn--primary {
  background: var(--brand); color: #fff;
  border-color: var(--brand);
  box-shadow: 0 2px 4px rgba(4, 120, 87, 0.2);
}
.mv-btn--primary:hover {
  background: var(--brand-ink);
  border-color: var(--brand-ink);
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.3);
  transform: translateY(-1px);
}
.mv-btn--primary:disabled {
  opacity: 0.5; cursor: not-allowed; transform: none;
  box-shadow: 0 2px 4px rgba(4, 120, 87, 0.1);
}
.mv-btn--ghost {
  background: transparent;
  color: var(--brand);
  border-color: var(--brand-tint-border);
  box-shadow: 0 2px 4px rgba(4, 120, 87, 0.08);
}
.mv-btn--ghost:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.2);
}
.mv-btn--xs { padding: 5px 10px; font-size: 11px; border-radius: 8px; gap: 5px; }
.mv-btn--danger { color: var(--danger); border-color: rgba(220,38,38,0.3); }
.mv-btn--danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ── Location search pill (34px, same outline as the other pills) ──── */
.mv-loc-input {
  display: grid;
  grid-template-columns: 16px 1fr auto auto auto;
  align-items: center;
  gap: 6px;
  flex: 1 1 200px;
  min-width: 180px;
  max-width: 300px;
  height: 34px; box-sizing: border-box;
  background: #fff;
  border: 1px solid rgba(4, 120, 87, 0.22);
  border-radius: 999px;
  padding: 0 4px 0 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mv-loc-input:hover { border-color: rgba(4, 120, 87, 0.5); }
.mv-loc-input:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.mv-loc-input__icon { font-size: 13px; color: var(--muted); }
.mv-loc-input #mv-search {
  width: 100%; min-width: 0; height: 100%;
  font-size: 13px; font-weight: 500; font-family: inherit;
  border: 0; outline: 0; background: transparent;
  padding: 0 2px;
  color: var(--ink);
}
.mv-loc-input #mv-search::placeholder { color: var(--muted); font-weight: 500; }
.mv-mini-spinner {
  display: none;
  width: 12px; height: 12px;
  border: 2px solid var(--brand-tint);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: mv-spin 0.8s linear infinite;
  flex: 0 0 auto;
}
.mv-btn-clear-loc {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border: 0; border-radius: 50%;
  background: rgba(15, 23, 42, 0.08);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.mv-btn-clear-loc:hover { background: rgba(15, 23, 42, 0.16); color: var(--ink); }
.mv-btn-clear-loc i { font-size: 11px; }
.mv-btn-clear-loc[hidden] { display: none; }
.mv-btn-submit-loc {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff;
  border: none; border-radius: 50%;
  width: 26px; height: 26px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.mv-btn-submit-loc:hover { background: var(--brand-ink); }
.mv-btn-submit-loc i { font-size: 11px; color: #fff; }

/* Awesomplete dropdown — match brand palette */
.mv-loc-input .awesomplete { width: 100% !important; min-width: 0; }
.mv-loc-input .awesomplete > ul {
  background: var(--card);
  border: 1px solid var(--ring);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  padding: 6px 0; margin-top: 4px;
  list-style: none;
  z-index: 10000 !important;
  max-height: 280px;
  overflow-y: auto;
}
.mv-loc-input .awesomplete > ul > li {
  padding: 9px 14px;
  font-size: 14px; font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background 0.12s ease, color 0.12s ease;
}
.mv-loc-input .awesomplete > ul > li:hover,
.mv-loc-input .awesomplete > ul > li[aria-selected="true"] {
  background: var(--brand-tint);
  color: var(--brand-ink);
}
.mv-loc-input .awesomplete mark,
.mv-loc-input .awesomplete > ul > li:hover mark,
.mv-loc-input .awesomplete > ul > li[aria-selected="true"] mark {
  background: transparent;
  color: var(--brand);
  font-weight: 700;
}
.mv-loc-input .awesomplete > ul > li[aria-selected="true"] mark {
  color: var(--brand-ink);
}

@media (max-width: 640px) {
  .mv-loc-input { flex: 1 1 100%; max-width: none; }
}

/* ── Spinner (status stamp) ────────────────────────────────────────── */
.mv-spinner {
  width: 12px; height: 12px;
  border: 2px solid var(--brand-tint);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: mv-spin 0.8s linear infinite;
  flex: 0 0 auto;
}
@keyframes mv-spin { to { transform: rotate(360deg); } }

/* ── Map shell + wrap (in-map glass chrome absolute-positions inside
     .mv-map-wrap; the card above it holds the toolbar) ─────────────── */
.mv-map-shell { position: relative; }
.mv-map-wrap { position: relative; }
/* Stage = map + bar + stamp. On phones the legend flows below the stage
   (inside .mv-map-wrap), so the in-map chrome stays anchored to the map. */
.mv-map-stage { position: relative; background: #e9ecef; }
#mv-map {
  width: 100%;
  /* Wide rectangle that fits the viewport below the site nav + toolbar
     (no page scroll to see the whole map); 680px cap ≈ radar.php's 700px
     card. viewer.js fitBounds() the CONUS into whatever this resolves to. */
  /* Reserve = live site header (bottom at 90px) + 8px section pad + 55px
     toolbar + card border + 12px bottom pad, with a few px of slack. The
     CONUS fit is height-limited at this card width, so every extra row
     of pixels here shows more of the map north–south AND fills the sides. */
  height: clamp(460px, calc(100vh - 168px), 760px);
}
/* Basemap/label img tiles: the fractional-zoom seam fix radar.php uses.
   (Data is a single canvas overlay — MrmsRasterLayer — so it can't seam.) */
.mv-map-stage .leaflet-tile { outline: 1px solid transparent; }

/* ── Legend (desktop: light-glass overlay bottom-right of the map,
     vertical stepped colorbars so every band reads at full size) ──── */
.mv-legend {
  position: absolute;
  bottom: 12px; right: 12px;
  z-index: 1076;
  padding: 8px 8px 10px;
  border-radius: 14px;
  font-size: 11px;
  line-height: 1.4;
  /* Bar height tracks the map's height clamp (map = 100vh - 168px); leave
     room for the title, the reports block and the top-right attribution */
  --cbar-h: clamp(250px, calc(100vh - 380px), 420px);
}
.mv-legend h4 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}
.mv-legend__bars { display: flex; gap: 10px; }
.mv-cbar__body {
  display: flex; align-items: stretch;
  height: var(--cbar-h);
}
.mv-cbar__bands {
  display: flex; flex-direction: column;
  width: 18px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.18);
}
.mv-cbar__band { flex: 1 1 0; min-height: 0; }
.mv-cbar__ticks {
  position: relative;
  margin-left: 6px;
}
.mv-cbar__sizer {
  visibility: hidden;
  font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mv-cbar__tick {
  position: absolute; left: 0;
  transform: translateY(50%);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}
/* Tick mark: short rule that bridges the gap to the band edge */
.mv-cbar__tick::before {
  content: '';
  position: absolute; left: -6px; top: 50%;
  width: 4px; height: 1px;
  background: rgba(15, 23, 42, 0.45);
}
.mv-legend__reports { margin-top: 10px; }
.mv-legend__bars + .mv-legend__reports {
  padding-top: 8px;
  border-top: 1px solid rgba(15, 23, 42, 0.10);
}
.mv-legend .swatch {
  display: inline-block;
  width: 12px; height: 12px;
  vertical-align: middle;
  margin-right: 6px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.08);
}
.mv-legend .row {
  margin-bottom: 2px;
  display: flex; align-items: center;
  font-size: 11px;
}
.mv-legend__count {
  margin-left: 4px;
  color: var(--muted);
  font-weight: 600;
}

/* ── Storm report markers (unchanged glyph shapes) ─────────────────── */
.mv-marker { display: block; }
.mv-marker--tornado {
  /* Upside-down triangle — apex points down at the report location */
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 14px solid var(--danger);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.mv-marker--hail {
  border-radius: 50%;
  background: #16a34a;
  /* Solid fill, no white outline — a subtle dark drop-shadow keeps the
     glyph legible against the light basemap without diluting the color. */
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.45));
}
.mv-marker--wind {
  background: #2563eb;
  border-radius: 3px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.45));
}
.mv-popup { font-size: 12px; line-height: 1.45; }
.mv-popup b { text-transform: capitalize; color: var(--brand-ink); }

/* ── Full-screen loading overlay (matches gdd_pro .gdd-loading) ────── */
.mv-loading {
  position: fixed; inset: 0;
  z-index: 8000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: rgba(248,250,252,0.7);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.mv-loading--active { opacity: 1; pointer-events: auto; }
.mv-loading__spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--ring);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: mv-spin 0.8s linear infinite;
}
.mv-loading__text {
  font-size: 14px; font-weight: 600;
  color: var(--muted);
}

/* ── User location bullseye (pulsing blue dot) ─────────────────────── */
.mv-user-dot { background: none !important; border: none !important; pointer-events: none; }
.mv-user-dot .mv-user-dot__ring {
  position: absolute; top: 0; left: 0;
  width: 24px; height: 24px;
  border: 2px solid #2563eb;
  border-radius: 50%;
  box-sizing: border-box;
  animation: mv-user-pulse 1.6s ease-out infinite;
}
.mv-user-dot .mv-user-dot__core {
  position: absolute; top: 8px; left: 8px;
  width: 8px; height: 8px;
  background: #2563eb;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
}
@keyframes mv-user-pulse {
  0%   { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ── Drop-pin marker ────────────────────────────────────────────────── */
.mv-pin { background: none !important; border: none !important; }
.mv-pin i {
  font-size: 32px;
  color: var(--brand);
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
}

/* ── Pin popup timeline ─────────────────────────────────────────────── */
.leaflet-popup-content-wrapper:has(.mv-pin-popup) { border-radius: 10px; }
.mv-pin-popup { font-size: 12px; line-height: 1.4; min-width: 280px; }
.mv-pin-popup__header {
  font-weight: 700; color: var(--brand-ink);
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px;
}
.mv-pin-popup__header i { color: var(--brand); }
.mv-pin-popup__stats {
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  font-size: 11px; color: var(--muted);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ring);
}
.mv-pin-popup__stats b { color: var(--ink); font-size: 12px; }
.mv-pin-popup__table {
  width: 100%; border-collapse: collapse;
  font-size: 11px;
}
.mv-pin-popup__table th {
  text-align: left; padding: 4px 6px;
  color: var(--muted); font-weight: 600;
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--ring);
}
.mv-pin-popup__table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(232,231,227,0.5);
}
.mv-pin-popup__table td:nth-child(2),
.mv-pin-popup__table td:nth-child(3) { font-variant-numeric: tabular-nums; }
.mv-pin-popup__table tr:last-child td { border-bottom: none; }
.mv-pin-popup__muted { color: var(--muted); }
.mv-pin-popup__empty { padding: 8px 0; color: var(--muted); font-style: italic; }
/* Notable-days collapsible section */
.mv-pin-popup__details { margin-top: 6px; }
.mv-pin-popup__details summary {
  cursor: pointer; font-size: 11px; font-weight: 600;
  color: var(--brand); user-select: none;
  margin-bottom: 4px;
}
.mv-pin-popup__details summary:hover { text-decoration: underline; }
.mv-pin-popup__details .mv-pin-popup__table { max-height: 200px; overflow-y: auto; display: block; }
.mv-pin-popup__details .mv-pin-popup__table thead,
.mv-pin-popup__details .mv-pin-popup__table tbody { display: table; width: 100%; table-layout: fixed; }

/* ── Mini bar chart (inside pin popup) ─────────────────────────────── */
.mv-chart { position: relative; margin: 8px 0; }
.mv-chart__bars {
  display: flex;
  align-items: flex-end;
  height: 70px;
  gap: 0;
  border-bottom: 1px solid var(--ring);
  border-left: 1px solid var(--ring);
  padding-left: 1px;
}
.mv-chart__col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  height: 100%;
  cursor: default;
}
.mv-chart__fill {
  background: #3b82f6;
  min-height: 0;
  border-radius: 1px 1px 0 0;
  transition: height 0.15s ease;
}
.mv-chart__fill--hail {
  background: linear-gradient(to top, #3b82f6 40%, #16a34a);
}
.mv-chart__dot {
  width: 100%; max-width: 6px; height: 4px;
  background: #dc2626;
  border-radius: 1px;
  margin: 2px auto 0;
  flex: 0 0 auto;
}
.mv-chart__axis {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--muted);
  padding-top: 3px;
  line-height: 1;
}
.mv-chart__scale {
  position: absolute;
  top: -2px; left: 0;
  font-size: 9px;
  color: var(--muted);
  background: rgba(255,255,255,0.85);
  padding: 0 2px;
  line-height: 1;
}
.mv-chart__legend {
  display: flex;
  gap: 10px;
  font-size: 9px;
  color: var(--muted);
  margin-top: 4px;
  justify-content: center;
}
.mv-chart__swatch {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 1px;
  vertical-align: middle;
  margin-right: 2px;
}
.mv-chart__swatch--rain { background: #3b82f6; }
.mv-chart__swatch--hail { background: linear-gradient(to top, #3b82f6, #16a34a); }
.mv-chart__swatch--dot  { background: #dc2626; border-radius: 50%; width: 6px; height: 6px; }

.mv-pin-popup__footer {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--ring);
  display: flex; gap: 6px; flex-wrap: wrap;
}

/* ── Pin detail panel (expanded view below map) ────────────────────── */
.mv-pin-panel {
  background: var(--card);
  border: 1px solid var(--ring);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.mv-pin-panel__topbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ring);
}
.mv-pin-panel__title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 1.1rem; font-weight: 800;
  color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.mv-pin-panel__title i { color: var(--brand); }
.mv-pin-panel__actions { display: flex; gap: 8px; }
.mv-pin-panel__stats {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 16px;
}
.mv-pin-panel__stat {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: var(--bg);
  border: 1px solid var(--ring);
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  color: var(--ink);
}
.mv-pin-panel__stat b { color: var(--brand); font-weight: 700; }
.mv-pin-panel__chart-wrap { margin-bottom: 16px; }
.mv-pin-panel__chart-wrap .mv-chart__bars { height: 100px; }

/* Full-width report table inside the panel */
.mv-pin-panel__table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.mv-pin-panel__table th {
  text-align: left; padding: 8px 10px;
  color: var(--muted); font-weight: 600;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--ring);
  position: sticky; top: 0; background: var(--card);
}
.mv-pin-panel__table td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(232,231,227,0.5);
}
.mv-pin-panel__table tr:hover td { background: var(--bg); }
.mv-pin-panel__table-wrap {
  max-height: 400px; overflow-y: auto;
  overflow-x: auto;  /* SPC table gained county/comments columns — allow
                        sideways scroll on narrow screens */
  border: 1px solid var(--ring);
  border-radius: 10px;
  margin-top: 12px;
}
.mv-pin-panel__section-label {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 16px 0 6px;
}
.mv-pin-panel__muted { color: var(--muted); }

/* ── SPC report detail (marker popup + pin popup entries) ──────────── */
/* Coordinates line in the storm-report marker popup */
.mv-popup__coords {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.mv-popup small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

/* Stacked full-detail report entries in the live-mode pin popup */
.mv-rep-list {
  max-height: 220px;
  overflow-y: auto;
}
.mv-rep {
  padding: 6px 0;
  border-bottom: 1px solid rgba(232,231,227,0.5);
}
.mv-rep:last-child { border-bottom: none; }
.mv-rep__head {
  font-weight: 700;
  text-transform: capitalize;
  color: var(--brand-ink);
}
.mv-rep__when { font-size: 11px; }
.mv-rep__where { font-size: 11px; color: var(--muted); }
.mv-rep__notes {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin-top: 2px;
}

/* Comments column in the expanded pin panel's SPC table */
.mv-pin-panel__comment {
  color: var(--muted);
  font-size: 11px;
  max-width: 280px;
}

/* ── Light "liquid glass" in-map chrome ──────────────────────────────
   radar.php's dark glass (blur 32px / saturate 180% / 20px radii / inset
   highlight) lightened for the light basemap. Same geometry, same slots:
   zoom top-left, attribution top-right, stamp bottom-left, bar bottom-center,
   legend bottom-right. */
.mv-glass {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  color: var(--ink);
}
@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .mv-glass { background: rgba(255, 255, 255, 0.94); }
}

/* Bottom-center bar: basemap + precip colors */
.mv-map-bar {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  z-index: 1076;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px 5px 6px;
  border-radius: 20px;
  font-size: 12px;
  user-select: none;
  white-space: nowrap;
}
.mv-map-bar__label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
  margin: 0 2px 0 8px;
}
.mv-seg {
  display: inline-flex; align-items: center;
  background: rgba(15, 23, 42, 0.07);
  border-radius: 999px;
  padding: 2px;
}
.mv-seg__btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent;
  color: var(--muted);
  font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.mv-seg__btn i { font-size: 11px; }
.mv-seg__btn:hover { color: var(--ink); }
.mv-seg__btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-tint); }
.mv-seg__btn.is-active {
  background: #fff;
  color: var(--brand-ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.04);
}
.mv-seg__btn.is-active i { color: var(--brand); }

/* Bottom-left stamp: load status + pin hint (radar's time-stamp slot) */
.mv-map-stamp {
  position: absolute;
  left: 12px; bottom: 12px;
  z-index: 1076;
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  max-width: 32%;
  white-space: nowrap;
}
.mv-map-stamp .mv-status-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mv-stamp-hint {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.mv-stamp-hint i { color: var(--brand); font-size: 11px; }
.mv-map-stamp.has-status .mv-stamp-hint::before { content: '·'; color: var(--muted); margin-right: 2px; }

/* Value readout that follows the cursor over precip/hail grids */
.mv-hover {
  position: absolute;
  pointer-events: none;
  z-index: 1100;
  display: none;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f1f5f9;
  font-size: 12px; font-weight: 600;
  font-family: system-ui, sans-serif;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Leaflet zoom control — light glass */
.mv-map-wrap .leaflet-control-zoom {
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  border-radius: 20px !important;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  margin: 12px 0 0 12px !important;
}
.mv-map-wrap .leaflet-control-zoom a {
  background: rgba(255, 255, 255, 0.72) !important;
  color: var(--ink) !important;
  border: none !important;
  width: 32px !important; height: 32px !important; line-height: 32px !important;
  font-size: 15px !important; font-weight: 400 !important;
  transition: background 0.15s;
}
.mv-map-wrap .leaflet-control-zoom a:hover {
  background: rgba(255, 255, 255, 0.95) !important;
  color: var(--brand-ink) !important;
}
.mv-map-wrap .leaflet-control-zoom a.leaflet-disabled { color: rgba(15, 23, 42, 0.3) !important; }
.mv-map-wrap .leaflet-control-zoom-in { border-radius: 20px 20px 0 0 !important; }
.mv-map-wrap .leaflet-control-zoom-out {
  border-radius: 0 0 20px 20px !important;
  border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
}

/* Reset-view control — glass button stacked under the zoom pill */
.mv-map-wrap .mv-reset-ctl {
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  border-radius: 20px !important;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  margin: 8px 0 0 12px !important;
}
.mv-map-wrap .mv-reset-ctl a {
  display: flex !important; align-items: center; justify-content: center;
  width: 32px !important; height: 32px !important; line-height: 32px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  color: var(--ink) !important;
  border: none !important;
  border-radius: 20px !important;
  font-size: 13px;
  transition: background 0.15s;
}
.mv-map-wrap .mv-reset-ctl a:hover {
  background: rgba(255, 255, 255, 0.95) !important;
  color: var(--brand-ink) !important;
}
/* MapLibre label canvas lives in the (pointer-events:none) label pane.
   Leaflet names createPane('labelPane') .leaflet-label-pane. */
.mv-map-wrap .leaflet-label-pane .leaflet-gl-layer,
.mv-map-wrap .leaflet-label-pane .maplibregl-canvas { pointer-events: none; }
.mv-map-wrap .mv-reset-ctl a i { color: inherit; }

/* Leaflet attribution — light glass mini pill, top-right */
.mv-map-wrap .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none !important;
  color: rgba(15, 23, 42, 0.5) !important;
  font-size: 9px !important;
  padding: 2px 8px !important;
  border-radius: 12px !important;
  margin: 8px 8px 0 0 !important;
}
.mv-map-wrap .leaflet-control-attribution a {
  color: rgba(15, 23, 42, 0.7) !important;
  text-decoration: none !important;
}
.mv-map-wrap .leaflet-control-attribution a:hover { text-decoration: underline !important; }
.mv-map-wrap .leaflet-control-attribution .leaflet-attribution-flag,
.mv-map-wrap .leaflet-control-attribution span[aria-hidden] { display: none !important; }

/* ── Responsive ────────────────────────────────────────────────────── */
/* Laptops: tighten so the toolbar still fits one row down to ~1280px */
@media (max-width: 1320px) {
  .mv-toolbar { gap: 6px; padding: 10px 12px; }
  .mv-toolbar__title { margin-right: 8px; }
  .mv-loc-input { flex-basis: 150px; min-width: 150px; max-width: 240px; }
  .mv-pill, .mv-select, .mv-date, .mv-toggle { padding: 0 10px; gap: 7px; }
  .mv-select { padding-right: 26px; }
  .mv-toolbar__group { margin-left: 2px; }
}

@media (max-width: 760px) {
  .mv-toolbar { gap: 6px; padding: 8px 10px; }
  /* Title row also carries the action cluster; search takes the next row */
  .mv-toolbar__title { font-size: 1.1rem; margin-right: 6px; order: -2; }
  .mv-toolbar__right { order: -1; }
  .mv-toolbar__group { margin-left: 0; }
  .mv-pill, .mv-select, .mv-date, .mv-toggle { height: 30px; font-size: 12px; padding: 0 9px; gap: 6px; }
  .mv-toggle { padding: 0 10px 0 9px; }
  .mv-pill--icon { padding: 0 9px; }
  .mv-select { padding-right: 24px; }
  .mv-toolbar__group { display: none; }   /* glyphs carry the grouping on phones */
  .mv-loc-input { height: 30px; flex: 1 1 100%; max-width: none; }
  .mv-toolbar__sep { display: none; }
  #mv-map { height: 60vh; min-height: 360px; }
  /* Legend: break out of the overlay, render as a footer strip in the card */
  .mv-legend {
    position: static;
    top: auto; right: auto; bottom: auto;
    max-width: none;
    width: 100%;
    font-size: 12px;
    padding: 12px 14px;
    border: 0; border-top: 1px solid var(--ring);
    border-radius: 0;
    background: var(--card);
    backdrop-filter: none; -webkit-backdrop-filter: none;
    box-shadow: none;
  }
  .mv-legend:empty { display: none; }
  .mv-legend { --cbar-h: 240px; display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
  .mv-legend__bars { gap: 18px; }
  .mv-legend__reports { margin-top: 0; }
  .mv-legend__bars + .mv-legend__reports { padding-top: 0; border-top: 0; }
  /* In-map glass: bar goes full width like radar's control bar; the
     status stamp rides above it */
  .mv-map-bar {
    left: 8px; right: 8px; width: auto;
    transform: none;
    bottom: 8px;
    justify-content: center;
    gap: 6px;
    padding: 4px 6px;
  }
  .mv-map-bar__label { display: none; }
  /* Stamp moves top-left under the zoom control; attribution stays top-right */
  .mv-map-stamp { left: 8px; bottom: auto; top: 84px; max-width: calc(100% - 16px); height: 26px; font-size: 11px; }
  .mv-map-wrap .leaflet-control-attribution { margin: 8px 8px 0 0 !important; }
  .mv-map-stamp .mv-stamp-hint { display: none; }
  .mv-map-stamp.has-status .mv-stamp-hint::before { content: none; }
  .mv-map-wrap .leaflet-control-zoom { margin: 8px 0 0 8px !important; }
  .mv-map-wrap .mv-reset-ctl { margin: 6px 0 0 8px !important; }
  .mv-map-stamp { top: 122px; }
}

