/* WEATHER PANEL ROOT */
#weather-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-light);
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    z-index: 9000;
}

/* MAIN HEADER */
#weather-header {
    padding: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: white;
    border-bottom: 1px solid var(--panel-border);
    font-size: 15px;
}

/* SECTION WRAPPER */
.weather-section {
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
}

/* SUBHEADER (Radar / Satellite / Models) */
.weather-subheader {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #222;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

/* CONTENT AREA */
.weather-subcontent {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px; /* consistent spacing */
}

/* COLLAPSED STATE */
.weather-subcontent.collapsed {
    display: none;
}

/* BUTTONS INSIDE WEATHER PANEL */
.weather-subcontent button,
.weather-subcontent select {
    width: 100%;
    padding: 8px;
    background: var(--btn-bg);
    color: var(--text-light);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    cursor: pointer;
}

/* SLIDER INSIDE WEATHER PANEL */
.weather-subcontent input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.weather-subcontent input[type="range"]::-webkit-slider-thumb {
    background: var(--mint);
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

/* ACTIVE SECTION HIGHLIGHT */
.weather-subheader.active {
    color: var(--mint);
}

/* PER-LAYER THRESHOLD SLIDER (ui/layerThresholds.js) */
.layer-threshold-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.layer-threshold-row label {
    flex: 0 0 auto;
    white-space: nowrap;
}

.layer-threshold-row .layer-threshold-slider {
    flex: 1 1 auto;
    width: auto;
}

.layer-threshold-row .layer-threshold-value {
    flex: 0 0 auto;
    min-width: 44px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* RADAR RENDER MODE TOGGLE (radar/radarControls.js -- Legacy/GPU) */
.radar-render-mode-row select {
    flex: 1 1 auto;
}

/* MODELS PANEL (ui/modelsPanel.js) -- one row per NOMADS product */
.model-product-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--panel-border);
}

.model-product-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.model-product-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-product-toggle {
    flex: 1 1 auto;
    text-align: left;
    background: var(--btn-bg);
    color: var(--text-light);
    border: 1px solid var(--panel-border);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
}

.model-product-toggle.active {
    background: #006622;
    border-color: #00aa55;
}

.model-product-badge {
    flex: 0 0 auto;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #fbbf24;
    border: 1px solid #fbbf24;
    border-radius: 3px;
    padding: 2px 5px;
    cursor: help;
}

.model-product-disclaimer {
    font-size: 11px;
    color: #9aa4b2;
    line-height: 1.4;
}

.model-product-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.model-product-status {
    font-size: 11px;
    color: #9aa4b2;
    min-height: 14px;
}

/* LEVEL SCRUBBER (ui/levelScrubber.js) */
.level-scrubber-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.level-scrubber-row label {
    flex: 0 0 auto;
    white-space: nowrap;
}

.level-scrubber-slider {
    flex: 1 1 auto;
}

.level-scrubber-value {
    flex: 0 0 auto;
    min-width: 44px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ===============================
   Layer-selector redesign (2026-09-07) -- see
   claude/weather-frontend-product-layer-selector-design-2026-09-07.md
   =============================== */

/* Weather panel header now carries the "+ Add Layer" button */
/* Keep the title and button on one line in the 260px bar: the title
   gives way (ellipsis) before the button wraps. */
#weather-header {
    gap: 8px;
    white-space: nowrap;
}

#weather-header > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

#addLayerBtn {
    flex: none;
    white-space: nowrap;
    padding: 5px 8px;
    background: var(--btn-bg);
    color: var(--text-light);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: normal;
}

#addLayerBtn:hover {
    border-color: var(--mint);
    color: var(--mint);
}

/* ACTIVE LAYER CARDS (ui/activeLayersPanel.js) -- the left column */
.active-layer-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--panel-border);
}

.active-layer-card:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.active-layer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.active-layer-label {
    font-size: 13px;
    font-weight: bold;
    color: var(--text-light);
}

/* #active-layers-list carries the .weather-subcontent class (for its
   padding/gap), and ".weather-subcontent button" (specificity 0,1,1)
   sets width:100%/padding:8px/background on every button inside it --
   including this one. Both of these selectors need two classes
   (0,2,0) to outrank that and keep this button its own small square
   instead of stretching full-width, which was the "close button
   doesn't look right" bug. */
.active-layer-header .active-layer-remove {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    padding: 0;
    background: none;
    border: 1px solid var(--panel-border);
    color: #ff8080;
    border-radius: 4px;
    line-height: 1;
    cursor: pointer;
}

.active-layer-header .active-layer-remove:hover {
    background: none;
    border-color: #ff8080;
}

/* Reorder controls (ui/layerReorder.js): a grab handle plus small up/down
   buttons. Same two-class specificity trick as .active-layer-remove above. */
.active-layer-header .active-layer-handle {
    flex: 0 0 auto;
    width: 18px;
    text-align: center;
    color: var(--text-light);
    opacity: 0.6;
    cursor: grab;
    user-select: none;
    touch-action: none; /* the pointer drives the drag, not page scroll */
    letter-spacing: -2px;
}
.active-layer-header .active-layer-handle:hover,
.active-layer-header .active-layer-handle:focus-visible { opacity: 1; }
.active-layer-header .active-layer-handle:focus-visible { outline: 2px solid #4da3ff; outline-offset: 2px; }
.active-layer-header .active-layer-label { flex: 1 1 auto; }
.active-layer-header .active-layer-move-up,
.active-layer-header .active-layer-move-down {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    padding: 0;
    background: none;
    border: 1px solid var(--panel-border);
    color: var(--text-light);
    border-radius: 4px;
    font-size: 9px;
    line-height: 1;
    cursor: pointer;
}
.active-layer-header .active-layer-move-up:hover,
.active-layer-header .active-layer-move-down:hover { background: none; border-color: var(--text-light); }
.active-layer-card:first-child .active-layer-move-up,
.active-layer-card:last-child .active-layer-move-down { visibility: hidden; }

#active-layers-list.reordering { cursor: grabbing; user-select: none; }
.active-layer-card.dragging {
    opacity: 0.85;
    outline: 2px solid #4da3ff;
    outline-offset: 2px;
    background: var(--panel-bg);
}

.active-layer-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.active-layer-status {
    font-size: 11px;
    color: #9aa4b2;
    min-height: 14px;
}

.active-layer-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.active-layer-slider-row label {
    flex: 0 0 auto;
    width: 44px;
    white-space: nowrap;
}

.active-layer-slider-row input[type="range"] {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

.active-layer-slider-value {
    flex: 0 0 52px;
    color: var(--mint);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-layer-legend {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 4px;
}

.active-layer-legend-track {
    display: flex;
    height: 9px;
    overflow: hidden;
    border: 1px solid rgba(139, 164, 176, 0.45);
    border-radius: 3px;
    background:
        linear-gradient(45deg, rgba(255,255,255,0.10) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.10) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.10) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.10) 75%);
    background-color: rgba(255, 255, 255, 0.04);
    background-position: 0 0, 0 4px, 4px -4px, -4px 0;
    background-size: 8px 8px;
}

.active-layer-legend-segment {
    min-width: 3px;
}

.active-layer-legend-ticks {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    color: #9aa4b2;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.active-layer-legend-ticks span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ADD-LAYER POPOUT (ui/layerPickerPopout.js) -- same fixed-dropdown
   convention as .alerts-dropdown (alerts.css). */
.layer-picker-popout {
    position: fixed;
    top: 52px;
    left: 260px;
    width: 320px;
    max-height: 75vh;
    overflow-y: auto;
    z-index: 10000;
    padding: 12px;
}

.active-layer-provenance {
    margin-top: -2px;
    color: #9ea8b4;
    font-size: 10px;
    line-height: 1.35;
}

.layer-picker-workflow {
    color: var(--mint);
    font-size: 11px;
    line-height: 1.35;
    padding: 2px 0 8px;
    border-bottom: 1px solid var(--panel-border);
}

.layer-picker-section-header {
    font-weight: bold;
    font-size: 13px;
    padding: 8px 0 6px;
    border-bottom: 1px solid var(--panel-border);
    margin-bottom: 4px;
}

.layer-picker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 4px;
    font-size: 13px;
    border-radius: 4px;
}

.layer-picker-row-expandable {
    cursor: pointer;
}

.layer-picker-row-expandable:hover {
    background: rgba(255, 255, 255, 0.05);
}

.layer-picker-row-indent-1 {
    padding-left: 14px;
    font-size: 12px;
}

.layer-picker-row-indent-2 {
    padding-left: 28px;
    font-size: 12px;
}

.layer-picker-row-label {
    flex: 1 1 auto;
}

.layer-picker-children {
    display: none;
    flex-direction: column;
}

.layer-picker-children.is-expanded {
    display: flex;
}

.layer-picker-add-btn {
    flex: 0 0 auto;
    background: var(--btn-bg);
    color: var(--mint);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    cursor: pointer;
}

.layer-picker-add-btn:hover {
    border-color: var(--mint);
}

.layer-picker-add-btn.layer-picker-remove-btn {
    color: #ff8080;
}

.layer-picker-empty {
    font-size: 12px;
    color: #9aa4b2;
    padding: 6px 4px;
}

/* SITE RADAR MARKER BOXES (map/siteRadarMarkers.js) -- one small
   clickable labeled box per CONUS NEXRAD site, placed directly on the
   map with a maplibregl.Marker. Inactive by default; clicking toggles
   a "site_radar" active-layer instance (defaulted to reflectivity) and
   flips this to the active state via onActiveLayersChange. */
.site-radar-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 18px;
    padding: 0 4px;
    background: rgba(20, 22, 26, 0.85);
    border: 1px solid var(--panel-border);
    border-radius: 3px;
    color: #9aa4b2;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.03em;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.site-radar-marker:hover {
    border-color: var(--mint);
    color: var(--text-light);
}

.site-radar-marker-active {
    /* Keep the opaque dark marker surface over both bright basemaps and
       high-reflectivity returns; active state is communicated by its label. */
    color: var(--mint);
}

.site-radar-marker-busy {
    opacity: 0.6;
    pointer-events: none;
}

/* Product dropdown on a site-radar active-layer card
   (ui/activeLayersPanel.js's createSiteRadarController) -- same row
   layout as .active-layer-slider-row's range inputs, just a <select>
   instead of an <input type="range">. */
.active-layer-product-select {
    flex: 1 1 auto;
    background: var(--btn-bg);
    color: var(--text-light);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 12px;
}

@media (max-width: 760px) {
    #weather-panel {
        border: none;
        min-height: 100%;
    }

    #weather-header {
        min-height: 44px;
        padding-left: 56px;
    }

    #active-layers-list {
        padding-bottom: 18px;
    }

    .layer-picker-popout {
        bottom: calc(var(--timeline-h) + 8px);
        left: 8px;
        max-height: min(58vh, 430px);
        right: 8px;
        top: auto;
        width: auto;
    }
}

@media (max-width: 420px) {
    .active-layer-slider-row {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .active-layer-slider-row label {
        width: auto;
    }

    .active-layer-slider-row input[type="range"] {
        flex-basis: calc(100% - 62px);
    }
}

/* Accumulation window of the frame on screen (precip accumulation): 15 min, 1 h, 2 h ... */
.active-layer-window {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 2px;
}
.active-layer-window:empty { display: none; }

/* RGB composite interpretation key (activeLayersPanel.js buildRgbKey -- GOES Day Cloud Phase). */
.active-layer-rgb-key { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: 11px; }
.active-layer-rgb-key-row { display: flex; align-items: center; gap: 6px; }
.active-layer-rgb-swatch { width: 12px; height: 10px; border-radius: 2px; border: 1px solid rgba(255, 255, 255, 0.25); flex: 0 0 auto; }
.active-layer-rgb-note { margin-top: 2px; font-style: italic; opacity: 0.75; }

/* Turbulence (EDR) layers: aircraft class for the category labels (ui/activeLayersPanel.js). */
.active-layer-edr-class { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-light); margin-top: 4px; }
.active-layer-edr-class select { font-size: 11px; }
.active-layer-barbs { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-light); margin-top: 4px; cursor: pointer; }
.active-layer-edr-note { font-size: 10.5px; line-height: 1.35; color: var(--text-muted, #9aa3ad); margin-top: 2px; }

/* Add Layer picker: search, By type / By source, categories (ui/layerPickerPopout.js, 2026-10-09). */
.layer-picker-popout { width: 360px; }
.layer-picker-row[hidden], .layer-picker-cat[hidden], .layer-picker-view[hidden], .layer-picker-bysource > div[hidden],
.layer-picker-nomatch[hidden] { display: none; }
.layer-picker-tools { display: flex; gap: 6px; align-items: center; padding-bottom: 6px; }
.layer-picker-search { flex: 1 1 auto; min-width: 0; padding: 5px 8px; background: var(--btn-bg); color: var(--text-light);
    border: 1px solid var(--panel-border); border-radius: 4px; font-size: 12px; }
.layer-picker-views { display: inline-flex; flex: none; }
.layer-picker-views button { padding: 4px 7px; font-size: 11px; background: var(--btn-bg); color: var(--text-light);
    border: 1px solid var(--panel-border); margin-left: -1px; cursor: pointer; }
.layer-picker-views button:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.layer-picker-views button:last-child { border-radius: 0 4px 4px 0; }
.layer-picker-views button[aria-pressed="true"] { border-color: var(--mint); color: #fff; background: #1d3a33; position: relative; }
.layer-picker-cat { border-bottom: 1px solid var(--panel-border); }
.layer-picker-cat > summary { display: flex; align-items: center; gap: 8px; padding: 7px 2px; cursor: pointer; font-weight: bold; font-size: 13px; list-style: none; }
.layer-picker-cat > summary::-webkit-details-marker { display: none; }
.layer-picker-cat > summary::before { content: "▸"; color: var(--text-muted, #9aa3ad); font-size: 10px; width: 10px; }
.layer-picker-cat[open] > summary::before { content: "▾"; }
.layer-picker-cat-title { flex: 1 1 auto; }
.layer-picker-cat-count { font-weight: normal; font-size: 11px; color: var(--text-muted, #9aa3ad); }
.layer-picker-cat-count.on { color: var(--mint); }
.layer-picker-cat > .layer-picker-row, .layer-picker-cat > .layer-picker-children { margin-left: 8px; }
.layer-picker-source { display: block; font-size: 10.5px; color: var(--text-muted, #9aa3ad); }
.layer-picker-source-radar, .layer-picker-source-satellite { color: #8ec5ff; }
.layer-picker-tools { position: sticky; top: -12px; z-index: 1; margin: -12px -12px 0; padding: 10px 12px 6px; background: var(--panel-bg, #161a20); }
.layer-picker-row-expandable::after { content: "▸"; flex: none; color: var(--text-muted, #9aa3ad); font-size: 10px; padding: 0 6px; }
.layer-picker-row-expandable[aria-expanded="true"]::after { content: "▾"; }
.layer-picker-popout { top: calc(var(--topbar-h, 52px) + 8px); max-height: calc(100vh - var(--topbar-h, 52px) - 24px); }
.layer-picker-popout { max-height: calc(100vh - var(--topbar-h, 52px) - var(--timeline-h, 60px) - 24px); }
