:root {
    --panel-bg: rgba(12, 16, 22, 0.92);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-text: #e6edf3;
    --panel-muted: #92a4b1;
    --accent: #48b2ff;
    --accent-soft: rgba(72, 178, 255, 0.2);
}

/* ── wp-icons: GENERATED by tools/build-glyphicons-sprite.mjs — do not edit ── */
:root {
    --gi-play: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%3E%3Cpath%20d='M14.69232,10.84814,5.52966,16.57007A1,1,0,0,1,4,15.7218V4.27808a1,1,0,0,1,1.52966-.84815l9.16266,5.72193A.99991.99991,0,0,1,14.69232,10.84814Z'/%3E%3C/svg%3E");
    --gi-pause: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%3E%3Cpath%20d='M9,4V16a1,1,0,0,1-1,1H6a1,1,0,0,1-1-1V4A1,1,0,0,1,6,3H8A1,1,0,0,1,9,4Zm5-1H12a1,1,0,0,0-1,1V16a1,1,0,0,0,1,1h2a1,1,0,0,0,1-1V4A1,1,0,0,0,14,3Z'/%3E%3C/svg%3E");
    --gi-more: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%3E%3Cpath%20d='M6,10A2,2,0,1,1,4,8,2.00006,2.00006,0,0,1,6,10Zm4-2a2,2,0,1,0,2,2A2,2,0,0,0,10,8Zm6,0a2,2,0,1,0,2,2A2,2,0,0,0,16,8Z'/%3E%3C/svg%3E");
    --gi-chevron-right: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%3E%3Cpath%20d='M10.17187,10,5.43955,5.26761a.5.5,0,0,1,0-.70709l1.621-1.62108a.5.5,0,0,1,.70712,0l6.70689,6.707a.5.5,0,0,1,0,.7071l-6.70689,6.707a.5.5,0,0,1-.70712,0l-1.621-1.62108a.5.5,0,0,1,0-.70709Z'/%3E%3C/svg%3E");
    --gi-chevron-down: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%3E%3Cpath%20d='M10,10.17188l4.73239-4.73233a.5.5,0,0,1,.70709,0l1.62108,1.621a.5.5,0,0,1,0,.70712l-6.707,6.70689a.5.5,0,0,1-.7071,0l-6.707-6.70689a.5.5,0,0,1,0-.70712l1.62108-1.621a.5.5,0,0,1,.70709,0Z'/%3E%3C/svg%3E");
    --gi-resize-horizontal: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3E%3Cpath%20d='M15,14v3a1,1,0,0,1-1,1H11v1.94458a1,1,0,0,1-1.61725.78662L3.71722,16.28674a1,1,0,0,1,0-1.57361l5.66553-4.44445A1,1,0,0,1,11,11.05542V13h3A1,1,0,0,1,15,14Zm13.28278.71313-5.66553-4.44445A1,1,0,0,0,21,11.05542V13H18a1,1,0,0,0-1,1v3a1,1,0,0,0,1,1h3v1.94458a1,1,0,0,0,1.61725.78662l5.66553-4.44446A1,1,0,0,0,28.28278,14.71313Z'/%3E%3C/svg%3E");
}
/* ── /wp-icons ── */

/* ── Icons ─────────────────────────────────────────────────────────────
   Every UI glyph is a GLYPHICONS symbol from the inline sprite
   (app/views/maps/_wp-icons.svg, generated by
   tools/build-glyphicons-sprite.mjs — add icons THERE, never by hand),
   referenced as <svg class="wpGi"><use href="#gi-NAME"/></svg> from markup
   or window._wpIcon(name, size) / _wpIconEl(name, size) from JS.  Size is
   the svg's own width/height attributes (default 1em, so a glyph inside a
   text button follows its font-size); the per-control rules below override
   where a fixed glyph is wanted.  Fill rides currentColor, so every
   hover/active colour rule keeps working unchanged.  Pseudo-elements that
   need a glyph (play button, tree carets, dropdown hints, split divider)
   mask with the --gi-* data URIs above instead. */
.wpGi {
    display: inline-block;
    fill: currentColor;
    vertical-align: -0.15em;
    flex: none;
    pointer-events: none;
}

#appShell {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: radial-gradient(circle at 20% 20%, #16212b 0%, #0b0f14 55%, #07090b 100%);
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

#cesiumContainer {
    position: absolute;
    inset: 0;
}

/* Dual-viewer NEXRAD split: side-by-side panes with a seam in the middle. */
#cesiumContainer2 {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50%;
    display: none;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.6);
}
#appShell.dual-split #cesiumContainer {
    inset: 0 50% 0 0;
}
#appShell.dual-split #cesiumContainer2 {
    display: block;
}
/* In dual-split mode, hide the single-viewer split UI — it's replaced by
 * the two side-by-side panes. */
#appShell.dual-split #splitDivider,
#appShell.dual-split #splitLabelLeft,
#appShell.dual-split #splitLabelRight {
    display: none !important;
}

#layersPanel {
    position: absolute;
    top: 74px; /* 24px margin + 42px button row + 8px gap */
    right: 24px;
    width: 320px;
    /* Auto-size to content; cap at viewport-minus-HUD via max-height.
       _syncBottomHudLayout in maps.js overrides max-height when the legend
       or timeline encroaches.  .tree (the scrollable region) needs min-height:0
       so it shrinks inside this flex column once the cap is hit. */
    height: auto;
    max-height: calc(100% - 98px);
    display: flex;
    flex-direction: column;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    color: var(--panel-text);
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    z-index: 4;
    backdrop-filter: blur(6px);
    transition: transform 180ms ease, opacity 180ms ease, max-height 200ms ease;
}

#layersPanel.collapsed {
    transform: translateX(calc(100% + 24px));
    opacity: 0;
    pointer-events: none;
}

#layersToggle {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    color: var(--panel-text);
    font-size: 16px;
    cursor: pointer;
    z-index: 5;
}

#layersPanel .panelHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--panel-border);
    font-size: 16px;
    letter-spacing: 0.4px;
}

#layersPanel .status {
    font-size: 12px;
    color: var(--panel-muted);
    text-transform: uppercase;
}

#layersPanel .panelActions {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--panel-border);
}
#layersPanel .panelActionBtn {
    /* Compact pill — just wide enough for its label.  Previously flex:1
       so it could share a row with the Copy-Link button; with only one
       action left it shouldn't span the whole panel. */
    padding: 4px 12px;
    background: transparent;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    color: var(--panel-text);
    font: 500 11px/1 "IBM Plex Sans", "Segoe UI", sans-serif;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
#layersPanel .panelActionBtn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
#layersPanel .panelActionBtn.copied {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}


/* ── Wind ink swatches (in #windBarbControls) ─────────────────────────
   Buttons rather than <input type=color> so the flyout's mouseleave grace
   + focus guard keep working — see the note in maps.js. */
#windBarbControls .wbInkRow {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 2px 0 0;
}
#windBarbControls .wbInkBtn {
    width: 15px;
    height: 15px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: transform 100ms ease, box-shadow 100ms ease;
}
#windBarbControls .wbInkBtn:hover { transform: scale(1.15); }
#windBarbControls .wbInkBtn.active {
    box-shadow: 0 0 0 2px var(--accent, #48b2ff);
    border-color: rgba(255, 255, 255, 0.85);
}

/* ── Product filter row ───────────────────────────────────────────────
   Sits between the panel actions and the tree.  The tree can be 870
   products deep; this is the only way to reach one by name. */
#layersPanel .layerFilterRow {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-bottom: 1px solid var(--panel-border);
}
#layersPanel #layerFilter {
    flex: 1;
    min-width: 0;
    padding: 5px 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    border-radius: 13px;
    color: var(--panel-text);
    font: 400 12px/1.3 "IBM Plex Sans", "Segoe UI", sans-serif;
    outline: none;
    transition: border-color 120ms ease, background 120ms ease;
}
#layersPanel #layerFilter::placeholder { color: var(--panel-muted); }
#layersPanel #layerFilter:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}
#layersPanel #layerFilterCount {
    flex: none;
    font: 500 10px/1 "IBM Plex Sans", "Segoe UI", sans-serif;
    letter-spacing: 0.3px;
    color: var(--panel-muted);
    text-transform: uppercase;
    white-space: nowrap;
}

/* Filter visibility is a class so container passes can test it with
   :not() — see applyLayerFilter in maps.js. */
#layersPanel .wpFilterHidden { display: none !important; }

/* While filtering, every surviving section is force-opened, so the results
   should read as one flat list grouped by model.  The MODEL heading is what
   tells two identically-named matches apart ("2-m Dewpoint Temperature" x14);
   the category heading below it is pure vertical noise once the row is on
   screen, and dropping it roughly halves the scroll depth of a broad query. */
#layersPanel .tree.filtering details { border-bottom: none; }
#layersPanel .tree.filtering .modelNode > summary {
    font-size: 11px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--panel-muted);
    padding-top: 3px;
    padding-bottom: 3px;
}
#layersPanel .tree.filtering .categoryNode > summary { display: none; }
#layersPanel .tree.filtering .categoryNode {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
}
#layersPanel .tree.filtering .layerItem,
#layersPanel .tree.filtering .levelShelf { padding-left: 14px; }

#layersPanel .tree {
    overflow: auto;
    padding: 6px 10px 12px;
    /* Allow the tree to shrink inside the flex column when the panel hits
       its max-height cap; without this, default min-height:auto pins it to
       content-height and the panel's max-height has no effect. */
    min-height: 0;
}

#layersPanel details {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 2px 0;
}

#layersPanel details:last-child {
    border-bottom: none;
}

#layersPanel summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--panel-text);
    outline: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 8px;
    transition: background 120ms ease, color 120ms ease;
}

#layersPanel summary::-webkit-details-marker {
    display: none;
}

#layersPanel summary::before {
    content: "";
    flex: none;
    width: 11px;
    height: 11px;
    background-color: var(--accent);
    -webkit-mask: var(--gi-chevron-right) center / contain no-repeat;
    mask: var(--gi-chevron-right) center / contain no-repeat;
    transition: transform 120ms ease;
}

#layersPanel details[open] > summary::before {
    transform: rotate(90deg);
}

#layersPanel summary:hover {
    background: rgba(72, 178, 255, 0.08);
    color: #ffffff;
}

#layersPanel .modelNode > summary {
    background: rgba(255, 255, 255, 0.04);
    font-size: 15px;
    letter-spacing: 0.3px;
}

/* Blue indicator dot — real DOM element, hidden by default, shown when
   the parent node has data-has-active="1". */
#layersPanel .activeDot {
    display: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4fc3f7;
    margin-left: 7px;
    vertical-align: middle;
    opacity: 0.9;
    cursor: pointer;
    /* Larger touch target without changing visual size */
    padding: 5px;
    background-clip: content-box;
    -webkit-background-clip: content-box;
}
#layersPanel [data-has-active="1"] > summary > .activeDot {
    display: inline-block;
}

#layersPanel .categoryNode {
    margin-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding-left: 8px;
}

#layersPanel .categoryNode > summary {
    font-size: 13px;
    color: var(--panel-muted);
}

/* A model nested in a Live Weather subgroup (Radar > MRMS, Radar > Canada
   Radar, Satellite > GOES East CONUS) is a SOURCE inside a folder: indent it
   like a category and drop the 15px top-level model heading, which drew it
   flush with — and larger than — the subgroup it sits in. */
#layersPanel .categoryNode .modelNode {
    margin-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding-left: 8px;
}
#layersPanel .categoryNode .modelNode > summary {
    background: none;
    font-size: 13px;
    letter-spacing: 0;
}
#layersPanel .tree.filtering .categoryNode .modelNode {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
}

#layersPanel .layerItem {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 24px;
    font-size: 13px;
    color: var(--panel-muted);
    border-radius: 8px;
    transition: background 120ms ease, color 120ms ease;
}

/* ── Level shelf: per-level product families ("N-hPa X") render as one
      row of compact chips instead of N full rows (56% of the catalogue).
      Chips wrap a real hidden checkbox so toggle sync, the loading
      spinner, and the active-dot ancestor walk all work unchanged. ────── */
#layersPanel .levelShelf {
    padding: 4px 10px 6px 24px;
}
#layersPanel .levelShelfName {
    font-size: 13px;
    color: var(--panel-muted);
    padding: 2px 0 5px;
}
#layersPanel .levelShelfUnit {
    font-size: 10px;
    color: var(--panel-muted);
    opacity: 0.6;
    margin-left: 6px;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
}
#layersPanel .levelChips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
#layersPanel .levelChip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 7px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    font-size: 11.5px;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    color: var(--panel-muted);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: background 120ms, color 120ms, border-color 120ms;
}
#layersPanel .levelChip:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--panel-text);
}
#layersPanel .levelChip:has(input:checked) {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
#layersPanel .levelChip .chipContourBtn {
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.45;
    width: 14px;
    height: 14px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 3px;
    transition: opacity 120ms, color 120ms;
}
#layersPanel .levelChip .chipContourBtn:hover { opacity: 1; color: var(--accent); }
#layersPanel .levelChip:has(input:checked) .chipContourBtn:hover { color: #fff; }
#layersPanel .levelChip .chipContourBtn.active {
    opacity: 1;
    color: var(--accent);
}
/* On a CHECKED chip the background is already accent blue, so an accent
   glyph would be invisible — the white override below is why "contours on"
   read as nothing but an opacity change.  Give it a dark badge instead, so
   the state is unmistakable on both chip backgrounds. */
#layersPanel .levelChip:has(input:checked) .chipContourBtn.active {
    color: #fff;
    background: rgba(0, 0, 0, 0.34);
}

/* Contour quick-toggle glyph on heights/MSLP tree rows; the Track flight
   opener on the Aircraft (ADS-B) row (swim.js) shares the shape. */
#layersPanel .layerItem .treeContourBtn,
#layersPanel .layerItem .treeTrackBtn {
    margin-left: auto;
    border: none;
    background: transparent;
    color: var(--panel-muted);
    width: 22px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.55;
    flex-shrink: 0;
    transition: color 120ms, opacity 120ms, background 120ms;
}
#layersPanel .layerItem .treeContourBtn:hover,
#layersPanel .layerItem .treeTrackBtn:hover { color: var(--accent); opacity: 1; }
#layersPanel .layerItem .treeContourBtn.active,
#layersPanel .layerItem .treeTrackBtn.active {
    color: var(--accent);
    opacity: 1;
    background: rgba(120, 180, 255, 0.15);
}
/* Flights are being tracked (card open or not): the halo's pink. */
#layersPanel .layerItem .treeTrackBtn.tracking { color: #ff3cdc; opacity: 1; }

#layersPanel .layerItem:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--panel-text);
}

#layersPanel .layerItem input {
    accent-color: var(--accent);
}

/* Density slider row beneath the Raster Values toggle */
#layersPanel .densityRow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 8px 24px;
    font-size: 12px;
    color: var(--panel-muted);
}

#layersPanel .densityRow input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
    height: 4px;
    cursor: pointer;
}

/* ─── Saved Views ──────────────────────────────────────────────────────── */
.svContainer {
    padding: 4px 8px 8px;
}

.svSaveBtn {
    width: 100%;
    padding: 6px 10px;
    margin-bottom: 4px;
    border: 1px dashed rgba(255,255,255,0.2);
    border-radius: 6px;
    background: transparent;
    color: var(--panel-muted);
    font-size: 12px;
    cursor: pointer;
    transition: color 150ms, border-color 150ms;
}
.svSaveBtn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.svRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 4px;
    border-radius: 5px;
    transition: background 120ms;
}
.svRow:hover {
    background: rgba(255,255,255,0.06);
}
.svRow.svDefault .svName {
    color: var(--accent);
}

.svName {
    flex: 1;
    min-width: 0;
    padding: 4px 6px;
    border: none;
    background: transparent;
    color: var(--panel-text);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.svName:hover {
    color: var(--accent);
}

.svActions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}
.svActions button {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--panel-muted);
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.svActions button:hover {
    background: rgba(255,255,255,0.1);
    color: var(--panel-text);
}

/* ─── Entity hover tooltip ─────────────────────────────────────────────── */
.entityTooltip {
    position: absolute;
    display: none;
    padding: 6px 10px;
    border-radius: 5px;
    background: rgba(12,16,22,0.92);
    border: 1px solid rgba(255,255,255,0.15);
    color: #e6edf3;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    pointer-events: none;
    z-index: 10;
    max-width: 320px;
    backdrop-filter: blur(4px);
}
.entityTooltip .ttTitle { font-weight: 700; font-size: 13px; }
.entityTooltip .ttSub   { opacity: 0.7; font-size: 11px; }
.entityTooltip .ttRow   { white-space: nowrap; }

/* ─── Hazards menu section ────────────────────────────────────────────── */
/* Pinned atop Live Weather and given an amber accent so users know this is
   where warnings / watches / ProbSevere live — it must not read like just
   another muted subgroup. */
#layersPanel .hazardsNode {
    border-left-color: rgba(255, 149, 0, 0.55);
    background: rgba(255, 120, 40, 0.06);
    border-radius: 8px;
    margin-top: 2px;
    margin-bottom: 6px;
}
#layersPanel .hazardsNode > summary.hazardsSummary {
    flex-wrap: wrap;                /* let the descriptor drop to its own line */
    font-size: 14px;
    font-weight: 700;
    color: #ffb04a;
    padding: 3px 4px;
}
#layersPanel .hazardsNode > summary.hazardsSummary:hover { color: #ffc06a; }
#layersPanel .hazardsIcon {
    display: inline-flex;
    align-items: center;
    margin-right: 3px;
    color: #ff9500;
}
#layersPanel .hazardsHint {
    flex-basis: 100%;              /* full-width row under the title */
    margin: 1px 0 1px 22px;
    font-size: 11px;
    font-weight: 500;
    color: var(--panel-muted);
    letter-spacing: 0.01em;
}
#layersPanel .hazardsCount {
    margin-left: 6px;
    font-size: 12px;
    color: var(--panel-muted);
    font-weight: 500;
}
#layersPanel .hazardsCount.hot {
    color: #ff6b35;
    font-weight: 700;
}
.hazardsBody {
    padding: 6px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
/* Product toggle pills — one per Hazards overlay, with live count badge. */
.hazPills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}
.hazPill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px 3px 6px;
    font: 600 11px "IBM Plex Sans", "Segoe UI", sans-serif;
    letter-spacing: 0.02em;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.02);
    color: var(--panel-muted);
    cursor: pointer;
    transition: background 120ms, color 120ms, border-color 120ms;
}
.hazPill:hover {
    color: var(--panel-text);
    border-color: rgba(255,255,255,0.25);
}
.hazPill.on {
    color: var(--panel-text);
    background: rgba(255,255,255,0.06);
}
.hazPillDot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.55;
}
.hazPill.on .hazPillDot { opacity: 1; }
.hazPillLabel { white-space: nowrap; }
.hazPillCount {
    font: 700 10px ui-monospace, "SF Mono", Menlo, monospace;
    padding: 1px 5px;
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    color: var(--panel-text);
    min-width: 18px;
    text-align: center;
}
.hazPillCount.muted {
    background: rgba(255,255,255,0.04);
    color: var(--panel-muted);
    opacity: 0.55;
}
.hazFilters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.hazFilterChip {
    padding: 3px 8px;
    font: 600 11px "IBM Plex Sans", "Segoe UI", sans-serif;
    letter-spacing: 0.04em;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    color: var(--panel-muted);
    cursor: pointer;
    transition: background 120ms, color 120ms, border-color 120ms;
}
.hazFilterChip:hover {
    color: var(--panel-text);
    border-color: rgba(255,255,255,0.25);
}
.hazFilterChip.on {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}
.hazProbRow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--panel-muted);
}
.hazProbRow input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
    height: 4px;
    cursor: pointer;
}
.hazSection {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.hazSectionHead {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--panel-muted);
    opacity: 0.7;
    padding: 4px 0 2px;
}
.hazSectionHeadWarn,
.hazSectionHeadPS {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 1;
    flex-wrap: wrap;
}
.hazSectionTitle {
    opacity: 0.7;
}
.hazSectionFilters {
    display: inline-flex;
    gap: 2px;
    margin-left: auto;
}
.hazSectionFilters .hazFilterChip {
    padding: 1px 6px;
    font: 600 9px "IBM Plex Sans", "Segoe UI", sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 999px;
}
.hazPsSort {
    display: inline-flex;
    gap: 2px;
    margin-left: auto;
}
.hazPsSortChip {
    padding: 1px 6px;
    font: 600 9px "IBM Plex Sans", "Segoe UI", sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    color: var(--panel-muted);
    cursor: pointer;
    transition: background 120ms, color 120ms, border-color 120ms;
}
.hazPsSortChip:hover {
    color: var(--panel-text);
    border-color: rgba(255,255,255,0.25);
}
.hazPsSortChip.on {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}
/* Slim collapsible state group header — caret + state code + count + tier dot. */
button.hazSubHead {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    padding: 3px 4px;
    margin: 2px 0 0;
    border: 0;
    background: transparent;
    color: var(--panel-muted);
    font: 700 10px "IBM Plex Sans", "Segoe UI", sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    text-align: left;
}
button.hazSubHead:hover { background: rgba(255,255,255,0.04); color: var(--panel-text); }
button.hazSubHead.open  { color: var(--panel-text); }
.hazSubHeadCaret { width: 9px; opacity: 0.7; font-size: 9px; }
.hazSubHeadDot   { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; }
.hazSection > .hazSubHead:first-of-type { margin-top: 0; }
.hazState {
    margin-left: 4px;
    padding: 1px 5px;
    font: 700 9px "IBM Plex Sans", "Segoe UI", sans-serif;
    letter-spacing: 0.05em;
    border-radius: 3px;
    background: rgba(255,255,255,0.08);
    color: var(--panel-muted);
}
.hazList {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 320px;
    overflow-y: auto;
}
button.hazRow {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    padding: 3px 6px 3px 8px;
    margin: 0;
    border: 1px solid rgba(255,255,255,0.06);
    border-left: 3px solid #555;
    border-radius: 5px;
    background: rgba(255,255,255,0.02);
    color: var(--panel-text);
    cursor: pointer;
    font: 11px/1.3 "IBM Plex Sans", "Segoe UI", sans-serif;
    transition: background 120ms, border-color 120ms;
}
/* Warning rows are single-line — no chip row, no where line. */
button.hazRow.hazRowWarn { padding: 4px 6px 4px 8px; }
.hazRow:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.18);
}
.hazRowHead {
    display: flex;
    align-items: center;
    gap: 6px;
}
.hazTag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #0a0a0a;
    padding: 1px 6px;
    border-radius: 3px;
}
.hazTitle {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hazExpiry {
    font-variant-numeric: tabular-nums;
    color: var(--panel-muted);
    font-size: 11px;
}
.hazChips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.hazChip {
    background: #2a2a2a;
    color: #e8e8e8;
    border: 1px solid #555;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.hazChipUrgent {
    background: #aa0000;
    color: #fff;
    border-color: #aa0000;
    font-weight: 700;
}
/* Inline condensed threat readout — sits in the row head, not its own row. */
.hazThreats {
    display: inline-flex;
    gap: 3px;
    flex-shrink: 0;
}
.hazThreat {
    padding: 0 4px;
    border-radius: 2px;
    font: 700 9px ui-monospace, "SF Mono", Menlo, monospace;
    letter-spacing: 0.02em;
    background: rgba(255,255,255,0.06);
    color: var(--panel-muted);
    white-space: nowrap;
    line-height: 1.5;
}
.hazThreatUrgent {
    background: #aa0000;
    color: #fff;
}
.hazPsGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 8px;
    margin-top: 2px;
}
.hazPsCell {
    display: grid;
    grid-template-columns: 30px 1fr 32px;
    align-items: center;
    gap: 4px;
    font-size: 10px;
}
.hazPsLbl {
    color: var(--panel-muted);
}
.hazPsTrack {
    display: block;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}
.hazPsFill {
    display: block;
    height: 100%;
    border-radius: 2px;
}
.hazPsVal {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.hazEmpty {
    font-size: 11px;
    color: var(--panel-muted);
    line-height: 1.5;
    padding: 8px 4px;
    opacity: 0.7;
}

/* Alert highlight on recently-fired ProbSevere rows */
button.hazRow.alerted {
    background: rgba(255, 60, 200, 0.12);
    border-color: rgba(255, 60, 200, 0.55);
    box-shadow: 0 0 0 1px rgba(255, 60, 200, 0.35) inset, 0 0 12px rgba(255, 60, 200, 0.18);
    animation: hazAlertPulse 1.6s ease-out 0s 4;
}
@keyframes hazAlertPulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(255, 60, 200, 0.35) inset, 0 0 8px rgba(255, 60, 200, 0.18); }
    50%      { box-shadow: 0 0 0 1px rgba(255, 60, 200, 0.7) inset, 0 0 18px rgba(255, 60, 200, 0.45); }
}

/* ─── Alerts sub-section inside Hazards body ─────────────────────────── */
.alertsNode {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    background: rgba(255,255,255,0.02);
}
.alertsSummary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    color: var(--panel-text);
    font-size: 12px;
    font-weight: 600;
}
.alertsSummary::-webkit-details-marker { display: none; }
.alertsSummary::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    vertical-align: -1px;
    background-color: var(--panel-muted);
    -webkit-mask: var(--gi-chevron-right) center / contain no-repeat;
    mask: var(--gi-chevron-right) center / contain no-repeat;
    transition: transform 120ms;
}
details[open] > .alertsSummary::before { transform: rotate(90deg); }
.alertOnChip {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.08);
    color: var(--panel-muted);
}
.alertOnChip.on {
    background: var(--accent);
    color: #0a0a0a;
}
.alertsBody {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 10px 10px;
}
.alertMasterBtn {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 5px;
    background: transparent;
    color: var(--panel-text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms, border-color 120ms, color 120ms;
}
.alertMasterBtn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.alertMasterBtn.on {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}
.alertNotifRow {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--panel-muted);
}
.alertSmallBtn {
    padding: 2px 8px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    background: transparent;
    color: var(--panel-muted);
    font-size: 11px;
    cursor: pointer;
}
.alertSmallBtn:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.alertNotifHelp {
    flex: 1 0 100%;
    font-size: 10.5px;
    color: var(--panel-muted);
    line-height: 1.4;
    padding: 4px 0 0;
    opacity: 0.85;
}
.alertSection {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.alertSectionHead {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--panel-muted);
    opacity: 0.7;
    padding-top: 4px;
}
.alertPresetChips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.alertPresetChip {
    padding: 4px 9px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    background: transparent;
    color: var(--panel-text);
    font-size: 11px;
    cursor: pointer;
    transition: background 120ms, border-color 120ms, color 120ms;
}
.alertPresetChip:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}
.alertEditorPresetHead { padding-top: 0; }
.alertRuleList {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.alertRuleRow {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 4px;
    font-size: 11.5px;
}
.alertRuleLbl {
    font-weight: 600;
    color: var(--panel-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.alertRuleDet {
    color: var(--panel-muted);
    font-variant-numeric: tabular-nums;
    font-size: 10.5px;
    white-space: nowrap;
}
.alertRuleDel {
    background: none;
    border: none;
    color: var(--panel-muted);
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
}
.alertRuleDel:hover { color: #ff6b6b; }
.alertRuleEmpty {
    font-size: 11px;
    color: var(--panel-muted);
    opacity: 0.7;
    padding: 4px 0;
}
.alertAddBtn {
    width: 100%;
    padding: 5px;
    margin-top: 4px;
    border: 1px dashed rgba(255,255,255,0.2);
    border-radius: 5px;
    background: transparent;
    color: var(--panel-muted);
    font-size: 11.5px;
    cursor: pointer;
    transition: color 120ms, border-color 120ms;
}
.alertAddBtn:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.alertEditor {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    margin-top: 4px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 5px;
    min-width: 0;
    overflow: hidden;
}
.alertField {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
    color: var(--panel-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    min-width: 0;
}
.alertEditorInput {
    width: 100%;
    box-sizing: border-box;
    padding: 4px 6px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    background: rgba(0,0,0,0.25);
    color: var(--panel-text);
    font: 11.5px "IBM Plex Sans", "Segoe UI", sans-serif;
    min-width: 0;
}
.alertSliderRow {
    display: grid;
    grid-template-columns: 14px 36px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    min-width: 0;
}
.alertSliderRow input[type="range"] {
    accent-color: var(--accent);
    height: 4px;
    width: 100%;
    min-width: 0;
}
.alertSliderRow input[type="checkbox"] {
    accent-color: var(--accent);
    margin: 0;
}
.alertSliderLbl { color: var(--panel-text); }
.alertSliderVal {
    text-align: right;
    color: var(--panel-muted);
    font-variant-numeric: tabular-nums;
    font-size: 10.5px;
}
.alertBtnRow {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}
.alertSaveBtn, .alertCancelBtn {
    flex: 1;
    padding: 5px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.15);
    background: transparent;
    color: var(--panel-text);
}
.alertSaveBtn {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}
.alertSaveBtn:hover { background: var(--accent); color: #0a0a0a; }
.alertCancelBtn:hover { color: var(--panel-text); border-color: rgba(255,255,255,0.3); }

/* Section divider inside the Map Overlays accordion (e.g. "Labels" sub-heading) */
#layersPanel .overlayGroupHeader {
    padding: 8px 10px 4px 24px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--panel-muted);
    opacity: 0.65;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 4px;
}

#timelinePanel {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)); /* JS ResizeObserver overrides this dynamically */
    display: grid;
    grid-template-columns: auto auto auto auto auto 1fr auto auto auto;
    /* prev | play | lookback | next | run-select | scrubber | label | live | rec */
    gap: 5px 8px;
    align-items: center;
    padding: 4px 8px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    color: var(--panel-text);
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    z-index: 3;
    backdrop-filter: blur(6px);
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Transport icon buttons — shared base */
#timelinePanel .tlBtn {
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--panel-border);
    color: var(--panel-text);
    border-radius: 6px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    transition: background 120ms, color 120ms;
    font-family: inherit;
}
#timelinePanel .tlBtn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* Play/pause button */
#timelinePanel .tlBtn.play {
    background: var(--accent);
    border-color: transparent;
    color: #04121f;
    font-size: 14px;
}
#timelinePanel .tlBtn.play::before {
    content: "";
    width: 13px;
    height: 13px;
    background-color: currentColor;
    -webkit-mask: var(--gi-play) center / contain no-repeat;
    mask: var(--gi-play) center / contain no-repeat;
}
#timelinePanel .tlBtn.play.active::before {
    -webkit-mask-image: var(--gi-pause);
    mask-image: var(--gi-pause);
}
#timelinePanel .tlBtn.play.loading::before {
    -webkit-mask-image: var(--gi-more);
    mask-image: var(--gi-more);
}
#timelinePanel .tlBtn.play.buffering::before {
    /* same glyph as idle — the button itself pulses */
    -webkit-mask-image: var(--gi-play);
    mask-image: var(--gi-play);
}
#timelinePanel .tlBtn.play.buffering {
    background: #48b2ff;
    animation: btnPulse 0.8s ease-in-out infinite;
}
@keyframes btnPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}
#timelinePanel .tlBtn.play:hover {
    background: #72c8ff;
}
#timelinePanel .tlBtn.play.active {
    background: #22d69f;
    color: #052016;
}

/* Live jump button */
#timelineLive {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0 8px;
    width: auto;
    min-width: 38px;
    white-space: nowrap;
}
#timelineLive.at-live {
    min-width: 54px;
    background: #22d69f;
    border-color: transparent;
    color: #052016;
    box-shadow: 0 0 8px rgba(34, 214, 159, 0.4);
}
#timelineLive.at-live::before {
    content: "\25CF\00A0"; /* ● non-breaking-space */
    font-size: 7px;
    vertical-align: middle;
}

#timelineScrubber {
    grid-column: 6;
    width: 100%;
    --track-fill-pct: 0%;
    /* Reset browser defaults so we can style the track uniformly. */
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Track — WebKit / Blink */
#timelineScrubber::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right,
        rgba(72, 178, 255, 0.7) var(--track-fill-pct),
        rgba(255, 255, 255, 0.18) var(--track-fill-pct));
    transition: background 80ms linear;
}

/* Track — Firefox */
#timelineScrubber::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right,
        rgba(72, 178, 255, 0.7) var(--track-fill-pct),
        rgba(255, 255, 255, 0.18) var(--track-fill-pct));
    transition: background 80ms linear;
}

/* Thumb — WebKit / Blink */
#timelineScrubber::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #48b2ff;
    border: 2px solid rgba(0, 0, 0, 0.45);
    margin-top: -5px;
    cursor: pointer;
    transition: transform 100ms ease;
}
#timelineScrubber::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

/* Thumb — Firefox */
#timelineScrubber::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.45);
    background: #48b2ff;
    cursor: pointer;
}

#timelineRun {
    background: rgba(255, 255, 255, 0.06);
    color: var(--panel-text);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 11px;
    min-width: 150px;
}
#playLookback {
    background: rgba(255, 255, 255, 0.06);
    color: var(--panel-text);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 2px 5px;
    font-size: 10.5px;
    min-width: 0;
    width: auto;
}

#timelineLabel {
    grid-column: 7;
    font-size: 11px;
    color: var(--panel-muted);
    justify-self: end;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 34vw;
}
/* Forecast hour ("+036hr", maps.js _timelineLeadInfo): tabular so the label
   keeps its width through a loop. */
#timelineLabel .tlLead {
    color: var(--panel-text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-left: 4px;
}

#cesiumCredits {
    display: none;
}

#paletteLegend {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(12,16,22,0.9);
    color: #e6edf3;
    z-index: 3;
    display: none;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

/* ─── Product bar (below gradient) ───────────────────────────────────────── */
#paletteLegend .activeProducts {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 3px 2px 1px;
    flex-wrap: wrap;
}
.productBarSide {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
    min-width: 0;
}
.productBarRight { justify-content: flex-end; }
.productBarVs {
    align-self: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--panel-muted);
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    padding: 0 2px;
}
.productGroup {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.productGroupLabel {
    font-size: 9px;
    font-weight: 800;
    color: var(--panel-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}
#paletteLegend .activeProduct {
    display: inline-flex;
    align-items: stretch;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.05);
    color: #d9e6ef;
    overflow: hidden;
}
#paletteLegend .activeProduct.isCurrent {
    border-color: rgba(72, 178, 255, 0.55);
    background: rgba(72, 178, 255, 0.14);
    color: #f1f8ff;
}
#paletteLegend .activeProduct.splitRight {
    border-color: rgba(34, 214, 159, 0.45);
    background: rgba(34, 214, 159, 0.1);
    color: #d0f5e8;
}
#paletteLegend .activeProductSelect {
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    text-align: left;
    line-height: 1.2;
    white-space: nowrap;
}
#paletteLegend .activeProductSelect:hover { color: #ffffff; }
#paletteLegend .activeProductRemove,
#paletteLegend .compareBtn {
    border: none;
    border-left: 1px solid rgba(255,255,255,0.08);
    background: transparent;
    color: var(--panel-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    font-size: 13px;
    opacity: 1;
    flex-shrink: 0;
    transition: color 120ms, background 120ms;
}
#paletteLegend .activeProductRemove:hover { color: #ff7b7b; background: rgba(255,100,100,0.12); }
#paletteLegend .compareBtn:hover { opacity: 1; color: var(--accent); }

/* RT overlay pills — amber tint to distinguish from data layers */
#paletteLegend .rtPill {
    border-color: rgba(255, 191, 64, 0.35);
    background: rgba(255, 191, 64, 0.10);
    color: #ffe0a6;
}
#paletteLegend .rtGroup {
    margin-left: auto;
}

/* Clear-category ✕ (one per multi-pill group) and global Clear-all button */
#paletteLegend .productGroupClear {
    border: none;
    background: transparent;
    color: var(--panel-muted);
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    flex-shrink: 0;
    opacity: 0.55;
    transition: color 120ms, background 120ms, opacity 120ms;
}
#paletteLegend .productGroupClear:hover {
    color: #ff7b7b;
    background: rgba(255,100,100,0.12);
    opacity: 1;
}
#paletteLegend .productClearAll {
    margin-left: auto;
    align-self: center;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.05);
    color: var(--panel-muted);
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 120ms, background 120ms, border-color 120ms;
}
#paletteLegend .productClearAll:hover {
    color: #ff9a9a;
    border-color: rgba(255,100,100,0.45);
    background: rgba(255,100,100,0.12);
}

#paletteLegend .paletteTitle {
    font-size: 11px;
    color: #b6c6d3;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#paletteLegend .paletteGradient {
    height: 9px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.16);
    overflow: hidden;
    margin-bottom: 3px;
}

#paletteLegend .paletteSteps {
    position: relative;
    height: 18px;
}

#paletteLegend .stepTick {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    width: 1px;
    height: 6px;
    background: rgba(255,255,255,0.5);
}

#paletteLegend .stepLabel {
    position: absolute;
    top: 7px;
    transform: translateX(-50%);
    font-size: 9px;
    color: #d6e2ea;
    white-space: nowrap;
}

#appShell.timeline-hidden #paletteLegend {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

/* ─── Record button (lives in the timeline as a .tlBtn) ──────────────────── */
.recDot {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e05555;
    box-shadow: 0 0 0 2px rgba(224,85,85,0.25);
    transition: background 180ms, box-shadow 180ms;
}
#timelinePanel #recBtn:hover .recDot {
    background: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255,107,107,0.3);
}
#timelinePanel #recBtn.recording .recDot {
    background: #ff4d4d;
    animation: recDotPulse 1.2s ease-in-out infinite;
}
@keyframes recDotPulse {
    0%, 100% { box-shadow: 0 0 0 0   rgba(255,77,77,0.0); }
    50%       { box-shadow: 0 0 0 6px rgba(255,77,77,0.4); }
}
#timelinePanel #recBtn.recording {
    border-color: rgba(255, 77, 77, 0.45);
}

/* ─── Right-edge tool rail ──────────────────────────────────────────────────
   Vertical stack of map controls down the right side, sitting BELOW the
   hamburger (which lives solo in the corner as the layers-panel toggle).
   The rail is anchored to the same right edge so the column reads as a
   single set of related tools, not a satellite of the hamburger.
   When the layers panel is open the rail slides off-screen right — the
   hamburger handles closing the panel, and the panel itself is the
   active workspace, so the rail is redundant in that state.
*/
/* The rail is a flex column so buttons stack with a fixed gap and any
   hidden/absent control (e.g. RVOL when no MRMS layer is active, or the
   quad-pane button before its module loads) collapses out — the remaining
   buttons move up to fill the space instead of leaving a hole. */
#toolRail {
    position: absolute;
    top: 68px;             /* hamburger(24) + 36 + 8 */
    right: 24px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}
/* Every rail button shares ONE look — size, radius, border, hover — so
   the stack reads as a single instrument cluster no matter which module
   contributed the button.  Per-button rules below only set glyph sizing. */
#toolRail > button {
    position: relative;   /* anchors the slide-out hover label */
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    color: var(--panel-text);
    font-weight: 700;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    cursor: pointer;
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: opacity 180ms ease, transform 180ms ease,
                color 180ms, border-color 180ms, background 180ms;
}
#windBarbBtn   { font-size: 14px; }
#sceneModeBtn  { font-size: 12px; }
#radar3dBtn    { font-size: 10px; }
#radar3dBtn.hidden { display: none; }
/* While a site is loaded the radar button shows its code (KFTG) instead of
   the glyph — same text-chip idiom as the scene-mode button. */
#ssrRailBtn.site-on { font-size: 10px; letter-spacing: 0.02em; }
/* Rail glyphs are the 24-px-grid "basic" set drawn at 20 px (15 px body). */
#toolRail > button > .wpGi,
#layersToggle .wpGi { width: 20px; height: 20px; }
/* The eye button carries BOTH eye states; the body class picks one. */
#hudToggleBtn .gi-off { display: none; }
body.wp-hud-hidden #hudToggleBtn .gi-on { display: none; }
body.wp-hud-hidden #hudToggleBtn .gi-off { display: inline-block; }

/* Task-group separators — a short hairline, right-aligned like the buttons.
   Kept as visibility (not display) under wp-hud-hidden so the rail's layout
   never shifts while toggling the HUD. */
#toolRail > .railSep {
    width: 22px;
    height: 1px;
    margin-right: 7px;
    background: var(--panel-border);
    flex: 0 0 auto;
}

/* Slide-out hover labels: every rail button with data-label grows a text
   chip to its LEFT on hover/focus, delayed slightly so quick pointer
   passes don't flash the whole column.  Buttons that own a hover flyout
   (wind) carry no data-label — the flyout occupies the same space.
   Suppressed while that button's own panel is open (.open on the radar
   button, .active on RVOL whose threshold strip sits there).
   HOVER-CAPABLE DEVICES ONLY: touch taps latch :hover (verified in
   emulation — the chip faded in AFTER the tap and lingered until the
   next tap elsewhere), so without this gate every rail tap on a phone
   leaves a stuck tooltip. */
@media (hover: hover) {
    #toolRail > button[data-label]::after {
        content: attr(data-label);
        position: absolute;
        right: calc(100% + 10px);
        top: 50%;
        transform: translateY(-50%) translateX(6px);
        padding: 4px 9px;
        border-radius: 7px;
        border: 1px solid var(--panel-border);
        background: var(--panel-bg);
        color: var(--panel-text);
        font: 600 11px "IBM Plex Sans", "Segoe UI", sans-serif;
        white-space: nowrap;
        pointer-events: none;
        opacity: 0;
        backdrop-filter: blur(6px);
        transition: opacity 120ms ease, transform 120ms ease;
    }
    #toolRail > button[data-label]:hover::after,
    #toolRail > button[data-label]:focus-visible::after {
        opacity: 1;
        transform: translateY(-50%);
        transition-delay: 280ms;
    }
    #toolRail > button.open::after,
    #radar3dBtn.active::after { display: none; }
}

#toolRail > button:hover { border-color: var(--accent); color: var(--accent); }
/* Rail buttons whose feature is currently drawing on the map fill accent —
   the wind barb button was the only one anyone had wired up, so the contour
   button stayed grey with contours live on screen.  Any new rail toggle
   belongs in this list. */
#windBarbBtn.active,
#inspectBtn.active,
#ssrRailBtn.active,
#radar3dBtn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Slide rail off-screen right when the layers panel is open so the rail
   tools never float over the panel content. */
#appShell:not(.layers-collapsed) #toolRail,
#appShell:not(.layers-collapsed) #radar3dControls {
    opacity: 0;
    pointer-events: none;
    transform: translateX(60px);
}

/* Threshold flyout for the 3D radar volume — appears to the left of the
   RVOL button only while RVOL is active.  Three small numeric inputs let
   power users retune the marching-cubes isosurface levels (e.g. 30/45/55
   for tornadic supercells, 10/20/30 for stratiform). */
#radar3dControls {
    position: absolute;
    top: 158px;          /* aligned with #radar3dBtn (top:156, h:36) */
    right: 68px;         /* radar3dBtn(24) + 36 + 8 */
    display: none;
    gap: 4px;
    align-items: center;
    z-index: 3;
    transition: opacity 180ms ease, transform 180ms ease;
}
#radar3dControls.visible { display: flex; }
/* Auto-faded after a few seconds of no interaction, restored on hover of the
   RVOL button or the controls themselves.  Keeps the chrome out of the way
   for screenshots without losing the controls outright. */
#radar3dControls.idle {
    opacity: 0;
    transform: translateX(12px);
    pointer-events: none;
}
#radar3dControls .r3dLabel {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--panel-muted);
    padding: 0 4px 0 0;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}
#radar3dControls .r3dThresh {
    width: 44px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    color: var(--panel-text);
    font-size: 12px;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-weight: 600;
    text-align: center;
    backdrop-filter: blur(6px);
    padding: 0 4px;
    -moz-appearance: textfield;
}
#radar3dControls .r3dThresh::-webkit-outer-spin-button,
#radar3dControls .r3dThresh::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#radar3dControls .r3dThresh:focus {
    outline: none;
    border-color: var(--accent);
    color: var(--accent);
}

#windBarbControls {
    position: absolute;
    /* Anchored to the rail's wind button — appears as a flyout to its left
       so the level + style pickers feel attached to the button that owns
       them, not floating in random screen space. */
    /* Positioned relative to #toolRail (its position:absolute containing
       block), NOT the viewport.  `top` is set by maps.js _wbAlign() from
       windBarbBtn.offsetTop at show time — the rail's button order changes
       and a hardcoded top desynced the flyout from the barb repeatedly.
       Never reintroduce a static top here. */
    right: 44px;          /* button width 36 + 8 gap, from the rail's right edge */
    display: none;
    gap: 4px;
    align-items: center;
    z-index: 3; /* below layersPanel (z:4) */
    transition: opacity 180ms ease, transform 180ms ease;
}
#windBarbControls.visible { display: flex; }
/* Hide the wind controls when the layers panel is open — they belong to
   the rail's wind button and the rail itself slides off-screen in that
   state.  Without this they'd float disconnected over the map. */
#appShell:not(.layers-collapsed) #windBarbControls {
    opacity: 0;
    pointer-events: none;
    transform: translateX(60px);
}

#windBarbControls select,
#windBarbControls .wbStyleBtn {
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    color: var(--panel-text);
    font-size: 12px;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    backdrop-filter: blur(6px);
    padding: 0 8px;
    cursor: pointer;
}
#windBarbControls .wbStyleBtn {
    width: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 120ms, color 120ms;
}
#windBarbControls .wbStyleBtn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* The contour overlay flyout (#contourControls) is gone — contours are
   reached only by turning a product into lines, and the interval lives in
   that product's pill menu.  See the note in maps.js. */

/* Pill contour-mode button (isolines instead of filled raster) */
#paletteLegend .contourModeBtn {
    border: none;
    border-left: 1px solid rgba(255,255,255,0.08);
    background: transparent;
    color: var(--panel-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    flex-shrink: 0;
    transition: color 120ms, background 120ms;
}
#paletteLegend .contourModeBtn:hover { color: var(--accent); }
#paletteLegend .contourModeBtn.active {
    color: var(--accent);
    background: rgba(120, 180, 255, 0.12);
}

/* ─── Record dialog (opens above the timeline near the rec button) ───────── */
#recDialog {
    position: absolute;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    right: 24px;
    width: 220px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: 14px 16px 16px;
    color: var(--panel-text);
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-size: 13px;
    z-index: 6;
    backdrop-filter: blur(6px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    display: none;
}
#recDialog.open {
    display: block;
    animation: recDialogIn 120ms ease forwards;
}
@keyframes recDialogIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}
.recDialogTitle {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--panel-muted);
    margin-bottom: 10px;
}
.recModeRow {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 11px;
    color: var(--panel-text);
    cursor: pointer;
    line-height: 1.3;
}
.recModeRow input[type="checkbox"] {
    margin-top: 1px;
    accent-color: var(--accent);
}
#recTimedOptions.hidden {
    display: none;
}
.recPresets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.recPresets button {
    flex: 1;
    min-width: 38px;
    padding: 5px 4px;
    border-radius: 7px;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--panel-text);
    font-size: 12px;
    cursor: pointer;
    transition: background 100ms;
}
.recPresets button:hover { background: rgba(255, 255, 255, 0.12); }
.recPresets button.active {
    border-color: var(--accent);
    color: var(--accent);
}
.recCustomRow {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--panel-muted);
}
#recDurInput {
    flex: 1;
    width: 0;
    min-width: 0;
    padding: 5px 7px;
    border-radius: 7px;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.07);
    color: var(--panel-text);
    font-size: 13px;
}
#recStartBtn {
    width: 100%;
    padding: 8px 0;
    border-radius: 9px;
    border: none;
    background: #b71c1c;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 120ms;
}
#recStartBtn:hover { background: #e53935; }

/* ─── Frame-load progress bar (replaces scrubber-track loading hack) ─────── */
#timelineLoadBar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 150ms;
}
#timelineLoadBar.active { opacity: 1; }
#timelineLoadBar::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--load-pct, 0%);
    background: var(--accent);
    transition: width 80ms linear;
}

/* ─── Location search (magnifier / "/") ─────────────────────────────────── */
#locSearch {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    width: min(440px, 82vw);
    display: none;
    flex-direction: column;
    background: rgba(10, 16, 22, 0.94);
    border: 1px solid rgba(120, 200, 255, 0.35);
    border-radius: 10px;
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    overflow: hidden;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}
#locSearch.open { display: flex; }
#locSearch input {
    border: 0;
    outline: none;
    background: transparent;
    color: #eef5fb;
    font-size: 14px;
    padding: 10px 14px;
}
#locSearch input::placeholder { color: rgba(255,255,255,0.35); }
#locSearch .locList { display: flex; flex-direction: column; padding: 0 6px 6px; }
#locSearch .locList:empty { padding: 0; }
#locSearch .locRow {
    display: flex;
    align-items: baseline;
    gap: 8px;
    border: 0;
    background: none;
    text-align: left;
    color: #dce8f2;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}
#locSearch .locRow:hover { background: rgba(255,255,255,0.08); }
#locSearch .locRow.active { background: rgba(78,161,255,0.28); color: #fff; }
#locSearch .locKind {
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
}
body.wp-hud-hidden #locSearch { display: none !important; }

/* ─── Single-site quick switcher — on-map product/tilt strip ────────────── */
#ssrQuickStrip {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(118px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    max-width: min(92vw, 920px);
    padding: 4px 8px;
    border-radius: 9px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(6px);
    z-index: 3;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    -webkit-user-select: none;
    user-select: none;
}
#ssrQuickStrip .ssrStripSite {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--accent, #48b2ff);
    background: rgba(72,178,255,0.08);
    border: 1px solid rgba(72,178,255,0.35);
    border-radius: 5px;
    padding: 2px 7px;
    cursor: pointer;
}
#ssrQuickStrip .ssrStripSite::after {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-left: 3px;
    vertical-align: -1px;
    opacity: 0.7;
    background-color: currentColor;
    -webkit-mask: var(--gi-chevron-down) center / contain no-repeat;
    mask: var(--gi-chevron-down) center / contain no-repeat;
}
#ssrQuickStrip .ssrStripSite:hover { background: rgba(72,178,255,0.2); color: #fff; }

/* Site chooser — anchored above the strip, nearest-first, searchable. */
/* Shared box styling for BOTH site-picker instances — the quick-strip
   chooser (#ssrSitePicker, opens upward above the strip) and the tool-rail
   flyout (#ssrRailSitePicker, opens leftward beside the radar button, top
   set by JS from the button's measured offsetTop). */
.ssrSitePicker {
    display: none;
    position: absolute;
    width: 240px;
    max-height: min(46vh, 420px);
    flex-direction: column;
    overflow: hidden;
    background: rgba(10, 16, 22, 0.96);
    border: 1px solid rgba(120, 200, 255, 0.35);
    border-radius: 9px;
    box-shadow: 0 -10px 34px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
}
.ssrSitePicker.open { display: flex; }
.ssrSitePicker input {
    flex: 0 0 auto;
    margin: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.06);
    color: #eaf2fb;
    font: 12px "IBM Plex Sans", "Segoe UI", sans-serif;
    outline: none;
    text-transform: uppercase;
}
.ssrSitePicker input:focus { border-color: var(--accent, #4ea1ff); }
.ssrSitePicker .ssrSiteList { overflow-y: auto; padding: 0 6px 8px; }
.ssrSitePicker .ssrSiteRow {
    display: flex;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    border: 0;
    background: none;
    text-align: left;
    color: #dce8f2;
    font: 600 12px "IBM Plex Mono", "IBM Plex Sans", monospace;
    padding: 4px 8px;
    border-radius: 5px;
    cursor: pointer;
}
.ssrSitePicker .ssrSiteRow:hover { background: rgba(255,255,255,0.08); }
.ssrSitePicker .ssrSiteRow.active { background: rgba(78,161,255,0.28); color: #fff; }
.ssrSitePicker .ssrSiteRow.current { color: var(--accent, #48b2ff); }
.ssrSitePicker .ssrSiteDist {
    margin-left: auto;
    font: 10px "IBM Plex Sans", "Segoe UI", sans-serif;
    color: rgba(255,255,255,0.45);
}
.ssrSitePicker .ssrSiteName {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: 10.5px "IBM Plex Sans", "Segoe UI", sans-serif;
    color: rgba(255,255,255,0.62);
}
#ssrSitePicker { bottom: calc(100% + 8px); left: 0; }
#ssrRailSitePicker { right: calc(100% + 8px); }

/* View menu (#viewMenu) — the scene-mode button's click flyout:
   projection, terrain, relief shading.  Same box as the radar picker; opens
   leftward, `top` set by maps.js from the button's measured offsetTop at
   open (rail-flyout rule — never a static top). */
.railMenu {
    display: none;
    position: absolute;
    right: calc(100% + 8px);
    width: 236px;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: rgba(10, 16, 22, 0.96);
    border: 1px solid rgba(120, 200, 255, 0.35);
    border-radius: 9px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    color: #dce8f2;
    font: 12px "IBM Plex Sans", "Segoe UI", sans-serif;
}
.railMenu.open { display: flex; }
.railMenuRow { display: flex; flex-direction: column; gap: 5px; }
.railMenuLabel {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}
.railMenuHint { font-size: 11px; line-height: 1.35; color: rgba(255, 255, 255, 0.6); }
/* Segmented control: a row of mutually exclusive choices. */
.wpSeg {
    display: flex;
    border: 1px solid var(--panel-border);
    border-radius: 7px;
    overflow: hidden;
}
.wpSeg > button {
    flex: 1 1 0;
    height: 28px;
    padding: 0 8px;
    border: 0;
    border-left: 1px solid var(--panel-border);
    background: transparent;
    color: var(--panel-text);
    font: 600 12px "IBM Plex Sans", "Segoe UI", sans-serif;
    cursor: pointer;
    transition: background 120ms, color 120ms;
}
.wpSeg > button:first-child { border-left: 0; }
.wpSeg > button:hover { background: rgba(255, 255, 255, 0.08); }
.wpSeg > button.active { background: var(--accent); color: #fff; }
.wpSeg > button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.wpSeg > button:disabled { opacity: 0.4; cursor: not-allowed; background: transparent; }
body.wp-hud-hidden #viewMenu,
#appShell:not(.layers-collapsed) #viewMenu { display: none; }
/* View menu Spotlight row: region list + click-to-pick. */
.wpSpotCtl { display: flex; gap: 6px; }
.wpSpotSel,
.wpSpotPick {
    height: 28px;
    border-radius: 7px;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--panel-text);
    font: 600 12px "IBM Plex Sans", "Segoe UI", sans-serif;
    cursor: pointer;
}
.wpSpotSel { flex: 1 1 auto; min-width: 0; padding: 0 6px; }
.wpSpotSel option, .wpSpotSel optgroup { background: #0a1016; color: var(--panel-text); }
.wpSpotPick {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 9px;
    transition: background 120ms, color 120ms;
}
.wpSpotPick:hover { background: rgba(255, 255, 255, 0.08); }
.wpSpotPick.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.wpSpotSel:focus-visible,
.wpSpotPick:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* An armed pick: the hover-entity handler writes the canvas cursor inline. */
body.wpSpotPicking #cesiumContainer canvas { cursor: crosshair !important; }
.ssrSitePicker .ssrPickUnload {
    flex: 0 0 auto;
    margin: 0 8px 8px;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.05);
    color: #f0a9a9;
    font: 600 11px "IBM Plex Sans", "Segoe UI", sans-serif;
    cursor: pointer;
    text-align: left;
}
.ssrSitePicker .ssrPickUnload:hover { background: rgba(255,80,80,0.18); color: #ffc4c4; }
/* Touch: bigger site-picker hit targets (25 px rows are fine for a mouse,
   cramped for thumbs — this is now a primary phone entry point).  Must
   stay BELOW the base rules: same specificity, source order decides. */
@media (pointer: coarse) {
    .ssrSitePicker .ssrSiteRow { padding: 9px 10px; }
    .ssrSitePicker .ssrPickUnload { padding: 9px 10px; }
}
#ssrQuickStrip .ssrStripRow { display: flex; gap: 3px; flex-wrap: wrap; }
#ssrQuickStrip .ssrStripRow + .ssrStripRow {
    border-left: 1px solid rgba(255,255,255,0.12);
    padding-left: 8px;
}
#ssrQuickStrip .ssrStripBtn {
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.05);
    color: #d9e6ef;
    border-radius: 5px;
    padding: 2px 7px;
    font-size: 10.5px;
    line-height: 1.5;
    cursor: pointer;
}
#ssrQuickStrip .ssrStripBtn:hover { border-color: rgba(255,255,255,0.3); color: #fff; }
#ssrQuickStrip .ssrStripBtn.on {
    background: rgba(72,178,255,0.25);
    border-color: rgba(72,178,255,0.6);
    color: #fff;
}
#ssrQuickStrip .ssrStripClose {
    border: 0;
    background: none;
    color: var(--panel-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 0 2px;
}
#ssrQuickStrip .ssrStripClose:hover { color: #ff7b7b; }
/* "⇔ MRMS": radar and national radar side by side (quad radar mode). */
#ssrQuickStrip .ssrStripCmp {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
#ssrQuickStrip .ssrStripCmp svg { flex: none; }
body.wp-hud-hidden #ssrQuickStrip { display: none !important; }
/* Quad owns the screen: the strip drives the MAIN viewer's radar and the
   location search flies the MAIN camera — both meaningless (and floating
   over panes) while the grid is up. */
#appShell.quad-active #ssrQuickStrip,
#appShell.quad-active #locSearch { display: none !important; }

/* ─── Hide-HUD mode (H / eye button) — chrome off, data stays ───────────── */
body.wp-hud-hidden #layersPanel,
body.wp-hud-hidden #layersToggle,
body.wp-hud-hidden #timelinePanel,
body.wp-hud-hidden #paletteLegend,
body.wp-hud-hidden #cesiumCredits,
body.wp-hud-hidden .ah_branding,
body.wp-hud-hidden #windBarbControls,
body.wp-hud-hidden #radar3dControls,
body.wp-hud-hidden #wbVwpPanel {
    display: none !important;
}
/* Rail siblings keep their LAYOUT (visibility, not display) so the eye
   button never moves under the cursor when toggling — a control that
   jumps between its two states is unusable as a toggle. */
body.wp-hud-hidden #toolRail > button:not(#hudToggleBtn),
body.wp-hud-hidden #toolRail > .railSep {
    visibility: hidden !important;
    pointer-events: none !important;
}
body.wp-hud-hidden #toolRail {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    backdrop-filter: none;
}
body.wp-hud-hidden #hudToggleBtn { opacity: 0.3; }
body.wp-hud-hidden #hudToggleBtn:hover,
body.wp-hud-hidden #hudToggleBtn:focus-visible { opacity: 1; }

/* ─── Recording active — hide all UI except the globe ───────────────────── */
#appShell.rec-active #layersPanel,
#appShell.rec-active #layersToggle,
#appShell.rec-active #recDialog,
#appShell.rec-active #paletteLegend,
#appShell.rec-active #cesiumCredits,
#appShell.rec-active #lutDebugPanel,
#appShell.rec-active .valueProbePopup,
#appShell.rec-active #splitDivider,
#appShell.rec-active .splitLabel,
#appShell.rec-active #splitCloseBtn,
#appShell.rec-active #splitProductPicker,
#appShell.rec-active #splitRunPicker {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: none !important;
}

@media (max-width: 900px) {
    #layersPanel {
        width: 240px;
        right: 16px;
        top: 66px; /* 16px margin + 42px button row + 8px gap */
        max-height: calc(100% - 90px);
        font-size: 12px;
    }

    #layersPanel .panelHeader {
        font-size: 13px;
        padding: 10px 14px;
    }

    #layersPanel summary {
        font-size: 12px;
        padding: 6px 8px;
    }

    #layersPanel .modelNode > summary {
        font-size: 12px;
    }

    #layersPanel .categoryNode > summary,
    #layersPanel .categoryNode .modelNode > summary {
        font-size: 11px;
    }

    #layersPanel .layerItem {
        font-size: 11px;
        padding: 5px 8px 5px 18px;
    }

    #layersPanel .densityRow {
        font-size: 11px;
        padding: 3px 8px 6px 18px;
    }

    #layersToggle {
        top: 16px;
        right: 16px;
    }

    #toolRail {
        top: 60px; /* layersToggle(16 + 36 + 8) */
        right: 16px;
    }

    #radar3dControls {
        top: 150px;
        right: 60px; /* radar3dBtn(16) + 36 + 8 */
    }

    #windBarbControls {
        /* Rail-relative (see desktop rule); top comes from _wbAlign(). */
        right: 44px; /* button width 36 + 8 gap, from the rail's right edge */
    }

    #recDialog {
        bottom: calc(70px + env(safe-area-inset-bottom, 0px));
        right: 16px;
    }

    #timelinePanel {
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        /* Row 1: [⏮][▶][⏭][run-select flex][label][LIVE][REC]
           Row 2: [――――——scrubber full width————――]           */
        grid-template-columns: auto auto auto 1fr auto auto auto;
        grid-template-rows: auto auto;
        gap: 5px 8px;
        padding: 6px 8px 7px;
    }
    #playLookback { display: none !important; }

    #timelinePanel .tlBtn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    #timelinePanel .tlBtn.play {
        font-size: 13px;
    }

    #timelineRun {
        grid-column: 4;
        grid-row: 1;
        min-width: 0;
        width: 100%;
        padding: 5px 6px;
        font-size: 11px;
    }

    #timelineLabel {
        grid-column: 5;
        grid-row: 1;
        justify-self: end;
        /* Compact label here ("20:00Z" / "21 Aug 06:00Z") — see
           compactTimeLabel in maps.js — so it fits at a readable size
           instead of being ellipsised down to the date. */
        max-width: 110px;
        font-size: 12px;
        font-variant-numeric: tabular-nums;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    /* "21 Aug 06Z +036hr": LIVE is hidden on model timelines, so the
       room comes out of the run select's 1fr column. */
    #timelineLabel.hasLead {
        max-width: 165px;
    }

    #timelineLive {
        grid-column: 6;
        grid-row: 1;
        font-size: 10px;
        min-width: 32px;
        padding: 0 5px;
        white-space: nowrap;
    }
    #timelineLive.at-live {
        min-width: 48px;
    }

    #timelineScrubber {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    #paletteLegend {
        left: 8px;
        right: 8px;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        padding: 3px 7px 4px;
    }

    #paletteLegend .activeProducts {
        gap: 6px;
        padding: 5px 2px 2px;
    }

    #paletteLegend .activeProductSelect {
        font-size: 13px;
        padding: 7px 12px;
    }

    #paletteLegend .activeProductRemove,
    #paletteLegend .productMenuBtn {
        width: 40px;
        font-size: 15px;
    }

    .productGroupLabel {
        font-size: 10px;
    }

    #paletteLegend .paletteGradient {
        height: 8px;
    }

    #paletteLegend .paletteTicks {
        height: 13px;
    }

    #paletteLegend .paletteTickLabel {
        font-size: 8px;
    }

    #paletteLegend .paletteEndLabel {
        font-size: 8px;
    }

    #paletteRangeRow {
        font-size: 9px;
        margin-top: 2px;
    }
}

/* ─── Tablet (touch) compaction ─────────────────────────────────────────────
   iPad Pro / iPad Air landscape sit between the phone (≤900) and desktop
   tiers — wide enough that the timeline can stay single-row, but vertical
   real estate is precious (1024 px on 12.9").  Trim the bottom HUD chrome
   without shrinking transport buttons below 32 px (Apple HIG floor).        */
@media (min-width: 901px) and (max-width: 1400px) and (pointer: coarse) {
    #paletteLegend {
        padding: 3px 8px 4px;
    }
    #paletteLegend .activeProducts {
        gap: 6px;
        padding: 4px 2px 2px;
    }
    #paletteLegend .activeProductSelect {
        font-size: 11px;
        padding: 4px 8px;
    }
    #paletteLegend .activeProductRemove,
    #paletteLegend .productMenuBtn {
        width: 28px;
        font-size: 12px;
    }
    .productGroupLabel {
        font-size: 8px;
    }
    #paletteLegend .paletteTitle {
        font-size: 10px;
        margin-bottom: 2px;
    }
    #paletteLegend .paletteGradient {
        height: 8px;
        margin-bottom: 2px;
    }
    #paletteLegend .paletteSteps {
        height: 14px;
    }
    #paletteLegend .stepTick {
        height: 5px;
    }
    #paletteLegend .stepLabel {
        top: 6px;
        font-size: 8px;
    }

    #timelinePanel {
        padding: 6px 10px;
        gap: 6px 10px;
    }
    #timelineLabel {
        font-size: 11px;
    }
    #timelineRun {
        padding: 5px 7px;
        font-size: 11px;
        min-width: 150px;
    }
}

/* ─── Split-view divider */
#splitDivider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent);
    cursor: col-resize;
    z-index: 6;
    transform: translateX(-50%);
    box-shadow: 0 0 8px rgba(72, 178, 255, 0.4);
    display: none;
}
#splitDivider.active {
    display: block;
}
#splitDivider::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--panel-bg);
    border: 2px solid var(--accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
#splitDivider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: 15px;
    height: 15px;
    background-color: var(--accent);
    -webkit-mask: var(--gi-resize-horizontal) center / contain no-repeat;
    mask: var(--gi-resize-horizontal) center / contain no-repeat;
    pointer-events: none;
}

/* Split-view floating side labels */
.splitLabel {
    position: absolute;
    top: 76px;
    padding: 6px 12px;
    border-radius: 10px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--panel-text);
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-size: 12px;
    line-height: 1.4;
    z-index: 5;
    backdrop-filter: blur(6px);
    max-width: 42vw;
    display: none;
    pointer-events: none;
}
.splitLabel.active {
    display: block;
}
.splitLabel.left {
    left: 14px;
    border-left: 3px solid var(--accent);
}
.splitLabel.right {
    right: 360px;
    border-right: 3px solid #22d69f;
    text-align: right;
    pointer-events: auto;
    cursor: pointer;
}
.splitLabel .splitLabelTitle {
    display: block;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.splitLabel .splitLabelDetail {
    display: block;
    font-size: 10px;
    color: var(--panel-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Run picker dropdown for compare side */
#splitRunPicker {
    position: absolute;
    top: 130px;
    right: 360px;
    z-index: 10;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 6px 0;
    min-width: 160px;
    max-height: 240px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    display: none;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}
#splitRunPicker.active { display: block; }
#splitRunPicker .runPickerTitle {
    padding: 4px 12px 6px;
    font-size: 10px;
    color: var(--panel-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--panel-border);
    margin-bottom: 4px;
}
#splitRunPicker .runPickerOption {
    padding: 6px 12px;
    font-size: 12px;
    color: var(--panel-text);
    cursor: pointer;
    white-space: nowrap;
}
#splitRunPicker .runPickerOption:hover {
    background: rgba(255,255,255,0.06);
}
#splitRunPicker .runPickerOption.selected {
    color: #22d69f;
    font-weight: 600;
}


#splitCloseBtn {
    position: absolute;
    top: 74px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    color: var(--panel-text);
    font-size: 14px;
    cursor: pointer;
    z-index: 7;
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
}
#splitCloseBtn.active {
    display: flex;
}
#splitCloseBtn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* Split-view product picker dropdown */
#splitProductPicker {
    position: absolute;
    top: 110px;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    max-height: 50vh;
    overflow-y: auto;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: 12px;
    color: var(--panel-text);
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-size: 13px;
    z-index: 8;
    backdrop-filter: blur(6px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    display: none;
}
#splitProductPicker.active {
    display: block;
    animation: recDialogIn 120ms ease forwards;
}

#splitProductPicker .pickerTitle {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--panel-muted);
    margin-bottom: 10px;
}

#splitProductPicker .pickerTabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

#splitProductPicker .pickerTab {
    flex: 1;
    padding: 6px 8px;
    border-radius: 7px;
    border: 1px solid var(--panel-border);
    background: rgba(255,255,255,0.06);
    color: var(--panel-text);
    font-size: 11px;
    cursor: pointer;
    text-align: center;
    transition: background 100ms;
}
#splitProductPicker .pickerTab:hover {
    background: rgba(255,255,255,0.12);
}
#splitProductPicker .pickerTab.active {
    border-color: var(--accent);
    color: var(--accent);
}

#splitProductPicker .pickerOption {
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 120ms, color 120ms;
    color: var(--panel-muted);
}
#splitProductPicker .pickerOption:hover {
    background: rgba(72, 178, 255, 0.08);
    color: #fff;
}

/* ─── Collapse tabs (timeline & legend) ───────────────────────────────────── */
.collapseTab {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    min-width: 48px;
    height: 20px;
    padding: 0 10px;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    color: var(--panel-muted);
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    backdrop-filter: blur(6px);
    transition: background 120ms, color 120ms;
}
.collapseTab:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
/* Tab on top of the timeline panel */
.collapseTab.top {
    top: -19px;
    border-radius: 8px 8px 0 0;
    border-bottom: none;
}
/* Tab on bottom of the legend panel (sticks down from the legend) */
.collapseTab.bottom {
    bottom: -19px;
    border-radius: 0 0 8px 8px;
    border-top: none;
}

/* ─── Collapsed states ────────────────────────────────────────────────────── */
#timelinePanel.collapsed > *:not(.collapseTab) {
    display: none !important;
}
#timelinePanel.collapsed {
    padding: 0;
    border: none;
    background: none;
    backdrop-filter: none;
    grid-template-columns: 1fr;
    z-index: 5;
    gap: 0;
    min-height: 0;
}
#timelinePanel.collapsed .collapseTab.top {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin: 0 auto;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    height: 26px;
    font-size: 11px;
    color: var(--panel-text);
    z-index: 5;
}

#paletteLegend.collapsed > *:not(.collapseTab):not(.activeProducts) {
    display: none !important;
}
#paletteLegend.collapsed {
    padding: 4px 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(12,16,22,0.9);
    border-radius: 10px;
    min-height: 0 !important;
}
#paletteLegend.collapsed .activeProducts {
    display: flex !important;
    padding-top: 0;
}
#paletteLegend.collapsed .paletteTitle {
    display: none !important;
}
#paletteLegend.collapsed .collapseTab.top {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    margin: 0 auto;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    height: 26px;
    font-size: 11px;
    color: var(--panel-text);
}

@media (max-width: 900px) {
    .splitLabel {
        top: 56px;
        font-size: 11px;
        padding: 5px 8px;
        max-width: 38vw;
    }
    .splitLabel.left {
        left: 8px;
    }
    .splitLabel.right {
        right: 66px;
    }
    .splitLabel .splitLabelTitle {
        font-size: 12px;
    }
    .splitLabel .splitLabelDetail {
        font-size: 9px;
    }
    #splitRunPicker {
        top: 105px;
        right: 66px;
        max-width: 200px;
    }
    #splitRunPicker .runPickerOption {
        padding: 8px 12px;
        min-height: 32px;
    }
    #splitCloseBtn {
        top: 66px;
    }
    #splitProductPicker {
        top: 102px;
        width: calc(100vw - 32px);
        max-width: 320px;
        max-height: 45vh;
    }
    #splitProductPicker .pickerTitle {
        font-size: 12px;
    }
    #splitProductPicker .pickerTab {
        font-size: 12px;
        padding: 8px 8px;
    }
    #splitProductPicker .pickerOption {
        padding: 10px 10px;
        font-size: 13px;
        min-height: 36px;
    }
    #splitDivider::after {
        width: 36px;
        height: 36px;
    }
    #splitDivider::before {
        font-size: 16px;
    }
    .collapseTab {
        min-width: 40px;
        height: 18px;
        font-size: 10px;
    }
}

/* ── Movable surfaces (window._wpDraggable in maps.js) ─────────────────────
   Every floating surface in the app — probe/entity popups, the overlay
   cards (fronts, lightning, tropical, CAP, SWIM, ProbSevere), the colour
   -table editor, the VWP stack, the record dialog and the welcome /
   what's-new modals — carries .wpMovable and drags by the same contract, so
   "can I move this one?" is never a per-popup guess.  The JS puts the move
   cursor on the surface (or on its declared handle); these rules hand the
   normal cursor back to the children that opt OUT of the drag, and must
   stay in step with _DRAG_SKIP_SELECTOR. */
.wpMovable a,
.wpMovable button,
.wpMovable summary,
.wpMovable label,
.wpMovable select { cursor: pointer; }
.wpMovable input,
.wpMovable textarea,
.wpMovable pre,
.wpMovable code,
.wpMovable [contenteditable],
.wpMovable details > :not(summary) { cursor: auto; user-select: text; }
.wpMovable input[type="range"],
.wpMovable input[type="checkbox"],
.wpMovable input[type="color"] { cursor: pointer; }
/* Lifted while dragging so the surface reads as picked up. */
.wpMovable.dragging {
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55);
    user-select: none;
}

/* ── Feed-failure surfacing ─────────────────────────────────────────────── */
/* Toast stack: bottom-center, above the timeline HUD. */
#wpToasts {
    position: fixed;
    left: 50%;
    bottom: 96px;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}
.wpToast {
    background: rgba(40, 12, 12, 0.92);
    border: 1px solid #ffb020;
    color: #ffd9a0;
    font: 12px "IBM Plex Sans", "Segoe UI", sans-serif;
    padding: 7px 14px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    transition: opacity 0.4s ease;
}
.wpToast.out { opacity: 0; }
/* A notice, not an alert: neutral panel, optional action buttons
   (_wpToast(text, {kind: "info", actions})).  The host ignores the pointer;
   a toast with buttons takes it back. */
.wpToast.info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--panel-bg, rgba(14, 20, 28, 0.94));
    border-color: rgba(72, 178, 255, 0.55);
    color: #d9e6ef;
    pointer-events: auto;
}
.wpToast .wpToastAct {
    padding: 3px 10px;
    border: 1px solid rgba(72, 178, 255, 0.45);
    background: rgba(72, 178, 255, 0.14);
    color: #d9e6ef;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.wpToast .wpToastAct:hover { background: rgba(72, 178, 255, 0.28); color: #fff; }
/* The single-site quick strip owns the bottom centre while a radar is up
   (bottom 118 px, up to two wrapped rows): toasts stack above it. */
body.wp-ssr-strip #wpToasts { bottom: calc(196px + env(safe-area-inset-bottom, 0px)); }

/* Stale feed pill: amber border + pulsing warning badge. */
.hazPill.stale .hazPillCount {
    color: #ffb020;
    animation: wpStalePulse 1.6s ease-in-out infinite;
}
@keyframes wpStalePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* Layer row spinner while times/modules load after a toggle. */
#layersPanel .layerItem.layerLoading::after,
#layersPanel .levelChip.layerLoading::after {
    content: "";
    width: 10px;
    height: 10px;
    margin-left: 6px;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: wpSpin 0.7s linear infinite;
}
@keyframes wpSpin { to { transform: rotate(360deg); } }

/* Timeline hides entirely when no active layer provides time data. */
#timelinePanel.noTimes { display: none !important; }

/* ── Tropical subgroup sub-controls (injected by tropical.js) ─────────── */
.tropControls {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 8px 8px 22px;
}
.tropChips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.tropChip {
    padding: 3px 8px;
    font: 600 11px "IBM Plex Sans", "Segoe UI", sans-serif;
    letter-spacing: 0.04em;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    color: var(--panel-muted);
    cursor: pointer;
    transition: background 120ms, color 120ms, border-color 120ms;
}
.tropChip:hover {
    color: var(--panel-text);
    border-color: rgba(255,255,255,0.25);
}
.tropChip.on {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}
.tropStormRow {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px;
    font: 600 11px "IBM Plex Sans", "Segoe UI", sans-serif;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--panel-text);
    cursor: pointer;
    text-align: left;
}
.tropStormRow:hover { background: rgba(255,255,255,0.06); }
.tropStormDot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.6);
    flex: none;
}
.tropStormKt {
    margin-left: auto;
    color: var(--panel-muted);
    font-weight: 500;
}
.tropNone {
    font: 500 11px "IBM Plex Sans", "Segoe UI", sans-serif;
    color: var(--panel-muted);
    padding: 2px 6px;
}
.tropLegend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    padding-top: 2px;
}
.tropLegendItem {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font: 500 10px "IBM Plex Sans", "Segoe UI", sans-serif;
    color: var(--panel-text);
    border: none;
    background: transparent;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
}
.tropLegendItem:hover { background: rgba(255,255,255,0.06); }
.tropLegendItem.off { color: var(--panel-muted); opacity: 0.6; }
.tropLegendSwatch {
    width: 10px;
    height: 3px;
    border-radius: 2px;
    flex: none;
}

/* Warning popup → single-site radar shortcut */
.wpOpenRadarBtn {
    display: block;
    margin-top: 8px;
    padding: 5px 12px;
    font: 600 12px "IBM Plex Sans", "Segoe UI", sans-serif;
    color: #d9e6ef;
    background: rgba(72,178,255,0.15);
    border: 1px solid rgba(72,178,255,0.45);
    border-radius: 6px;
    cursor: pointer;
    transition: background 120ms;
}
.wpOpenRadarBtn:hover { background: rgba(72,178,255,0.3); }

/* Warning popup action row (radar + storm-motion buttons) */
.wpWarnActions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.wpWarnActions .wpOpenRadarBtn { margin-top: 0; }
.wpSetMotionBtn {
    display: block;
    padding: 5px 12px;
    font: 600 12px "IBM Plex Sans", "Segoe UI", sans-serif;
    color: #d9e6ef;
    background: rgba(255, 213, 79, 0.12);
    border: 1px solid rgba(255, 213, 79, 0.45);
    border-radius: 6px;
    cursor: pointer;
    transition: background 120ms;
}
.wpSetMotionBtn:hover { background: rgba(255, 213, 79, 0.25); }
.wpSetMotionBtn:disabled { opacity: 0.7; cursor: default; }

/* Hazard product-chooser tabs (popup lists every product at the click) */
.wpHazTabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid rgba(120, 200, 255, 0.18);
}
.wpHazTabs .wpHazTab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font: 600 11px "IBM Plex Sans", "Segoe UI", sans-serif;
    color: #c6d8e6;
    background: rgba(120, 200, 255, 0.06);
    border: 1px solid rgba(120, 200, 255, 0.22);
    border-radius: 11px;
    padding: 2px 9px;
    line-height: 1.6;
    transition: background 120ms;
}
.wpHazTabs .wpHazTab:hover { color: #fff; background: rgba(120, 200, 255, 0.16); }
.wpHazTabs .wpHazTab.on {
    color: #fff;
    background: rgba(120, 200, 255, 0.26);
    border-color: rgba(120, 200, 255, 0.6);
}
.wpHazTabs .wpHazDot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: 0 0 auto;
}

/* ─── In-app colour-table editor (palette-editor.js) ──────────────────
   Opened from the legend pill's palette button for the product that pill
   owns — the palettes endpoint stores one table per productId per
   customer, so the editor is always scoped to one product. */
#wpPaletteEditor {
    position: fixed;
    right: 16px;
    bottom: 104px;          /* clear of the legend + timeline bars */
    width: 372px;
    max-height: min(72vh, 720px);
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--panel-text);
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 34px rgba(0,0,0,0.45);
    z-index: 12;
}
#wpPaletteEditor.open { display: flex; }
#wpPaletteEditor.busy { pointer-events: none; opacity: 0.75; }

#wpPaletteEditor .peHead {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
#wpPaletteEditor .peTitle { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#wpPaletteEditor .peName {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#wpPaletteEditor .pePid {
    font-size: 10px;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    color: var(--panel-muted);
}
#wpPaletteEditor .peClose {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--panel-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
#wpPaletteEditor .peClose:hover { color: var(--panel-text); }

/* Live preview of the table being edited — the same segment model buildLut
   uses, so this strip is what the map will draw. */
#wpPaletteEditor .peBar {
    height: 18px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--panel-border);
}
#wpPaletteEditor .peGrad { width: 100%; height: 100%; }

#wpPaletteEditor .peMeta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10.5px;
    color: var(--panel-muted);
}
#wpPaletteEditor .peMeta b { color: var(--panel-text); font-weight: 600; }
#wpPaletteEditor .peCount { margin-left: auto; }
#wpPaletteEditor .peStock {
    border: 1px solid var(--panel-border);
    border-radius: 5px;
    padding: 2px 6px;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 9.5px;
}
#wpPaletteEditor .peStock.custom { color: var(--accent); border-color: var(--accent); }

#wpPaletteEditor .peStops {
    flex: 1 1 auto;
    min-height: 80px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 2px;
}
#wpPaletteEditor .peStop {
    display: flex;
    align-items: center;
    gap: 5px;
}
/* Duplicate stop values collapse into one JSON key server-side, so they are
   flagged here and block the save. */
#wpPaletteEditor .peStop.dup { outline: 1px solid #ff6b6b; border-radius: 6px; }
#wpPaletteEditor input[type="number"],
#wpPaletteEditor input[type="text"] {
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--panel-border);
    background: rgba(0,0,0,0.25);
    color: var(--panel-text);
    font-size: 11px;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    padding: 0 6px;
    min-width: 0;
}
#wpPaletteEditor .peVal { width: 62px; flex: none; }
#wpPaletteEditor .peColor { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; min-width: 0; }
#wpPaletteEditor .peC2Empty { flex: 1 1 auto; }
#wpPaletteEditor input[type="color"] {
    width: 26px;
    height: 26px;
    flex: none;
    padding: 0;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
}
#wpPaletteEditor .peHex { width: 68px; flex: none; text-transform: uppercase; }
#wpPaletteEditor .peAlpha { width: 44px; flex: none; }
#wpPaletteEditor .peC2Btn,
#wpPaletteEditor .peDel {
    flex: none;
    width: 22px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--panel-border);
    background: transparent;
    color: var(--panel-muted);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
}
#wpPaletteEditor .peC2Btn:hover,
#wpPaletteEditor .peDel:hover { color: var(--panel-text); border-color: var(--panel-text); }

#wpPaletteEditor .peAddRow { display: flex; gap: 6px; }
#wpPaletteEditor button.peAdd,
#wpPaletteEditor button.peText,
#wpPaletteEditor button.pePalApply,
#wpPaletteEditor button.pePalCopy,
#wpPaletteEditor button.peRevert,
#wpPaletteEditor button.peCancel,
#wpPaletteEditor button.peSave {
    height: 28px;
    padding: 0 10px;
    border-radius: 7px;
    border: 1px solid var(--panel-border);
    background: rgba(255,255,255,0.04);
    color: var(--panel-text);
    font-size: 11.5px;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    cursor: pointer;
}
#wpPaletteEditor button:hover:not(:disabled) { border-color: var(--panel-text); }
#wpPaletteEditor button:disabled { opacity: 0.42; cursor: default; }
#wpPaletteEditor button.peSave {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}
#wpPaletteEditor .pePalBox {
    width: 100%;
    height: 116px;
    resize: vertical;
    border-radius: 7px;
    border: 1px solid var(--panel-border);
    background: rgba(0,0,0,0.3);
    color: var(--panel-text);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 10.5px;
    padding: 6px;
}
#wpPaletteEditor .pePalBtns {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}
#wpPaletteEditor .peFoot {
    display: flex;
    align-items: center;
    gap: 6px;
    border-top: 1px solid var(--panel-border);
    padding-top: 8px;
}
/* Footer buttons never wrap: "Revert to default" broke to two lines and
   overflowed its own box once the status message shared the row.  The
   message is the flexible element — it wraps and truncates instead. */
#wpPaletteEditor .peFoot button {
    white-space: nowrap;
    flex: none;
}
#wpPaletteEditor .peFoot .peMsg {
    min-width: 0;
    max-height: 2.6em;
    overflow: hidden;
}
#wpPaletteEditor .peCancel { margin-left: auto; }
#wpPaletteEditor .peMsg,
#wpPaletteEditor .pePalMsg {
    font-size: 10.5px;
    color: var(--panel-muted);
    flex: 1 1 auto;
    min-width: 0;
}
#wpPaletteEditor .peMsg.err,
#wpPaletteEditor .pePalMsg.err { color: #ff8f8f; }

/* ─── Layer pill "\22EF" menu ────────────────────────────────────────────
   Per-layer actions are LABELLED menu rows, not a row of icon buttons: four
   14px glyphs crammed after the product name were indistinguishable, and
   every new per-layer feature made the pill worse.  Remove (\2715) stays
   inline; everything else lives here. */
#paletteLegend .productMenuBtn {
    border: none;
    border-left: 1px solid rgba(255,255,255,0.08);
    background: transparent;
    color: var(--panel-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    align-self: stretch;
    font-size: 14px;
    line-height: 1;
}
#paletteLegend .productMenuBtn:hover { color: var(--panel-text); }

/* Parented to <body> (the pills are rebuilt wholesale on every toggle and
   on the playback cut path), positioned from the button's measured rect. */
.productMenu {
    position: fixed;
    z-index: 40;
    min-width: 208px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    border-radius: 10px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}
.productMenuItem {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 9px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--panel-text);
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}
.productMenuItem:hover { background: rgba(255,255,255,0.09); }
.productMenuItem.on { color: var(--accent); }
.productMenuGlyph {
    flex: none;
    width: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--panel-muted);
    font-size: 13px;
}
.productMenuItem.on .productMenuGlyph,
.productMenuItem:hover .productMenuGlyph { color: inherit; }
.productMenuLabel { white-space: nowrap; }
/* Divides a grouped run of items (e.g. the contour interval choices) from
   the actions above it. */
.productMenuSep {
    height: 1px;
    margin: 4px 6px;
    background: var(--panel-border);
}

@media (max-width: 620px) {
    #wpPaletteEditor { right: 8px; left: 8px; width: auto; }
}

/* ── Entitlement locks ─────────────────────────────────────────────────
   A control this account can't run is shown LOCKED, not hidden and not
   left to fail: free used to be offered the whole Live Weather menu and
   answered with a "warnings feed failed" toast over an empty map
   (Ryan, 2026-08-20).  Muted row + padlock + an Upgrade link that opens
   in a new tab, keeping the same footprint as the live control so the
   menu doesn't reflow between tiers. */
#layersPanel .layerItem.rtLocked {
    cursor: default;
    opacity: 0.62;
}
/* Single Site Radar for a non-Maps account: only the summary and the locked
   row show; the panel's controls stay built (modules still mount into
   them) but never display. */
#layersPanel .singleSiteRadarNode.ssrLockedNode > :not(summary):not(.rtLocked) {
    display: none !important;
}
#layersPanel .layerItem.rtLocked:hover { background: none; }
.rtLockIcon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    opacity: 0.75;
}
.wpUpgradeLink {
    margin-left: auto;
    flex-shrink: 0;
    font: 700 10px "IBM Plex Sans", "Segoe UI", sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent, #4fc3f7);
    text-decoration: none;
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 1px 7px;
    opacity: 0.85;
}
.wpUpgradeLink:hover { opacity: 1; }
.hazPill.locked {
    text-decoration: none;
    opacity: 0.6;
    border-style: dashed;
}
.hazPill.locked:hover { opacity: 0.95; }
