/* Models (dev) viewer. Loads after the site stylesheet; viewer rules are scoped to
   .models-app so the shared site header keeps its own look. Colors follow the site's
   light / dark theme (data-theme on <html>); the map's own colors swap in app-tools.js (applyMapTheme). */
html, body { overflow: hidden; overscroll-behavior: none; }

/* Same fixed header + section bar layout as the tropics page (fixed rather than
   sticky: iOS pinch-zoom leaves sticky elements displaced). */
.site-header { position: fixed; left: 0; right: 0; top: 0; }
.section-bar {
    position: fixed;
    top: var(--header-h, 44px);
    left: 0;
    right: 0;
    z-index: 99; /* just under the site header's 100 */
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    padding: 0 1.25rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}
[data-theme="light"] .section-bar { background: var(--accent-soft); }

/* Expanded view (wide screens; app-tools.js setupExpandView): no site header, so the section bar sits at
   the top and the map takes the room; the hamburger hides / shows the left menu */
#expand-btn .ic-collapse { display: none; }
html.expand-view #expand-btn .ic-expand { display: none; }
html.expand-view #expand-btn .ic-collapse { display: block; }
@media (min-width: 861px) {
    html.expand-view { --header-h: 0px; }
    html.expand-view .site-header { display: none; }
    html.expand-view .models-app.menu-collapsed { --sidebar-w: 0px; }
    html.expand-view .models-app.menu-collapsed #controls { display: none; }
}
@media (max-width: 860px) {
    #expand-btn, #sidebar-toggle { display: none; }   /* narrow: the menu is a drawer already */
}

.models-app {
    /* Follows the site theme (style.css :root / [data-theme="dark"]): --border and --accent come
       straight from the site; the rest are the viewer's names for site colors, plus a few shades */
    --panel-bg: var(--bg-card);
    --panel-fg: var(--text);
    --muted: var(--text-muted);
    --hover: #eef3f8;            /* row / header hover */
    --selected: #dce8f6;         /* selected option */
    --selected-hover: #d2e1f2;
    --sel-border: #b9cde4;       /* section holding a selection */
    --subtle: #f6f8fa;           /* pinned rows (base layer) */
    --layer-card: #f3f6f9;       /* Layers tab cards: a shade off the panel */
    --layer-card-base: #e6edf5;  /* the base layer's card: a shade further */
    --style-head: #eef2f7;       /* style editor: title bar, value pills */
    --ml-prev-bg: #e4e9ee;       /* member lows: map-like backdrop of the Show as pictures */
    --track: #d5dde7;            /* slider track (unfilled) */
    --legend-edge: rgba(0, 0, 0, 0.25);
    --map-bg: #dfe7ee;
    --sec-bg: #e7edf4;           /* picker section bars */
    --sec-bg-hover: #dce5ef;
    --sub-bg: #f1f4f8;           /* picker subsection bars */
    --guide: #d3dce6;            /* line beside a subsection's options */
    --title-bg: #2c4a6e;         /* Data Source / Parameters title bands */
    --title-fg: #ffffff;
    color-scheme: light;
    --sidebar-w: 320px;
    position: fixed;
    top: calc(var(--header-h, 44px) + 40px); /* site header + section bar */
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--map-bg);
    color: var(--panel-fg);
    font-size: 13px;
    line-height: 1.35;
}
[data-theme="dark"] .models-app {
    --hover: #1e2938;
    --selected: #1c3350;
    --selected-hover: #224063;
    --sel-border: #2f4c70;
    --subtle: #1b2430;
    --layer-card: #1d2733;
    --layer-card-base: #243246;
    --style-head: #22303f;
    --ml-prev-bg: #2b3946;
    --track: #364557;
    --legend-edge: rgba(255, 255, 255, 0.3);
    --map-bg: #0b1119;
    --sec-bg: #222d3b;
    --sec-bg-hover: #2a3747;
    --sub-bg: #1f2937;
    --guide: #2f3c4d;
    --title-bg: #2b3d55;
    --title-fg: #e4ebf3;
    color-scheme: dark;
}

.models-app { --title-h: 0px; }   /* the plot title bar's height (app-tools.js updatePlotTitle) */
.models-app #map { position: absolute; inset: 0; left: var(--sidebar-w); }   /* (the plot title over its top: app-tools.js updatePlotTitle) */
.models-app .maplibregl-ctrl-top-right { top: var(--title-h); }   /* (below the plot title, at every width) */
/* Plot title: over the map, the full width right of the menu (colorbars included), as on a saved image */
.models-app .plot-title { position: absolute; z-index: 3; top: 0; right: 0; left: var(--sidebar-w); box-sizing: border-box;
    padding: clamp(4px, 0.28vw + 2.9px, 6px) clamp(9px, 0.42vw + 7.4px, 12px) clamp(5px, 0.28vw + 3.9px, 7px); display: grid; gap: 1px; background: var(--panel-bg); color: var(--panel-fg); border-bottom: 1px solid var(--border); }
.models-app .plot-title[hidden] { display: none; }
/* Text scales with the window: full size from 1100 px wide, smallest at phone width (390 px) */
.models-app .pt-title { font-size: clamp(12.5px, 0.493vw + 10.58px, 16px); font-weight: 700; line-height: 1.3; }
.models-app .pt-sub { font-size: clamp(11px, 0.352vw + 9.63px, 13.5px); font-weight: 400; line-height: 1.3; opacity: 0.7; font-variant-numeric: tabular-nums; }
.models-app .panel { position: absolute; z-index: 2; background: var(--panel-bg); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.12); }
/* Main menu: docked to the left edge, full height, the map to its right (narrow screens: a drawer,
   see below) */
.models-app #controls { top: 0; left: 0; bottom: 0; width: var(--sidebar-w); box-sizing: border-box; padding: 12px 14px;
    display: grid; gap: 10px; align-content: start; overflow-y: auto; overscroll-behavior: contain;
    background: var(--panel-bg); border: 0; border-right: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.models-app #controls h1 { margin: 0; font-size: 14px; font-weight: 600; }
.models-app #controls .sub { color: var(--muted); font-size: 12px; }
.models-app select, .models-app button { font: inherit; color: inherit; }
.models-app select { width: 100%; padding: 5px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--panel-bg); }
.models-app .row { display: flex; align-items: center; gap: 8px; }
.models-app .row.split { justify-content: space-between; }
.models-app button { padding: 4px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--panel-bg); cursor: pointer; }
.models-app button:hover { border-color: var(--accent); }
.models-app #hour { width: 100%; accent-color: var(--accent); }
.models-app #fhr { font-weight: 600; font-variant-numeric: tabular-nums; }
.models-app #valid { color: var(--muted); font-variant-numeric: tabular-nums; }
.models-app .seg { display: inline-flex; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.models-app .seg label { padding: 3px 10px; cursor: pointer; }
.models-app .seg input { display: none; }
.models-app .seg label:has(input:checked) { background: var(--accent); color: #fff; }
.models-app #legend { display: grid; gap: 4px; }
.models-app #suite { display: grid; gap: 6px; }
.models-app #suite[hidden] { display: none; }
.models-app #stats { font-size: 11px; color: var(--muted); }
/* Style editor (Layers > Edit; app-styles.js styleEditor): a card per item with a title bar attached to its top
   (what it styles; Restore defaults on the right), then groups of options under small captions, each a
   two-column grid (label | control) */
.models-app .style-item { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--panel-bg); }
/* Layers > Edit > Draw as (products.js drawAs): Fill | Contours | Both, above the layer's cards */
.models-app .style-drawas { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px;
    border: 1px solid var(--border); border-radius: 8px; background: var(--panel-bg); }
.models-app .style-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 10px;
    background: var(--style-head); border-bottom: 1px solid var(--border); }
.models-app .style-title { min-width: 0; display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--panel-fg); }
.models-app .style-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 500; color: var(--muted); }
.models-app .style-reset { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border: 1px solid transparent;
    border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.models-app .style-reset svg { width: 12px; height: 12px; }
.models-app .style-reset:hover { color: var(--accent); background: var(--panel-bg); border-color: var(--border); }
.models-app .style-head:has(.style-head-btns) { flex-wrap: wrap; row-gap: 2px; }   /* (narrow: the buttons under the title) */
.models-app .style-head:has(.style-head-btns) .style-title { flex: 1 1 auto; }
.models-app .style-head-btns { display: flex; align-items: center; gap: 2px; flex: none; margin-left: auto; }
.models-app .style-save:not(:disabled) { color: var(--accent); }
.models-app .style-save:disabled { opacity: 0.45; cursor: default; }
.models-app .style-save:disabled:hover { color: var(--muted); background: transparent; border-color: transparent; }
.models-app .style-body { display: grid; gap: 9px; padding: 8px 10px 9px; }
.models-app .style-group { display: grid; gap: 5px; }
.models-app .style-group + .style-group { padding-top: 8px; border-top: 1px dashed var(--border); }
.models-app .style-group-title { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.models-app .style-row { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 24px; }
.models-app .style-row[hidden] { display: none; }
.models-app .style-label { font-size: 12px; color: var(--muted); }
.models-app .style-ctl { min-width: 0; display: flex; align-items: center; gap: 8px; }
.models-app .style-ctl select { flex: 1; min-width: 0; height: 26px; padding: 0 6px; border-radius: 6px; font-size: 12px; }
.models-app .style-item input[type=number] { width: 100%; min-width: 0; height: 26px; box-sizing: border-box; padding: 0 7px; border: 1px solid var(--border);
    border-radius: 6px; background: var(--panel-bg); color: var(--panel-fg); font: inherit; font-size: 12px; font-variant-numeric: tabular-nums; }
.models-app .style-item input[type=number]:focus, .models-app .style-ctl select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
/* Labelled fields side by side (From / To / Every; Min / Max) */
.models-app .style-fields { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.models-app .style-field { display: grid; gap: 2px; }
.models-app .style-field > span { font-size: 10.5px; font-weight: 600; color: var(--muted); }
/* Edit > Levels > Custom: the levels typed in a box */
.models-app .style-lvlist { width: 100%; min-width: 0; box-sizing: border-box; padding: 5px 7px; border: 1px solid var(--border); border-radius: 6px; resize: vertical;
    background: var(--panel-bg); color: var(--panel-fg); font: inherit; font-size: 12px; font-variant-numeric: tabular-nums; line-height: 1.4; }
.models-app .style-lvlist:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
/* Slider: a thin track filled up to the thumb (--p, app-playback.js), round thumb; the value in a pill */
.models-app .style-slider { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.models-app .style-smooth { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.models-app .style-smooth-note { display: flex; align-items: flex-start; gap: 5px; font-size: 11px; line-height: 1.3; color: #c62828; }
.models-app .style-smooth-note svg { flex: none; width: 13px; height: 13px; margin-top: 1px; }
[data-theme="dark"] .models-app .style-smooth-note { color: #ff7a7a; }
.models-app .style-slider input[type=range] { flex: 1; min-width: 60px; height: 18px; margin: 0; padding: 0; background: transparent; cursor: pointer;
    -webkit-appearance: none; appearance: none; --p: 50%; }
.models-app .style-slider input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
    background: linear-gradient(to right, var(--accent) var(--p), var(--track) var(--p)); }
.models-app .style-slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 15px; height: 15px; margin-top: -5.5px;
    border-radius: 50%; background: var(--panel-bg); border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(16, 34, 56, 0.25); transition: transform 0.1s ease; }
.models-app .style-slider input[type=range]:hover::-webkit-slider-thumb, .models-app .style-slider input[type=range]:active::-webkit-slider-thumb { transform: scale(1.15); }
.models-app .style-slider input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--track); }
.models-app .style-slider input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
.models-app .style-slider input[type=range]::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; background: var(--panel-bg);
    border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(16, 34, 56, 0.25); }
.models-app .style-slider input[type=range]:focus { outline: none; }
.models-app .style-slider input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent-soft); }
.models-app .style-val { flex: none; min-width: 44px; padding: 3px 6px; box-sizing: border-box; border-radius: 6px; background: var(--style-head);
    text-align: center; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--panel-fg); }
/* Color: a swatch with its hex code */
.models-app .style-color { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 8px 0 3px; border: 1px solid var(--border);
    border-radius: 6px; background: var(--panel-bg); cursor: pointer; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--panel-fg); }
.models-app .style-color:hover { border-color: var(--accent); }
.models-app .style-color input[type=color] { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px; background: none; cursor: pointer; }
.models-app .style-color input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.models-app .style-color input[type=color]::-webkit-color-swatch { border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 4px; }
.models-app .style-color input[type=color]::-moz-color-swatch { border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 4px; }
/* Line style: Solid | Dashed */
.models-app .style-seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 7px; background: var(--style-head); }
.models-app .style-seg button { height: 22px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; color: var(--muted);
    font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.models-app .style-seg button:hover:not(.active) { color: var(--panel-fg); }
.models-app .style-seg button.active { background: var(--panel-bg); color: var(--accent); box-shadow: 0 1px 2px rgba(16, 34, 56, 0.18); }
.models-app .style-hint { font-size: 11.5px; color: var(--muted); }
/* EPS member lows: "Show as" as three pictures of the choices, the picked one outlined */
.models-app .ml-shows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.models-app .ml-show { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 4px; border: 1.5px solid var(--border);
  border-radius: 8px; background: var(--panel-bg); color: var(--muted); font: inherit; cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s; }
.models-app .ml-show:hover:not(.active) { border-color: var(--muted); color: var(--panel-fg); }
.models-app .ml-show.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.models-app .ml-show:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-soft); }
.models-app .ml-prev { height: 50px; border-radius: 5px; background: var(--ml-prev-bg); display: flex; flex-direction: column; align-items: center;
  justify-content: center; line-height: 1; font-weight: 700; --halo: #fff; text-shadow: 0 0 1px var(--halo), 0 0 2px var(--halo), 0 0 2px var(--halo); }
.models-app .ml-d { font-size: 15px; color: #d90000; }
.models-app .ml-l { font-size: 21px; color: #d90000; }
.models-app .ml-p { font-size: 12px; color: #000; margin-top: 1px; }
.models-app .ml-dot { width: 11px; height: 11px; border-radius: 50%; background: #d90000; box-shadow: 0 0 0 1px rgba(26, 26, 26, 0.75); text-shadow: none; }
.models-app .ml-dot-big { width: 22px; height: 22px; display: grid; place-items: center; font-size: 11px; color: #fff; }
.models-app .ml-name { font-size: 11px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* One line of a several-line contour field: a dot of its color before its name */
.models-app .style-group-title { display: flex; align-items: center; gap: 6px; }
.models-app .style-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.models-app .style-note { font-size: 11.5px; line-height: 1.35; color: #c0392b; }
[data-theme="dark"] .models-app .style-note { color: #ff8a80; }
.models-app .style-note[hidden] { display: none; }
/* Narrow screens, where the menu is a drawer (app-tools.js setupMenuToggle): the section bar's menu button opens / closes
   it; the section switch at the drawer's top (controls-head), across its width */
.models-app .controls-head { display: none; }
.section-bar #menu-burger { display: none; }
/* (its "Menu" label beside the icon) */
.section-bar #menu-burger.burger-labeled { width: auto; gap: 5px; padding: 0 9px 0 6px; font: 600 14px/1 Figtree, system-ui, sans-serif; }
@media (max-width: 860px) {
    .models-app #map { left: 0; }
    .models-app .plot-title { left: 0; }
    .models-app #controls { z-index: 5; width: min(320px, 88vw); box-shadow: 2px 0 14px rgba(0,0,0,0.22);
        transition: transform 180ms ease-out, visibility 0s; }
    .models-app.menu-hidden #controls { transform: translateX(-102%); visibility: hidden; box-shadow: none;
        transition: transform 180ms ease-in, visibility 0s 180ms; }
    .section-bar #menu-burger { display: inline-flex; align-items: center; justify-content: center; }
    .models-app .controls-head { display: block; margin-bottom: 2px; }
    .models-app .controls-head .seg-toggle { display: flex; width: 100%; box-sizing: border-box; }
    .models-app .controls-head .seg-toggle button { flex: 1 1 0; justify-content: center; min-width: 0; padding: 0.35rem 0.4rem; }
}
/* The map's wordmark (app-globe.js), bottom right above the attribution, as on saved images: icon + "PolarWx", the address
   under it; a light halo, no box; not clickable */
.models-app .map-wordmark { display: flex; flex-direction: column; align-items: flex-end; gap: 0; margin: 0 10px 10px 0 !important;
    pointer-events: none; user-select: none; color: var(--text); font-family: Figtree, system-ui, sans-serif; line-height: 1.1;
    --mw-halo: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 2px var(--mw-halo), 0 0 2px var(--mw-halo), 0 0 3px var(--mw-halo), 0 0 4px var(--mw-halo); }
[data-theme="dark"] .models-app .map-wordmark { --mw-halo: rgba(10, 16, 24, 0.85); }
.models-app .map-wordmark .mw-name { display: flex; align-items: center; gap: 6px; font-size: 24px; font-weight: 800; }
.models-app .map-wordmark svg { width: 24px; height: 24px; color: var(--accent); filter: drop-shadow(0 0 1.5px var(--mw-halo)) drop-shadow(0 0 1.5px var(--mw-halo)); }
.models-app .map-wordmark .mw-url { font-size: 13px; font-weight: 600; }
@media (max-width: 520px) {
    .models-app .map-wordmark .mw-name { font-size: 18px; gap: 4px; }
    .models-app .map-wordmark svg { width: 18px; height: 18px; }
    .models-app .map-wordmark .mw-url { font-size: 11px; }
}

/* ---------------------------------------------------------------------------
   Forecast-hour loop bar, copied from the tropics page (tropical/assets/tropics.css,
   .loop-bar ... .loop-fhr and its narrow-screen block; the time-axis "ticked"
   variant is left out). Keep the two in sync when either changes.
   --------------------------------------------------------------------------- */
/* Bar height: --loop-h (one row) / --loop-h-stacked (narrow, two rows); the map ends above it */
:root { --loop-h: 40px; --loop-h-stacked: 72px; }
.models-app.loop-open { bottom: var(--loop-h); }
@media (max-width: 720px) {
    body.loop-stacked .models-app.loop-open { bottom: var(--loop-h-stacked); }
}
.loop-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: var(--loop-h);
    padding: 0 0.9rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.08);
}
.loop-bar[hidden] { display: none; }

.loop-btn {
    width: 28px;
    height: 28px;
    flex: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
}
.loop-btn:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }
.loop-btn:disabled { opacity: 0.35; cursor: default; }

/* Playback speed: gauge + "Speed" + the multiplier select, one pill beside
   the transport buttons. */
.loop-speed {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 28px;
    margin-right: 0.35rem;
    padding: 0 0.1rem 0 0.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}
.loop-speed:hover, .loop-speed:focus-within { border-color: var(--accent); }
.loop-speed svg { width: 15px; height: 15px; flex: none; }
.loop-bar .loop-speed select {
    padding: 0.2rem 0.25rem;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}
.loop-bar .loop-speed select:focus { outline: none; } /* the pill shows focus */

/* Frame slider. The native range stays for dragging, keys and a11y, with an
   invisible thumb exactly the size of .loop-thumb; the bubble is drawn on top
   at the same spot: left = p * (track - thumb), the range's own thumb travel.
   --thumb-w widens for forecast loops, whose bubble shows the hour. */
.loop-track {
    --p: 0;
    --thumb-w: 18px;
    --thumb-h: 18px;
    position: relative;
    flex: 1;
    min-width: 80px;
    height: 28px;
    display: flex;
    align-items: center;
}
.loop-track.labeled { --thumb-w: 46px; --thumb-h: 22px; }
.loop-track input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 30px;
    margin: 0;
    background: transparent;
    cursor: pointer;
}
.loop-track input[type="range"]:focus { outline: none; } /* the bubble shows focus */
/* WebKit: one track, filled up to the thumb's center by a hard-stop
   gradient. While a loop preloads, --loop-buf (set from JS) layers the
   already-loaded segments in a lighter accent between the fill and the
   unloaded base. */
.loop-track { --loop-buf-color: #4da3ff; } /* light: vivid sky blue, clear of the gray base and the deep-blue fill */
[data-theme="dark"] .loop-track { --loop-buf-color: rgba(90, 162, 238, 0.38); }
.loop-track input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background:
        linear-gradient(to right,
            var(--accent) calc(var(--thumb-w) / 2 + var(--p) * (100% - var(--thumb-w))),
            transparent 0),
        var(--loop-buf, none),
        var(--border);
}
.loop-track input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: var(--thumb-w);
    height: var(--thumb-h);
    margin-top: calc((6px - var(--thumb-h)) / 2);
    border: 0;
    background: transparent;
    /* (iOS Safari otherwise draws its own white thumb and shadow, a box around the bubble: nothing of it shown) */
    border-radius: 0;
    box-shadow: none;
    opacity: 0;
}
.loop-track input[type="range"]::-webkit-slider-runnable-track { box-shadow: none; border: 0; }
/* Firefox: native progress fill */
.loop-track input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: var(--loop-buf, none), var(--border);
}
.loop-track input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
/* Here (unlike the tropics forecast loops) no played fill from the left end, so it never hides the
   preloaded segments: just the track and the preload segments under the thumb, as on the tropics
   page's time-axis loops. */
.loop-track input[type="range"]::-webkit-slider-runnable-track {
    background: var(--loop-buf, none), var(--border);
}
.loop-track input[type="range"]::-moz-range-progress { background: transparent; }
.loop-track input[type="range"]::-moz-range-thumb {
    width: var(--thumb-w);
    height: var(--thumb-h);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 0;
}
/* Archive-only datasets (analyses: RTMA, MRMS, Station Plots): the tropics page's time-axis loops (its
   satellite tab, tropics.css .loop-track.ticked ...): a plain thumb riding near the top, date/time ticks
   hanging under the line (app-playback.js syncLoopTicks) */
.loop-track.ticked { height: 40px; align-items: flex-start; }
.loop-track.ticked input[type="range"] { height: 24px; margin-top: 3px; }
.loop-track.ticked .loop-thumb { top: 15px; }
.loop-ticks { display: none; }
.loop-track.ticked .loop-ticks { display: block; position: absolute; left: 0; right: 0; top: 20px; height: 18px; pointer-events: none; }
.loop-tick { position: absolute; top: 0; }
.loop-tick i { position: absolute; left: -0.5px; top: 0; width: 1px; height: 4px; background: var(--text-muted); opacity: 0.55; }
.loop-tick.major i { height: 6px; opacity: 1; }
.loop-tick b { position: absolute; top: 7px; left: 0; transform: translateX(-50%); font-size: 0.6rem; font-weight: 600; line-height: 1;
    color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.loop-tick.major b { font-weight: 700; color: var(--text); }
.loop-tick.edge-l b { transform: translateX(-4px); }   /* keep end labels inside */
.loop-tick.edge-r b { transform: translateX(calc(-100% + 4px)); }
.loop-thumb {
    position: absolute;
    top: 50%;
    left: calc(var(--p) * (100% - var(--thumb-w)));
    box-sizing: border-box;
    width: var(--thumb-w);
    height: var(--thumb-h);
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    transition: transform 0.12s ease;
}
.loop-track:hover .loop-thumb,
.loop-track input[type="range"]:active + .loop-thumb { transform: translateY(-50%) scale(1.08); }
.loop-track input[type="range"]:focus-visible + .loop-thumb {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.loop-preload {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.74rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}
.loop-preload[hidden] { display: none; }
.loop-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    animation: loop-spin 0.7s linear infinite;
}
@keyframes loop-spin { to { transform: rotate(360deg); } }
/* Valid time: small caption over "Wed Jul 15 · 12 UTC" */
.loop-hour {
    flex: none;
    min-width: 128px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 0.35rem;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.loop-hour[hidden] { display: none; }
.loop-hour-cap {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.loop-hour-val { font-size: 0.84rem; font-weight: 700; color: var(--text); }
/* Forecast hour, left of the valid time (forecast loops only): same caption
   + value stack, a hairline between the two. */
.loop-fhr {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 2.6rem;
    margin-left: 0.35rem;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.loop-fhr[hidden] { display: none; }
.loop-fhr:not([hidden]) + .loop-hour {
    margin-left: 0.15rem;
    padding-left: 0.6rem;
    border-left: 1px solid var(--border);
}

@media (max-width: 720px) {
    .loop-bar { gap: 0.35rem; padding: 0 0.5rem; }
    /* body.loop-stacked (updateLoopBar: the bar carries Hour / Valid): two
       rows — transport + Speed left, readouts right; the slider below at
       full width. Height: --loop-h-stacked. */
    body.loop-stacked .loop-bar {
        height: var(--loop-h-stacked);
        flex-wrap: wrap;
        align-content: center;
        row-gap: 2px;
    }
    body.loop-stacked .loop-speed { margin-right: auto; }
    body.loop-stacked .loop-track { order: 10; flex: 1 1 100%; }
    /* Room for the slider: the speed pill keeps its gauge + multiplier, and
       the valid time stacks date over time with no caption. */
    .loop-speed { margin-right: 0.15rem; padding-left: 0.4rem; }
    .loop-speed-word { display: none; }
    .loop-track { min-width: 64px; }
    .loop-hour { min-width: 0; margin-left: 0.15rem; }
    .loop-hour-cap, .loop-hour-sep { display: none; }
    /* the hour keeps its caption: two short lines, no extra width */
    .loop-fhr { min-width: 0; margin-left: 0.15rem; }
    .loop-fhr .loop-hour-cap { display: block; font-size: 0.58rem; }
    .loop-fhr .loop-hour-val { font-size: 0.74rem; line-height: 1.2; }
    .loop-fhr:not([hidden]) + .loop-hour { padding-left: 0.4rem; }
    .loop-hour-val { display: flex; flex-direction: column; align-items: flex-end;
                     font-size: 0.74rem; line-height: 1.2; }
}

/* Last frame held over the map while layers are rebuilt (app-cycles.js holdFrame) */
.models-app .frame-hold { position: absolute; top: 0; left: 0; pointer-events: none; }

/* ---------------------------------------------------------------------------
   Section-bar icon buttons and the settings modal, copied from the tropics page
   (tropical/assets/tropics.css: .section-bar .icon-btn ..., tooltips, .modal-*, .settings-*,
   .setting-*, .bg-*, .switch). Keep the two in sync when either changes.
   --------------------------------------------------------------------------- */
/* Icon-button width (the horizontal room around the glyph) eases from 34px at
   >=600px viewports down to 30px at <=400px. */
.section-bar .icon-btn { width: clamp(30px, 2vw + 22px, 34px); height: 34px; }
/* .icon-btn sets display:flex, which overrides the [hidden] attribute. */
.section-bar .icon-btn[hidden] { display: none; }
.section-bar .icon-btn svg { width: 18px; height: 18px; }
/* Between-button margin shrinks linearly from 0.25rem at 700px to 0 at 500px. */
.section-bar .section-actions {
    display: flex;
    align-items: center;
    gap: clamp(0px, 2vw - 10px, 0.25rem);
}
/* Narrow viewports: a slimmer bar edge and buttons a little closer (the icons here share the bar with only the Menu
   button, so less condensed than the tropics page's: 34px wide at 600px down to 30px at <=400px, 2px apart; 28px and
   touching at <=340px). Tooltips hang left off each button's right edge, so the thinner edge never clips them. */
@media (max-width: 720px) {
    .section-bar { padding: 0 0.75rem; }
    .section-bar-left { gap: 0.5rem; }
    .section-bar .section-actions { gap: 2px; }
}
@media (max-width: 340px) {
    .section-bar .section-actions { gap: 0; }
    .section-bar .icon-btn { width: 28px; }
}
@media (max-width: 400px) {
    .section-bar { padding: 0 0.5rem; }
}
/* the bar's light-mode background IS --accent-soft, so the default
   icon-btn hover was invisible here */
.section-bar .icon-btn:hover { background: var(--accent); color: #fff; }
.section-bar .icon-btn.active { background: var(--accent); color: #fff; }

/* Instant tooltips for the section-action buttons (no native-title delay) */
.section-actions button[data-tip] { position: relative; }
.section-actions button[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 0.32rem 0.55rem;
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    z-index: 200;
    transition: opacity 0.05s ease;
}
.section-actions button[data-tip]:focus-visible::after { opacity: 1; }
/* only on devices with a real hover (not touch, where it sticks after a tap) */
@media (hover: hover) {
    .section-actions button[data-tip]:hover::after { opacity: 1; }
}

.modal-backdrop[hidden] { display: none; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 300;   /* over the popups' layer (.models-floats, 200, added last to the page: it would win a tie) */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 16, 24, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: modal-fade 0.15s ease;
}

.modal {
    width: min(360px, calc(100vw - 2rem));
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    animation: modal-pop 0.18s ease;
}

@keyframes modal-fade { from { opacity: 0; } }
@keyframes modal-pop { from { opacity: 0; transform: scale(0.96) translateY(6px); } }

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.15rem 0.7rem;
    border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 1.05rem; letter-spacing: -0.01em; }
.modal-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
.modal-close:hover { background: var(--accent-soft); color: var(--text); }
.modal-body { padding: 0.75rem 1.15rem 1rem; }
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    cursor: pointer;
    user-select: none;
}
.setting-row + .setting-row,
.setting-row + .setting-group,
.setting-group + .setting-row,
.setting-group + .setting-group { border-top: 1px solid var(--border); padding-top: 0.35rem; }

/* Settings categories: tab strip on top (narrow) / left rail (wide) */
.settings-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.6rem 1.15rem 0;
}
.settings-tabs button {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}
.settings-tabs button:hover { color: var(--text); background: var(--accent-soft); }
.settings-tabs button.active { color: #fff; background: var(--accent); }
.settings-pane[hidden] { display: none; }

@media (min-width: 721px) {
    .settings-modal { width: min(680px, calc(100vw - 2rem)); }
    .settings-layout { display: flex; align-items: stretch; }
    .settings-tabs {
        flex: 0 0 118px;
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        padding: 0.9rem 0 0.9rem 0.9rem;
        border-right: 1px solid var(--border);
        margin-right: 0.15rem;
    }
    .settings-tabs button { text-align: left; }
    .settings-layout .modal-body { flex: 1 1 auto; min-width: 0; }
    /* Taller than the window: the settings scroll, the title and the tabs stay put */
    .settings-modal { max-height: calc(100dvh - 2rem); display: flex; flex-direction: column; overflow: hidden; }
    .settings-modal .modal-head { flex: none; }
    .settings-modal .settings-layout { flex: 1 1 auto; min-height: 0; }
    .settings-modal .settings-tabs { overflow-y: auto; }
    .settings-modal .settings-layout .modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
}

/* Background colors: one section, two exclusive choices (Blue Marble OR
   custom fills) — rows deliberately carry no divider borders. */
.bg-or {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0.25rem 0 0.25rem 0.75rem;
}
.bg-or::before, .bg-or::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--border);
}
.bg-custom {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding-bottom: 0.65rem; /* breathing room above the next group's divider */
    transition: opacity 0.15s;
}
.bg-custom.disabled { opacity: 0.4; pointer-events: none; }

.setting-name { display: block; font-weight: 600; font-size: 0.92rem; line-height: 1.35; }
.setting-desc { display: block; color: var(--text-muted); font-size: 0.8rem; line-height: 1.35; }
.setting-desc.setting-warn { margin-top: 3px; color: #b42318; }
[data-theme="dark"] .setting-desc.setting-warn { color: #f97066; }
.setting-desc[hidden] { display: none; }

.setting-color {
    width: 40px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    flex: 0 0 auto;
}

.setting-row-static { cursor: default; }
.setting-restore {
    border: none;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.setting-restore:hover { color: var(--accent-hover); }
/* Toggle switch */
.switch { position: relative; flex: 0 0 auto; width: 40px; height: 22px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--border);
    transition: background 0.15s ease;
    pointer-events: none;
}
.switch .slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 720px) {
    /* modals center on the viewport with a small margin; one scrolling body */
    .modal-backdrop { padding: 0.75rem; }
    .modal { max-height: calc(100dvh - 1.5rem); display: flex; flex-direction: column; overflow: hidden; }
    .modal-head { flex: none; }
    .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .settings-modal .settings-layout { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
    .settings-modal .settings-tabs { flex: none; }
}

/* ---------------------------------------------------------------------------
   Section switch in the section bar (Data Sources / Layers / Map Display): the tropics page's
   segmented pill (wide) / dropdown (narrow), copied from tropics.css (.section-bar-left,
   .seg-toggle, .seg-select and the narrow-screen swap). Keep in sync.
   --------------------------------------------------------------------------- */
.section-bar-left { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }

/* Section switch: segmented pill (wide) / dropdown (narrow) */
.seg-toggle {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: inset 0 1px 2px rgba(16, 34, 56, 0.05);
}
.seg-toggle button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.seg-toggle button svg { width: 15px; height: 15px; flex: 0 0 auto; }
.seg-toggle button[hidden] { display: none; }
.seg-toggle button:hover:not(.active) { color: var(--text); }
.seg-toggle button.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 1px 4px rgba(16, 34, 56, 0.2);
}
.seg-select {
    display: none;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.28rem 1.6rem 0.28rem 0.6rem;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6b7d' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}
@media (max-width: 360px) { .models-app .controls-head .seg-toggle button svg { display: none; } }   /* (the drawer's switch: words only) */

/* Left menu sections */
.models-app .side-pane { display: grid; gap: 8px; align-content: start; }
.models-app .side-pane[hidden] { display: none; }
/* Map Display > Geography: switch rows (labels, roads, background), as the settings modal's */
.models-app .geo-group { display: grid; gap: 0; }
.models-app .geo-group + .geo-group { margin-top: 4px; padding-top: 5px; border-top: 1px solid var(--border); }
.models-app .geo-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 1px 2px; min-height: 30px;
    border-radius: 7px; cursor: pointer; user-select: none; }
.models-app div.geo-row { cursor: default; }
.models-app div.geo-row > .geo-text { flex: 1; cursor: pointer; }
/* Gear: opens the row's panel */
.models-app .geo-gear { flex: none; width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border: none; border-radius: 7px;
    background: transparent; color: var(--muted); cursor: pointer; transition: background 0.12s, color 0.12s; }
.models-app .geo-gear svg { width: 16px; height: 16px; transition: transform 0.2s; }
.models-app .geo-gear:hover { background: var(--hover); color: var(--panel-fg); }
.models-app .geo-gear.active { background: var(--accent-soft); color: var(--accent); }
.models-app .geo-gear.active svg { transform: rotate(60deg); }
.models-app .geo-gear:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* The panel under a row */
.models-app .geo-panel { display: grid; gap: 7px; margin: 2px 0 4px; padding: 9px 10px; border-radius: 9px; background: var(--sub-bg); }
.models-app .geo-panel[hidden] { display: none; }
.models-app .geo-ctl { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.models-app .geo-ctl.disabled { opacity: 0.45; }
.models-app .geo-ctl-name { flex: 0 0 76px; font-size: 12px; font-weight: 600; color: var(--muted); }
.models-app .geo-ctl .setting-color { width: 34px; height: 22px; flex: none; }
.models-app .geo-range { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.models-app .geo-range input[type=range] { flex: 1; width: 0; min-width: 0; accent-color: var(--accent); }   /* width 0: grows to the room left, never widens the menu */
.models-app .geo-group, .models-app .geo-panel { min-width: 0; }
.models-app .geo-val { flex: 0 0 38px; text-align: right; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--panel-fg); }
.models-app .geo-ctl .switch { transform: scale(0.85); transform-origin: left center; }
.models-app .geo-ctl-foot { justify-content: flex-end; min-height: 0; }
.models-app .geo-text { display: grid; gap: 1px; min-width: 0; }
.models-app .geo-name { font-size: 13px; font-weight: 600; color: var(--panel-fg); }
.models-app .geo-desc { font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.models-app .geo-row .switch { transform: scale(0.9); transform-origin: right center; }
.models-app .geo-row .setting-color { width: 36px; height: 24px; }
.models-app .bg-or { margin: 2px 0 0; }
.models-app .geo-custom { gap: 0; padding: 0 0 0 10px; }
.models-app .geo-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 2px 0; }
.models-app .geo-foot-btns { display: flex; gap: 6px; margin-left: auto; }
.models-app .geo-foot-btns button { white-space: nowrap; }
.models-app .geo-foot:has(.geo-foot-btns) { flex-wrap: wrap; row-gap: 4px; }
.models-app .geo-foot:has(.geo-foot-btns) > .geo-desc { order: 2; flex-basis: 100%; text-align: right; }

/* Background color presets modal (outside .models-app: site colors only) */
.presets-modal { width: min(460px, calc(100vw - 2rem)); }
.presets-modal .modal-body { max-height: min(70vh, 560px); overflow-y: auto; }
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.preset-grid[hidden] { display: none; }
@media (max-width: 420px) { .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.preset-item { position: relative; }
.preset-card { width: 100%; display: grid; gap: 5px; padding: 5px 5px 6px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-card);
    color: var(--text); font: inherit; font-size: 0.8rem; font-weight: 600; text-align: center; cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s; }
.preset-card:hover { border-color: var(--accent); }
.preset-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.preset-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.preset-swatch { display: block; width: 100%; height: 44px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.12); box-sizing: border-box; }
.preset-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; padding: 0; border: 1px solid var(--border); border-radius: 50%;
    background: var(--bg-card); color: var(--text-muted); font-size: 14px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.preset-del:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.preset-sub { margin: 14px 0 8px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.preset-empty { margin: 0; font-size: 0.8rem; color: var(--text-muted); }
.preset-empty[hidden] { display: none; }
.preset-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.preset-add .cfg-name { flex: 1 1 140px; min-width: 0; }
.preset-color { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.preset-save { padding: 0.35rem 0.9rem; border: none; border-radius: 7px; background: var(--accent); color: #fff; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.preset-save:hover { background: var(--accent-hover); }
/* Projection row: a small Map / Globe toggle; the globe's options indented under it */
.models-app .seg-mini { flex: none; display: inline-flex; gap: 2px; padding: 2px; border: none; border-radius: 8px; background: var(--sec-bg);
    box-shadow: inset 0 1px 2px rgba(16, 34, 56, 0.08); }
.models-app .seg-mini label { padding: 3px 11px; border-radius: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.models-app .seg-mini label:hover:not(:has(input:checked)) { color: var(--panel-fg); }
.models-app .seg-mini label:has(input:checked) { background: var(--panel-bg); color: var(--accent); box-shadow: 0 1px 3px rgba(16, 34, 56, 0.18); }
[data-theme="dark"] .models-app .seg-mini label:has(input:checked) { background: var(--sec-bg-hover); }
.models-app .seg-mini label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.models-app .geo-sub { display: grid; margin: 0 0 2px 10px; padding-left: 10px; border-left: 2px solid var(--border); }
.models-app .geo-sub[hidden] { display: none; }
.models-app .geo-sub .geo-row.disabled { opacity: 0.45; }
.models-app .geo-sub .geo-ctl { padding: 0 2px; }
.models-app .geo-sub .geo-ctl[hidden] { display: none; }
.models-app #space-row .setting-restore { margin-left: auto; font-size: 12px; }
/* Globe backdrop: the space color around the globe (the canvas is transparent there) */
.models-app #map.globe-space { background: var(--space-bg, var(--map-bg)); }
.models-app .starfield { position: absolute; inset: 0; background: #02040a; pointer-events: none; overflow: hidden; }
.models-app .starfield[hidden] { display: none; }
.models-app .sf-layer { position: absolute; inset: 0; background-repeat: repeat; }
.models-app .sf-1 { background-position: 160px 90px; animation: sf-twinkle 3.2s ease-in-out infinite alternate; }
.models-app .sf-2 { background-position: 330px 250px; animation: sf-twinkle 4.1s ease-in-out -2s infinite alternate; }
@keyframes sf-twinkle { from { opacity: 0.15; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .models-app .sf-layer { animation: none; } }
/* Projection: the Base layer / Overlays toggle's look */

/* Layers: drawing order top down (base layer first); drag by the handle, x removes, Edit opens the editor */
.models-app #layer-list { display: grid; gap: 6px; }
/* Cards: a shade off the panel (--layer-card), the same for the base layer and overlays */
.models-app .layer-row { border: 1px solid var(--border); border-radius: 8px; background: var(--layer-card); }
.models-app .layer-row.base { background: var(--layer-card-base); }
/* Being edited (its Edit section open): outlined in the accent color, fading in / out with the slide */
.models-app .layer-row { transition: border-color 240ms ease, box-shadow 240ms ease; }
.models-app .layer-row.editing { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
@media (prefers-reduced-motion: reduce) { .models-app .layer-row { transition: none; } }
/* Sections ("Base Layer", "Overlays": .pane-section / .pane-title bands, as in Map Display), cards in a column,
   the drag hint under "Overlays" */
.models-app #layer-list { gap: 0; }
.models-app .layer-cards { display: grid; gap: 6px; }
.models-app .layer-hint { margin: -2px 0 -2px; text-align: center; font-size: 11px; color: var(--muted); }
.models-app .layer-row.dragging { box-shadow: 0 6px 18px rgba(0,0,0,0.18); position: relative; z-index: 3; opacity: 0.95; }

.models-app .layer-row { display: flex; flex-direction: column; overflow: hidden; }
.models-app .layer-top { display: flex; align-items: stretch; }
/* Drag handle: the card's whole left side */
.models-app .layer-handle { flex: none; width: 20px; align-self: stretch; display: grid; place-items: center; color: var(--muted);
    cursor: grab; touch-action: none; border-right: 1px solid transparent; }
.models-app .layer-handle:hover { color: var(--panel-fg); background: var(--hover); border-right-color: var(--border); }
.models-app .layer-handle svg { width: 14px; height: 14px; }
/* Name, then the buttons along the bottom, then the Edit section */
.models-app .layer-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 7px 8px 7px 4px; }
.models-app .layer-row.base .layer-handle { cursor: default; visibility: hidden; }
.models-app .layer-name { flex: 1; min-width: 0; display: grid; }
.models-app .layer-name b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.models-app .layer-name small { color: var(--muted); font-size: 11px; }
/* A layer with nothing at this frame (app-styles.js syncLayerAvailability): greyed out, "Not available ..." */
.models-app .layer-row.unavailable .layer-name b { color: var(--muted); font-weight: 600; }
.models-app .layer-row.unavailable .layer-name small { font-style: italic; }
.models-app .layer-row.unavailable { background: transparent; border-style: dashed; }
/* Delete over Edit: one column, both the same width */
/* Bottom bar: the three buttons edge to edge across the card, thin dividers between them */
.models-app .layer-actions { display: flex; border-top: 1px solid var(--border); }
.models-app .layer-row .layer-actions .layer-btn { flex: 1 1 0; min-width: 0; height: 30px; margin: 0; border: 0; border-radius: 0;
    background: var(--panel-bg); }
.models-app .layer-row .layer-actions .layer-btn + .layer-btn { border-left: 1px solid var(--border); }
.models-app .layer-row .layer-btn { flex: none; height: 26px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
    gap: 5px; margin: 0; border: 1px solid var(--border); border-radius: 7px; background: var(--panel-bg); color: var(--panel-fg);
    font: inherit; font-size: 12px; font-weight: 600; line-height: 1; cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease; }
.models-app .layer-row .layer-btn svg { width: 14px; height: 14px; flex: none; }
.models-app .layer-row .layer-btn { padding: 0 6px; justify-content: center; }
.models-app .layer-row .layer-hide svg { color: var(--muted); }
.models-app .layer-row .layer-hide:hover { border-color: var(--accent); background: var(--hover); }
.models-app .layer-row .layer-hide:hover svg { color: var(--accent); }
/* A hidden layer: its card dimmed, Show highlighted */
.models-app .layer-row.hidden-layer .layer-name { opacity: 0.55; }
.models-app .layer-row .layer-hide[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.models-app .layer-row .layer-hide[aria-pressed="true"] svg { color: var(--accent); }
.models-app .layer-row .layer-edit svg { color: var(--muted); }
.models-app .layer-row .layer-edit:hover { border-color: var(--accent); background: var(--hover); }
.models-app .layer-row .layer-edit:hover svg { color: var(--accent); }
.models-app .layer-row .layer-edit.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.models-app .layer-row .layer-edit.active svg { color: #fff; }
.models-app .layer-row .layer-remove svg { color: var(--muted); }
.models-app .layer-row .layer-remove:hover, .models-app .layer-row .layer-remove:hover svg { color: #d93f36; }
.models-app .layer-row .layer-remove:hover { border-color: #e8a29d; background: #fdecea; }
[data-theme="dark"] .models-app .layer-row .layer-remove:hover { color: #ff8a80; border-color: #8a3a35; background: #3a2123; }
.models-app .layer-row .layer-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.models-app .layer-style { display: grid; gap: 8px; padding: 8px; border-top: 1px solid var(--border); }   /* under the buttons (hidden with the section) */
/* Edit section: slides open / closed (as the Data Sources menu's sections) */
.models-app .layer-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 240ms ease; }
.models-app .layer-collapse.open { grid-template-rows: 1fr; }
.models-app .layer-collapse-inner { min-height: 0; overflow: hidden; visibility: hidden; opacity: 0; transition: opacity 180ms ease, visibility 0s linear 240ms; }
.models-app .layer-collapse.open > .layer-collapse-inner { visibility: visible; opacity: 1; transition: opacity 240ms ease, visibility 0s; }
@media (prefers-reduced-motion: reduce) {
    .models-app .layer-collapse, .models-app .layer-collapse-inner { transition: none !important; }
}
.models-app .layer-empty { color: var(--muted); font-size: 12px; }

/* Product picker (Data Sources): collapsed category sections and subsections, animated open /
   closed (grid rows 0fr <-> 1fr); options highlight on hover, the current base layer / active
   overlays stay highlighted (app-suite.js renderPicker) */
.models-app #pick-mode { margin-bottom: 2px; }
.models-app #pick-mode[hidden] { display: none; }
.models-app #pick-list { display: grid; gap: 4px; }
.models-app .pick-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 220ms ease; }
.models-app .pick-collapse-inner { min-height: 0; overflow: hidden; visibility: hidden; opacity: 0;
    transition: opacity 180ms ease, visibility 0s linear 220ms; }
.models-app .open > .pick-collapse, .models-app .pick-collapse.open { grid-template-rows: 1fr; }
.models-app .open > .pick-collapse > .pick-collapse-inner, .models-app .pick-collapse.open > .pick-collapse-inner {
    visibility: visible; opacity: 1; transition: opacity 220ms ease, visibility 0s; }
@media (prefers-reduced-motion: reduce) {
    .models-app .pick-collapse, .models-app .pick-collapse-inner, .models-app .pick-group-head::before,
    .models-app .pick-subgroup-head::before { transition: none !important; }
}
.models-app .pick-group-head, .models-app .pick-subgroup-head { all: unset; box-sizing: border-box; width: 100%; display: flex;
    align-items: center; gap: 8px; cursor: pointer; transition: background 0.12s, color 0.12s; }
/* Sections: filled bars (no box around their contents); accent-tinted while open */
.models-app .pick-group-head { padding: 8px 10px; border-radius: 7px; font-weight: 600; background: var(--sec-bg); }
.models-app .pick-group-head:hover { background: var(--sec-bg-hover); }
.models-app .pick-group.open > .pick-group-head { background: var(--accent-soft); color: var(--accent); }
.models-app .pick-group.open > .pick-group-head::before { border-color: var(--accent); }
/* Subsections: lighter bars, indented under their section */
.models-app .pick-subgroup { margin-top: 3px; }
/* Third menu level (e.g. Diagnostics > Non-Model Datasets > Storm Prediction Center): indented */
.models-app .pick-level3 { margin-left: 10px; }
.models-app .pick-subgroup-head { padding: 6px 8px 6px 10px; border-radius: 6px; background: var(--sub-bg); font-size: 11px;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.models-app .pick-subgroup-head:hover { background: var(--hover); color: var(--panel-fg); }
.models-app .pick-subgroup.open > .pick-subgroup-head { color: var(--panel-fg); }
.models-app .pick-group-head:focus-visible, .models-app .pick-subgroup-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Chevrons: right when closed, down when open */
.models-app .pick-group-head::before, .models-app .pick-subgroup-head::before { content: ''; flex: none; width: 6px; height: 6px;
    border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg);
    transition: transform 220ms ease; margin-right: 2px; }
.models-app .pick-subgroup-head::before { width: 5px; height: 5px; border-width: 0 1.6px 1.6px 0; }
.models-app .pick-group.open > .pick-group-head::before, .models-app .pick-subgroup.open > .pick-subgroup-head::before { transform: rotate(45deg); }
.models-app .pick-head-name { flex: 1; min-width: 0; }
.models-app .pick-head-note { flex: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 11px; font-weight: 600; color: var(--accent); text-transform: none; letter-spacing: 0; }
.models-app .pick-items { display: grid; padding: 3px 0 6px 10px; }
/* A subsection's options: on the panel background, beside a thin guide line */
.models-app .pick-subgroup > .pick-collapse .pick-rows { margin: 3px 0 4px 10px; padding-left: 6px; border-left: 2px solid var(--guide); }
.models-app .pick-rows { display: grid; }
.models-app .pick-row { display: flex; align-items: center; gap: 2px; border-radius: 5px; transition: background 0.12s; }
.models-app .pick-row:hover { background: var(--hover); }
.models-app .pick-row.selected { background: var(--selected); }
.models-app .pick-row.selected:hover { background: var(--selected-hover); }
.models-app .pick-main { all: unset; box-sizing: border-box; flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px;
    padding: 5px 6px; cursor: pointer; border-radius: 5px; }
.models-app .pick-main:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.models-app .pick-name { flex: 1; min-width: 0; }
.models-app .pick-row.selected .pick-name { color: var(--accent); font-weight: 600; }
.models-app .pick-buttons { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 5px; padding: 2px 6px 6px; }   /* (products.js menuButtons) */
.models-app .pick-btn { padding: 5px 4px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-bg); color: var(--panel-fg); font: inherit; font-size: 12.5px; white-space: nowrap; cursor: pointer; transition: background 0.12s; }
.models-app .pick-btn:hover { background: var(--hover); }
.models-app .pick-btn.selected { background: var(--selected); border-color: var(--accent); color: var(--accent); font-weight: 600; }
/* Overlays: their kind, and a check mark on the active ones */
.models-app #pick-list .pick-row .pick-kind { flex: none; font-size: 10.5px; color: var(--muted); }
.models-app .pick-row.selected .pick-main::after { content: '\2713'; flex: none; color: var(--accent); font-weight: 700; }
/* (i): the tropics page's .info-btn (tropics.css), a little smaller to fit the rows */
.models-app .info-btn { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px;
    padding: 0; border: none; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; flex: 0 0 auto; }
.models-app .info-btn:hover { background: var(--accent-soft); color: var(--panel-fg); border: none; }
.models-app .info-btn svg { width: 17px; height: 17px; }
.models-app .pick-info { width: 24px; height: 24px; margin-right: 2px; }

/* Information modal, copied from tropics.css (.info-modal / .info-body). Keep in sync. */
/* Information modal: a single rendered description for the current view. */
.info-modal { width: min(560px, calc(100vw - 2rem)); }
.info-body {
    max-height: min(70vh, 560px);
    overflow-y: auto;
    padding: 1rem 1.25rem 1.2rem;
}
.info-body p { margin: 0 0 0.7rem; line-height: 1.5; color: var(--text); }
.info-body p:last-child { margin-bottom: 0; }
.info-body ul { margin: 0 0 0.7rem; padding-left: 1.2rem; line-height: 1.5; }
.info-body li { margin: 0.15rem 0; }
.info-body a { color: var(--accent); }
.info-body code {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.85em;
    background: var(--accent-soft);
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
}
.info-body .info-meta { font-size: 0.8rem; color: var(--text-muted); }

/* MapLibre's own controls (zoom / compass, attribution) in dark mode: its stylesheet is light-only */
[data-theme="dark"] .models-app .maplibregl-ctrl-group { background: var(--bg-card); box-shadow: 0 0 0 1px var(--border); }
[data-theme="dark"] .models-app .maplibregl-ctrl-group button + button { border-top-color: var(--border); }
[data-theme="dark"] .models-app .maplibregl-ctrl-group button:not(:disabled):hover { background-color: var(--hover); }
[data-theme="dark"] .models-app .maplibregl-ctrl-icon,
[data-theme="dark"] .models-app .maplibregl-ctrl-attrib-button { filter: invert(1) hue-rotate(180deg); }
[data-theme="dark"] .models-app .maplibregl-ctrl-attrib,
[data-theme="dark"] .models-app .maplibregl-ctrl-attrib.maplibregl-compact { background-color: var(--bg-card); color: var(--text-muted); }
[data-theme="dark"] .models-app .maplibregl-ctrl-attrib a { color: var(--text-muted); }
.models-app .pick-head-note.check { font-size: 15px; font-weight: 700; line-height: 1; }   /* base layer: a check mark */

/* Parameter search (between the Base layer / Overlays switch and the sections) */
.models-app .pick-search { position: relative; display: flex; align-items: center; }
.models-app .pick-search svg { position: absolute; left: 9px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.models-app #pick-search { width: 100%; box-sizing: border-box; padding: 7px 30px 7px 31px; border: 1px solid var(--border);
    border-radius: 7px; background: var(--panel-bg); color: var(--panel-fg); font: inherit; -webkit-appearance: none; appearance: none; }
.models-app #pick-search::-webkit-search-cancel-button { display: none; }
.models-app #pick-search::placeholder { color: var(--muted); }
.models-app #pick-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.models-app #pick-search-clear { position: absolute; right: 5px; width: 22px; height: 22px; padding: 0; border: none; border-radius: 50%;
    background: transparent; color: var(--muted); font-size: 16px; line-height: 1; display: grid; place-items: center; }
.models-app #pick-search-clear[hidden] { display: none; }
.models-app #pick-search-clear:hover { background: var(--hover); color: var(--panel-fg); }
.models-app .pick-empty { color: var(--muted); font-size: 12px; padding: 6px 2px; }

/* Data Sources: two titled blocks, Data Source (model, cycle) and Parameters */
.models-app .pane-section { display: grid; gap: 8px; align-content: start; }
.models-app .pane-section[hidden] { display: none; }
.models-app .pane-section + .pane-section { margin-top: 10px; }
/* Block titles: a full-width band across the menu (bleeding into its side padding), centered */
.models-app .pane-title { margin: 0 -14px 2px; padding: 7px 14px; text-align: center; font-size: 11.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em; background: var(--title-bg); color: var(--title-fg); }
.models-app .pane-field { display: grid; gap: 3px; }
/* A collapsible section (Data Sources > Data Source): its title band a button with a chevron, its body sliding open / shut */
.models-app .pane-title-toggle { padding: 0; }
.models-app .pane-title-toggle button { position: relative; display: block; width: 100%; padding: 7px 14px; border: 0; background: none; color: inherit;
    font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.models-app .pane-title-toggle .pane-chev { position: absolute; right: 14px; top: 50%; width: 14px; height: 14px; margin-top: -7px; transition: transform 200ms ease; }
.models-app .pane-title-toggle button[aria-expanded="false"] .pane-chev { transform: rotate(-90deg); }
.models-app .pane-collapse > .pick-collapse-inner { display: grid; gap: 8px; align-content: start; margin: -4px; padding: 4px; }   /* (the section's spacing; room for focus rings) */
.models-app .pane-section:has(> .pane-collapse:not(.open)) { gap: 0; }
.models-app .pane-section:has(> .pane-collapse:not(.open)) > .pane-title { margin-bottom: 0; }
.models-app .pane-collapse:not(.open) > .pick-collapse-inner { margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
.models-app .pane-section:has(> .pane-collapse:not(.open)) + .pane-section { margin-top: 0; }   /* (collapsed: the next band right under it) */
.models-app .pane-field[hidden] { display: none; }
/* Archive mode (app-suite.js archive): its switch, and its time range (two handles, as the analyses' Time range) */
.models-app .archive-field { gap: 4px; }
.models-app .archive-field.locked { opacity: 0.55; }   /* (Storm-Centered View: as it was, locked) */
.models-app .archive-field.locked .switch, .models-app .archive-field.locked input { cursor: not-allowed; }
.models-app .archive-range { display: grid; gap: 3px; padding: 2px 4px 0; }
.models-app .archive-range[hidden] { display: none; }
.models-app .archive-range .range2-val { min-width: 0; text-align: left; font-size: 11px; color: var(--muted); }
#storm-follow { display: flex; }
#storm-follow button { flex: 1; justify-content: center; }
.models-app .pane-field > span { font-size: 11px; font-weight: 600; color: var(--muted); }
/* Cycle slider: filled up to the thumb (--p, set in app-cycles.js fillRuns), run names at the ends */
.models-app .cycle-slider { display: grid; gap: 2px; padding: 0 2px; --p: 1; }
/* Trend loop slider: the loop bar's slider (.loop-track), its bubble wide enough for "10/15 12z" */
.models-app .trend-track { --thumb-w: 68px; flex: none; width: 100%; min-width: 0; }
.models-app .trend-track input:disabled { cursor: default; }
.models-app .trend-track:has(input:disabled) .loop-thumb { opacity: 0.6; }
.models-app .cycle-ends { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); }
.models-app .cycle-status { font-size: 11.5px; color: var(--accent); font-weight: 600; }
.models-app .cycle-status[hidden] { display: none; }

/* Base layer / Overlays: a pill switch; the active side is a raised card */
.models-app .pick-toggle { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--sec-bg);
    box-shadow: inset 0 1px 2px rgba(16, 34, 56, 0.08); }
.models-app .pick-toggle button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 6px 8px; border: none; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 600;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.models-app .pick-toggle button svg { width: 16px; height: 16px; flex: none; }
/* (three tabs: Base layer, Overlays, My Maps: each on one line) */
.models-app #pick-mode button { gap: 4px; padding: 6px 4px; font-size: 12.5px; white-space: nowrap; min-width: 0; }
.models-app #pick-mode button svg { width: 14px; height: 14px; }
.models-app .pick-toggle button:hover:not(.active) { color: var(--panel-fg); background: var(--sec-bg-hover); }
.models-app .pick-toggle button.active { background: var(--panel-bg); color: var(--accent);
    box-shadow: 0 1px 3px rgba(16, 34, 56, 0.18), 0 0 0 1px rgba(16, 34, 56, 0.04); }
[data-theme="dark"] .models-app .pick-toggle button.active { background: var(--sec-bg-hover); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.models-app .pick-toggle button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Wide screens: the first title band sits flush with the top of the menu */
@media (min-width: 861px) {
    .models-app .side-pane > .pane-section:first-child > .pane-title,
    .models-app .side-pane > #layer-list:first-child > .pane-section:first-child > .pane-title { margin-top: -12px; }
}

/* Styled dropdowns (js/dropdown.js) for Model and Cycle: a button in the menu, a list in a
   fixed-position popup (attached to <body>, so it uses the site's theme variables) */
.models-app .dd-btn { display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; min-height: 40px;
    padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-bg); color: var(--panel-fg);
    text-align: left; cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s; }
.models-app .dd-btn:hover:not(:disabled) { border-color: var(--accent); }
.models-app .dd.open .dd-btn, .models-app .dd-btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.models-app .dd-btn:disabled { cursor: default; opacity: 0.75; }
.models-app .dd-btn svg { flex: none; width: 16px; height: 16px; color: var(--muted); margin-left: auto; transition: transform 0.18s ease; }
.models-app .dd.open .dd-btn svg { transform: rotate(180deg); }
.dd-label { display: grid; min-width: 0; flex: 1; }
.dd-main { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-sub { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-badge { flex: none; font-size: 10px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--accent);
    background: var(--accent-soft); border-radius: 999px; padding: 2px 7px; }
.dd-list { position: fixed; z-index: 150; box-sizing: border-box; overflow-y: auto; padding: 5px; outline: none;
    background: var(--bg-card); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 10px 30px rgba(16, 34, 56, 0.18), 0 2px 6px rgba(16, 34, 56, 0.08);
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 13px; line-height: 1.35;
    animation: dd-in 0.14s ease; transform-origin: top center; }
.dd-list.up { transform-origin: bottom center; }
.dd-list[hidden] { display: none !important; }   /* over .dd-list.columns { display: flex } */
[data-theme="dark"] .dd-list { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.dd-list.up { animation-name: dd-in-up; }
@keyframes dd-in-up { from { opacity: 0; transform: translateY(4px) scale(0.98); } }
@media (prefers-reduced-motion: reduce) { .dd-list { animation: none; } }
.dd-group { padding: 8px 9px 3px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.dd-group:first-child { padding-top: 4px; }
.dd-opt { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 7px; cursor: pointer; }
.dd-opt.active { background: var(--accent-soft); }
.dd-opt.selected .dd-main { color: var(--accent); }
.dd-opt.selected::after { content: '\2713'; flex: none; color: var(--accent); font-weight: 700; }
/* Model menu top bar: "When switching models": Cycle [Latest | Match current], Overlays [Keep current | Suggested]
   (app-cycles.js modelMenuHeader). Wide: one line; narrow: the two rows stacked, labels aligned */
.dd-header { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 4px 4px 9px; margin-bottom: 4px;
    border-bottom: 1px solid var(--border); }
.dd-header-rows { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; margin-left: auto; }
.dd-header-row { display: flex; align-items: center; gap: 8px; }
.dd-header-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.dd-header-row .dd-seg { margin-left: 0; }
@media (max-width: 600px) {
  .dd-header { display: grid; gap: 6px; }
  .dd-header-rows { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; margin-left: 0; padding-left: 5px; }
  .dd-header-row { display: contents; }
  .dd-header-row .dd-seg { justify-self: start; }
}
.dd-header-title { padding-left: 5px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.dd-seg { display: flex; gap: 3px; padding: 3px; margin-left: auto; border-radius: 9px; background: var(--accent-soft); }
.dd-seg button { padding: 4px 10px; border: none; border-radius: 7px; background: transparent; color: var(--text-muted);
    font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.dd-seg button:hover:not(.active) { color: var(--text); }
.dd-seg button.active { background: var(--bg-card); color: var(--accent); box-shadow: 0 1px 3px rgba(16, 34, 56, 0.18); }
.dd-list.compact .dd-label { display: flex; align-items: baseline; gap: 8px; }
.dd-list.compact .dd-opt { padding: 5px 9px; }

/* "Use suggested overlays" switch under the Base layer / Overlays toggle */
.models-app .pick-option { display: flex; align-items: center; gap: 6px; padding: 2px 2px 2px 4px;
    font-size: 12.5px; font-weight: 600; color: var(--panel-fg); user-select: none; }
.models-app .pick-option > label { cursor: pointer; }
.models-app .pick-option .switch { transform: scale(0.9); transform-origin: right center; margin-left: auto; }
/* ? help button and its panel */
.models-app .help-btn { flex: none; width: 18px; height: 18px; padding: 0; border-radius: 50%; display: grid; place-items: center;
    border: 1.5px solid var(--muted); background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1;
    transition: background 0.12s, color 0.12s, border-color 0.12s; }
.models-app .help-btn:hover, .models-app .help-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.models-app .help-box { position: relative; margin: 2px 0 2px; padding: 8px 30px 8px 10px; border-radius: 8px;
    background: var(--accent-soft); color: var(--panel-fg); font-size: 12px; line-height: 1.45; }
.models-app .help-box p { margin: 0; }
.models-app .help-box p + p { margin-top: 5px; }
.models-app .help-close { position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; padding: 0; border: none; border-radius: 50%;
    background: transparent; color: var(--muted); font-size: 15px; line-height: 1; display: grid; place-items: center; }
.models-app .help-close:hover { background: var(--panel-bg); color: var(--panel-fg); }
/* The switch row and its help panel are one item of the menu's grid, so the closed panel adds no gap */
.models-app .help-wrap .help-box { margin: 6px 0 0; }

/* Settings form controls, copied from tropics.css (.setting-subrow, .cfg-name, .setting-select). Keep in sync. */
.setting-subrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 0 0.55rem 0.9rem;
    cursor: pointer;
    user-select: none;
}
.cfg-name {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font: inherit;
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
    border-radius: 7px;
}
.cfg-name:focus { outline: none; border-color: var(--accent); }
.setting-select {
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 0.85rem;
}
.cycle-format-custom { flex-direction: column; align-items: stretch; gap: 4px; cursor: default; }
.cycle-format-custom .cfg-name { width: 100%; box-sizing: border-box; }
#cycle-format { flex: none; max-width: 52%; }
.setting-subrow[hidden] { display: none; }
[data-theme="dark"] .modal { color-scheme: dark; }   /* native selects / inputs in the settings modal */

/* Model menu: a wide panel, one column per category with the models stacked as cards; the selected
   model has a light outline; a status dot per model and a status bar for the highlighted one */
.dd-list.columns { padding: 8px; display: flex; flex-direction: column; }
.dd-cols { display: grid; grid-template-columns: repeat(var(--dd-cols, 1), minmax(0, 1fr)); gap: 6px; align-items: start; }
.dd-col { display: grid; gap: 2px; min-width: 0; }
.dd-list.columns .dd-group { padding: 4px 8px 4px; border-bottom: 1px solid var(--border); margin-bottom: 3px; }
.dd-list.columns .dd-opt { align-items: flex-start; padding: 8px 9px; border: 1px solid transparent; }
.dd-list.columns .dd-opt.selected { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.dd-list.columns .dd-opt.selected.active { background: var(--accent-soft); }
.dd-list.columns .dd-opt.selected::after { content: none; }
.dd-list.columns .dd-sub { white-space: normal; }
/* Compact cards (150 px columns: app-tools.js colWidth); on narrow screens the model names only */
.dd-list.columns .dd-opt { gap: 6px; padding: 4px 7px; }
.dd-list.columns .dd-sub { font-size: 11px; line-height: 1.3; }
@media (max-width: 600px) {
  .dd-list.columns .dd-sub { display: none; }
  /* (one line per model: tight rows, the status dot centered on it) */
  .dd-list.columns .dd-opt { padding: 3px 7px; align-items: center; }
  .dd-list.columns .dd-opt .dd-status { margin-top: 0; }
  .dd-list.columns .dd-col { gap: 1px; }
  .dd-list.columns .dd-cols { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); row-gap: 6px; }   /* categories wrap: whole names */
}
/* Narrow screens (dropdown.js cascade, the Model menu): the window's width, the categories on the left, the open one's
   models beside them, each with its description and the cycle it opens on (app-cycles.js decorateModel) */
.dd-list.cascade { padding: 8px; display: flex; flex-direction: column; }
.dd-cascade { display: grid; grid-template-columns: minmax(104px, 36%) minmax(0, 1fr); gap: 8px; align-items: start; }
.dd-cats { display: grid; gap: 3px; position: sticky; top: 0; }
.dd-cat { display: flex; align-items: center; gap: 6px; padding: 9px 8px 9px 10px; border-radius: 7px; cursor: pointer; }
.dd-cat:hover { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.dd-cat.open { background: var(--accent-soft); }
.dd-cat.open .dd-main { color: var(--accent); }
.dd-cat svg { flex: none; width: 15px; height: 15px; color: var(--text-muted); transform: rotate(-90deg); }
.dd-cat.open svg { color: var(--accent); }
.dd-cat .dd-sub { font-size: 11px; }
.dd-submenu { display: grid; gap: 3px; min-width: 0; padding-left: 8px; border-left: 1px solid var(--border); }
.dd-list.cascade .dd-opt { align-items: flex-start; gap: 7px; padding: 7px 8px; border: 1px solid transparent; }
.dd-list.cascade .dd-opt.selected { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.dd-list.cascade .dd-opt.selected.active { background: var(--accent-soft); }
.dd-list.cascade .dd-opt.selected::after { content: none; }
.dd-list.cascade .dd-opt .dd-sub { white-space: normal; font-size: 11px; line-height: 1.3; }
.dd-list.cascade .dd-opt.cycle-miss { background: rgba(229, 72, 77, 0.10); border-color: rgba(229, 72, 77, 0.28); }
[data-theme="dark"] .dd-list.cascade .dd-opt.cycle-miss { background: rgba(255, 99, 104, 0.14); border-color: rgba(255, 99, 104, 0.32); }
.dd-cycle { margin-top: 2px; font-size: 11px; font-weight: 600; line-height: 1.3; color: var(--text); }
.dd-cycle.miss { color: #c62f35; }
[data-theme="dark"] .dd-cycle.miss { color: #ff8a8e; }
.dd-cycle[hidden] { display: none; }
.dd-status { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--border); }
.dd-status.ok { background: #2e9d57; }
.dd-status.partial { background: #e0a21b; }
.dd-status.bad { background: #d9534f; }
.dd-status.na { background: var(--text-muted); opacity: 0.5; }
.dd-status.loading { background: var(--border); animation: dd-pulse 1s ease-in-out infinite alternate; }
@keyframes dd-pulse { to { opacity: 0.35; } }
.dd-footer { display: grid; gap: 2px; margin-top: 8px; padding: 8px 10px 4px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted); }
.dd-foot-head { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 7px; }
.dd-footer .dd-status { margin-top: 0; }
.dd-footer b { color: var(--text); font-weight: 700; }
.dd-foot-sep { opacity: 0.7; }
.dd-foot-line { padding-left: 17px; color: var(--text); }   /* under the model name (past the dot) */

/* Layers: the empty base layer slot */
.models-app .layer-none { padding: 9px 10px; color: var(--muted); font-size: 12px; font-style: italic; }

/* Cycle menu + Trend loop button on one row; the trend slider below (hidden until it's on) */
.models-app .cycle-row { display: flex; align-items: stretch; gap: 6px; }
.models-app .cycle-row .dd { flex: 1; min-width: 0; }
.models-app .trend-btn[hidden] { display: none; }
/* Compare (app-cycles.js compare): cycles toggle, then a button per model */
.models-app .compare-box { display: grid; gap: 7px; }
/* Parameters while comparing: greyed out (app-cycles.js setCompare makes them inert) */
.models-app #suite.locked > :not(.pane-title):not(.suite-locked) { opacity: 0.45; filter: grayscale(0.4); pointer-events: none; }
.models-app .suite-locked { margin: 0; padding: 6px 9px; border-radius: 7px; background: var(--accent-soft); color: var(--panel-fg); font-size: 12px; }
.models-app .suite-locked[hidden] { display: none; }
.models-app .compare-box[hidden] { display: none; }
.models-app .compare-mode { justify-self: start; }
.models-app .compare-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
.models-app .compare-model { display: grid; gap: 1px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-bg);
    color: var(--panel-fg); text-align: left; font: inherit; cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.models-app .compare-model b { font-size: 13px; }
.models-app .compare-model span { font-size: 11px; color: var(--muted); }
.models-app .compare-model:hover, .models-app .compare-model:focus-visible { border-color: var(--accent); outline: none; }
.models-app .compare-model.shown { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }   /* on the map */
.models-app .compare-model.selected { background: var(--accent-soft); }
.models-app .compare-model.selected b { color: var(--accent); }
.models-app .compare-model.loading { opacity: 0.45; cursor: progress; border-color: var(--border); box-shadow: none; }   /* not preloaded yet */
.models-app .compare-model { touch-action: none; user-select: none; }   /* draggable (app-cycles.js dragCompareCard) */
.models-app .compare-model { cursor: grab; }
.models-app .compare-model.dragging { position: relative; z-index: 3; opacity: 0.95; cursor: grabbing; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }   /* as .layer-row.dragging */
.models-app .compare-hint { margin: 0 0 -2px; font-size: 11.5px; color: var(--muted); }
/* Eye: hide / show a model in the comparison (app-cycles.js toggleCompareHidden); hidden cards dimmed, dashed */
.models-app .compare-model { position: relative; }
.models-app .compare-model b { padding-right: 18px; }   /* room for the eye on the title line only */
.models-app .compare-model .cm-eye { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; padding: 2px; border: 0; border-radius: 5px;
    background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.models-app .compare-model .cm-eye svg { width: 15px; height: 15px; }
.models-app .compare-model .cm-eye:hover { color: var(--accent); background: var(--hover); }
.models-app .compare-model .cm-eye:disabled { opacity: 0.35; cursor: default; background: none; color: var(--muted); }
.models-app .compare-model.excluded { opacity: 0.5; border-style: dashed; background: none; cursor: grab; }
.models-app .compare-model.excluded b { color: var(--muted); text-decoration: line-through; }
.models-app .compare-model.excluded .cm-eye { opacity: 1; }
.models-app .compare-hint[hidden] { display: none; }
.models-app .trend-btn { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--panel-bg); color: var(--muted); font-size: 12px; font-weight: 600;
    white-space: nowrap; transition: background 0.12s, color 0.12s, border-color 0.12s; }
.models-app .trend-btn svg { width: 15px; height: 15px; }
.models-app .trend-btn:hover { color: var(--panel-fg); border-color: var(--accent); }
.models-app .trend-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.models-app .cycle-slider[hidden] { display: none; }
.models-app .trend-status { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.models-app .trend-status .cmp-finding { display: block; width: 20px; height: 20px; margin: 10px auto; }   /* (Compare: finding the models) */

/* Colorbars docked on the map's right edge (app-styles.js drawColorbars): columns of up to two stacked
   bars; each bar = (title, only with 2+ bars), then its sections on one axis (a plain fill = one
   section; precip type = Rain / Snow / Ice pellets / Freezing rain from the top), each with its color
   cells (low end at the bottom) and ticks. The map's controls move left of the dock (--bars-w).
   Narrow screens: horizontal bars along the bottom (--bars-h). */
.models-app { --bars-w: 0px; --bars-h: 0px; }
.models-app .maplibregl-ctrl-top-right { right: var(--bars-w); }
.models-app .maplibregl-ctrl-bottom-right { right: var(--bars-w); bottom: var(--bars-h); }
.models-app .maplibregl-ctrl-bottom-left { bottom: var(--bars-h); }
.models-app .cb-dock { position: absolute; z-index: 3; top: var(--title-h); right: 0; bottom: 0; box-sizing: border-box; display: flex; flex-direction: column;
    gap: 8px; padding: 10px 3px; background: var(--panel-bg); border-left: 1px solid var(--border); }
.models-app .cb-dock[hidden] { display: none; }
.models-app .cb-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--cb-cols, 1), auto);
    grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 14px 6px; }
.models-app .cb { display: flex; gap: 2px; min-height: 0; }
.models-app .cb-title { writing-mode: vertical-rl; transform: rotate(180deg); max-height: 100%; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; text-align: center; font-size: 11px; font-weight: 700; color: var(--panel-fg); }
/* Sections on one axis, the first (low end) at the bottom; gaps between precip types */
.models-app .cb-body { flex: 1; min-height: 0; display: flex; flex-direction: column-reverse; gap: 5px; }
.models-app .cb-sec { position: relative; min-height: 0; flex-basis: 0; display: flex; gap: 3px; }
.models-app .cb-secname { writing-mode: vertical-rl; transform: rotate(180deg); align-self: center; max-height: 100%; overflow: hidden;
    white-space: nowrap; font-size: 11.5px; font-weight: 700; color: var(--panel-fg); }
.models-app .cb-cells { width: 14px; display: flex; flex-direction: column-reverse; border: 1px solid var(--legend-edge); border-radius: 3px; overflow: hidden; }
.models-app .cb-cells span { flex: 1; min-height: 1px; }
/* (a bar of many colors: one image, a pixel per color, stretched with hard edges: app-styles.js drawColorbars) */
.models-app .cb-cells .cb-img { flex: 1; display: block; width: 100%; height: 100%; min-height: 0; min-width: 0; image-rendering: pixelated; }
.models-app .cb-ticks { position: relative; flex: none; width: var(--tw, 26px); }   /* --tw: widest label (app-styles.js fitColorbarTicks) */
.models-app .cb-ticks span { position: absolute; left: 0; bottom: var(--p); transform: translateY(50%); font-size: 11.5px; line-height: 1;
    color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.models-app .cb-ticks span:has(br) { line-height: 1.1; }   /* two-line labels (app-styles.js tickLines) */
.models-app .cb-ticks span[hidden] { display: none; }
.models-app .cb-keys { display: grid; gap: 4px; max-width: calc(var(--cb-cols, 1) * 80px); font-size: 10.5px; color: var(--muted); line-height: 1.25; }
.models-app .cb-key { display: flex; align-items: center; gap: 5px; }
.models-app .cb-swatch { flex: none; width: 18px; }
/* Narrow screens: one horizontal bar per row along the bottom of the map, sections left to right */
.models-app .cb-dock.horizontal { top: auto; left: 0; right: 0; bottom: 0; padding: 6px 12px 4px; gap: 4px; border-left: 0; border-top: 1px solid var(--border); }
.models-app .cb-dock.horizontal .cb-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: auto; gap: 6px; }
.models-app .cb-dock.horizontal .cb { flex-direction: column; gap: 2px; }
.models-app .cb-dock.horizontal .cb-title { writing-mode: horizontal-tb; transform: none; text-align: left; font-size: 10.5px; }
.models-app .cb-dock.horizontal .cb-body { flex-direction: row-reverse; gap: 4px; }
.models-app .cb-dock.horizontal .cb-sec { flex-direction: column; gap: 1px; min-width: 0; }
.models-app .cb-dock.horizontal .cb-secname { writing-mode: horizontal-tb; transform: none; align-self: flex-start; font-size: 11px; }
.models-app .cb-dock.horizontal .cb-cells { width: auto; height: 9px; flex-direction: row; }
.models-app .cb-dock.horizontal .cb-ticks { flex: none; width: auto; height: 13px; min-width: 0; }   /* the bar's full length (not the vertical label column's --tw) */
.models-app .cb-dock.horizontal .cb-ticks span { bottom: auto; top: 1px; left: var(--p); transform: translateX(calc(-50% + var(--shift, 0px))); font-size: 10.5px; }   /* (narrow screens: as before; wider: 11.5px)
.models-app .cb-dock.horizontal .cb-keys { max-width: none; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* Value Readout (section bar crosshair button; app-tools.js setupValueReadout): crosshair cursor over the
   map and a popup beside it with each shown variable's value, coordinates below */
.models-app.readout-on .maplibregl-canvas-container.maplibregl-interactive { cursor: crosshair; }
.models-app.readout-on .maplibregl-canvas-container.maplibregl-interactive:active { cursor: grabbing; }
.models-app .value-pop { position: absolute; top: 0; left: 0; z-index: 4; pointer-events: none; min-width: 120px; max-width: 260px;
    padding: 6px 9px 5px; border-radius: 8px; background: var(--panel-bg); color: var(--panel-fg); border: 1px solid var(--border);
    box-shadow: 0 4px 14px rgba(16, 34, 56, 0.18); font-size: 12px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.models-app .value-pop[hidden] { display: none; }
[data-theme="dark"] .models-app .value-pop { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); }
.models-app .vp-row { display: flex; justify-content: space-between; gap: 12px; white-space: nowrap; }
.models-app .vp-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.models-app .vp-val { font-weight: 700; }
.models-app .vp-none { color: var(--muted); }
.models-app .vp-coord { margin-top: 3px; font-size: 10.5px; color: var(--panel-fg); opacity: 0.55; }
/* Touch screens: a crosshair fixed at the map's center, the popup centered below it */
.models-app .vp-cross { position: absolute; top: 0; left: 0; z-index: 4; width: 40px; height: 40px; pointer-events: none; color: #111; }
.models-app .vp-cross[hidden] { display: none; }
.models-app .vp-cross svg { display: block; width: 100%; height: 100%; stroke: currentColor; }
.models-app .vp-cross .vp-halo { stroke: rgba(255, 255, 255, 0.9); }
[data-theme="dark"] .models-app .vp-cross { color: #f2f5f8; }
[data-theme="dark"] .models-app .vp-cross .vp-halo { stroke: rgba(0, 0, 0, 0.75); }
.models-app .value-pop.centered .vp-coord { text-align: center; }
/* The page font inside the map too (MapLibre's stylesheet sets Helvetica Neue / Arial on .maplibregl-map):
   the value readout popup, the attribution */
.models-app .maplibregl-map { font-family: inherit; }

/* Trend legend: Current Run / Previous Run line keys, bottom left of the map (app-styles.js drawTrendLegend) */
/* Exponents in units (util.js mathify): smaller and raised, a true minus; the ^ and the typed minus kept as hidden text */
.m-car, .m-neg { display: none; }
.m-sup { font-size: 0.7em; line-height: 0; vertical-align: 0.45em; }
.m-sup.m-negative::before { content: '\2212'; }
/* Compare: Single image | Two models, centered; the one picked under its own small section title */
.models-app .compare-kind { justify-self: center; }
.models-app .cmp-part { display: grid; gap: 7px; }
.models-app .cmp-part[hidden] { display: none; }
.models-app .cmp-head { margin: 2px -14px 2px; padding: 4px 14px; text-align: center; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; background: var(--sec-bg); color: var(--panel-fg); }
.models-app #cmp-side .compare-mode { justify-self: center; }
.models-app #cmp-side .compare-hint { margin: 4px 0; text-align: center; }
/* Compare > Two models (app-twomodel.js): the model pickers, then while comparing the Parameters' one list */
.models-app .mc-go, .models-app .mc-exit { height: 34px; border: 0; border-radius: 8px; color: #fff; font-weight: 700; font-size: 13.5px; letter-spacing: 0.01em;
    box-shadow: 0 1px 3px rgba(16, 34, 56, 0.25); cursor: pointer; }
.models-app .mc-go { background: var(--accent); }
.models-app .mc-go:hover { filter: brightness(1.08); }
.models-app .mc-exit { background: #a3201a; }
.models-app .mc-exit:hover { background: #8a1913; }
.models-app .mc-go:focus-visible, .models-app .mc-exit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.models-app .cb-end { flex: none; font-size: 10.5px; font-weight: 700; line-height: 1.15; color: var(--panel-fg); padding: 2px 0; }
.models-app .cb-ends { display: flex; justify-content: space-between; gap: 8px; }
.models-app .style-head .mc-show { transform: scale(0.8); transform-origin: right center; margin-left: auto; }
.models-app .style-item.mc-hidden .style-head { opacity: 0.75; }
.models-app .compare-kind { margin-bottom: 8px; }
.models-app .mc-pick { display: grid; gap: 8px; }
.models-app .mc-pick[hidden] { display: none; }
.models-app .mc-sel { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 13px; }
.models-app .mc-sel .dd { min-width: 0; }
.models-app .mc-go, .models-app .mc-exit { width: 100%; }
.models-app #suite.mc-mode #pick-mode, .models-app #suite.mc-mode .pick-option-block, .models-app #suite.mc-mode .pick-search { display: none; }
.models-app .mc-head { display: grid; gap: 2px; margin: 4px 2px 10px; font-size: 13px; }
.models-app .mc-head span, .models-app .mc-empty { color: var(--muted); font-size: 12px; }
.models-app .pick-row.mc-row { flex-direction: column; align-items: stretch; gap: 4px; padding-bottom: 4px; }
.models-app .mc-levels { flex-wrap: wrap; align-self: flex-start; margin-left: 8px; }
.models-app .mc-levels button { min-width: 38px; }
/* Bottom-left corner stack (app-styles.js mapCorner): the preload badge over the trend legend, all above the data credits
   line (the attribution, bottom left: --attrib-h) */
.models-app { --attrib-h: 20px; }
.models-app .map-corner { position: absolute; left: 10px; bottom: calc(6px + var(--attrib-h) + var(--bars-h)); z-index: 4; display: flex; flex-direction: column;
    align-items: flex-start; gap: 6px; pointer-events: none; }
.models-app .map-corner .loop-preload { padding: 4px 9px 4px 7px; border-radius: 8px; color: var(--panel-fg);
    background: color-mix(in srgb, var(--panel-bg) 72%, transparent); border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    box-shadow: 0 2px 8px rgba(16, 34, 56, 0.1); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
/* The base layer's credit (app-styles.js drawCredit; products.js credit): the corner stack's lowest line */
.models-app .map-corner .plot-credit { order: 99; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-style: italic; font-weight: 600;
    color: var(--panel-fg); background: color-mix(in srgb, var(--panel-bg) 72%, transparent); }
.models-app .map-corner .plot-credit[hidden] { display: none; }
/* SPC legend (app-overlays.js drawSpcLegend): the outlook shown and its categories */
.models-app .spc-legend { display: grid; gap: 8px; max-width: min(300px, 60vw); padding: 7px 10px; border-radius: 8px; background: var(--panel-bg);
    color: var(--panel-fg); border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(16, 34, 56, 0.12); font-size: 12px; line-height: 1.3; pointer-events: none; }
.models-app .spc-legend[hidden] { display: none; }
.models-app .spc-sec { display: grid; gap: 3px; }
.models-app .spc-head { font-weight: 700; }
.models-app .spc-issued { font-weight: 400; opacity: 0.6; }
.models-app .spc-row { display: flex; align-items: center; gap: 8px; }
.models-app .spc-none { opacity: 0.6; }
.models-app .spc-swatch { flex: none; width: 18px; height: 11px; border-radius: 2px; box-sizing: border-box; }
.models-app .trend-legend { display: grid; gap: 3px;
    padding: 6px 10px; border-radius: 8px; background: var(--panel-bg); color: var(--panel-fg); border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(16, 34, 56, 0.12); font-size: 12px; font-weight: 600; line-height: 1.3; pointer-events: none; }
.models-app .trend-legend[hidden] { display: none; }
.models-app .tl-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.models-app .tl-line { flex: none; width: 22px; height: 3px; border-radius: 2px; }
.models-app .tl-cycle { font-weight: 400; opacity: 0.55; margin-left: -4px; }   /* "(10/15 0z)" */

/* Map right-click menu, copied from tropics.css (.ctx-menu, .ctx-item). Keep in sync. */
.ctx-menu { position: fixed; z-index: 10000; min-width: 168px; padding: 4px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.ctx-menu[hidden] { display: none; }
.ctx-item { display: block; width: 100%; padding: 0.4rem 0.7rem; text-align: left; border: none; border-radius: 5px; background: none;
    color: var(--text); font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; }
.ctx-item:hover, .ctx-item:focus-visible { background: var(--accent-soft); outline: none; }
.ctx-item[hidden] { display: none; }

/* Save Animation dialog (app-export.js setupSaveAnimation), copied from tropics.css (#gif-modal, .gif-*,
   .dual-range, .trend-range-label, .field-label). Keep in sync. */
.anim-modal { width: min(400px, calc(100vw - 2rem)); }
#anim-modal .field-label { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-muted); margin: 0.25rem 0 0.5rem; }
#anim-modal .dual-range { position: relative; height: 26px; margin-bottom: 0.35rem; }
#anim-modal .dual-range .dual-track,
#anim-modal .dual-range .dual-fill { position: absolute; top: 50%; transform: translateY(-50%); height: 4px; border-radius: 2px; }
#anim-modal .dual-range .dual-track { left: 0; right: 0; background: var(--border); }
#anim-modal .dual-range .dual-fill { background: var(--accent); }
#anim-modal .dual-range input[type="range"] { position: absolute; inset: 0; width: 100%; margin: 0; background: none;
    -webkit-appearance: none; appearance: none; pointer-events: none; }
#anim-modal .dual-range input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px;
    border-radius: 50%; background: var(--bg-card); border: 2px solid var(--accent); pointer-events: auto; cursor: pointer; }
#anim-modal .dual-range input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--bg-card);
    border: 2px solid var(--accent); pointer-events: auto; cursor: pointer; }
#anim-modal .dual-range input[type="range"]::-moz-range-track { background: transparent; }
#anim-modal .dual-range input[type="range"]:disabled::-webkit-slider-thumb { border-color: var(--border); }
#anim-modal .dual-range input[type="range"]:disabled::-moz-range-thumb { border-color: var(--border); }
/* The range's first and last frame: forecast hour (or day) over its valid time, each end */
.anim-range-label { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.5rem; align-items: start; margin-top: 2px;
    font-size: 0.78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.anim-range-label .anim-end { display: grid; gap: 1px; }
.anim-range-label .anim-end:last-child { text-align: right; }
.anim-range-label .anim-lead { font-weight: 700; color: var(--text); font-size: 0.84rem; }
.anim-range-label .anim-dash { align-self: center; }
.anim-range-label .anim-msg { grid-column: 1 / -1; text-align: center; }
#anim-modal .gif-speed-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin: 1rem 0 0.4rem; font-size: 0.88rem; }
#anim-modal .gif-speed-row input[type="number"] { width: 92px; padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg); color: var(--text); font: inherit; }
#anim-modal .gif-speed-row[hidden] { display: none; }
#anim-modal .gif-speed-row + .gif-speed-row { margin-top: 0.5rem; }
#anim-modal .gif-speed-row select { width: auto; min-width: 8.5rem; }
#anim-modal .gif-estimate { font-size: 0.78rem; line-height: 1.4; margin: 0; color: var(--text); }
#anim-modal .gif-summary { margin-top: 0.9rem; padding: 0.6rem 0.75rem 0.7rem; background: #fffae6; border: 1px solid #eee2b4; border-radius: 8px; text-align: center; }
[data-theme="dark"] #anim-modal .gif-summary { background: #2f2b1c; border-color: #564d2c; }
#anim-modal .gif-estimate .gif-warn { color: #c0392b; }
[data-theme="dark"] #anim-modal .gif-estimate .gif-warn { color: #ff8a7a; }
#anim-modal .modal-actions { margin-top: 0.55rem; text-align: center; }
#anim-modal .modal-actions .btn { border: 1px solid; border-radius: 6px; padding: 0.45rem 1rem; font: inherit; font-weight: 600; cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease; }
#anim-modal .modal-actions .btn + .btn { margin-left: 0.5rem; }
#anim-modal .modal-actions .btn[hidden] { display: none; }
#anim-generate { background: #dbeafe; border-color: #6f9fdd; color: #1d4a86; }
#anim-generate:hover:not(:disabled) { background: #c7ddfb; border-color: #4f86d0; }
#anim-cancel { background: #fde2e2; border-color: #df8a8a; color: #8f2727; }
#anim-cancel:hover:not(:disabled) { background: #fbd0d0; border-color: #cf6a6a; }
[data-theme="dark"] #anim-generate { background: #1f3350; border-color: #5b8fd6; color: #cfe0fa; }
[data-theme="dark"] #anim-generate:hover:not(:disabled) { background: #26406a; border-color: #79a7e6; }
[data-theme="dark"] #anim-cancel { background: #472227; border-color: #c96b6b; color: #f7d2d2; }
[data-theme="dark"] #anim-cancel:hover:not(:disabled) { background: #5a2a30; border-color: #de8585; }
#anim-modal .modal-actions .btn:disabled { opacity: 0.55; cursor: default; }
#anim-modal .gif-progress { display: flex; align-items: center; gap: 0.6rem; margin: 0.6rem 0 0.2rem; }
#anim-modal .gif-progress[hidden] { display: none; }
#anim-modal .gif-progress-track { flex: 1; height: 7px; border-radius: 4px; background: var(--border); overflow: hidden; }
#anim-modal .gif-progress-bar { height: 100%; width: 0; background: var(--accent); transition: width 0.15s; }
#anim-modal .gif-progress-text { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }

/* Settings: a slider row (Loading > Check for new data; app-globe.js refreshSeconds) */
.setting-range-row { flex-wrap: wrap; }
.setting-range { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; width: 170px; }
.setting-range input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); }
.setting-range-val { flex: 0 0 34px; text-align: right; font-size: 0.82rem; font-variant-numeric: tabular-nums; color: var(--text); }

/* Measure Distance readout (app-tools.js setupRuler), copied from tropics.css (.maplibregl-popup-*, .map-tooltip,
   .ruler-tip). Keep in sync. */
.models-app .ruler-tip .maplibregl-popup-content { background: var(--bg-card); color: var(--text); border-radius: 10px;
    box-shadow: 0 4px 14px rgba(16, 34, 56, 0.18); padding: 0.4rem 0.65rem; font-family: inherit; font-size: 0.9rem; font-weight: 600; }
.models-app .ruler-tip .maplibregl-popup-tip { border-top-color: var(--bg-card) !important; border-bottom-color: var(--bg-card) !important; }
.models-app .map-tooltip, .models-app .map-tooltip * { pointer-events: none !important; }
/* the ruler's readout is clickable once a measurement is finished (clears it) */
.models-app .ruler-tip.ruler-done, .models-app .ruler-tip.ruler-done * { pointer-events: auto !important; cursor: pointer; }
.models-app .map-tooltip .tip-title { font-weight: 700; }
.models-app .map-tooltip .tip-sub { font-weight: 400; font-size: 0.85rem; color: var(--text-muted); }

/* Drawing toolbar (app-tools.js setupDraw), copied from tropics.css (.draw-toolbar, .draw-sym-opts, .draw-text-input).
   Keep in sync. Width is a slider here (line widths are sliders on this page). */
.draw-toolbar { position: absolute; top: calc(0.5rem + var(--title-h, 0px));   /* (below the plot title: app-tools.js updatePlotTitle) */
    left: 50%; transform: translateX(-50%); z-index: 12; display: flex; align-items: center;
    gap: 0.3rem; max-width: calc(100% - 1rem); flex-wrap: wrap; justify-content: center; padding: 0.3rem 0.45rem; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 4px 14px rgba(16, 34, 56, 0.18); font-family: inherit; }
.draw-toolbar[hidden] { display: none; }
/* Instant tooltips like the section-action buttons', centered under each button */
.draw-toolbar button[data-tip] { position: relative; }
.draw-toolbar button[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 0.32rem 0.55rem;
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    z-index: 200;
    transition: opacity 0.05s ease;
}
.draw-toolbar button[data-tip]:focus-visible::after { opacity: 1; }
@media (hover: hover) {
    .draw-toolbar button[data-tip]:hover::after { opacity: 1; }
}
.draw-toolbar button { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: none; border-radius: 8px;
    background: transparent; color: var(--text-muted); cursor: pointer; }
.draw-toolbar button svg { width: 16px; height: 16px; flex: none; }   /* padding 0: .models-app button's 4px 10px left a 10px box */
.draw-toolbar button:hover { background: var(--accent-soft); color: var(--text); }
.draw-toolbar button.active { background: var(--accent); color: #fff; }
.draw-toolbar .draw-sep { width: 1px; height: 20px; background: var(--border); }
.draw-sym-opts { flex-basis: 100%; display: flex; align-items: center; justify-content: center; gap: 0.3rem; margin-top: 0.15rem; padding-top: 0.3rem;
    border-top: 1px solid var(--border); }
.draw-sym-opts[hidden] { display: none; }
.draw-toolbar .draw-sym { font-family: inherit; font-size: 0.85rem; font-weight: 800; }
.draw-toolbar input[type="color"] { width: 26px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: transparent; cursor: pointer; }
.draw-toolbar select { width: auto; flex: none; padding: 0.2rem 0.3rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); color: var(--text);
    font: inherit; font-size: 0.78rem; }
.draw-toolbar input[type="range"] { width: 70px; min-width: 0; accent-color: var(--accent); }
.draw-op-val { font-size: 0.72rem; color: var(--text-muted); min-width: 2.6em; font-variant-numeric: tabular-nums; }
.models-app.drawing #map canvas { cursor: crosshair; }
.draw-text-input { position: absolute; z-index: 13; width: 160px; padding: 0.3rem 0.5rem; border: 1px solid var(--accent); border-radius: 8px;
    background: var(--bg-card); color: var(--text); font: inherit; font-size: 0.88rem; box-shadow: 0 4px 14px rgba(16, 34, 56, 0.18); }
.draw-text-input[hidden] { display: none; }

/* Colormap editor (app-styles.js openColormapEditor): mode, preview bars, the stops table, tools, the range ends.
   Outside .models-app: the site's own colors (--bg-card, --text, --text-muted, --border, --accent). */
.cmap-modal { width: min(560px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); display: flex; flex-direction: column; }
.cmap-modal .modal-head { flex: none; }
.cmap-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; gap: 14px; padding-top: 0.85rem; }
.cmap-sec { display: grid; gap: 8px; }
.cmap-sec[hidden] { display: none; }
.cmap-sec-title { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.cmap-hint { margin: 0; font-size: 12px; color: var(--text-muted); }
.cmap-note { margin: 0; font-size: 12px; color: #c0392b; }
[data-theme="dark"] .cmap-note { color: #ff8a80; }
.cmap-note[hidden] { display: none; }
.cmap-seg { display: inline-flex; justify-self: start; padding: 3px; gap: 3px; border-radius: 9px; background: var(--accent-soft); }
.cmap-seg button { height: 28px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--text-muted);
    font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.cmap-seg button:hover:not(.active) { color: var(--text); }
.cmap-seg button.active { background: var(--bg-card); color: var(--accent); box-shadow: 0 1px 3px rgba(16, 34, 56, 0.18); }
.cmap-prev { display: grid; gap: 2px; }
.cmap-prev-name { font-size: 11.5px; font-weight: 600; color: var(--text); }
.cmap-canvas { display: block; width: 100%; height: 40px; }
.cmap-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cmap-select { height: 28px; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); color: var(--text); font: inherit; font-size: 12px; }
.cmap-btn { height: 30px; padding: 0 12px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-card); color: var(--text);
    font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background 0.12s ease, border-color 0.12s ease; }
.cmap-btn:hover { border-color: var(--accent); }
.cmap-btn.cmap-small { height: 28px; padding: 0 10px; font-size: 12px; }
.cmap-btn.cmap-clear { border-color: #d93f36; background: #d93f36; color: #fff; }   /* (Clear all colors) */
.cmap-btn.cmap-clear:hover { border-color: #b8322a; background: #b8322a; }
/* Stops: value | one color per type | remove */
.cmap-table { display: grid; gap: 2px; min-width: max-content; }
.cmap-tablewrap { overflow-x: auto; min-width: 0; padding-bottom: 2px; }
.cmap-modal.cmap-wide { width: min(720px, calc(100vw - 2rem)); }
/* a row: drag handle | value | per colormap: swatch, hex | remove (one colormap: as wide as it needs, not the dialog) */
.cmap-row { display: grid; grid-template-columns: 14px 76px repeat(var(--ncol, 1), 40px 70px) 24px; gap: 4px 6px; align-items: center; border-radius: 6px; }
.cmap-single { justify-content: start; }
.cmap-single .cmap-row { grid-template-columns: 14px 84px 56px 76px 24px; }
/* Split colors (app-styles.js renderCmapEditor): a Split column; a split is one entry over two lines, Below then Above */
.cmap-splits .cmap-row { grid-template-columns: 14px 76px 52px repeat(var(--ncol, 1), 40px 70px) 24px; }
.cmap-splits.cmap-single .cmap-row { grid-template-columns: 14px 84px 52px 56px 76px 24px; }
.cmap-split { height: 22px; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px; background: #eef1f4; color: var(--text-muted);
  font: 600 11px Figtree, system-ui, sans-serif; cursor: pointer; }
.cmap-split:hover { border-color: var(--accent); color: var(--accent); }
.cmap-split.on { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] .cmap-split:not(.on) { background: #2b3542; border-color: #3a4656; color: #9fb0c2; }
.cmap-row.cmap-pair-a, .cmap-row.cmap-pair-b { background: var(--accent-soft); }
.cmap-row.cmap-pair-a { border-radius: 6px 6px 0 0; padding-top: 2px; }
.cmap-row.cmap-pair-b { border-radius: 0 0 6px 6px; padding-bottom: 2px; margin-top: -2px; }
.cmap-same { height: 24px; }
.cmap-hex { height: 24px; width: 100%; box-sizing: border-box; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); color: var(--text);
  font: 500 12px/22px Figtree, system-ui, sans-serif; font-variant-numeric: tabular-nums; text-transform: lowercase; }
.cmap-hex:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.cmap-head .cmap-hex-head { text-align: left; }
.cmap-grip { display: grid; place-items: center; height: 24px; color: var(--text-muted); cursor: grab; touch-action: none; border-radius: 4px; }
.cmap-grip:hover { color: var(--accent); background: var(--accent-soft); }
.cmap-grip svg { width: 8px; height: 13px; fill: currentColor; }
/* Dragging a color (app-styles.js cmapDrag): its handle, swatch and hex lifted over the rest, the values left in place */
.cmap-row.cmap-lifted .cmap-grip, .cmap-row.cmap-lifted .cmap-swatch, .cmap-row.cmap-lifted .cmap-hex { position: relative; z-index: 3; cursor: grabbing;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22); background: var(--bg-card); }
.cmap-row.cmap-lifted .cmap-grip { color: var(--accent); }
/* Mode: the three listed with what each does */
.cmap-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; align-items: stretch; }   /* (side by side, the same height) */
.cmap-mode { display: grid; grid-template-columns: 16px 1fr; grid-template-rows: auto 1fr; align-items: center; column-gap: 7px; row-gap: 3px; padding: 7px 10px 8px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.cmap-mode .cmap-mode-desc { grid-column: 1 / -1; align-self: start; line-height: 1.35; }
.cmap-mode:hover { border-color: var(--accent); }
.cmap-mode.active { border-color: var(--accent); background: var(--accent-soft); }
.cmap-mode-dot { width: 12px; height: 12px; border: 2px solid var(--text-muted); border-radius: 50%; box-sizing: border-box; align-self: center; }
.cmap-mode.active .cmap-mode-dot { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
.cmap-mode-name { font-size: 13px; font-weight: 700; white-space: nowrap; }
.cmap-mode.active .cmap-mode-name { color: var(--accent); }
.cmap-mode-desc { font-size: 12px; color: var(--text-muted); }
@media (max-width: 520px) { .cmap-modes { gap: 4px; } .cmap-mode { padding: 6px 7px; column-gap: 5px; } .cmap-mode-name { font-size: 12px; white-space: normal; } .cmap-mode-desc { font-size: 11px; } }
.cmap-head span { font-size: 10.5px; font-weight: 700; color: var(--text-muted); text-align: center; }
.cmap-head span:first-child { text-align: left; }
.cmap-num { height: 24px; width: 100%; box-sizing: border-box; padding: 0 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card);
    color: var(--text); font: inherit; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cmap-num:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.cmap-swatch { display: grid; place-items: center; height: 24px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); cursor: pointer; }
.cmap-swatch:hover { border-color: var(--accent); }
.cmap-swatch input[type=color] { width: calc(100% - 6px); height: 17px; padding: 0; border: 0; background: none; cursor: pointer; }
.cmap-swatch input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.cmap-swatch input[type=color]::-webkit-color-swatch { border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 4px; }
.cmap-swatch input[type=color]::-moz-color-swatch { border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 4px; }
.cmap-swatch input[type=color]:disabled { opacity: 0.35; cursor: default; }
/* Segmented: the last stop is the top (its colors are used only above it) */
.cmap-row.cmap-top .cmap-swatch { opacity: 0.45; }
.cmap-del { width: 24px; height: 24px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text-muted);
    font-size: 16px; line-height: 1; cursor: pointer; }
.cmap-del:hover:not(:disabled) { color: #d93f36; border-color: #e8a29d; background: #fdecea; }
.cmap-del:disabled { opacity: 0.3; cursor: default; }
.cmap-add { justify-self: start; }
.cmap-end { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.cmap-end .cmap-end-label { flex: 1; }
.cmap-end .cmap-swatch { width: 56px; }
.cmap-foot { flex: none; display: flex; align-items: center; gap: 8px; padding: 0.75rem 1.15rem; border-top: 1px solid var(--border); }
.cmap-foot-gap { flex: 1; }
.cmap-done { background: var(--accent); border-color: var(--accent); color: #fff; }
.cmap-done:hover { filter: brightness(1.08); }
.cmap-restore { color: var(--text-muted); }
/* The colormap library (Save, Load: app-styles.js cmapSaveDialog / cmapLoadDialog), and questions, over the editor */
.modal-backdrop.confirm-modal { z-index: 340; }
.cmap-sub .modal { width: min(420px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); display: flex; flex-direction: column; }
.cmap-sub .modal-body { overflow-y: auto; }
.cmap-sub-body { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-family: Figtree, system-ui, sans-serif; }
.cmap-sub-label { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.cmap-sub .cmap-name { height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-card); color: var(--text); font: 14px Figtree, system-ui, sans-serif; }
.cmap-sub .cmap-name:focus { outline: none; border-color: var(--accent); }
.cmap-lib { display: flex; flex-direction: column; gap: 4px; }
.cmap-lib-item { display: flex; align-items: center; gap: 4px; }
.cmap-lib-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px;
    background: var(--bg-card); color: var(--text); font: 13px Figtree, system-ui, sans-serif; text-align: left; cursor: pointer; }
.cmap-lib-row:hover { border-color: var(--accent); }
.cmap-strip { flex: none; width: 120px; height: 14px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); }
.cmap-lib-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmap-lib-del { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-card); color: var(--text-muted); cursor: pointer; }
.cmap-lib-del:hover { border-color: #d93f36; color: #d93f36; }
.cmap-lib-del svg { width: 16px; height: 16px; }
@media (max-width: 640px) { .cmap-foot { flex-wrap: wrap; } .cmap-strip { width: 80px; } }
/* Edit section: the Colormap row */
.models-app .style-cmap { display: flex; align-items: center; gap: 6px; min-width: 0; }
.models-app .style-badge { padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; white-space: nowrap; }
.models-app .style-cmap-btn { height: 26px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-bg); color: var(--panel-fg);
    font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.models-app .style-cmap-btn:hover { border-color: var(--accent); color: var(--accent); }

/* EPS member lows: the chip of a highlighted member track, with its X */
/* Model menu > HAFS-A: the storm modal (app-storms.js stormChooser): the on-map picker's storm buttons, in a column */
.models-app .storm-modal .modal { max-width: 420px; }
.models-app .storm-modal .modal:focus { outline: none; }
.models-app .storm-modal .modal.sc-wide { max-width: min(980px, 94vw); width: 100%; }
.models-app .storm-modal .sc-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0 0 14px; }
.models-app .storm-modal .sc-wide .sc-cols { grid-template-columns: 300px minmax(0, 1fr); height: min(460px, 60vh); }
.models-app .storm-modal .sp-list { grid-template-columns: minmax(0, 1fr); align-content: start; max-height: 50vh; overflow-y: auto; }
.models-app .storm-modal .sc-wide .sp-list { max-height: none; height: 100%; padding-right: 2px; }
.models-app .storm-modal .sc-map { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; min-height: 0; }
.models-app .sc-storm { grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 10px; }
.models-app .sc-storm.sc-hot { border-color: var(--accent); }
.models-app .sc-sym { display: grid; place-items: center; width: 30px; height: 30px; }
.models-app .sc-sym canvas { width: 26px; height: 26px; }
.models-app .sc-txt { display: grid; gap: 2px; min-width: 0; }
/* Storm datasets: the Storm Track and L Marker switches, top left of the map (app-storms.js stormTrackBtnSync) */
.models-app .storm-track-btn { position: absolute; left: 10px; top: calc(10px + var(--title-h)); z-index: 4; display: grid; gap: 5px;
  padding: 7px 12px 7px 9px; border-radius: 10px; background: var(--panel-bg); color: var(--panel-fg); border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(16, 34, 56, 0.18); font: 700 12px Figtree, system-ui, sans-serif; white-space: nowrap; }
.models-app .storm-track-btn[hidden] { display: none; }
.models-app .storm-track-btn .st-sw { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.models-app .storm-track-btn .switch { transform: scale(0.8); transform-origin: left center; margin-right: -7px; }
.models-app .ml-track-chip { position: absolute; left: 10px; top: calc(10px + var(--title-h)); z-index: 4; display: flex; align-items: center; gap: 6px;
  padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--panel-bg); color: var(--panel-fg); border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(16, 34, 56, 0.18); font-size: 12px; white-space: nowrap; }
.models-app .ml-track-chip::before { content: ''; width: 14px; height: 3px; border-radius: 2px; background: var(--trk, #c00000); box-shadow: 0 0 0 1px #fff; flex: none; }
/* The chips stacked on the map's top left (app-tracks.js trackChips): a tracked low's, then each Ensemble Track layer's */
.models-app .track-chips { position: absolute; left: 10px; top: calc(10px + var(--title-h)); z-index: 4; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  max-width: calc(100% - 80px); pointer-events: none; }
.models-app .track-chips > * { pointer-events: auto; }
.models-app .track-chips .ml-track-chip { position: static; }
.models-app .tg-chip .ml-track-img:disabled { opacity: 0.6; cursor: default; border-color: var(--border); color: var(--muted); }
/* Cluster comparison / analysis: no chips, no cluster tools on the map (their own box) */
.models-app.cluster-mode .track-chips, .models-app.cluster-ana .track-chips, .models-app.cluster-ana #lows-box-btn, .models-app.cluster-ana #cluster-cmp-btn { display: none; }
.models-app .ml-track-text b { font-weight: 700; }
.models-app .ml-track-x { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: var(--style-head); color: var(--muted); cursor: pointer; }
.models-app .ml-track-x:hover { background: var(--accent-soft); color: var(--accent); }
.models-app .ml-track-x svg { width: 12px; height: 12px; }

/* Ensemble track box tool: the box being drawn, and the note when it holds no lows */
.models-app .lows-box { position: absolute; z-index: 4; pointer-events: none; border: 1.5px dashed #c00000; background: rgba(192, 0, 0, 0.08); border-radius: 2px; }
/* A saved map's appearance shown (app-suite.js mapLookChip): its name, Keep, Revert */
.models-app .look-chip { position: absolute; top: calc(10px + var(--title-h)); left: 50%; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: 5px 6px 5px 12px; border-radius: 999px; background: var(--panel-bg); color: var(--panel-fg); border: 1px solid var(--accent); box-shadow: 0 4px 14px rgba(16, 34, 56, 0.18);
  font: 600 12.5px Figtree, system-ui, sans-serif; white-space: nowrap; max-width: calc(100% - 120px); }
.models-app .look-chip[hidden] { display: none; }
.models-app .look-chip .look-text { overflow: hidden; text-overflow: ellipsis; }
.models-app .look-chip button { flex: none; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-bg); color: var(--panel-fg); font: inherit; cursor: pointer; }
.models-app .look-chip .look-keep { background: var(--accent); border-color: var(--accent); color: #fff; }
.models-app .lows-box-toast { position: absolute; left: 50%; top: calc(12px + var(--title-h)); transform: translateX(-50%); z-index: 5; padding: 6px 12px; border-radius: 999px;
  background: var(--panel-bg); color: var(--panel-fg); border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(16, 34, 56, 0.18); font-size: 12px; }
/* Its button (and Compare clusters under it): pills in one column just left of the map's zoom buttons
   (inside their corner, so they follow them; a hidden one leaves no gap) */
.models-app .map-pills { position: absolute; top: 10px; right: calc(100% + 8px); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.models-app .lows-box-btn { pointer-events: auto; display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-bg); color: var(--panel-fg);
  box-shadow: 0 2px 8px rgba(16, 34, 56, 0.2); font: 600 12.5px Figtree, system-ui, sans-serif; white-space: nowrap; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s; }
.models-app .lows-box-btn svg { width: 20px; height: 20px; flex: none; color: #c00000; }
.models-app #cluster-cmp-btn svg { color: #0072B2; }
.models-app .lows-box-btn:hover { border-color: var(--accent); }
.models-app .lows-box-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.models-app .lows-box-btn.active svg { color: #fff; }
.models-app .lows-box-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.models-app .lows-box-btn[hidden] { display: none; }
@media (max-width: 640px) {
  .models-app .lows-box-btn { width: 38px; height: 38px; padding: 0; justify-content: center; }
  .models-app .lows-box-btn .lows-box-label { display: none; }
}
.models-app .lows-box-hint { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; padding: 3px 8px; border-radius: 6px; white-space: nowrap;
  background: var(--panel-bg); color: var(--panel-fg); border: 1px solid var(--border); box-shadow: 0 2px 6px rgba(16, 34, 56, 0.18); font-size: 11.5px; font-weight: 600; }
.models-app .lows-box-hint[hidden] { display: none; }

/* Ensemble track: Cyclone attributes button (Edit) and its draggable panel (MSLP chart) */
.models-app .tg-open-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-bottom: 4px; }
.models-app .tg-open-btn svg { width: 15px; height: 15px; }
.models-app .tg-panel { position: fixed; z-index: 60;   /* (inside the viewer's area: app-tracks.js floatBounds) */ width: min(480px, calc(100vw - 16px)); background: var(--panel-bg); color: var(--panel-fg);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 34, 56, 0.28); overflow: hidden; }
.models-app .tg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 12px; background: var(--style-head);
  border-bottom: 1px solid var(--border); cursor: move; user-select: none; touch-action: none; }
.models-app .tg-title { font-size: 13px; font-weight: 700; }
.models-app .tg-x { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.models-app .tg-x:hover { background: var(--accent-soft); color: var(--accent); }
.models-app .tg-x svg { width: 14px; height: 14px; }
.models-app .tg-body { padding: 10px 12px 10px; display: grid; gap: 8px; }
.models-app .tg-follow { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.models-app .tg-plot { position: relative; }
.models-app .tg-chart { width: 100%; height: 240px; display: block; cursor: crosshair; }
.models-app .tg-tip { position: absolute; z-index: 1; display: grid; grid-template-columns: auto auto; gap: 1px 10px; padding: 6px 9px; border-radius: 7px;
  background: var(--panel-bg); border: 1px solid var(--border); box-shadow: 0 3px 10px rgba(16, 34, 56, 0.2); font-size: 11.5px; pointer-events: none; white-space: nowrap; }
.models-app .tg-tip[hidden] { display: none; }
.models-app .tg-tip > b:first-child { grid-column: 1 / -1; margin-bottom: 2px; text-align: left; font-weight: 700; }
.models-app .tg-tip span { color: var(--muted); }
.models-app .tg-tip b { font-weight: 600; text-align: right; }
.models-app .tg-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--muted); }
.models-app .tg-legend span { display: inline-flex; align-items: center; gap: 6px; }
.models-app .tg-sw { display: inline-block; width: 16px; border-radius: 2px; }
.models-app .tg-sw-m { height: 1.5px; background: rgba(122, 20, 20, 0.55); }
.models-app .tg-sw-e { height: 3px; background: #c00000; }
.models-app .tg-now { margin-left: auto; color: var(--panel-fg); font-weight: 600; }

/* Ensemble track Edit: Cyclone attributes | Save cluster */
.models-app .tg-actions { display: grid; grid-template-columns: auto 1fr; gap: 6px; margin-bottom: 4px; }
.models-app .tg-actions .tg-open-btn { margin: 0; padding: 0 6px; gap: 5px; font-size: 12px; white-space: nowrap; min-width: 0; }
.models-app .tg-actions .tg-open-btn svg { width: 14px; height: 14px; flex: none; }
.models-app .tg-actions .tg-open-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.models-app .tg-actions .tg-open-btn:disabled { opacity: 0.75; cursor: default; color: var(--accent); }

/* Saved clusters (modal) */
.models-app .clusters-modal { width: min(560px, calc(100vw - 24px)); }
.models-app .cl-body { max-height: min(60vh, 520px); overflow: auto; padding: 6px 16px; }
.models-app .cl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.models-app .cl-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--layer-card); }
.models-app .cl-row.cl-off { opacity: 0.55; }
.models-app .cl-pick { flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; }
.models-app .cl-off .cl-pick { cursor: not-allowed; }
.models-app .cl-pick input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.models-app .cl-text { display: grid; min-width: 0; }
.models-app .cl-text b { font-size: 13px; }
.models-app .cl-text small { font-size: 11.5px; color: var(--muted); }
.models-app .cl-del { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.models-app .cl-del:hover { background: var(--accent-soft); color: #c00000; }
.models-app .cl-del svg { width: 16px; height: 16px; }
.models-app .cl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.models-app .cl-note { font-size: 12px; color: var(--muted); }
.models-app .cl-go, .models-app .cl-exit { height: 34px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: 600 13px Figtree, system-ui, sans-serif; cursor: pointer; flex: none; }
.models-app .cl-go:disabled { opacity: 0.45; cursor: default; }
.models-app .cl-go[hidden] { display: none; }

/* Cluster comparison: the legend on the map, its colors, and the Layers pane */
.models-app .cluster-legend { position: absolute; left: 10px; top: calc(10px + var(--title-h)); z-index: 4; display: grid; gap: 6px; padding: 10px 12px; border-radius: 10px;
  background: var(--panel-bg); color: var(--panel-fg); border: 1px solid var(--border); box-shadow: 0 2px 10px rgba(16, 34, 56, 0.2); font-size: 12.5px; }
.models-app .cl-leg-head { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.models-app .cl-leg-row { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.models-app .cl-swatch { width: 22px; height: 22px; padding: 0; border: 2px solid var(--panel-bg); border-radius: 50%; box-shadow: 0 0 0 1px var(--border); cursor: pointer; background: none; flex: none; }
.models-app .cl-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.models-app .cl-swatch::-webkit-color-swatch { border: 0; border-radius: 50%; }
.models-app .cl-swatch::-moz-color-swatch { border: 0; border-radius: 50%; }
.models-app .cluster-legend .cl-exit { height: 30px; margin-top: 2px; font-size: 12px; }
.models-app .cl-pane-rows { display: grid; gap: 8px; padding: 10px 2px; }
.models-app .cl-pane-style { padding: 10px 0; }
.models-app .cl-exit-wide { width: 100%; margin-top: 4px; }
/* Cluster analysis: the box on the map, the manager's head and buttons */
.models-app .cl-ana-name { font-size: 12.5px; }
.models-app .cl-ana-head { display: grid; gap: 2px; padding: 10px 2px 0; }
.models-app .cl-ana-head b { font-size: 14px; }
.models-app .cl-ana-head small { font-size: 12px; color: var(--muted); }
.models-app .cl-ana-acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 8px; }
.models-app .cl-ana-acts button:disabled { opacity: 0.55; cursor: default; }
#section-switch button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Time range (analyses with models.js `range`, e.g. MRMS): two thumbs on one track, the range between them filled */
.models-app .range-field[hidden] { display: none; }
.models-app .range2 { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.models-app .range2-track { position: relative; flex: 1; height: 22px; --a: 75%; --b: 100%; }
.models-app .range2-track::before { content: ''; position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--track, var(--border)) var(--a), var(--accent) var(--a), var(--accent) var(--b), var(--track, var(--border)) var(--b)); }
.models-app .range2-track input { position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.models-app .range2-track input::-webkit-slider-runnable-track { background: none; border: 0; }
.models-app .range2-track input::-moz-range-track { background: none; border: 0; }
.models-app .range2-track input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 16px; height: 16px; border-radius: 50%;
  background: var(--panel-bg, #fff); border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(16, 34, 56, 0.25); cursor: pointer; margin-top: 3px; }
.models-app .range2-track input::-moz-range-thumb { pointer-events: auto; width: 14px; height: 14px; border-radius: 50%;
  background: var(--panel-bg, #fff); border: 2px solid var(--accent); cursor: pointer; }
.models-app .range2-val { flex: none; min-width: 74px; font-size: 12px; font-weight: 600; text-align: right; }

/* Low track: Save Image on its chip, and the image panel */
.models-app .ml-track-img { height: 22px; padding: 0 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--style-head); color: var(--panel-fg);
  font: 600 11.5px Figtree, system-ui, sans-serif; cursor: pointer; }
.models-app .ml-track-img:hover { border-color: var(--accent); color: var(--accent); }
.models-app .ti-panel { width: auto; max-width: calc(100vw - 16px); }   /* (sized to the viewer's area: app-tracks.js fitTrackImage) */
.models-app .ti-panel { display: flex; flex-direction: column; }
.models-app .ti-panel .tg-head { flex: none; }
.models-app .ti-panel .tg-body { overflow-y: auto; min-height: 0; grid-auto-rows: max-content; }   /* (rows never squeezed) */   /* (only on the smallest areas: the map shrinks to fit first) */
.models-app .ti-titles { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; align-items: baseline; max-width: 100%; }   /* (title | Start, subtitle | End; as wide as the map: app-tracks.js fitTrackImage) */
.models-app .ti-title { font-size: 15px; font-weight: 700; line-height: 1.25; }   /* (as exported: not editable) */
.models-app .ti-sub { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.models-app .ti-start, .models-app .ti-end { font-size: 12.5px; color: var(--muted); line-height: 1.3; white-space: nowrap; text-align: right; }   /* (as .ti-sub) */
.models-app .ti-start { align-self: end; margin-bottom: -2px; }   /* (just above End, not level with the title) */
.models-app .ti-opt small { color: var(--muted); font-size: 11.5px; }
.models-app .ti-opt.off { opacity: 0.45; pointer-events: none; }
.models-app .ti-figure { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; width: fit-content; max-width: 100%; }
.models-app .ti-map { flex: none; }
.models-app .ti-cb { flex: none; display: block; }
.models-app .ti-cb[hidden] { display: none; }
.models-app .ti-opts { display: grid; gap: 8px; }
.models-app .ti-opt { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.models-app .ti-opt > span { width: 56px; color: var(--muted); font-weight: 600; }
.models-app .ti-color { width: 30px; height: 24px; padding: 0; border: 1px solid var(--border); border-radius: 5px; background: none; cursor: pointer; }
.models-app .ti-color:disabled, .models-app .ti-every:disabled { opacity: 0.4; cursor: default; }
.models-app .ti-every { flex: none; width: auto; height: 26px; border-radius: 6px; font-size: 12px; }
.models-app .ti-opt .style-seg { flex: none; }
/* Forecast Track's Color choices: one line, the switch across the card under its label */
.models-app .style-row.st-color-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.models-app .st-color-row .style-seg { display: flex; flex: 1; }
.models-app .st-color-row .style-seg button { flex: 1; white-space: nowrap; padding: 0 6px; }
.models-app .ti-opt .style-seg button { white-space: nowrap; }
.models-app .ti-foot { display: flex; justify-content: flex-end; }
/* Options beside the map (right); narrow windows: below it, in columns (app-tracks.js fitTrackImage) */
.models-app .ti-panel.side .tg-body { grid-template-columns: auto auto; column-gap: 14px; align-items: start; }
.models-app .ti-panel.side .ti-titles { grid-column: 1; grid-row: 1; }
.models-app .ti-panel.side .ti-figure { grid-column: 1; grid-row: 2 / span 2; }
.models-app .ti-panel.side .ti-opts { grid-column: 2; grid-row: 1 / span 2; }   /* (from the top, beside the titles) */
.models-app .ti-panel.side .ti-foot { grid-column: 2; grid-row: 3; align-self: end; }

/* Place search (app-tools.js setupPlaceSearch) and pins with their value box */
.models-app .place-search { position: fixed; z-index: 61; background: var(--panel-bg); color: var(--panel-fg); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 34, 56, 0.28); padding: 8px; box-sizing: border-box; font-family: Figtree, system-ui, sans-serif; }
.models-app .place-search[hidden] { display: none; }
.models-app .ps-input { width: 100%; box-sizing: border-box; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--panel-bg); color: var(--panel-fg); font: 500 13.5px Figtree, system-ui, sans-serif; }
/* (over the input and the marker button, what each is for) */
.models-app .ps-heads { display: flex; justify-content: space-between; margin: 0 2px 3px; font-size: 11px; font-weight: 600; color: var(--panel-fg); opacity: 0.55; }
.models-app .ps-row { display: flex; gap: 6px; }
.models-app .ps-row .ps-input { flex: 1; min-width: 0; }
.models-app .ps-pin { flex: none; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 7px;
  background: var(--panel-bg); color: var(--panel-fg); cursor: pointer; }
.models-app .ps-pin svg { width: 18px; height: 18px; }
.models-app .ps-pin:hover, .models-app .ps-pin.active { border-color: var(--accent); background: var(--accent-soft); }
/* Drop Marker's faint pin following the pointer */
.models-app .pin-ghost { opacity: 0.5; }
.models-app .ps-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.models-app .ps-list { display: grid; margin-top: 6px; max-height: 300px; overflow-y: auto; }
.models-app .ps-list:empty { display: none; }
.models-app .ps-item { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none;
  color: inherit; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.models-app .ps-item.sel { background: var(--accent-soft); }
.models-app .ps-name { font-weight: 700; white-space: nowrap; }
.models-app .ps-where { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.models-app .ps-none { padding: 6px 8px; color: var(--muted); font-size: 12.5px; }
.models-app .ps-note { margin-top: 6px; font-size: 10.5px; color: var(--muted); text-align: right; }
.models-app .ps-note a { color: inherit; }
.models-app .pin { display: flex; flex-direction: column; align-items: center; pointer-events: none; font-family: Figtree, system-ui, sans-serif; }
.models-app .pin-box { pointer-events: auto; cursor: default; margin-bottom: 4px; min-width: 90px; max-width: 240px; padding: 5px 8px 6px; border-radius: 8px;
  background: var(--panel-bg); color: var(--panel-fg); border: 1px solid var(--border); box-shadow: 0 4px 14px rgba(16, 34, 56, 0.25); font-size: 12px; }
[data-theme="dark"] .models-app .pin-box { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); }
.models-app .pin-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.models-app .pin-title { font-weight: 700; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.models-app .pin-x { flex: none; display: flex; width: 18px; height: 18px; padding: 2px; border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; }
.models-app .pin-x:hover { color: var(--panel-fg); background: var(--accent-soft); }
.models-app .pin-x svg { width: 100%; height: 100%; }
.models-app .pin-row { display: flex; justify-content: space-between; gap: 10px; white-space: nowrap; }
.models-app .pin-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.models-app .pin-val { font-weight: 700; }
.models-app .pin-mg { display: block; width: 100%; margin-top: 5px; height: 24px; padding: 0 8px; border: 1px solid var(--accent); border-radius: 6px;
  background: none; color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.models-app .pin-mg:hover { background: var(--accent-soft); }
.models-app .pin-mg[hidden] { display: none; }
.models-app .pin-mark { width: 22px; height: 29px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); }
.models-app .pin-mark path { fill: #d62f2f; stroke: #fff; stroke-width: 1.6; }
.models-app .pin-mark circle { fill: #fff; }

/* NWS warnings legend (app-overlays.js drawWarnLegend; laid out as SPC's) */
.models-app .warn-swatch { height: 3px; border-radius: 1px; box-shadow: 0 0 0 1px #000; }
.models-app .warn-count { margin-left: auto; padding-left: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Compare's model comparison table (app-cycles.js openCmpTable) */
.models-app .cmpt-panel { width: auto; min-width: 300px; max-width: min(560px, calc(100vw - 16px)); }
.models-app .cmpt-where { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 12.5px; }
.models-app .cmpt-sub { color: var(--muted); font-size: 12px; }
.models-app .cmpt-pin { height: 28px; border-radius: 6px; font: 600 12.5px Figtree, system-ui, sans-serif; }
.models-app .cmpt-scroll { max-height: min(420px, 60vh); overflow: auto; }
.models-app .cmpt-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.models-app .cmpt-table th { position: sticky; top: 0; background: var(--panel-bg); text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted);
  padding: 4px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.models-app .cmpt-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.models-app .cmpt-table tr:last-child td { border-bottom: 0; }
.models-app .cmpt-table tr.shown td { background: var(--accent-soft); }
.models-app .cmpt-model, .models-app .cmpt-val { font-weight: 700; }
.models-app .cmpt-none { color: var(--muted); text-align: center; }
.models-app .cmpt-sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.models-app .cmpt-sort:hover, .models-app .cmpt-sort.on { color: var(--accent); }
.models-app .cmpt-arrow { font-size: 10px; }

/* Save Animation while comparing: the models to save (app-export.js openAnimModal) */
#anim-modal .anim-models { display: grid; gap: 4px; margin-bottom: 0.6rem; max-height: 220px; overflow-y: auto; }
#anim-modal .anim-models[hidden], #anim-modal .dual-range[hidden] { display: none; }
#anim-modal .anim-model { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
#anim-modal .anim-model span { color: var(--text-muted); font-size: 12px; }

/* Station Weather's key (app-overlays.js drawObsLegend; laid out as SPC's) */
.models-app .obs-sec { grid-template-columns: 1fr 1fr; column-gap: 12px; }
.models-app .obs-sec .spc-head { grid-column: 1 / -1; }
.models-app .obs-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.6); }

/* Observed station hover and time series (app-panels.js openStationSeries) */
.models-app .vp-stn-id { font-weight: 700; font-size: 13px; }
.models-app .vp-stn-hint { font-size: 11px; font-weight: 400; opacity: 0.65; margin-top: 1px; }
.models-app .ss-panel { width: auto; max-width: calc(100vw - 16px); }
.models-app .ss-opts { display: grid; gap: 6px; }
.models-app .ss-opt { display: flex; align-items: center; gap: 10px; font-size: 12px; flex-wrap: wrap; }
.models-app .ss-opt > span { width: 76px; color: var(--muted); font-weight: 600; }
.models-app .ss-plot { position: relative; }
.models-app .ss-chart { display: block; }
.models-app .ss-note { font-size: 12px; color: var(--muted); }
.models-app .ss-note:empty { display: none; }
.models-app .ss-panel .tg-tip .ss-tip-row { display: flex; justify-content: space-between; gap: 14px; white-space: nowrap; }
.models-app .ss-panel .tg-tip .ss-tip-row span { opacity: 0.75; }
.models-app .ss-panel .tg-tip { display: block; grid-template-columns: none; min-width: 170px; }   /* (one variable a row, not the cyclone panel's grid) */
.models-app .ss-panel .tg-tip[hidden] { display: none; }   /* (hidden off the charts: the rule above would show it) */
.models-app .ss-panel .tg-tip > b { display: block; margin-bottom: 3px; }

/* Floating panels' layer (app-tracks.js floatLayer): the whole window, above the site header and the timeline; only
   the panels take the pointer */
.models-app.models-floats { position: fixed; inset: 0; top: 0; bottom: 0; z-index: 200; background: none; pointer-events: none; }
.models-app.models-floats > * { pointer-events: auto; }
.models-app .ti-opt input[type="range"] { width: 130px; accent-color: var(--accent); }
.models-app .ti-opt input[type="range"] + small { width: 46px; white-space: nowrap; }
.models-app .ti-sec { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted); }
.models-app .ti-sec:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.models-app .ti-group { display: grid; gap: 7px; padding: 8px 10px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--subtle); }
.models-app .ti-group .ti-sec { margin: 0 0 2px; padding: 0; border: 0; }
.models-app .ti-pairpart { display: inline-flex; align-items: center; gap: 10px; width: auto !important; color: inherit !important; font-weight: inherit !important; }
.models-app .ti-pairpart > span { width: 56px; color: var(--muted); font-weight: 600; }
.models-app .ti-pairpart + .ti-pairpart { margin-left: 14px; }
.models-app .ti-lbl2 { font-style: normal; color: var(--muted); font-weight: 600; white-space: nowrap; }
.models-app .ti-dotopt.off { opacity: 0.45; pointer-events: none; }

/* Dark theme: floating boxes stand off the dark map with a deeper, wider black shadow */
[data-theme="dark"] .models-app .tg-panel, [data-theme="dark"] .models-app .place-search { box-shadow: 0 14px 44px rgba(0, 0, 0, 0.75), 0 2px 8px rgba(0, 0, 0, 0.5); }
[data-theme="dark"] .models-app .value-pop, [data-theme="dark"] .models-app .pin-box { box-shadow: 0 8px 26px rgba(0, 0, 0, 0.7), 0 1px 4px rgba(0, 0, 0, 0.5); }
.models-app .ss-win .range2 { flex: 0 1 auto; }
.models-app .ss-win .range2-track { flex: none; width: 300px; }
.models-app .ss-win .range2-val { min-width: 0; text-align: left; font-weight: 600; }   /* (right after the slider) */
/* Save image: in the title bar, before the x */
.models-app .ss-panel .tg-head .ss-save, .models-app .xs-panel .tg-head .ss-save { margin-left: auto; margin-right: 4px; height: 26px; padding: 0 10px;
  border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: #fff; font: 600 12px Figtree, system-ui, sans-serif; cursor: pointer; }
.models-app .ss-panel .tg-head .ss-save:disabled, .models-app .xs-panel .tg-head .ss-save:disabled { opacity: 0.45; cursor: default; }
.models-app .ss-panel .tg-head .tg-title { margin-right: 10px; }
.models-app .ss-win[hidden] { display: none; }
.models-app .ss-panel .tg-tip { pointer-events: none; }   /* (the pointer stays over the chart: leaving it hides the popup) */
.models-app .ss-tog { height: 26px; padding: 0 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel-bg); color: var(--muted);
  font: 600 12px Figtree, system-ui, sans-serif; cursor: pointer; }
.models-app .ss-tog:hover { border-color: var(--accent); }
.models-app .ss-tog.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.models-app .ml-p-only { font-weight: 700; font-size: 13px; }
/* hatchOne layers' key (app-styles.js drawHatchLegend): one hatch swatch in the panel's ink */
.models-app .hatch-swatch { border: 1px solid var(--panel-fg); background: repeating-linear-gradient(-45deg, var(--panel-fg) 0 1px, transparent 1px 4px); }
/* Edit > Colormap (app-styles.js cmapControl): the menu as wide as its names, the button beside it while both fit, else
   on the next row across the whole width */
.models-app .cmap-pick { flex: 1; flex-wrap: wrap; }
.models-app .style-ctl .cmap-pick .cmap-pick-select { width: auto; flex: 100 1 auto; min-width: 0; max-width: 100%; font-family: Figtree, system-ui, sans-serif; }
.models-app .cmap-pick .style-cmap-btn { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.models-app .cmap-pick:has(select) .style-cmap-btn { flex: 1 1 auto; }
/* Colorbars beside the map (not narrow screens): slightly larger text, more room on the left */
@media (min-width: 861px) {
    .models-app .cb-dock:not(.horizontal) { padding-left: 8px; }
    .models-app .cb-dock:not(.horizontal) .cb-ticks span { font-size: 12.5px; }
    .models-app .cb-dock:not(.horizontal) .cb-title { font-size: 12px; }
    .models-app .cb-dock:not(.horizontal) .cb-secname { font-size: 12.5px; }
    .models-app .cb-dock:not(.horizontal) .cb-keys { font-size: 11.5px; }
}
/* Model menu status bar: the cycle the model opens on (app-cycles.js describeModel) */
.models-app .dd-foot-cycle, .dd-footer .dd-foot-cycle { font-weight: 600; white-space: nowrap; }
/* Model menu, "Match current cycle": a model without the cycle shown (it opens on the nearest one: app-cycles.js menuCycle) */
.dd-list.columns .dd-opt.cycle-miss { background: rgba(229, 72, 77, 0.10); border-color: rgba(229, 72, 77, 0.28); }
.dd-list.columns .dd-opt.cycle-miss.active { background: rgba(229, 72, 77, 0.17); }
[data-theme="dark"] .dd-list.columns .dd-opt.cycle-miss { background: rgba(255, 99, 104, 0.14); border-color: rgba(255, 99, 104, 0.32); }
.dd-footer .dd-foot-miss { padding: 1px 7px; border-radius: 999px; background: rgba(229, 72, 77, 0.12); color: #c62f35; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
[data-theme="dark"] .dd-footer .dd-foot-miss { color: #ff8a8e; background: rgba(255, 99, 104, 0.16); }
/* Settings: two-button toggles (app-cycles.js segToggle), and a row nested under the one above it (no rule between) */
.setting-seg { flex: none; display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); }
.setting-seg button { border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: 0.82rem; font-weight: 600;
    padding: 0.3rem 0.7rem; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.setting-seg button:hover { color: var(--text); }
.setting-seg button.active { background: var(--accent); color: #fff; }
.setting-group > .setting-row + .setting-row.setting-row-nested { border-top: 0; padding-top: 0; padding-left: 0.9rem; }
.setting-group > .setting-row-nested[hidden] { display: none; }
.setting-subrow + .setting-row { border-top: 1px solid var(--border); padding-top: 0.35rem; }   /* (a hidden custom-format row between two rows) */
.setting-subrow + .setting-group { border-top: 1px solid var(--border); padding-top: 0.35rem; }   /* (the same, before a group: Always Show Latest Run) */
#valid-format { flex: none; max-width: 52%; }
.models-app .issued-note { font-size: 12px; font-weight: 600; color: var(--panel-fg); }
.models-app .issued-note[hidden] { display: none; }
/* Settings: a row with its control beside the name and the description the full width below */
.setting-row-stack { flex-direction: column; align-items: stretch; gap: 0.3rem; }
.setting-row-stack .setting-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
/* Settings: labeled sliders under a stacked row's description (Global Wind Barb Settings) */
.setting-group + .setting-row-stack { border-top: 1px solid var(--border); padding-top: 0.35rem; }
/* Global Wind Barb Settings: a light card of labeled sliders (the Edit cards' slider: a filled track, round thumb,
   the value in a pill; the settings modal is outside .models-app, so its own rules) */
.bs-card { display: grid; gap: 0.15rem; margin-top: 0.15rem; padding: 0.45rem 0.75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.bs-row { display: grid; grid-template-columns: 4.6rem 1fr 3.2rem; align-items: center; gap: 0.75rem; padding: 0.2rem 0; cursor: pointer; }
.bs-name { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.bs-val { justify-self: end; min-width: 3rem; padding: 3px 6px; box-sizing: border-box; border-radius: 6px; background: var(--accent-soft);
    text-align: center; font-size: 0.76rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.bs-range { width: 100%; height: 18px; margin: 0; padding: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; --p: 50%; }
.bs-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--p), var(--border) var(--p)); }
.bs-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 15px; height: 15px; margin-top: -5.5px; border-radius: 50%;
    background: var(--bg-card, #fff); border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(16, 34, 56, 0.25); transition: transform 0.1s ease; }
.bs-range:hover::-webkit-slider-thumb, .bs-range:active::-webkit-slider-thumb { transform: scale(1.15); }
.bs-range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--border); }
.bs-range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
.bs-range::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; background: var(--bg-card, #fff); border: 2px solid var(--accent); }
.bs-range:focus { outline: none; }
.bs-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent-soft); }
/* Yes / Cancel question (app-suite.js confirmDialog) */
.confirm-modal .confirm-text { margin: 0.2rem 0 1rem; font-size: 0.9rem; line-height: 1.45; color: var(--text); font-family: Figtree, system-ui, sans-serif; }
.confirm-modal .confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
/* Meteogram controls, compact (app-panels.js stationSeriesOptions): lines of groups, each a small caption and its buttons */
.models-app .ss-panel .tg-body { gap: 6px; padding-top: 8px; }
/* (a short viewer area: the charts shrink to half height, then the body scrolls under the fixed title bar) */
.models-app .ss-panel { display: flex; flex-direction: column; max-height: calc(100vh - 16px); }
.models-app .ss-panel .tg-head { flex: none; }
.models-app .ss-panel .tg-body { overflow-y: auto; overflow-x: hidden; min-height: 0; grid-auto-rows: max-content; }
.models-app .ss-opts { gap: 5px; }
.models-app .ss-line { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 18px; }
.models-app .ss-grp { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.models-app .ss-cap { width: auto !important; margin-right: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.models-app .ss-panel .style-seg button { padding: 0 9px; font-size: 11.5px; }
.models-app .ss-tog { height: 24px; padding: 0 10px; font-size: 11.5px; }
.models-app .ss-opt.ss-win { gap: 8px; font-size: 11.5px; }
.models-app .ss-win .range2-track { width: 260px; }
.models-app .ss-line > .ss-grp:first-child > .ss-cap, .models-app .ss-win > .ss-cap { min-width: 54px; }   /* (the first captions in one column) */
/* Highlighted menu sections (products.js highlightSections, e.g. Specialty Plots): a warm tint of their own */
.models-app .pick-group.hl-amber { --hl-bg: #fdf0d5; --hl-bg-hover: #fbe5b8; --hl-fg: #8a5300; --hl-open: #f9dc9f; }
[data-theme="dark"] .models-app .pick-group.hl-amber { --hl-bg: #3a2e14; --hl-bg-hover: #4a3a17; --hl-fg: #f3c56b; --hl-open: #54411a; }
.models-app .pick-group.hl-blue { --hl-bg: #dcebfb; --hl-bg-hover: #cbe1f8; --hl-fg: #17508f; --hl-open: #bcd7f5; }
[data-theme="dark"] .models-app .pick-group.hl-blue { --hl-bg: #14263d; --hl-bg-hover: #1a3150; --hl-fg: #8ec2f5; --hl-open: #1f3a5e; }
.models-app .pick-group.highlight > .pick-group-head { background: var(--hl-bg); color: var(--hl-fg); }
.models-app .pick-group.highlight > .pick-group-head:hover { background: var(--hl-bg-hover); }
.models-app .pick-group.highlight.open > .pick-group-head { background: var(--hl-open); color: var(--hl-fg); }
.models-app .pick-group.highlight.open > .pick-group-head::before { border-color: var(--hl-fg); }
/* Low Track Analysis: options below the map (narrow windows) in columns, filling the width */
.models-app .ti-panel:not(.side) .ti-opts { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); column-gap: 18px; align-items: start; }
/* Storm-Centered View: the bar at the map's top left while on: what it is, the storm and its pressure, Exit; then its
   tools: the track shown or not, Track Image, Vertical Diagnostics */
.models-app .storm-bar { position: absolute; top: calc(10px + var(--title-h)); left: 10px; z-index: 5; display: grid; gap: 7px; padding: 8px 10px 9px 12px;
  max-width: calc(100% - 80px); border-radius: 12px; background: var(--panel-bg); color: var(--panel-fg); border: 1px solid var(--accent);
  box-shadow: 0 4px 14px rgba(16, 34, 56, 0.25); font: 600 12.5px Figtree, system-ui, sans-serif; }
.models-app .storm-bar[hidden] { display: none; }
[data-theme="dark"] .models-app .storm-bar { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6); }
.models-app .storm-bar .sv-head { display: flex; align-items: center; gap: 12px; }
.models-app .storm-bar .sv-title { display: grid; gap: 1px; min-width: 0; }
.models-app .storm-bar .sv-title small { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.models-app .storm-bar .sv-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.models-app .storm-bar .sv-now { margin-left: auto; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.models-app .storm-bar .sv-exit { height: 26px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; cursor: pointer; }
.models-app .storm-bar .sv-tools { display: flex; align-items: center; gap: 6px; padding-top: 7px; border-top: 1px solid var(--border); }
.models-app .storm-bar .sv-trk { display: inline-flex; align-items: center; gap: 7px; margin-right: 4px; font-size: 11.5px; cursor: pointer; white-space: nowrap; }
.models-app .storm-bar .sv-tool { height: 26px; padding: 0 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel-bg);
  color: var(--panel-fg); font: 600 11.5px Figtree, system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.models-app .storm-bar .sv-tool:hover { border-color: var(--accent); }
.models-app .storm-bar .sv-tool.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.models-app .storm-bar .sv-more { display: none; }
/* Narrow maps: compact: the storm, its pressure and Exit; under them Analysis options, opening the tools (app-tracks.js) */
@media (max-width: 720px) {
  .models-app .storm-bar { left: 8px; top: calc(8px + var(--title-h)); max-width: calc(100% - 60px); gap: 0; padding: 5px 7px 4px 10px; border-radius: 10px; }
  .models-app .storm-bar .sv-head { gap: 8px; }
  .models-app .storm-bar .sv-title small { display: none; }
  .models-app .storm-bar .sv-name { font-size: 12.5px; }
  .models-app .storm-bar .sv-now { font-size: 12px; }
  .models-app .storm-bar .sv-exit { height: 24px; padding: 0 11px; }
  .models-app .storm-bar .sv-more { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; margin-top: 5px; padding: 5px 0 2px;
    border: 0; border-top: 1px solid var(--border); background: none; color: var(--accent); font: 700 11.5px Figtree, system-ui, sans-serif; cursor: pointer; }
  .models-app .storm-bar .sv-more svg { width: 14px; height: 14px; transition: transform 0.15s; }
  .models-app .storm-bar.tools-open .sv-more svg { transform: rotate(180deg); }
  .models-app .storm-bar .sv-tools { display: none; flex-wrap: wrap; row-gap: 6px; margin-top: 4px; padding: 0 0 3px; border-top: 0; }
  .models-app .storm-bar.tools-open .sv-tools { display: flex; }
}
/* Storm-Centered View: the Model and Cycle menus, Compare and Trend loop locked (app-tracks.js stormLock) */
.models-app .dd-btn:disabled, .models-app #compare-btn:disabled, .models-app #trend-btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* Storm-Centered View, map rotated (Vertical Diagnostics > Map orientation): the rotated frame's x = 0 and y = 0 lines
   through the storm's center (app-tracks.js svAxes) */
/* Cross section, placing A: a faint A dot following the cursor (app-panels.js xsectGhost) */
.models-app .xs-ghost { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px;
  border-radius: 50%; background: rgba(224, 27, 27, 0.5); border: 2px solid rgba(255, 255, 255, 0.75); box-sizing: border-box; }
.models-app .xs-ghost[hidden] { display: none; }
.models-app .xs-ghost span { position: absolute; left: 50%; bottom: 13px; transform: translateX(-50%); font: 700 17px Figtree, system-ui, sans-serif;
  color: rgba(17, 17, 17, 0.55); text-shadow: 0 0 2px rgba(255, 255, 255, 0.9), 0 0 3px rgba(255, 255, 255, 0.9); }
.models-app .sv-axes { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; overflow: visible;
  filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.95)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25)); }
.models-app .sv-axes[hidden] { display: none; }
.models-app .sv-axes line { stroke: #000; stroke-width: 1.4; stroke-dasharray: 7 5; }
/* Vertical Diagnostics popup (app-tracks.js vdiagBuild): the skew-T with the numbers beside it */
.models-app .vd-panel { width: auto; max-width: calc(100vw - 16px); }
.models-app .vd-panel[hidden] { display: none; }
.models-app .vd-panel .tg-head { gap: 10px; }
.models-app .vd-radius { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; }
.models-app .vd-radius > span { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.models-app .vd-radius input { width: 110px; accent-color: var(--accent); }
.models-app .vd-radius b { min-width: 46px; font-variant-numeric: tabular-nums; }
.models-app .vd-body { gap: 4px; padding-top: 6px; }
.models-app .vd-sub { font-size: 11px; color: var(--muted); }
.models-app .vd-main { display: flex; gap: 10px; align-items: stretch; }
.models-app .vd-plot { position: relative; flex: none; width: 330px; height: min(470px, calc(100vh - 230px)); min-height: 280px; }
.models-app .vd-canvas { position: absolute; inset: 0; display: block; touch-action: none; }
.models-app .vd-note { position: absolute; top: 40%; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); pointer-events: none; }
.models-app .vd-side { flex: none; width: 168px; display: flex; flex-direction: column; gap: 8px; }
.models-app .vd-stats { display: grid; align-content: start; gap: 2px; font-size: 11.5px; }
.models-app .vd-orient { margin-top: auto; display: grid; gap: 4px; }   /* (the lower right) */
.models-app .vd-orient-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.models-app .vd-orient-btns button { height: 24px; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-bg); color: var(--panel-fg);
  font: 600 11px Figtree, system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.models-app .vd-orient-btns button:hover { border-color: var(--accent); }
.models-app .vd-orient-btns button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.models-app .vd-sec { margin-top: 6px; padding-bottom: 1px; border-bottom: 1px solid var(--border); font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted); }
.models-app .vd-sec:first-child { margin-top: 0; }
.models-app .vd-row { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
.models-app .vd-row span { color: var(--muted); }
.models-app .vd-row b { font-weight: 700; font-variant-numeric: tabular-nums; }
.models-app .vd-legend { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 10.5px; color: var(--muted); }
.models-app .vd-legend span { display: inline-flex; align-items: center; gap: 4px; }
.models-app .vd-legend i { display: inline-block; width: 13px; height: 3px; border-radius: 2px; }
.models-app .vd-legend .vd-t { background: #d62f2f; }
.models-app .vd-legend .vd-td { background: #1a9a3a; }
.models-app .vd-legend .vd-pc { background: repeating-linear-gradient(90deg, var(--panel-fg) 0 4px, transparent 4px 6px); }
.models-app .vd-legend .vd-cape { height: 9px; background: rgba(220, 40, 40, 0.35); }
.models-app .vd-legend .vd-cin { height: 9px; background: rgba(40, 90, 220, 0.3); }
.models-app .vd-legend .vd-lay { height: 9px; background: rgba(40, 110, 220, 0.12); border-top: 1.5px solid #1565c0; border-bottom: 1.5px solid #1565c0; }
@media (max-width: 600px) { .models-app .vd-main { flex-direction: column; } .models-app .vd-plot { width: min(330px, calc(100vw - 40px)); }
  .models-app .vd-side { width: auto; } .models-app .vd-stats { grid-template-columns: 1fr 1fr; column-gap: 14px; } }
.models-app .ml-track-chip[hidden] { display: none; }   /* (Storm-Centered View: the bar names the storm) */
.models-app .vd-row b { display: inline-flex; align-items: center; gap: 4px; }
.models-app .vd-arrow { width: 13px; height: 13px; flex: none; fill: none; stroke: var(--panel-fg); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.models-app .vd-orient-btns button:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* (an odd last button: the full width) */
/* Storm datasets (HAFS-A): the storm buttons over the map (app-storms.js stormPickerShow) */
.models-app .storm-pick { position: absolute; top: calc(12px + var(--title-h)); left: 50%; transform: translateX(-50%); z-index: 6; width: min(560px, calc(100% - 24px)); box-sizing: border-box;
  padding: 10px 12px 12px; border-radius: 12px; background: var(--panel-bg); color: var(--panel-fg); border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(16, 34, 56, 0.28); font-family: Figtree, system-ui, sans-serif; }
[data-theme="dark"] .models-app .storm-pick { box-shadow: 0 14px 44px rgba(0, 0, 0, 0.75); }
.models-app .storm-pick[hidden] { display: none; }
.models-app .sp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13.5px; }
.models-app .sp-head span { color: var(--muted); font-size: 12px; }
.models-app .sp-x { margin-left: auto; display: flex; width: 22px; height: 22px; padding: 3px; border: 0; border-radius: 5px; background: none; color: var(--muted); cursor: pointer; }
.models-app .sp-x:hover { color: var(--panel-fg); background: var(--accent-soft); }
.models-app .sp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.models-app .sp-storm { display: grid; gap: 2px; text-align: left; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-bg);
  color: var(--panel-fg); font: inherit; cursor: pointer; }
.models-app .sp-storm:hover { border-color: var(--accent); }
.models-app .sp-storm.active { border-color: var(--accent); background: var(--accent-soft); }
.models-app .sp-storm b { font-size: 13px; }
.models-app .sp-storm span { font-size: 11px; color: var(--muted); }

/* Link to This View's panel, under its button (app-cycles.js linkPop): Short / Full, what it is, Copy and Turn off */
.models-app .link-pop { position: fixed; z-index: 250; width: 250px; display: grid; gap: 8px; padding: 10px 12px 12px; border-radius: 12px;
  background: var(--panel-bg); color: var(--panel-fg); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(16, 34, 56, 0.22);
  font: 600 12.5px Figtree, system-ui, sans-serif; pointer-events: auto; }
.models-app .link-pop[hidden] { display: none; }
.models-app .link-pop .lp-head { font-size: 13px; font-weight: 700; }
.models-app .link-pop .lp-mode { display: flex; }
.models-app .link-pop .lp-mode button { flex: 1; }
.models-app .link-pop .lp-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.models-app .link-pop .lp-desc { font-size: 11.5px; font-weight: 500; color: var(--muted); line-height: 1.35; }
.models-app .link-pop .lp-actions { display: flex; gap: 6px; }
.models-app .link-pop .lp-actions button { flex: 1; height: 28px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-bg);
  color: var(--panel-fg); font: inherit; font-size: 12px; cursor: pointer; }

.models-app .link-pop .lp-actions button:hover { border-color: var(--accent); }
.models-app .link-pop .lp-actions .lp-copy { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Low track image: a dot's popup (app-storms.js openTrackImage) */
.models-app .ti-tip { position: absolute; z-index: 3; display: grid; grid-template-columns: none; gap: 1px; pointer-events: none; white-space: nowrap; }
.models-app .ti-tip[hidden] { display: none; }
.models-app .ti-opt[hidden] { display: none; }   /* (e.g. SST opacity while Ocean is None) */

/* Cross section (app-panels.js setupCrossSection): the chooser beside B, and the panel */
.models-app .xs-pop { position: absolute; z-index: 40; padding: 8px 10px 10px; border-radius: 10px; background: var(--panel-bg); color: var(--panel-fg);
  border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(16, 34, 56, 0.28); font-family: Figtree, system-ui, sans-serif; font-size: 13px; }
[data-theme="dark"] .models-app .xs-pop { box-shadow: 0 8px 26px rgba(0, 0, 0, 0.7); }
.models-app .xs-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-weight: 700; white-space: nowrap; }
.models-app .xs-x { display: grid; place-items: center; width: 22px; height: 22px; padding: 3px; border: 0; border-radius: 5px; background: none; color: var(--muted); cursor: pointer; }
.models-app .xs-x:hover { color: var(--panel-fg); background: var(--accent-soft); }
.models-app .xs-x svg { width: 100%; height: 100%; }
.models-app .xs-pop-row { display: flex; gap: 6px; }
.models-app .xs-sel { height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-bg); color: var(--panel-fg); font: inherit; }
.models-app .xs-go { height: 30px; padding: 0 12px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.models-app .xs-panel { width: auto; max-width: calc(100vw - 16px); display: flex; flex-direction: column; max-height: calc(100vh - 16px); }
.models-app .xs-panel .tg-head { flex: none; }
.models-app .xs-panel .tg-body { overflow-y: auto; overflow-x: hidden; min-height: 0; grid-auto-rows: max-content; gap: 6px; }
.models-app .xs-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }   /* (the title block centered on the map's height) */
.models-app .xs-left { flex: none; display: grid; gap: 4px; min-width: 0; justify-items: start; }   /* (the map takes the rest of the row) */
/* Storm-Centered View's section: the radius and the direction it is normal to (app-panels.js xsStorm) */
.models-app .xs-storm { display: grid; gap: 6px; margin-top: 6px; justify-items: start; }
.models-app .xs-storm[hidden] { display: none; }
.models-app .xs-storm .xs-radius { margin-left: 0; }
.models-app .xs-storm .xs-radius input { width: 150px; }
.models-app .xs-align { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.models-app .xs-wind .xs-cap, .models-app .xs-align .xs-cap { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.models-app .xs-title { font-size: 15px; font-weight: 700; }
.models-app .xs-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; white-space: pre-line; }   /* (a storm's section: a second line) */
/* (its right edge at the colorbar's: --xs-inset-mr, app-panels.js drawCrossSection) */
.models-app .xs-inset { flex: none; width: calc(300px - var(--xs-inset-mr, 0px)); margin-right: var(--xs-inset-mr, 0px); height: 146px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
@media (max-width: 640px) { .models-app .xs-top { flex-wrap: wrap; } .models-app .xs-inset { width: calc(100% - var(--xs-inset-mr, 0px)); } }
.models-app .xs-plot { position: relative; }
/* Narrow windows: every floating panel a modal (app-tracks.js syncPanelModals): the window's width (the track image
   sizes itself: app-tracks.js fitTrackImage), its body scrolled, not dragged, over a backdrop that closes it */
.models-app .tg-backdrop { position: fixed; inset: 0; z-index: 59; background: rgba(0, 0, 0, 0.5); }
.models-app .tg-backdrop[hidden] { display: none; }
.models-app .tg-panel.tg-modal { display: flex; flex-direction: column; max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.4); }
.models-app .tg-panel.tg-modal[hidden] { display: none; }
.models-app .tg-panel.tg-modal:not(.ti-panel):not(.xs-panel):not(.ss-big) { left: 8px !important; top: 8px !important; right: 8px; width: auto; min-width: 0; max-width: none; }
.models-app .tg-modal .tg-head { flex: none; cursor: default; }
.models-app .tg-modal .tg-head .ss-save { flex: none; white-space: nowrap; }   /* (the title wraps instead) */
.models-app .tg-modal .tg-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; grid-auto-rows: max-content; }
.models-app .tg-modal .cmpt-scroll { max-height: none; }   /* (the panel's body scrolls instead) */
.models-app .tg-modal .ss-win .range2 { flex: 1 1 100%; flex-wrap: wrap; row-gap: 2px; }   /* (the meteogram's window: the slider the panel's width, its times under it) */
.models-app .tg-modal .ss-win .range2-track { flex: 1 1 100%; width: auto; }
.models-app .tg-modal .vd-main { flex-direction: column; }
.models-app .tg-modal .vd-plot { width: 100%; }   /* (the vertical profile: the panel's width) */
/* The cross section's modal: the window's height; the section zoomed within its box */
.models-app .xs-panel.xs-modal { left: 8px !important; top: 8px !important; right: 8px; bottom: 8px; width: auto; max-width: none; max-height: none;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.4); }
.models-app .xs-modal .tg-head { cursor: default; }
.models-app .xs-modal .tg-body { overscroll-behavior: contain; }
.models-app .xs-modal .xs-left { flex: 1 1 100%; }
.models-app .xs-modal .xs-modes { flex-wrap: wrap; }
.models-app .xs-wind { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.models-app .xs-wind[hidden] { display: none; }
.models-app .xs-modal .xs-plot { overflow: auto; touch-action: pan-x pan-y; max-height: 70vh; border-radius: 4px; }
.models-app .xs-zoom { display: none; }
.models-app .xs-modal .xs-zoom { display: flex; align-items: center; justify-content: center; gap: 10px; }
.models-app .xs-zoom button { width: 34px; height: 30px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-bg); color: var(--panel-fg);
  font: 600 18px Figtree, system-ui, sans-serif; cursor: pointer; }
.models-app .xs-zoom-v { min-width: 44px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.models-app .xs-panel .tg-tip { display: block; grid-template-columns: none; min-width: 170px; pointer-events: none; }
.models-app .xs-panel .tg-tip[hidden] { display: none; }
.models-app .xs-panel .tg-tip .ss-tip-row { display: flex; justify-content: space-between; gap: 14px; white-space: nowrap; }
.models-app .xs-panel .tg-tip .ss-tip-row span { opacity: 0.75; }
.models-app .xs-panel .tg-tip > b { display: block; margin-bottom: 3px; }

/* A plot loading (meteograms, cross sections: app-panels.js plotLoading): a spinner and "Loading…" centered over it */
.models-app .plot-loading { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: color-mix(in srgb, var(--panel-bg) 70%, transparent); color: var(--panel-fg); font-family: Figtree, system-ui, sans-serif; pointer-events: none; }
.models-app .plot-loading .pl-spin { width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: loop-spin 0.8s linear infinite; }
.models-app .plot-loading .pl-text { font-size: 14px; font-weight: 600; }
.models-app .plot-loading .pl-sub { font-size: 12px; color: var(--muted); }
.models-app .plot-loading .pl-sub:empty { display: none; }

/* Overlays > Data Labels: the Gridpoint / City switch at the section's top (app-suite.js renderPicker) */
/* products.js heading: a heading among a section's layers (app-suite.js renderPicker) */
.models-app .pick-heading { margin-top: 5px; padding: 7px 8px 3px; border-top: 1px solid var(--border); font-size: 11.5px; font-weight: 700; color: color-mix(in srgb, var(--accent) 65%, var(--panel-fg)); opacity: 0.9; }   /* (a blue tint: the site's accent) */
.models-app .pick-heading:first-child { margin-top: 0; padding-top: 3px; border-top: 0; }
.models-app .pick-dlmode { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 8px; }
.models-app .pick-dlmode-cap { font-size: 12px; font-weight: 600; color: var(--muted); }

/* My Maps (app-suite.js renderMyMaps, saveMapDialog, manageMapsDialog) */
.models-app .mm-actions { display: flex; gap: 6px; margin: 2px 0 10px; }
.models-app .mm-btn { flex: 1; height: 32px; padding: 0 10px; border: 1px solid var(--accent); border-radius: 7px; background: none; color: var(--accent);
  font: 600 12.5px Figtree, system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.models-app .mm-btn.mm-save { background: var(--accent); color: #fff; }
.models-app .mm-btn:hover:not(:disabled) { filter: brightness(1.06); background-color: var(--accent-soft); }
.models-app .mm-btn.mm-save:hover { background: var(--accent); }
.models-app .mm-btn:disabled { opacity: 0.45; cursor: default; }
/* The saved-map dialogs sit outside .models-app, so its colors aren't defined there: light mode uses the fallbacks
   in each rule; dark mode, the viewer's own dark colors (as .models-app has them) */
[data-theme="dark"] .mm-modal { --muted: var(--text-muted); --hover: #1e2938; --panel-bg: var(--bg-card); --panel-fg: var(--text); --sec-bg: #222d3b; }
.mm-modal .modal { max-width: 440px; font-family: Figtree, system-ui, sans-serif; }
.mm-modal.mm-manage .modal { max-width: 760px; width: calc(100vw - 32px); }
/* My Maps > Edit: a saved map's layers as Layers tab cards (app-suite.js editMapDialog); the viewer's own styles inside */
.mm-modal.mm-editmap .modal { max-width: 460px; width: calc(100vw - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.mm-modal.mm-editmap .modal-body { overflow-y: auto; min-height: 0; padding-bottom: 0; }
.mm-modal.mm-editmap .confirm-actions { position: sticky; bottom: 0; z-index: 2; margin: 0 -1.15rem; padding: 10px 1.15rem 12px; background: var(--bg-card, #fff); border-top: 1px solid var(--border); }
.models-app.mm-edit-app { position: static; inset: auto; background: none; display: grid; gap: 8px; margin-bottom: 12px; }
.mm-edit-app .mm-edit-row .layer-handle[draggable="true"] { cursor: grab; }
.mm-edit-app .mm-edit-row.dragging { opacity: 0.5; }
.mm-edit-app .mm-edit-row.drop-above { box-shadow: 0 -2px 0 var(--accent); }
.mm-edit-app .mm-edit-row.drop-below { box-shadow: 0 2px 0 var(--accent); }
.mm-edit-app .style-save { display: none; }   /* (Save settings: the layer's own preference; here the dialog's Save) */
.mm-edit-app .mm-note { font-size: 11.5px; color: var(--muted); }
.mm-modal .mm-check { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: center; margin: 2px 0 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.mm-modal .mm-check small { grid-column: 2; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.mm-modal .mm-del.mm-edit:hover { color: var(--accent); background: var(--accent-soft, rgba(22, 104, 199, 0.08)); }
.mm-modal .mm-field { display: grid; gap: 4px; margin-bottom: 12px; }
.mm-modal .mm-label { font-size: 12.5px; font-weight: 700; }
.mm-modal .mm-hint { font-size: 11.5px; color: var(--muted, #6b7a89); }
.mm-modal .mm-input, .mm-modal .mm-combo input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--border, #cfd8e3); border-radius: 7px;
  background: var(--panel-bg, #fff); color: inherit; font: 13.5px Figtree, system-ui, sans-serif; box-sizing: border-box; }
.mm-modal .mm-combo { position: relative; }
.mm-modal .mm-combo input { padding-right: 30px; }
.mm-modal .mm-caret { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; padding: 4px; border: 0; border-radius: 5px;
  background: none; color: var(--muted, #6b7a89); cursor: pointer; }
.mm-modal .mm-caret[hidden] { display: none; }
.mm-modal .mm-caret svg { width: 100%; height: 100%; }
.mm-modal .mm-combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 3px); z-index: 5; max-height: 200px; overflow-y: auto; padding: 4px;
  border: 1px solid var(--border, #cfd8e3); border-radius: 8px; background: var(--panel-bg, #fff); box-shadow: 0 8px 20px rgba(16, 34, 56, 0.18); }
.mm-modal .mm-combo-list[hidden] { display: none; }
.mm-modal .mm-combo-opt { display: block; width: 100%; padding: 6px 8px; border: 0; border-radius: 5px; background: none; color: inherit; text-align: left;
  font: 13px Figtree, system-ui, sans-serif; cursor: pointer; }
.mm-modal .mm-combo-opt:hover { background: var(--accent-soft, #e7f0fb); }
.mm-modal .mm-what { font-size: 12px; color: var(--muted, #6b7a89); margin: 2px 0 10px; }
.mm-modal .mm-err { font-size: 12.5px; color: #c92a2a; margin: 0 0 8px; }
.mm-modal .mm-err[hidden] { display: none; }
.mm-modal .mm-grip { width: 18px; height: 18px; color: var(--muted, #6b7a89); cursor: grab; }
.mm-modal .mm-grip svg { width: 100%; height: 100%; }
.mm-modal .mm-del { width: 28px; height: 28px; padding: 5px; border: 0; border-radius: 6px; background: none; color: var(--muted, #6b7a89); cursor: pointer; }
.mm-modal .mm-del:hover { color: #c92a2a; background: rgba(201, 42, 42, 0.08); }
.mm-modal .mm-del svg { width: 100%; height: 100%; }

/* My Maps: the availability dot (green: every layer on this model; orange: some), and the Manage tree */
.models-app .mm-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-left: 8px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9); }
.models-app .mm-dot.mm-all { background: #2f9e44; }
.models-app .mm-dot.mm-some { background: #f08c00; }
.mm-modal.mm-manage .modal { max-width: 560px; }
.mm-modal .mm-tree { display: grid; gap: 4px; max-height: 62vh; overflow-y: auto; margin-bottom: 10px; padding: 2px; }
.mm-modal .mm-node { display: flex; align-items: center; gap: 4px; border-radius: 7px; border: 1px solid transparent; }
.mm-modal .mm-cat-head { background: var(--sec-bg, #edf2f8); }
.mm-modal .mm-sub-head { background: rgba(127, 140, 160, 0.08); }
.mm-modal .mm-node.drop-into { border-color: var(--accent, #0b5ed7); background: var(--accent-soft, #e7f0fb); }
.mm-modal .mm-tog { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border: 0; background: none; color: inherit;
  font: 700 13px Figtree, system-ui, sans-serif; text-align: left; cursor: pointer; }
.mm-modal .mm-sub-head .mm-tog { font-weight: 600; font-size: 12.5px; height: 30px; }
.mm-modal .mm-tog svg { flex: none; width: 14px; height: 14px; transition: transform 0.15s; color: var(--muted, #6b7a89); }
.mm-modal .mm-node.open .mm-tog svg { transform: rotate(90deg); }
.mm-modal .mm-node-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-modal .mm-count { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--muted, #6b7a89); }
/* Rename (as the layers' Edit button), then Save / Cancel while the name is edited */
.mm-modal .mm-act { flex: none; height: 26px; box-sizing: border-box; display: inline-flex; align-items: center; gap: 5px; margin: 0 4px 0 0; padding: 0 8px;
  border: 1px solid var(--border, #cfd8e3); border-radius: 7px; background: var(--panel-bg, #fff); color: var(--panel-fg, inherit);
  font: 600 12px Figtree, system-ui, sans-serif; line-height: 1; cursor: pointer; transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease; }
.mm-modal .mm-act svg { width: 14px; height: 14px; flex: none; color: var(--muted, #6b7a89); }
.mm-modal .mm-act:hover { border-color: var(--accent, #0b5ed7); background: var(--hover, rgba(127, 140, 160, 0.12)); }
.mm-modal .mm-act:hover svg { color: var(--accent, #0b5ed7); }
.mm-modal .mm-act.mm-save { background: var(--accent, #0b5ed7); border-color: var(--accent, #0b5ed7); color: #fff; }
.mm-modal .mm-act.mm-save:hover { filter: brightness(1.08); }
.mm-modal .mm-rename { flex: 1; height: 30px; margin: 1px 4px; }
.mm-modal .mm-kids { display: grid; gap: 3px; padding: 3px 0 4px 18px; border-left: 2px solid var(--border, #cfd8e3); margin-left: 14px; }
.mm-modal .mm-item { display: grid; grid-template-columns: 20px minmax(0, 1fr) 30px 30px; gap: 6px; align-items: center; padding: 2px 4px; border-radius: 7px;
  border: 1px solid transparent; }
.mm-modal .mm-item.dragging { opacity: 0.45; }
.mm-modal .mm-item.drop-above { border-top-color: var(--accent, #0b5ed7); }
.mm-modal .mm-item.drop-below { border-bottom-color: var(--accent, #0b5ed7); }
.mm-modal .mm-item .mm-input { height: 30px; }

/* My Maps: a map whose overlays this model doesn't all have: a popup under its row on hover (app-suite.js renderMyMaps; fixed
   on the page, so the menu's sections don't clip it) */
.mm-tip { position: fixed; z-index: 400; padding: 0.32rem 0.55rem; border: 1px solid var(--border, #cfd8e3); border-radius: 7px;
  background: var(--bg-card, #fff); color: var(--text, #1b2a3a); font: 600 0.76rem/1.2 Figtree, system-ui, sans-serif; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(16, 34, 56, 0.18); pointer-events: none; }
.mm-tip[hidden] { display: none; }
/* Edit > Levels: back to the layer's own levels (app-styles.js levelsGroup) */
.models-app .style-lv-reset { justify-self: start; margin-top: 2px; }
.models-app .style-lv-reset:disabled { opacity: 0.45; cursor: default; }
/* Colormap editor, class layers (percentile ranks): the class's name in place of a value (app-styles.js renderCmapEditor) */
.cmap-class { height: 24px; line-height: 24px; padding: 0 2px; font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* My Maps > Manage: New category above the tree; a category's Sub-category and delete (bin); an empty one's hint; the maps
   in no category and, while a map is dragged, the area that takes it out of its category (app-suite.js manageMapsDialog) */
.mm-modal .mm-top { display: grid; gap: 6px; margin-bottom: 8px; }
.mm-modal .mm-top > .mm-add { justify-self: start; }
.mm-modal .mm-new { gap: 0; }
.mm-modal .mm-node-del { flex: none; width: 26px; height: 26px; margin-right: 4px; }
.mm-modal .mm-empty { font-size: 12px; font-style: italic; color: var(--muted, #6b7a89); padding: 4px 6px; }
.mm-modal .mm-kids.drop-into, .mm-modal .mm-root.drop-into { border-radius: 7px; background: var(--accent-soft, #e7f0fb); }
.mm-modal .mm-root { display: grid; gap: 3px; min-height: 8px; }
.mm-modal .mm-root-drop { display: none; padding: 10px; border: 1.5px dashed var(--border, #cfd8e3); border-radius: 7px; font-size: 12px; text-align: center;
  color: var(--muted, #6b7a89); }
.mm-modal .mm-tree.mm-dragging .mm-root-drop { display: block; }
.mm-modal .mm-root.drop-into .mm-root-drop { border-color: var(--accent, #0b5ed7); color: var(--accent, #0b5ed7); }
@media (max-width: 520px) { .mm-modal .mm-node .mm-act span { display: none; } }
/* A prompt's "Don't show this again" (app-suite.js confirmDialog dontAsk) */
.confirm-modal .confirm-skip { display: flex; align-items: center; gap: 8px; margin: -0.3rem 0 1rem; font: 500 0.84rem Figtree, system-ui, sans-serif; color: var(--text); cursor: pointer; }
.confirm-modal .confirm-skip input { margin: 0; accent-color: var(--accent, #0b5ed7); }
/* The meteogram's modal (app-panels.js openStationSeries, ss-big): centered over the page, up to 1400px wide and nearly the
   window's height; the options in a column on the left when wide enough, else above the charts with the whole body scrolling */
.models-app .tg-panel.ss-big { left: 0 !important; right: 0; top: 0 !important; bottom: 0; margin: auto; width: min(1400px, calc(100vw - 32px));
  height: calc(100vh - 40px); height: calc(100dvh - 40px); max-width: none; max-height: none; display: flex; flex-direction: column;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45); }
.models-app .ss-big .tg-head { cursor: default; }
.models-app .ss-big .tg-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; padding: 10px 14px 12px; }
.models-app .ss-big .ss-side { display: grid; gap: 8px; align-content: start; }
.models-app .ss-big .ss-main { flex: 1 0 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.models-app .ss-big .ss-win .range2 { flex: 1 1 100%; flex-wrap: wrap; row-gap: 2px; }
.models-app .ss-big .ss-win .range2-track { flex: 1 1 100%; width: auto; }
@media (min-width: 960px) {
  .models-app .ss-big .tg-body { flex-direction: row; overflow: hidden; }
  .models-app .ss-big .ss-side { flex: none; width: 250px; overflow-y: auto; padding-right: 14px; border-right: 1px solid var(--border); }
  .models-app .ss-big .ss-main { flex: 1 1 auto; min-height: 0; overflow: hidden; }
  /* (in the column: each group its caption over its controls, one under the other) */
  .models-app .ss-big .ss-side .ss-line { flex-direction: column; align-items: stretch; gap: 12px; }
  .models-app .ss-big .ss-side .ss-grp { flex-direction: column; align-items: flex-start; gap: 5px; }
  .models-app .ss-big .ss-side .ss-cap { min-width: 0 !important; }
  .models-app .ss-big .ss-side .ss-opts { gap: 12px; }
  .models-app .ss-big .ss-side .ss-win { flex-direction: column; align-items: stretch; gap: 5px; }
  .models-app .ss-big .ss-side .ss-win .range2 { flex: none; width: 100%; }
  .models-app .ss-big .ss-side .ss-win .range2-val { flex: 1 1 100%; }
  .models-app .ss-big .ss-side .ss-grp .ss-tog { align-self: flex-start; }
  .models-app .ss-big .ss-side .ss-grp:has(.ss-tog) { flex-direction: row; flex-wrap: wrap; }
  .models-app .ss-big .ss-side .ss-grp:has(.ss-tog) > .ss-cap { flex: 1 1 100%; }
}


/* ---- What's New and the virtual tour (app-help.js) ---- */
/* (the (i) button's dot: a release the visitor hasn't opened yet) */
#info-btn { position: relative; }
#info-btn.has-new::before {
    content: ''; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%;
    background: #e5484d; box-shadow: 0 0 0 2px var(--bg-card);
}
.modal.whatsnew-modal { width: min(680px, calc(100vw - 2rem)); max-height: min(86vh, 900px); display: flex; flex-direction: column; }
.whatsnew-body { overflow-y: auto; overscroll-behavior: contain; }
.tour-start {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%;
    padding: 0.7rem 1rem; margin: 0.25rem 0 0.9rem; border: none; border-radius: 10px;
    background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.tour-start:hover { filter: brightness(1.08); }
.tour-start svg { width: 20px; height: 20px; }
.wn-release { padding: 0.9rem 0 1rem; border-top: 1px solid var(--border); }
.wn-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.wn-head h3 { font-size: 1.05rem; letter-spacing: -0.01em; }
.wn-head time { font-size: 0.82rem; color: var(--text-muted); }
.wn-body, .tour-text { font-size: 0.92rem; line-height: 1.5; color: var(--text); }
.wn-body p, .tour-text p { margin: 0.45rem 0; }
.wn-body ul, .wn-body ol, .tour-text ul, .tour-text ol { margin: 0.45rem 0; padding-left: 1.3rem; }
.wn-body li { margin: 0.2rem 0; }
.wn-body h3, .wn-body h4, .wn-body h5 { font-size: 0.95rem; margin: 0.8rem 0 0.3rem; }
.wn-body a, .tour-text a { color: var(--accent); }
.wn-body code, .tour-text code { font-size: 0.85em; padding: 0.05em 0.3em; border-radius: 4px; background: var(--accent-soft); }
.wn-body img, .tour-text img { display: block; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); }
.wn-body figure { margin: 0.6rem 0; }
.wn-empty { color: var(--text-muted); font-size: 0.92rem; }

/* The tour: a transparent sheet over the page (it isn't usable meanwhile), the dimming with a hole per target (an SVG
   path, its holes eased from target to target in app-help.js tourPlace), a ring on each hole; the card beside the
   first, fading out and back in from the target's side; everything fading in and out with body.touring */
.tour-block { position: fixed; inset: 0; z-index: 400; }
.tour-dim { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 401; pointer-events: none; opacity: 0; transition: opacity 0.3s ease; }
.tour-dim path { fill: rgba(10, 16, 24, 0.55); }
.tour-rings { position: fixed; inset: 0; z-index: 401; pointer-events: none; opacity: 0; transition: opacity 0.3s ease; }
body.touring .tour-dim, body.touring .tour-rings { opacity: 1; }
.tour-ring { position: absolute; border-radius: 10px; box-shadow: 0 0 0 2px var(--accent), 0 0 18px 2px rgba(80, 160, 255, 0.45); }
.tour-ring[hidden] { display: none; }
/* (a ring that swells and fades once the highlights have arrived) */
.tour-rings.pulse .tour-ring::after {
    content: ''; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--accent);
    animation: tour-pulse 1.1s ease-out 0.35s 2 both;
}
@keyframes tour-pulse { 0% { opacity: 0.9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.12); } }
.tour-card {
    position: fixed; z-index: 402; width: min(360px, calc(100vw - 24px)); padding: 1rem 1rem 0.8rem;
    background: var(--bg-card); color: var(--text); border: 1px solid var(--border); border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.32);
    transition: opacity 0.32s ease, transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}
.tour-card.out { opacity: 0; transform: scale(0.96); transition: opacity 0.16s ease, transform 0.16s ease; pointer-events: none; }
/* (coming in: placed a little toward the target, then sliding into place) */
.tour-card.enter { transition: none; }
.tour-card.enter.from-right { transform: translateX(-18px) scale(0.98); }
.tour-card.enter.from-left { transform: translateX(18px) scale(0.98); }
.tour-card.enter.from-below { transform: translateY(-18px) scale(0.98); }
.tour-card.enter.from-above { transform: translateY(18px) scale(0.98); }
.tour-card.enter.from-center { transform: scale(0.9); }
.tour-progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; overflow: hidden; border-radius: 14px 14px 0 0; background: var(--accent-soft); }
.tour-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.tour-x { position: absolute; top: 0.55rem; right: 0.45rem; }
/* The section (a menu of them all) and the step in it */
.tour-sec-row { display: flex; align-items: center; gap: 0.5rem; margin: 0 1.8rem 0.3rem 0; }
.tour-sec-row[hidden] { display: none; }
.tour-sec {
    display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.18rem 0.45rem 0.18rem 0.55rem; border-radius: 999px;
    border: 1px solid var(--border); background: var(--accent-soft); color: var(--accent);
    font: inherit; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer;
}
.tour-sec svg { width: 13px; height: 13px; transition: transform 0.2s ease; }
.tour-sec[aria-expanded="true"] svg { transform: rotate(180deg); }
.tour-count { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.tour-sec-menu {
    position: absolute; left: 0.9rem; top: 2.3rem; z-index: 1; min-width: 210px; padding: 0.3rem;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    animation: modal-pop 0.15s ease;
}
.tour-sec-menu[hidden] { display: none; }
.tour-sec-item {
    display: block; width: 100%; text-align: left; padding: 0.45rem 0.6rem; border: none; border-radius: 7px;
    background: transparent; color: var(--text); font: inherit; font-size: 0.88rem; cursor: pointer;
}
.tour-sec-item:hover { background: var(--accent-soft); }
.tour-sec-item.current { color: var(--accent); font-weight: 700; }
.tour-title { font-size: 1.02rem; letter-spacing: -0.01em; margin: 0 1.6rem 0.25rem 0; }
.tour-sec-row:not([hidden]) + .tour-sec-menu + .tour-title { margin-right: 0; }
/* (the welcome's buttons straight to a section) */
.tour-jump { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.6rem; }
.tour-jump[hidden] { display: none; }
.tour-jump-btn {
    display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.75rem; border-radius: 9px;
    border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 0.9rem; font-weight: 600;
    cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.tour-jump-btn::after { content: '\203A'; font-size: 1.2rem; line-height: 1; color: var(--accent); }
.tour-jump-btn:hover { background: var(--accent-soft); border-color: var(--accent); transform: translateX(2px); }
.tour-nav { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.7rem; }
.tour-nav button {
    padding: 0.42rem 0.95rem; border-radius: 8px; font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer;
    border: 1px solid var(--border); background: transparent; color: var(--text); transition: filter 0.15s ease, background 0.15s ease;
}
.tour-nav button:hover { background: var(--accent-soft); }
.tour-nav button[hidden] { display: none; }
.tour-nav .tour-next { background: var(--accent); border-color: var(--accent); color: #fff; }
.tour-nav .tour-next:hover { background: var(--accent); filter: brightness(1.1); }
@media (prefers-reduced-motion: reduce) {
    .tour-card, .tour-card.out, .tour-progress span { transition: opacity 0.15s ease; }
    .tour-card.enter[class*="from-"] { transform: none; }
    .tour-rings.pulse .tour-ring::after { animation: none; }
}
