/* style.css */


/* ============================================================
   TW1ANALYST — SEVERE WEATHER COMMAND CENTER
   Storm-ops broadcast aesthetic · amber accent · stencil headlines
   ============================================================ */

:root {
    /* Space reserved for the iOS home-indicator / notch gesture area.
       Resolves to 0px on devices without one (Android, desktop, older iPhones). */
    --sab: env(safe-area-inset-bottom, 0px);

    /* Base surface palette — deep slate with warm undertone */
    --bg-0:        #0a0d12;
    --bg-1:        #11151c;
    --bg-2:        #161b24;
    --surface:     #1a2230;
    --surface-2:   #232c3d;
    --border:      #2a3548;
    --border-soft: #1f2735;

    /* Typography colors */
    --text:        #f3f4f6;
    --text-muted:  #94a3b8;
    --text-dim:    #64748b;

    /* Brand accent — storm amber */
    --accent:      #ffb020;
    --accent-soft: rgba(255, 176, 32, 0.18);
    --accent-line: rgba(255, 176, 32, 0.45);

    /* Live / hot */
    --hot:         #ff3b30;
    --hot-soft:    rgba(255, 59, 48, 0.2);

    /* Severity tokens */
    --sev-tornado: #ef4444;
    --sev-severe:  #f97316;
    --sev-sws:     #eab308;
    --sev-marine:  #fb923c;
    --sev-flashflood: #22c55e;
    --sev-floodadvisory: #16a34a;
    /* Watches use the same hue family as their warning but a lighter tint,
       matching the dashed/lighter-weight treatment used on the map. */
    --sev-tornado-watch: #facc15;
    --sev-severe-watch:  #ec4899;
    --sev-hurricane: #d946ef;
    --sev-hurricane-watch: #f472b6;
    --sev-tropical: #a855f7;
    --sev-tropical-watch: #e879f9;
    --sev-surge: #c026d3;
    --sev-surge-watch: #c084fc;
    --sev-extremewind: #ea580c;
    --sev-duststorm: #b45309;
    --sev-snowsquall: #0ea5e9;
    --sev-fire: #dc2626;

    --radius-sm: 4px;
    --radius:    6px;
    --radius-lg: 10px;

    /* Height of #bottom-strip at the current breakpoint — kept in sync via
       the media queries below so #top-progress-bar can sit flush above it
       without hardcoding the offset twice. 0px on mobile, where
       #bottom-strip is hidden entirely (see the mobile media query). */
    --bottom-strip-height: 36px;
}

* {
    box-sizing: border-box;
}

/* GLOBAL ---------------------------------------------------- */
html, body {
    margin: 0;
    padding: 0;
    /* Pinned to the true viewport edges via top:0/bottom:0 (inset:0) with
       NO height value set at all. Earlier attempt left height:100%/100dvh
       in this same rule alongside inset:0 — but per spec, when top,
       bottom, AND height are all non-auto on a fixed element, the browser
       ignores `bottom` and sizes purely from `height`, silently
       cancelling out the inset:0 fix entirely. Dropping height lets
       top:0 + bottom:0 alone determine the box size, computed directly
       from the real visual viewport with no dvh/vh number in the loop
       to ever be stale. */
    position: fixed;
    inset: 0;
    background-color: var(--bg-0);
    color: var(--text);
    font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    /* Faint horizontal scanlines — CRT broadcast vibe */
    background-image: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.012) 0px,
        rgba(255, 255, 255, 0.012) 1px,
        transparent 1px,
        transparent 3px
    );
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Oswald", "IBM Plex Sans", sans-serif;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin: 0;
}

code, kbd, samp, pre, .mono {
    font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

#map,
.maplibregl-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* MapLibre attribution */
.maplibregl-ctrl-attrib {
    background: rgba(10, 13, 18, 0.75) !important;
    color: var(--text-muted) !important;
}
.maplibregl-ctrl-attrib a {
    color: var(--accent) !important;
}

/* POPUPS ---------------------------------------------------- */
.maplibregl-popup {
    z-index: 5000;
}

.maplibregl-popup-content {
    background: rgba(17, 21, 28, 0.96);
    color: var(--text);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-top: 2px solid var(--accent);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 12px 14px;
}

.maplibregl-popup-tip {
    border-top-color: rgba(17, 21, 28, 0.96) !important;
    border-bottom-color: rgba(17, 21, 28, 0.96) !important;
}

.maplibregl-popup-close-button {
    color: var(--text-muted);
    font-size: 18px;
    padding: 2px 8px;
}

/* TOP BAR --------------------------------------------------- */
#top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background:
        linear-gradient(to bottom, rgba(10,13,18,0.98), rgba(10,13,18,0.86));
    border-bottom: 1px solid var(--border);
    box-shadow:
        inset 0 -1px 0 var(--accent-line),
        0 4px 16px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-bug {
    display: inline-flex;
    flex-direction: column;
    padding: 7px 14px 7px 16px;
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(255,176,32,0.10), rgba(0,0,0,0)) ,
        var(--bg-1);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    box-shadow: 0 0 18px rgba(255, 176, 32, 0.12);
    position: relative;
}

.brand-title {
    font-family: "Oswald", sans-serif;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text);
    line-height: 1;
}

.brand-subtitle {
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 4px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Thin separator between logical button groups (info tools vs. radar tools) */
.ui-control-divider {
    width: 1px;
    height: 22px;
    background: var(--border);
    margin: 0 4px;
    flex-shrink: 0;
}

/* BUTTONS --------------------------------------------------- */
/* Button icon/label visibility — icon always shown for quicker recognition,
   label alongside it on desktop, tucked underneath on mobile (see media query). */
.btn-icon  { display: flex; line-height: 0; align-items: center; justify-content: center; flex-shrink: 0; }
.btn-icon svg { width: 16px; height: 16px; }
.btn-label { display: inline; }

.ui-control-button {
    padding: 8px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-1);
    font-family: "Oswald", sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    color: var(--text);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.ui-control-button:active { transform: scale(0.95); }

.ui-control-button:hover {
    border-color: var(--accent-line);
    background: var(--surface);
    color: var(--accent);
    box-shadow:
        inset 0 0 0 1px var(--accent-line),
        0 4px 12px rgba(0, 0, 0, 0.6);
}

.ui-control-button.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    box-shadow:
        inset 0 0 0 1px var(--accent),
        0 0 16px rgba(255, 176, 32, 0.35);
}

/* Locked: Products / Volume / Cross Section / History before a radar
   station has been selected. Still clickable (the click handler shows a
   "select a station first" status message) — just visually dimmed rather
   than fully disabled, so the affordance to tap it and learn why isn't
   lost. */
.ui-control-button.locked {
    opacity: 0.4;
    filter: grayscale(0.4);
}
.ui-control-button.locked:hover {
    border-color: var(--border);
    background: none;
    color: inherit;
    box-shadow: none;
}

/* BOTTOM STRIP --------------------------------------------- */
#bottom-strip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 36px;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 16px;
    background:
        linear-gradient(to top, rgba(10,13,18,0.98), rgba(10,13,18,0.86));
    border-top: 1px solid var(--border);
    box-shadow: inset 0 1px 0 var(--accent-line);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: var(--text-muted);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

#bottom-strip-left,
#bottom-strip-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-label {
    font-family: "Oswald", sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 10px;
    color: var(--accent);
    padding: 2px 7px;
    border: 1px solid var(--accent-line);
    border-radius: 2px;
    background: var(--accent-soft);
}

#status-text,
#status-layers {
    color: var(--text);
}

/* TOP PROGRESS BAR -------------------------------------------
   Sits flush above #bottom-strip. Deliberately tiny (2px) and just a bare
   filled track — no percentage text, no chunky "N/total" label — because
   the underlying updates (network chunks, per-frame preload counts) arrive
   in irregular bursts, not a steady stream, and a numeric readout jumping
   around reads as janky where a thin bar smoothly animating its width
   (via the transition below) reads as fluid regardless of how choppy the
   underlying progress events actually are. */
#top-progress-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--bottom-strip-height);
    height: 2px;
    z-index: 3001; /* above #bottom-strip's 3000 */
    background: transparent;
    pointer-events: none;
    overflow: hidden;
}

#top-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent-line);
    opacity: 0;
    transition: width 0.3s ease-out, opacity 0.2s ease;
}

#top-progress-bar-fill.active {
    opacity: 1;
}

/* SIDE PANELS ---------------------------------------------- */
.side-panel {
    position: absolute;
    top: 60px;
    bottom: 36px;
    width: 360px;
    z-index: 2500;
    padding: 12px;
    box-sizing: border-box;
    pointer-events: none;
}

.side-panel-left  { left: 0; }
.side-panel-right { right: 0; }

/* Smooth slide + fade — replaces instant display:none */
.side-panel {
    transition:
        opacity 0.28s ease,
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s linear 0s;
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
}

.side-panel-left.hidden  { transform: translateX(-18px); }
.side-panel-right.hidden { transform: translateX(18px);  }

.side-panel.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.22s ease,
        transform 0.28s cubic-bezier(0.4, 0, 1, 1),
        visibility 0s linear 0.28s;
}

.side-panel-inner {
    height: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(17, 21, 28, 0.96);
    border: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        0 0 0 1px rgba(255, 176, 32, 0.05),
        0 14px 36px rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}

/* PANEL HEADERS -------------------------------------------- */
.side-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: relative;
    flex-shrink: 0; /* never let the header (and its close button) get squeezed
                        when the panel's content is taller than its max-height —
                        only .side-panel-body should shrink/scroll */
}

.side-panel-header::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
}

.side-panel-header-warning {
    background: linear-gradient(135deg, rgba(239,68,68,0.22), var(--surface));
}
.side-panel-header-warning::before {
    background: var(--sev-tornado);
}

.side-panel-header-forecast {
    background: linear-gradient(135deg, rgba(255,176,32,0.18), var(--surface));
}
.side-panel-header-forecast::before {
    background: var(--accent);
}

.side-panel-header-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.side-panel-title {
    font-family: "Oswald", sans-serif;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text);
    line-height: 1.1;
}

.side-panel-subtitle {
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.side-panel-close {
    border: 1px solid var(--border);
    background: var(--bg-1);
    color: var(--text);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    transition: 0.12s ease;
    flex-shrink: 0;
}
.side-panel-close:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* PANEL BODY ------------------------------------------------ */
.side-panel-body {
    padding: 14px 16px;
    overflow-y: auto;
    color: var(--text);
    font-size: 13px;
    line-height: 1.55;
    flex: 1;
}

.side-panel-location {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 8px 10px;
    margin-bottom: 12px;
    background: rgba(10, 13, 18, 0.6);
    border: 1px solid var(--border-soft);
    border-left: 2px solid var(--accent);
    border-radius: var(--radius-sm);
}

/* SETTINGS PANEL ------------------------------------------------ */
.settings-group + .settings-group {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border-soft);
}

.settings-group-title {
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 4px;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background 0.12s ease;
}
.settings-row:hover {
    background: rgba(255, 255, 255, 0.03);
}
.settings-row + .settings-row {
    border-top: 1px solid var(--border-soft);
}

.settings-row-text {
    flex: 1;
    min-width: 0;
}

.settings-row-label {
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 2px;
}

.settings-row-desc {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--text-muted);
}

/* Reusable pill toggle switch, checkbox-driven */
.toggle-switch {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    width: 42px;
    height: 24px;
}
.toggle-switch input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}
.toggle-switch-track {
    position: absolute;
    inset: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: background 0.18s ease, border-color 0.18s ease;
}
.toggle-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.18s ease;
}
.toggle-switch input:checked ~ .toggle-switch-track {
    background: var(--accent-soft);
    border-color: var(--accent-line);
}
.toggle-switch input:checked ~ .toggle-switch-track .toggle-switch-thumb {
    transform: translateX(18px);
    background: var(--accent);
}
.toggle-switch input:focus-visible ~ .toggle-switch-track {
    outline: 2px solid var(--accent-line);
    outline-offset: 2px;
}

/* Slider row (e.g. Radar Opacity) */
.settings-row-slider {
    cursor: default;
}
.settings-slider-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.settings-slider-wrap input[type="range"] {
    width: 110px;
    accent-color: var(--accent);
    cursor: pointer;
}
.settings-slider-val {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: var(--text-muted);
    width: 34px;
    text-align: right;
}

/* Indented sub-controls shown under a settings-row toggle (e.g. Range Ring
   spacing, SRM speed/direction) — dims/collapses when the parent toggle
   is off via the .is-disabled class set from script.js. */
.settings-subrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 4px 12px 4px;
    margin-top: -4px;
    transition: opacity 0.15s ease;
}
.settings-subrow.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}
.settings-subrow-label {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 11.5px;
    color: var(--text-muted);
}
.settings-subrow-cols {
    gap: 16px;
}
.settings-subfield {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.settings-select,
.settings-number {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    border-radius: var(--radius-sm);
    padding: 6px 8px;
}
.settings-select {
    cursor: pointer;
}
.settings-number {
    width: 100%;
}
.settings-select:focus,
.settings-number:focus {
    outline: 2px solid var(--accent-line);
    outline-offset: 1px;
}

.settings-badge {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    border-radius: 999px;
    padding: 2px 7px;
    margin-left: 6px;
    vertical-align: middle;
}

/* History panel */
.history-datetime-row {
    display: flex;
    gap: 10px;
    padding: 4px 4px 12px 4px;
}
.history-action-btn {
    width: 100%;
    background: var(--accent);
    color: #1a1200;
    border: none;
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 600;
    font-size: 13px;
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: filter 0.15s ease;
}
.history-action-btn:hover { filter: brightness(1.1); }
.history-action-btn:disabled { opacity: 0.5; cursor: default; filter: none; }
.history-action-btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}
.history-status {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: var(--text-muted);
    padding: 8px 4px 0 4px;
    line-height: 1.5;
    white-space: pre-line;
}

.side-panel-section {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
}
.side-panel-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.side-panel-section-title {
    font-family: "Oswald", sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}

.side-panel-text {
    color: var(--text);
    font-size: 13px;
}

.side-panel-footer {
    padding: 8px 16px;
    border-top: 1px solid var(--border);
    background: rgba(10, 13, 18, 0.6);
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* WARNING SEVERITY HEADERS --------------------------------- */
#warning-panel-header.warning-tornado {
    background: linear-gradient(135deg, rgba(239,68,68,0.4), var(--surface));
}
#warning-panel-header.warning-tornado::before { background: var(--sev-tornado); }

#warning-panel-header.warning-severe {
    background: linear-gradient(135deg, rgba(249,115,22,0.4), var(--surface));
}
#warning-panel-header.warning-severe::before { background: var(--sev-severe); }

#warning-panel-header.warning-sws {
    background: linear-gradient(135deg, rgba(234,179,8,0.35), var(--surface));
}
#warning-panel-header.warning-sws::before { background: var(--sev-sws); }

#warning-panel-header.warning-marine {
    background: linear-gradient(135deg, rgba(251,146,60,0.4), var(--surface));
}
#warning-panel-header.warning-marine::before { background: var(--sev-marine); }

#warning-panel-header.warning-flashflood {
    background: linear-gradient(135deg, rgba(34,197,94,0.4), var(--surface));
}
#warning-panel-header.warning-flashflood::before { background: var(--sev-flashflood); }

#warning-panel-header.warning-floodadvisory {
    background: linear-gradient(135deg, rgba(22,163,74,0.4), var(--surface));
}
#warning-panel-header.warning-floodadvisory::before { background: var(--sev-floodadvisory); }

/* RadarScope-parity alert types (watches + new warning kinds). */
#warning-panel-header.warning-tornado-watch {
    background: linear-gradient(135deg, rgba(250,204,21,0.35), var(--surface));
}
#warning-panel-header.warning-tornado-watch::before { background: var(--sev-tornado-watch); }

#warning-panel-header.warning-severe-watch {
    background: linear-gradient(135deg, rgba(236,72,153,0.35), var(--surface));
}
#warning-panel-header.warning-severe-watch::before { background: var(--sev-severe-watch); }

#warning-panel-header.warning-hurricane {
    background: linear-gradient(135deg, rgba(217,70,239,0.4), var(--surface));
}
#warning-panel-header.warning-hurricane::before { background: var(--sev-hurricane); }

#warning-panel-header.warning-hurricane-watch {
    background: linear-gradient(135deg, rgba(244,114,182,0.35), var(--surface));
}
#warning-panel-header.warning-hurricane-watch::before { background: var(--sev-hurricane-watch); }

#warning-panel-header.warning-tropical {
    background: linear-gradient(135deg, rgba(168,85,247,0.4), var(--surface));
}
#warning-panel-header.warning-tropical::before { background: var(--sev-tropical); }

#warning-panel-header.warning-tropical-watch {
    background: linear-gradient(135deg, rgba(232,121,249,0.35), var(--surface));
}
#warning-panel-header.warning-tropical-watch::before { background: var(--sev-tropical-watch); }

#warning-panel-header.warning-surge {
    background: linear-gradient(135deg, rgba(192,38,211,0.4), var(--surface));
}
#warning-panel-header.warning-surge::before { background: var(--sev-surge); }

#warning-panel-header.warning-surge-watch {
    background: linear-gradient(135deg, rgba(192,132,252,0.35), var(--surface));
}
#warning-panel-header.warning-surge-watch::before { background: var(--sev-surge-watch); }

#warning-panel-header.warning-extremewind {
    background: linear-gradient(135deg, rgba(234,88,12,0.4), var(--surface));
}
#warning-panel-header.warning-extremewind::before { background: var(--sev-extremewind); }

#warning-panel-header.warning-duststorm {
    background: linear-gradient(135deg, rgba(180,83,9,0.4), var(--surface));
}
#warning-panel-header.warning-duststorm::before { background: var(--sev-duststorm); }

#warning-panel-header.warning-snowsquall {
    background: linear-gradient(135deg, rgba(14,165,233,0.4), var(--surface));
}
#warning-panel-header.warning-snowsquall::before { background: var(--sev-snowsquall); }

#warning-panel-header.warning-fire {
    background: linear-gradient(135deg, rgba(220,38,38,0.4), var(--surface));
}
#warning-panel-header.warning-fire::before { background: var(--sev-fire); }

/* FORECAST -------------------------------------------------- */
.forecast-openmeteo {
    font-size: 13px;
    line-height: 1.55;
}

.forecast-openmeteo-section {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: rgba(10, 13, 18, 0.65);
    border: 1px solid var(--border-soft);
    border-left: 2px solid var(--accent);
}

.forecast-openmeteo-title {
    font-family: "Oswald", sans-serif;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
}

/* POPUP CONTENT -------------------------------------------- */
.popup-title {
    font-family: "Oswald", sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 4px;
    color: var(--text);
}

.popup-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.popup-mping,
.popup-nws {
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    max-width: min(320px, 90vw);
    color: var(--text);
}

.popup-mping {
    border-left: 3px solid var(--accent);
    padding-left: 10px;
}

.popup-nws {
    border-left: 3px solid var(--sev-tornado);
    padding-left: 10px;
}

.popup-nws-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.popup-nws-text {
    flex: 1;
    padding-right: 4px;
}

.popup-divider {
    border-top: 1px solid var(--border-soft);
    margin: 8px 0;
}

.nws-info-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    font-family: "Oswald", sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.12s ease;
}
.nws-info-btn:hover {
    background: var(--accent);
    color: var(--bg-0);
    box-shadow: 0 0 14px rgba(255, 176, 32, 0.7);
}

/* FORECAST TARGET CIRCLE ----------------------------------- */
.forecast-target-circle {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    box-shadow:
        0 0 0 2px var(--bg-0),
        0 0 18px rgba(255, 176, 32, 0.8);
    pointer-events: none;
    z-index: 4000;
    animation: target-ping 0.8s ease-out;
}

@keyframes target-ping {
    0%   { transform: scale(0.4); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* LEGEND ---------------------------------------------------- */
.legend-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 13px;
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid var(--border);
}

/* MAPLIBRE NAV CONTROLS ------------------------------------ */
.maplibregl-ctrl-group {
    background: var(--bg-1) !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
}
.maplibregl-ctrl-group button {
    background-color: transparent !important;
}
.maplibregl-ctrl-group button:hover {
    background-color: var(--surface) !important;
}
.maplibregl-ctrl-group button + button {
    border-top: 1px solid var(--border) !important;
}

/* MOBILE ---------------------------------------------------- */
/* ── Tablet (≤900px) ──────────────────────────────────────── */
@media (max-width: 900px) {
    #top-bar { height: 54px; padding: 6px 10px; }
    .brand-title    { font-size: 14px; }
    .brand-subtitle { font-size: 8px; }
    .ui-control-button { padding: 6px 10px; font-size: 12px; }
    #bottom-strip { height: 32px; font-size: 10px; padding: 2px 10px; }
    :root { --bottom-strip-height: 32px; }
    .side-panel {
        top: auto; bottom: 32px; left: 0; right: 0; width: 100%; padding: 6px;
    }
    .side-panel-inner {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        height: 60vh;
    }
    .side-panel-left.hidden,
    .side-panel-right.hidden { transform: translateY(24px); }
}

/* ── Mobile (≤640px or coarse pointer) ───────────────────── */
@media (max-width: 640px), (pointer: coarse) {

    /* --- Top bar: compact --- */
    #top-bar { height: 48px; padding: 4px 10px; }
    .brand-bug  { padding: 4px 10px 4px 11px; }
    .brand-title    { font-size: 13px; letter-spacing: 0.12em; }
    .brand-subtitle { display: none; }

    /* --- Status strip: removed on mobile. The new bottom bar below is
       the only bottom UI element now. --- */
    #bottom-strip {
        display: none;
    }
    /* No status strip to sit above here — instead sit above the edge-to-edge
       mobile tab bar (.top-bar-right below), which occupies the true bottom
       60px + safe-area and would otherwise completely cover the progress
       bar (it's opaque and z-indexed well above it). */
    :root { --bottom-strip-height: calc(60px + var(--sab)); }

    /* Playback bar sits directly above the tab bar (no status strip left
       to stack above on mobile). !important is needed here: this rule and
       the base #radar-playback-bar rule further down the file (bottom: 28px)
       have identical specificity (one ID selector each), so without it,
       source order alone decides the winner — and the base rule, sitting
       later in the file, was winning even on mobile. That silently put the
       bar back at the 28px desktop offset, underneath the ~60px-tall mobile
       tab bar, instead of above it. */
    #radar-playback-bar {
        bottom: calc(60px + var(--sab)) !important;
    }
    #radar-playback-bar:not(.collapsed) {
        padding: 7px 12px !important;
    }
    #radar-playback-progress {
        bottom: calc(60px + var(--sab) + 54px) !important;
    }

    /* ============================================================
       MOBILE BOTTOM BAR — full remake
       A real edge-to-edge tab bar, not a floating/attached dock:
       - spans the full screen width, flush with the bottom edge
       - 5 tabs share the width equally (flex: 1 each)
       - icon + label per tab (room now that it's down to 5 buttons
         from the original 7, and a full-width bar has space a
         clustered dock never did)
       - active tab gets a small top indicator bar + accent color,
         same visual language as the rest of the app's "active" state
       ============================================================ */
    .top-bar-right {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 4500;
        display: flex;
        flex-wrap: nowrap;
        align-items: stretch;
        height: calc(60px + var(--sab));
        padding: 0 0 var(--sab) 0;
        box-sizing: border-box;
        background: linear-gradient(to top, rgba(8,10,14,0.99), rgba(10,13,18,0.94));
        border-top: 1px solid var(--border);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        transition: opacity 0.18s ease, transform 0.18s ease;
    }

    /* Hidden while volume render or cross section is open on mobile — both
       are immersive full-screen views the bar would otherwise sit on top
       of. Faded + dropped rather than display:none so it doesn't pop
       jarringly when the panel closes and it reappears. */
    .top-bar-right.dock-hidden-immersive {
        opacity: 0;
        pointer-events: none;
        transform: translateY(12px);
    }

    /* --- Tabs: each one an equal-width flex column, icon over label --- */
    .ui-control-button {
        flex: 1 1 0;
        min-width: 0;
        height: 100%;
        padding: 7px 2px 0 2px;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 3px;
        background: none;
        border: none;
        box-shadow: none;
        position: relative;
        color: var(--text-muted);
        transition: color 0.12s ease;
    }
    .btn-label {
        display: block;
        font-size: 9px;
        font-weight: 600;
        letter-spacing: 0.03em;
        text-transform: uppercase;
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .btn-icon svg { width: 22px; height: 22px; }

    /* Pressed: dim rather than scale — reads as a native tab-bar tap
       instead of a floating button press */
    .ui-control-button:active {
        color: var(--text);
        background: rgba(255, 255, 255, 0.04);
    }

    /* Active tab: accent color + a small indicator bar along the top
       edge of that tab specifically (not the whole bar) */
    .ui-control-button.active {
        color: var(--accent);
    }
    .ui-control-button.active::before {
        content: "";
        position: absolute;
        top: 0;
        left: 22%;
        right: 22%;
        height: 2.5px;
        border-radius: 0 0 2px 2px;
        background: var(--accent);
        box-shadow: 0 0 8px rgba(255, 176, 32, 0.6);
    }

    /* No divider needed — 5 evenly-spaced labeled tabs read as distinct
       groups on their own */
    .ui-control-divider { display: none; }

    /* --- Drag handle (shown on mobile) --- */
    .panel-drag-handle {
        display: block;
        width: 38px;
        height: 4px;
        border-radius: 2px;
        background: rgba(255, 255, 255, 0.18);
        margin: 10px auto 4px;
        flex-shrink: 0;
    }

    /* --- Panels: full-width sheet from bottom, sitting above the
       dock bar (bottom-strip is gone on mobile now) --- */
    .side-panel {
        top: auto;
        bottom: calc(60px + var(--sab));
        left: 0;
        right: 0;
        width: 100%;
        padding: 0;
    }
    .side-panel-inner {
        border-radius: 20px 20px 0 0;
        max-height: 72vh;   /* fallback for browsers without dvh support */
        max-height: 72dvh;  /* tracks the real visible viewport as Safari's
                               address bar shows/hides, instead of the
                               often-taller "100vh" value */
        height: auto;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .side-panel-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .side-panel-left.hidden,
    .side-panel-right.hidden { transform: translateY(36px); }

    /* --- Close button: bigger touch target --- */
    .side-panel-close { width: 38px; height: 38px; font-size: 20px; }

    /* --- Radar control: left side, above dock --- */
    #radar-control-container {
        right: auto;
        left: 10px;
        bottom: calc(68px + var(--sab));
    }

    /* --- MapLibre attribution / zoom controls --- */
    .maplibregl-ctrl-bottom-right {
        bottom: calc(68px + var(--sab)) !important;
        right: 8px !important;
    }
    .maplibregl-ctrl-bottom-left {
        bottom: calc(68px + var(--sab)) !important;
        left: 8px !important;
    }

    /* --- Volume canvas height on mobile --- */
    #vol-canvas { height: 200px !important; }
    #cs-canvas  { height: 180px !important; }

    /* --- Compact "floating card" popups on mobile ------------------
       Cross Section and Volume Render are immersive tools that need
       the vertical space, and they already get their own dedicated
       mobile layouts elsewhere in this file (split view / tall sheet)
       — excluded here via :not(). Every other popup (Forecast,
       Settings, Models, History, Products, Legend, Warning) instead
       floats as a small card inset from the edges and anchored near
       the bottom, leaving the rest of the screen — including the map
       above/around it — visible and pannable while it's open.
       The :not(#id) selectors add ID-level specificity, so this wins
       over the full-width/tall-sheet rules above regardless of source
       order. */
    .side-panel:not(#cross-section-panel):not(#volume-panel) {
        bottom: calc(60px + var(--sab) + 8px);
        left: 8px;
        right: 8px;
        width: auto;
        max-width: 420px;
        margin: 0 auto;
    }
    .side-panel:not(#cross-section-panel):not(#volume-panel)
        .side-panel-inner {
        border-radius: var(--radius-lg);
        max-height: 40vh;   /* fallback for browsers without dvh support */
        max-height: 40dvh;
    }
    .side-panel:not(#cross-section-panel):not(#volume-panel)
        .panel-drag-handle {
        display: none;
    }
}

/* ── Mobile: Cross Section split view ────────────────────────
   Activated via body.cs-split-active (set in script.js while the
   Cross Section flow is live on a touch/narrow viewport). The map
   keeps the top half of the screen; the existing cross-section
   panel — same canvas, status text and TF editor — is pinned to the
   bottom half instead of floating as a tall sheet.
   Desktop / non-split layouts are untouched.
   Base state (hidden) is unconditional so desktop never sees this
   button at all; the mobile media query below is the only place
   that ever reveals it. */
.cs-split-close {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-1);
    color: var(--text);
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    z-index: 20;
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 176, 32, 0.06);
    transition: 0.12s ease;
}
.cs-split-close:hover,
.cs-split-close:active {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 16px rgba(255, 176, 32, 0.55);
}

@media (max-width: 640px), (pointer: coarse) {
    body.cs-split-active #cross-section-panel {
        top: 50%;
        bottom: 0;
        height: auto;
    }
    body.cs-split-active #cross-section-panel .side-panel-inner {
        height: 100%;
        max-height: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: var(--bg-0);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    body.cs-split-active #cross-section-panel .side-panel-header,
    body.cs-split-active #cross-section-panel .side-panel-footer,
    body.cs-split-active #cross-section-panel .panel-drag-handle,
    body.cs-split-active #cross-section-panel #cs-status,
    body.cs-split-active #cross-section-panel #cs-content {
        display: none;
    }
    body.cs-split-active #cross-section-panel .side-panel-body {
        display: flex;
        flex-direction: column;
        height: 100%;
        padding: 8px 8px calc(8px + var(--sab));
        gap: 8px;
        overflow: hidden;
    }
    body.cs-split-active #cross-section-panel .cs-split-close {
        display: flex;
    }
    body.cs-split-active #cs-canvas {
        flex: 1 1 0%;
        min-height: 0;
        width: 100% !important;
        height: auto !important;
        margin-top: 0 !important;
    }
    body.cs-split-active #cs-tf-wrap {
        flex: 0 0 auto;
        margin-top: 0 !important;
    }
}

/* Drag handle hidden on desktop */
.panel-drag-handle { display: none; }

/* ── Volume screen box overlay ───────────────────────────────
   A fixed outlined square that stays centered on the visible map
   area, indicating which geographic region the volume renderer is
   sampling. Shown whenever vol-split-active or vol-live is set. */
#vol-screen-box {
    display: none;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    box-sizing: border-box;
    border: 2px solid #ffb020;
    border-radius: 4px;
    background: rgba(255, 176, 32, 0.04);
    box-shadow:
        0 0 0 1px rgba(255, 176, 32, 0.18),
        inset 0 0 32px rgba(255, 176, 32, 0.04);
}
#vol-screen-box.active { display: block; }

/* Corner tick marks — pure CSS, no extra DOM */
#vol-screen-box::before,
#vol-screen-box::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    border-color: #ffb020;
    border-style: solid;
    opacity: 0.9;
}
#vol-screen-box::before {
    top: -2px; left: -2px;
    border-width: 2px 0 0 2px;
    border-radius: 2px 0 0 0;
}
#vol-screen-box::after {
    bottom: -2px; right: -2px;
    border-width: 0 2px 2px 0;
    border-radius: 0 0 2px 0;
}

/* ── Vol split close button ──────────────────────────────────
   Same design as .cs-split-close; always hidden on desktop, only
   shown by body.vol-split-active on mobile. */
.vol-split-close {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-1);
    color: var(--text);
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    z-index: 20;
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 176, 32, 0.06);
    transition: 0.12s ease;
}
.vol-split-close:hover,
.vol-split-close:active {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 16px rgba(255, 176, 32, 0.55);
}

@media (max-width: 640px), (pointer: coarse) {
    body.vol-split-active #volume-panel {
        top: 50%;
        bottom: 28px;
        height: auto;
    }
    body.vol-split-active #volume-panel .side-panel-inner {
        height: 100%;
        max-height: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: var(--bg-0);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    body.vol-split-active #volume-panel .side-panel-header,
    body.vol-split-active #volume-panel .side-panel-footer,
    body.vol-split-active #volume-panel .panel-drag-handle,
    body.vol-split-active #volume-panel #vol-status,
    body.vol-split-active #volume-panel #vol-content {
        display: none;
    }
    body.vol-split-active #volume-panel .side-panel-body {
        display: flex;
        flex-direction: column;
        height: 100%;
        padding: 8px;
        gap: 8px;
        overflow: hidden;
    }
    body.vol-split-active #volume-panel .vol-split-close {
        display: flex;
    }
    body.vol-split-active #vol-canvas {
        flex: 1 1 0%;
        min-height: 0;
        width: 100% !important;
        height: auto !important;
        margin-top: 0 !important;
    }
    body.vol-split-active #vol-tf-wrap {
        flex: 0 0 auto;
        margin-top: 0 !important;
    }
}

/* SOFT POPUP ENTRANCE -------------------------------------- */
.maplibregl-popup-content {
    animation: popup-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes popup-in {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Brand bug subtle hover lift */
.brand-bug {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.brand-bug:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 22px rgba(255, 176, 32, 0.22);
}

/* Smooth scrollbars in panels */
.side-panel-body::-webkit-scrollbar { width: 8px; }
.side-panel-body::-webkit-scrollbar-track { background: transparent; }
.side-panel-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 8px;
}
.side-panel-body::-webkit-scrollbar-thumb:hover {
    background: var(--accent-line);
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ============================================================
   RADAR STATION MARKERS
   ============================================================ */
/* (rendered via maplibre symbol layer; size set in JS) */

/* ============================================================
   FLOATING RADAR CONTROL BAR (bottom right)
   ============================================================ */
#radar-control {
    position: fixed;
    bottom: 56px;
    right: 16px;
    z-index: 30;
    background: rgba(10, 13, 18, 0.94);
    border: 1px solid rgba(255, 176, 32, 0.45);
    border-radius: 10px;
    color: #e9eef6;
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.06em;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.65), 0 0 22px rgba(255, 176, 32, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
    transition: border-radius 220ms ease, box-shadow 220ms ease;
    min-width: 320px;
}
#radar-control.hidden {
    display: none;
}

#radar-control .rc-idle,
#radar-control .rc-playing,
#radar-control .rc-products {
    display: none;
}

/* state: idle */
#radar-control.state-idle .rc-idle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

/* state: playing */
#radar-control.state-playing .rc-playing {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

/* state: products (idle bar + products panel above) */
#radar-control.state-products {
    border-radius: 14px;
}
#radar-control.state-products .rc-products {
    display: block;
    padding: 14px 16px 8px 16px;
    border-bottom: 1px solid rgba(255, 176, 32, 0.18);
    max-height: 360px;
    overflow-y: auto;
    animation: rc-products-slide 220ms ease-out;
}
#radar-control.state-products .rc-idle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

@keyframes rc-products-slide {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* buttons */
.rc-btn {
    background: rgba(255, 176, 32, 0.10);
    border: 1px solid rgba(255, 176, 32, 0.45);
    color: var(--accent);
    width: 28px;
    height: 28px;
    border-radius: 5px;
    cursor: pointer;
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 140ms ease, transform 90ms ease;
    flex-shrink: 0;
}
.rc-btn:hover {
    background: rgba(255, 176, 32, 0.22);
}
.rc-btn:active {
    transform: scale(0.94);
}
.rc-close {
    border-color: rgba(255, 88, 88, 0.55);
    color: #ff7a7a;
    background: rgba(255, 88, 88, 0.08);
}
.rc-close:hover {
    background: rgba(255, 88, 88, 0.20);
}

.rc-divider {
    color: rgba(233, 238, 246, 0.25);
    font-weight: 300;
}
.rc-station {
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.14em;
}
.rc-vcp {
    color: rgba(233, 238, 246, 0.78);
    font-size: 11px;
}

/* When products panel open, flip the expand arrow */
#radar-control.state-products #rc-btn-expand {
    transform: rotate(180deg);
}

/* Scrubber: 15 ticks, leftmost=oldest, rightmost=newest */
.rc-scrubber {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 4px;
}
.rc-tick {
    flex: 1;
    height: 14px;
    border-radius: 2px;
    background: rgba(233, 238, 246, 0.18);
    cursor: pointer;
    transition: background 120ms ease, height 120ms ease;
}
.rc-tick:hover {
    background: rgba(255, 176, 32, 0.45);
    height: 18px;
}
.rc-tick.current {
    background: var(--accent);
    height: 22px;
    box-shadow: 0 0 8px rgba(255, 176, 32, 0.65);
}
.rc-tick.played {
    background: rgba(255, 176, 32, 0.32);
}

/* Products panel */
.rc-products-title {
    font-family: "Oswald", sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.22em;
    color: var(--accent);
    text-align: center;
    margin-bottom: 10px;
}
.rc-products-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rc-product-btn {
    background: transparent;
    border: 1px solid rgba(233, 238, 246, 0.10);
    color: #e9eef6;
    text-align: left;
    padding: 9px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.10em;
    transition: background 120ms ease, border-color 120ms ease;
}
.rc-product-btn:hover {
    background: rgba(255, 176, 32, 0.10);
    border-color: rgba(255, 176, 32, 0.35);
}
.rc-product-btn.active {
    background: rgba(255, 176, 32, 0.18);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 700;
}
/* Radar Control Container */
#radar-control-container {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 500;
  font-family: system-ui, sans-serif;
  color: #e5e7eb;
}

/* Main Control Bar */
#radar-control-bar {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  padding: 6px 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  gap: 8px;
}

.rc-btn {
  background: rgba(30, 64, 175, 0.9);
  border: none;
  color: #e5e7eb;
  border-radius: 999px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
}

.rc-btn:hover {
  background: rgba(37, 99, 235, 1);
}

.rc-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

#radar-product-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

#radar-station-label {
  font-size: 13px;
  font-weight: 600;
}

/* Drawer Menu */
#radar-drawer {
  position: absolute;
  right: 0;
  bottom: 48px;
  width: 220px;
  background: rgba(15, 23, 42, 0.96);
  border-radius: 12px;
  padding: 10px 10px 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.7);
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

#radar-drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.rc-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9ca3af;
  margin-bottom: 4px;
}

.rc-subtitle {
  font-size: 11px;
  margin-top: 8px;
  margin-bottom: 2px;
  color: #9ca3af;
}

.rc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rc-item {
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.rc-item:hover {
  background: rgba(55, 65, 81, 0.9);
}

.rc-item.active {
  background: rgba(37, 99, 235, 0.9);
}

.product-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #222;
    color: white;
    border: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: background 0.2s;
    z-index: 1000;
}

.product-btn:hover {
    background: #333;
}

.product-panel {
    position: absolute;
    bottom: 50px;
    right: 10px;
    width: 180px;
    background: rgba(20,20,20,0.95);
    border: 1px solid #444;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: opacity 0.2s, transform 0.2s;
    transform: translateX(120%);
    z-index: 1001;
}

.product-panel.visible {
    transform: translateX(0);
}

.product-item {
    padding: 6px 10px;
    border-radius: 6px;
    background: #2a2a2a;
    color: white;
    cursor: pointer;
    transition: background 0.15s;
    z-index: 1002;
}

.product-item:hover {
    background: #3a3a3a;
}

.product-item.selected {
    background: #0066ff;
}

/* ── Volume transfer-function editor ─────────────────────────────────────── */
.vol-tf-canvas {
    display: block;
    width: 100%;
    height: 80px;
    border-radius: 6px;
    cursor: crosshair;
    border: 1px solid rgba(255,255,255,0.1);
    background: #0d1117;
    box-sizing: border-box;
}

/* ── Products panel rows ─────────────────────────────────────────────────── */
.product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 7px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    color: #e5e7eb;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
    gap: 10px;
}
.product-row:hover {
    background: rgba(255,176,32,0.10);
    border-color: rgba(255,176,32,0.25);
}
.product-row-active {
    background: rgba(255,176,32,0.16) !important;
    border-color: #ffb020 !important;
    color: #ffb020;
}
.product-row-left {
    flex: 1;
    min-width: 0;
}
.product-row-name {
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}
.product-row-desc {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-row-active .product-row-desc {
    color: rgba(255,176,32,0.65);
}
.product-row-unit {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
}
.product-row-active .product-row-unit {
    color: #ffb020;
}

/* Force crosshair during point-selection modes */
body.radar-selecting,
body.radar-selecting * {
    cursor: crosshair !important;
}

/* ── Cross-section A/B endpoint markers ──────────────────────────────────── */
.cs-endpoint-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.9);
    color: #0a0d12;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(0,255,255,0.4), 0 2px 8px rgba(0,0,0,0.7);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.cs-endpoint-marker:active {
    cursor: grabbing;
    transform: scale(1.15);
    box-shadow: 0 0 0 4px rgba(0,255,255,0.6), 0 4px 16px rgba(0,0,0,0.8);
}

/* ============================================================
   RADAR PLAYBACK BAR
   ============================================================
   Real always-visible controls (once a station + frames are loaded) —
   play/pause, a draggable scrubber, scan-time readout, frame count.
   Replaces the old floating "▶ KNKX" collapsed pill, which required a
   double-click to reveal any of this and was easy to mistake for
   inert decoration ("does nothing"). Sits above the bottom UI (the
   status strip on desktop/tablet, the tab bar on mobile — see the
   media-query override further down) so it never overlaps either. */
#radar-playback-bar {
    position: fixed;
    left: 12px;
    bottom: 28px;
    width: calc(100% - 24px);
    z-index: 3200;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(10, 13, 18, 0.94);
    border-top: 1px solid var(--border);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-family: "IBM Plex Mono", monospace;
    overflow: hidden;
    box-sizing: border-box;
    transition: opacity 0.15s ease, transform 0.15s ease,
        width 0.32s cubic-bezier(0.22, 1, 0.36, 1), padding 0.32s ease,
        border-radius 0.32s ease;
}
#radar-playback-bar.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
}

/* Collapsed = the "little widget": before the user has pressed play on a
   freshly-loaded loop, the bar is just a small round play button pinned to
   the bottom-left, playback fully off. Pressing it expands the bar out to
   the right (see the width transition above) into the full timeline —
   handled by expandPlaybackBarAndPreload() in script.js — rather than
   starting playback immediately. */
#radar-playback-bar.collapsed {
    width: 50px;
    padding: 8px;
    border-top: none;
    border-radius: 50%;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 176, 32, 0.08);
}
#radar-playback-bar.collapsed .playback-time-label,
#radar-playback-bar.collapsed .playback-scrub-slider,
#radar-playback-bar.collapsed .playback-count-label,
#radar-playback-bar.collapsed .playback-speed-btn {
    display: none;
}

/* Little progress bar that appears directly above the playback bar the
   moment the user presses play for the first time on a loop, filling as
   every frame in the loop downloads + decodes. Hidden again (and playback
   actually starts) once it reaches 100%. */
#radar-playback-progress {
    position: fixed;
    left: 12px;
    bottom: 84px;
    width: calc(100% - 24px);
    height: 4px;
    z-index: 3199;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
#radar-playback-progress.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
}
#radar-playback-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    box-shadow: 0 0 6px rgba(255, 176, 32, 0.6);
    transition: width 0.15s ease;
}

.playback-play-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    color: var(--accent);
    cursor: pointer;
    transition: background 0.12s ease, transform 0.08s ease;
}
.playback-play-btn:hover  { background: rgba(255, 176, 32, 0.28); }
.playback-play-btn:active { transform: scale(0.92); }

.playback-time-label {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.04em;
    min-width: 46px;
}

.playback-scrub-slider {
    flex: 1;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    outline: none;
    cursor: pointer;
}
.playback-scrub-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px rgba(255, 176, 32, 0.55);
    cursor: pointer;
    margin-top: -5.5px;
}
.playback-scrub-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px rgba(255, 176, 32, 0.55);
    cursor: pointer;
}
.playback-scrub-slider::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: var(--border);
}
.playback-scrub-slider::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: var(--border);
}

/* MODELS PANEL ------------------------------------------------ */
.models-playback-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px 4px 4px;
}
.models-playback-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.12s ease;
}
.models-playback-btn:hover {
    border-color: var(--accent);
    filter: brightness(1.1);
}
.models-playback-btn svg {
    width: 15px;
    height: 15px;
}
.models-slider {
    flex: 1;
    min-width: 0;
}
.models-fhour-count {
    flex-shrink: 0;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: var(--text);
    letter-spacing: 0.04em;
    min-width: 48px;
    text-align: right;
}
.models-time-label {
    font-family: "IBM Plex Mono", monospace;
    font-size: 10.5px;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 6px 4px 2px 4px;
}
.models-legend-img {
    display: block;
    width: 100%;
    max-width: 280px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: rgba(10, 13, 18, 0.6);
}
.models-legend-img.hidden {
    display: none;
}

/* Dims the panel controls (but not the model/field pickers themselves)
   when the selected model has no live imagery wired up yet. */
.models-panel-unavailable .settings-row-slider,
.models-panel-unavailable #models-legend-group,
.models-panel-unavailable .models-playback-row,
.models-panel-unavailable .models-time-label,
.models-panel-unavailable #models-run-select {
    opacity: 0.4;
    pointer-events: none;
}

.playback-count-label {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted);
    min-width: 32px;
    text-align: right;
}

.playback-speed-btn {
    flex-shrink: 0;
    min-width: 40px;
    height: 26px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.playback-speed-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}
.playback-speed-btn:active { transform: scale(0.94); }

@media (hover: none) and (pointer: coarse) and (min-width: 601px) and (min-height: 601px) {
    /* Formerly forced icon-only round buttons here because iPad was
       wrongly excluded from the main mobile bottom-bar query above (it
       fixed max-width/max-height to ≤600/640px, which no iPad matches)
       and was stuck rendering the desktop top-bar layout. That query is
       now `(pointer: coarse)` with no size ceiling, so iPad gets the
       same full bottom-bar redesign as phones — nothing left to patch
       here. */
}


/* ── Compact mode switcher ─────────────────────────────────────────────── */
.tw1-mode-switcher {
    position: relative;
    z-index: 20;
}
.tw1-mode-trigger {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
    /* Match the corner radius of every other toolbar button (var(--radius))
       instead of a rounder one-off value, so it reads as part of the same
       button row rather than a stray shape. */
    border-radius: var(--radius);
}
.tw1-mode-trigger .btn-label { display:none; }
.tw1-mode-trigger .btn-icon svg { width:20px; height:20px; }
.tw1-mode-menu {
    position:absolute;
    top:calc(100% + 8px);
    right:0;
    width:210px;
    padding:6px;
    border:1px solid var(--border);
    border-radius:12px;
    background:rgba(14,17,22,.96);
    box-shadow:0 14px 40px rgba(0,0,0,.55);
    backdrop-filter:blur(18px);
    transform-origin:top right;
    opacity:0;
    transform:translateY(-7px) scale(.97);
    pointer-events:none;
    transition:opacity .16s ease, transform .18s cubic-bezier(.2,.8,.2,1);
}
.tw1-mode-menu.open {
    opacity:1;
    transform:translateY(0) scale(1);
    pointer-events:auto;
}
.tw1-mode-option {
    width:100%;
    border:0;
    background:transparent;
    color:var(--text);
    border-radius:8px;
    padding:10px 11px;
    display:flex;
    align-items:center;
    gap:10px;
    cursor:pointer;
    font:600 12px "Oswald",sans-serif;
    letter-spacing:.1em;
    text-transform:uppercase;
    text-align:left;
    transition:background .12s ease,color .12s ease,transform .1s ease;
}
.tw1-mode-option:hover { background:var(--accent-soft); color:var(--accent); }
.tw1-mode-option.active { background:var(--accent-soft); color:var(--accent); }
.tw1-mode-option .mode-option-icon { display:flex; width:20px; justify-content:center; }
.tw1-mode-option .mode-option-icon svg { width:18px; height:18px; }
.tw1-mode-option:active { transform:scale(.98); }

/* On mobile the mode switcher lives in the fixed bottom tab bar, not the
   top bar, so the menu has no room to drop downward — it would open below
   the viewport. Flip it to open upward from the trigger instead. */
@media (max-width: 640px), (pointer: coarse) {
    .tw1-mode-menu {
        top:auto;
        bottom:calc(100% + 8px);
        transform-origin:bottom right;
        transform:translateY(7px) scale(.97);
    }
    .tw1-mode-menu.open {
        transform:translateY(0) scale(1);
    }
}

/* The model controls are an anchored floating card on touch devices rather
   than a full-screen sheet, so the map remains visible while choosing fields. */
@media (max-width: 900px), (pointer: coarse) {
    #models-panel {
        top:auto !important;
        bottom:calc(var(--bottom-strip-height, 60px) + 10px) !important;
        right:10px !important;
        left:auto !important;
        width:min(360px, calc(100vw - 20px)) !important;
        height:auto !important;
        max-height:calc(100dvh - var(--bottom-strip-height, 60px) - 68px) !important;
        padding:0 !important;
        z-index:120;
        pointer-events:none;
    }
    #models-panel:not(.hidden) { pointer-events:auto; }
    #models-panel .side-panel-inner {
        height:auto !important;
        max-height:calc(100dvh - var(--bottom-strip-height, 60px) - 68px);
        border-radius:14px !important;
        overflow:hidden;
        box-shadow:0 18px 50px rgba(0,0,0,.58);
    }
    #models-panel .side-panel-body {
        overflow:auto;
        max-height:calc(100dvh - var(--bottom-strip-height, 60px) - 142px);
    }
    #models-panel .side-panel-header { min-height:48px; }
    #models-panel .side-panel-footer { display:none; }
}
@media (max-width: 420px) {
    #models-panel {
        width:calc(100vw - 20px) !important;
    }
}

/* TW1 smoothing toggles */
.tw1-switch { position:relative; display:inline-flex; align-items:center; width:42px; height:24px; flex:0 0 auto; cursor:pointer; }
.tw1-switch input { position:absolute; opacity:0; width:1px; height:1px; pointer-events:none; }
.tw1-switch-track { width:42px; height:24px; border-radius:999px; background:var(--surface); border:1px solid var(--border); position:relative; transition:background .18s ease,border-color .18s ease,box-shadow .18s ease; }
.tw1-switch-track::after { content:""; position:absolute; width:18px; height:18px; left:2px; top:2px; border-radius:50%; background:var(--text-muted); transition:transform .18s cubic-bezier(.2,.8,.2,1),background .18s ease; }
.tw1-switch input:checked + .tw1-switch-track { background:var(--accent-soft); border-color:var(--accent); box-shadow:0 0 12px rgba(255,176,32,.14); }
.tw1-switch input:checked + .tw1-switch-track::after { transform:translateX(18px); background:var(--accent); }
.tw1-switch input:focus-visible + .tw1-switch-track { outline:2px solid var(--accent); outline-offset:2px; }
.tw1-mode-trigger { margin-left:4px; }

/* Mode switcher is the final control in the top-right group. A thin
   divider (instead of a bare auto-margin gap) reads as "grouped, but
   separated" rather than a stray square floating off on its own. */
#top-right-controls .tw1-mode-switcher {
    order: 999;
    margin-left: auto;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}

/* Desktop top-bar controls: keep the analysis buttons visible in the header.
   Mobile-only relocation is controlled by viewport width in script.js, so
   touch-capable desktop PCs stay in the desktop header. */
@media (min-width: 641px) {
    #top-right-controls {
        position: static;
        display: flex;
        visibility: visible;
        opacity: 1;
        align-items: center;
        justify-content: flex-end;
        flex: 1 1 auto;
        min-width: 0;
    }
    #top-right-controls .ui-control-button {
        flex: 0 0 auto;
    }
    #top-right-controls .tw1-mode-switcher {
        flex: 0 0 auto;
        margin-left: 10px;
    }
}

/* GOES-19 4000x4000 native satellite raster overlay.  The image itself is
   never replaced while zooming, so browser scaling is the only interpolation. */
#goes-satellite-raster-layer {
    position: absolute;
    pointer-events: none;
    overflow: hidden;
}
#goes-satellite-raster-layer img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: fill;
    user-select: none;
}

/* Touch devices: working v7 bottom-sheet drawer, redesigned as Controls + Display Mode. */
body.tw1-touch-layout #top-right-controls { display:none !important; }
body.tw1-touch-layout #tw1-mobile-drawer {
    --drawer-open:0;
    position:fixed;
    left:10px; right:10px; bottom:calc(8px + var(--sab, 0px));
    height:min(78dvh, 720px);
    z-index:9000;
    transform:translateY(calc((1 - var(--drawer-open)) * (100% - 64px)));
    background:rgba(13,17,23,.97);
    border:1px solid rgba(255,255,255,.14);
    border-radius:20px;
    box-shadow:0 14px 50px rgba(0,0,0,.5);
    overflow:hidden;
    color:#fff;
    transition:transform .24s cubic-bezier(.22,.8,.25,1);
    touch-action:none;
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
}
body.tw1-touch-layout #tw1-mobile-drawer.dragging { transition:none; }
.tw1-drawer-grab-zone {
    height:64px; min-height:64px; width:100%; display:flex; align-items:center; justify-content:center;
    cursor:grab; touch-action:none; position:relative;
}
.tw1-drawer-grab-zone:active { cursor:grabbing; }
.tw1-drawer-grab { width:90px; height:10px; border-radius:999px; background:rgba(255,255,255,.72); box-shadow:0 1px 4px rgba(0,0,0,.4); }
.tw1-drawer-page { height:calc(100% - 64px); overflow:auto; overscroll-behavior:contain; touch-action:pan-y; padding:0 14px 24px; box-sizing:border-box; }
.tw1-drawer-row { display:grid; grid-template-columns:minmax(0,1fr) 58px; gap:10px; align-items:stretch; }
.tw1-tools-trigger, .tw1-mode-trigger {
    min-height:54px; border:1px solid rgba(255,255,255,.14); border-radius:13px;
    background:rgba(255,255,255,.075); color:#fff; font:700 15px/1 "IBM Plex Sans",sans-serif;
}
.tw1-tools-trigger { display:flex; align-items:center; gap:10px; padding:0 15px; text-align:left; }
.tw1-trigger-chevron { margin-left:auto; font-size:19px; opacity:.7; }
.tw1-mode-trigger { display:flex; align-items:center; justify-content:center; padding:0; }
.tw1-mode-trigger svg { width:24px; height:24px; }
.tw1-tools-menu, .tw1-mode-menu { display:none; margin-top:9px; gap:8px; }
.tw1-tools-menu.open, .tw1-mode-menu.open { display:grid; }
.tw1-tools-menu { grid-template-columns:1fr 1fr; }
.tw1-tool-option, .tw1-mode-option {
    min-height:52px; border:1px solid rgba(255,255,255,.12); border-radius:12px;
    background:rgba(255,255,255,.065); color:#fff; font:600 13px/1.1 "IBM Plex Sans",sans-serif;
    padding:10px 12px; text-align:left;
}
.tw1-tool-option:active, .tw1-mode-option:active { background:rgba(255,255,255,.15); }
.tw1-mode-option { display:flex; align-items:center; gap:11px; }
.tw1-mode-option.active { border-color:var(--accent); background:var(--accent-soft); }
.tw1-mode-option .mode-option-icon { width:23px; height:23px; flex:0 0 23px; }
.tw1-mode-option .mode-option-icon svg { width:100%; height:100%; }
.tw1-drawer-content { margin-top:12px; }
.tw1-drawer-content.has-panel { padding-bottom:20px; }
.tw1-drawer-content .side-panel { position:static !important; inset:auto !important; width:100% !important; max-width:none !important; height:auto !important; max-height:none !important; border:0 !important; box-shadow:none !important; background:transparent !important; transform:none !important; overflow:visible !important; }
/* The original panel shell must disappear completely while its inner
   controls live inside the mobile drawer. This prevents a second menu from
   appearing behind/on top of the drawer. */
body.tw1-touch-layout .side-panel.tw1-drawer-embedded-panel { display:none !important; }
.tw1-drawer-content .side-panel-inner { padding:0 !important; max-height:none !important; overflow:visible !important; }
.tw1-drawer-content .side-panel-header { position:static !important; }
.tw1-drawer-content .side-panel-close { display:none !important; }
.tw1-drawer-content .side-panel-footer { position:static !important; }
.tw1-drawer-content .hidden { display:none !important; }
@media (max-width:520px){
    body.tw1-touch-layout #tw1-mobile-drawer{left:0;right:0;bottom:0;border-radius:18px 18px 0 0;}
    .tw1-tools-menu{grid-template-columns:1fr;}
}


/* ═══════════════════════════════════════════════════════════════════════
   TW1Analyst mobile drawer — integrated controls (v12)
   Menus are part of the sheet, never floating above/outside it.
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px), (pointer: coarse) {
    body.tw1-touch-layout #tw1-mobile-drawer {
        background: linear-gradient(180deg, rgba(15,19,25,.985), rgba(10,13,18,.99));
        border: 1px solid rgba(255,255,255,.12);
        border-bottom: 0;
        box-shadow: 0 -18px 60px rgba(0,0,0,.48);
        transition: transform .32s cubic-bezier(.22,.85,.25,1), box-shadow .25s ease;
    }
    body.tw1-touch-layout #tw1-mobile-drawer.open {
        box-shadow: 0 -24px 75px rgba(0,0,0,.58);
    }

    .tw1-drawer-grab-zone {
        height: 58px;
        min-height: 58px;
        padding: 0;
    }
    .tw1-drawer-grab {
        width: 82px;
        height: 5px;
        background: rgba(255,255,255,.52);
        box-shadow: 0 0 0 1px rgba(255,255,255,.05), 0 2px 8px rgba(0,0,0,.35);
        transition: width .2s ease, background .2s ease, transform .2s ease;
    }
    .tw1-drawer-grab-zone:active .tw1-drawer-grab {
        width: 98px;
        background: rgba(255,255,255,.82);
        transform: scaleY(1.25);
    }

    .tw1-drawer-page {
        height: calc(100% - 58px);
        padding: 0 14px calc(22px + var(--sab,0px));
        scrollbar-width: thin;
    }

    .tw1-drawer-row {
        display: grid;
        grid-template-columns: minmax(0,1fr) 58px;
        gap: 9px;
        align-items: stretch;
    }

    .tw1-tools-trigger,
    .tw1-mode-trigger {
        min-height: 52px;
        height: 52px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--bg-1);
        color: var(--text);
        box-shadow: 0 2px 7px rgba(0,0,0,.42);
        font-family: "Oswald", sans-serif;
        font-size: 13px;
        font-weight: 600;
        letter-spacing: .12em;
        text-transform: uppercase;
        transition: background .16s ease, border-color .16s ease, color .16s ease,
                    box-shadow .18s ease, transform .12s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .tw1-tools-trigger {
        display: flex;
        align-items: center;
        gap: 9px;
        padding: 0 14px;
        text-align: left;
    }
    .tw1-tools-trigger:active,
    .tw1-mode-trigger:active {
        transform: scale(.975);
        background: var(--surface);
    }
    .tw1-tools-trigger[aria-expanded="true"],
    .tw1-mode-trigger[aria-expanded="true"] {
        color: var(--accent);
        border-color: var(--accent-line);
        background: var(--accent-soft);
        box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 16px rgba(255,176,32,.12);
    }
    .tw1-trigger-icon {
        width: 18px;
        height: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 18px;
    }
    .tw1-trigger-icon svg { width: 18px; height: 18px; }
    .tw1-trigger-chevron {
        margin-left: auto;
        font-family: Arial, sans-serif;
        font-size: 17px;
        line-height: 1;
        opacity: .72;
        transform: translateY(-1px);
        transition: transform .22s cubic-bezier(.2,.8,.2,1);
    }
    .tw1-tools-trigger[aria-expanded="true"] .tw1-trigger-chevron {
        transform: rotate(180deg) translateY(1px);
    }

    .tw1-mode-trigger {
        margin-left: 0;
        width: 58px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }
    .tw1-mode-current-icon {
        width: 22px;
        height: 22px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .tw1-mode-current-icon svg { width: 22px; height: 22px; }
    .tw1-mode-current-dot {
        position: absolute;
        width: 5px;
        height: 5px;
        right: 9px;
        top: 9px;
        border-radius: 50%;
        background: var(--accent);
        box-shadow: 0 0 7px rgba(255,176,32,.65);
        opacity: .9;
    }

    /* Critical: these shells own the menu height. The menus are static-flow
       children of the drawer, so they cannot appear as floating cards behind it. */
    .tw1-menu-shell {
        display: grid;
        grid-template-rows: 0fr;
        opacity: 0;
        margin-top: 0;
        overflow: hidden;
        transition: grid-template-rows .28s cubic-bezier(.22,.8,.25,1),
                    opacity .18s ease, margin-top .28s ease;
    }
    .tw1-menu-shell.open {
        grid-template-rows: 1fr;
        opacity: 1;
        margin-top: 9px;
    }
    .tw1-tools-menu,
    .tw1-mode-menu {
        min-height: 0;
        position: static !important;
        inset: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        width: auto !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transition: none !important;
    }
    .tw1-menu-shell:not(.open) > .tw1-tools-menu,
    .tw1-menu-shell:not(.open) > .tw1-mode-menu {
        visibility: hidden;
    }
    .tw1-menu-shell.open > .tw1-tools-menu,
    .tw1-menu-shell.open > .tw1-mode-menu {
        visibility: visible;
    }

    .tw1-tools-menu {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 8px;
    }
    .tw1-mode-menu {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 8px;
    }

    .tw1-tool-option,
    .tw1-mode-option {
        min-height: 50px;
        width: 100%;
        box-sizing: border-box;
        border: 1px solid var(--border) !important;
        border-radius: var(--radius) !important;
        background: var(--bg-1) !important;
        color: var(--text) !important;
        box-shadow: 0 2px 6px rgba(0,0,0,.32);
        font-family: "Oswald", sans-serif;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: .08em;
        text-transform: uppercase;
        transition: background .15s ease, border-color .15s ease, color .15s ease,
                    box-shadow .18s ease, transform .12s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .tw1-tool-option {
        display: grid;
        grid-template-columns: 23px minmax(0,1fr) 12px;
        align-items: center;
        gap: 8px;
        padding: 8px 10px;
        text-align: left;
    }
    .tool-option-icon,
    .mode-option-icon {
        width: 23px;
        height: 23px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: currentColor;
    }
    .tool-option-icon svg,
    .mode-option-icon svg { width: 21px; height: 21px; }
    .tool-option-label,
    .mode-option-label {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .tool-option-chevron {
        font-family: Arial, sans-serif;
        font-size: 18px;
        line-height: 1;
        opacity: .45;
        text-align: right;
    }
    .tw1-mode-option {
        display: grid;
        grid-template-columns: 24px minmax(0,1fr) 16px;
        align-items: center;
        gap: 8px;
        padding: 8px 10px;
        text-align: left;
    }
    .tw1-mode-option .mode-option-check {
        opacity: 0;
        color: var(--accent);
        font-family: Arial, sans-serif;
        font-size: 15px;
        text-align: right;
        transition: opacity .15s ease, transform .18s ease;
    }
    .tw1-tool-option:hover,
    .tw1-mode-option:hover {
        border-color: var(--accent-line) !important;
        background: var(--surface) !important;
        color: var(--accent) !important;
        box-shadow: inset 0 0 0 1px var(--accent-line), 0 4px 12px rgba(0,0,0,.42);
    }
    .tw1-tool-option:active,
    .tw1-mode-option:active {
        transform: scale(.975);
    }
    .tw1-mode-option.active {
        border-color: var(--accent) !important;
        background: var(--accent-soft) !important;
        color: var(--accent) !important;
        box-shadow: inset 0 0 0 1px var(--accent), 0 0 14px rgba(255,176,32,.16);
    }
    .tw1-mode-option.active .mode-option-check {
        opacity: 1;
        transform: scale(1.05);
    }

    .tw1-drawer-content {
        margin-top: 10px;
        animation: tw1DrawerContentIn .22s ease both;
    }
    .tw1-drawer-content.has-panel {
        padding: 2px 0 20px;
        border-top: 1px solid rgba(255,255,255,.08);
    }
    @keyframes tw1DrawerContentIn {
        from { opacity: 0; transform: translateY(5px); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* Panels become actual drawer content — no floating card treatment. */
    .tw1-drawer-content .side-panel,
    .tw1-drawer-content .side-panel-inner {
        position: static !important;
        inset: auto !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        transform: none !important;
        overflow: visible !important;
    }
    .tw1-drawer-content .side-panel-inner {
        padding: 10px 0 0 !important;
    }
    .tw1-drawer-content .side-panel-header {
        position: static !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .tw1-drawer-content .side-panel-close { display: none !important; }
    .tw1-drawer-content .side-panel-footer { position: static !important; }
    .tw1-drawer-content .hidden { display: none !important; }

    @media (max-width: 520px) {
        .tw1-tools-menu,
        .tw1-mode-menu { grid-template-columns: 1fr; }
    }
}

/* v14 — drawer-native workspace styling.  Existing desktop panels remain
   unchanged; on touch they become simple inline controls inside the sheet. */
@media (pointer: coarse), (max-width: 640px) {
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-main { padding-bottom: 18px; }

  /* No floating/card treatment anywhere inside the drawer. */
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content.has-panel {
    margin-top: 12px;
    padding: 0 2px 18px;
    border-top: 1px solid var(--border);
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content .side-panel-header,
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content .side-panel-footer {
    display: none !important;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content .side-panel-body {
    padding: 0 !important;
    margin: 0 !important;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content .side-panel-location {
    padding: 10px 2px 8px !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 11px !important;
    opacity: .62;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content .settings-group {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content .settings-group-title {
    display: none !important;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content .settings-row {
    min-height: 48px !important;
    padding: 9px 2px !important;
    margin: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.07) !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: grid !important;
    grid-template-columns: minmax(0,1fr) minmax(110px,42%) !important;
    gap: 12px !important;
    align-items: center !important;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content .settings-row-text {
    min-width: 0;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content .settings-row-label {
    font-family: "Oswald", sans-serif !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    color: var(--text) !important;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content .settings-row-desc {
    display: none !important;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content .settings-select,
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content select {
    width: 100% !important;
    min-width: 0 !important;
    height: 36px !important;
    padding: 0 9px !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    background: var(--bg-1) !important;
    color: var(--text) !important;
    font: 500 11px "Oswald", sans-serif !important;
    letter-spacing: .03em !important;
    outline: none !important;
    box-shadow: none !important;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content input[type="range"] {
    width: 100% !important;
    accent-color: var(--accent);
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content .settings-slider-wrap {
    min-width: 0;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content .settings-slider-val {
    font: 600 10px "Oswald", sans-serif !important;
    color: var(--accent) !important;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content .models-playback-row {
    display: grid !important;
    grid-template-columns: 38px minmax(0,1fr) 58px !important;
    gap: 8px !important;
    padding: 12px 2px !important;
    border-bottom: 1px solid rgba(255,255,255,.07);
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content .models-time-label {
    padding: 7px 2px 12px !important;
    font-size: 10px !important;
    opacity: .55;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content .models-legend-img {
    display: block;
    width: 100% !important;
    max-height: 48px !important;
    object-fit: contain;
  }

  /* The two top controls are part of the same surface, not floating cards. */
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-row {
    padding: 0 2px;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-tools-trigger,
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-mode-trigger {
    box-shadow: none !important;
    background: rgba(255,255,255,.045) !important;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-tools-menu,
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-mode-menu {
    gap: 0 !important;
    border-top: 1px solid rgba(255,255,255,.07) !important;
    border-bottom: 1px solid rgba(255,255,255,.07) !important;
    background: rgba(255,255,255,.018) !important;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-tool-option,
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-mode-option {
    min-height: 44px !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.055) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    letter-spacing: .055em !important;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-tool-option:last-child,
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-mode-option:last-child {
    border-bottom: 0 !important;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-tool-option:hover,
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-mode-option:hover,
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-tool-option:active,
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-mode-option:active {
    box-shadow: none !important;
    background: rgba(255,255,255,.055) !important;
    color: var(--text) !important;
    transform: none !important;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-mode-option.active {
    color: var(--accent) !important;
    background: var(--accent-soft) !important;
  }
}

/* v15 — playback is part of the mobile drawer; the sheet can stop at any
   height instead of snapping to only open/closed states. */
@media (pointer: coarse), (max-width: 640px) {
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-playback-slot {
    margin: 8px 2px 0;
    padding: 0;
    border-top: 1px solid rgba(255,255,255,.07);
    border-bottom: 1px solid rgba(255,255,255,.07);
  }
  body.tw1-touch-layout #tw1-mobile-drawer #radar-playback-bar {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    min-height: 48px;
    margin: 0 !important;
    padding: 7px 4px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important;
  }
  body.tw1-touch-layout #tw1-mobile-drawer #radar-playback-bar.collapsed {
    width: 100% !important;
    justify-content: flex-start !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 7px 4px !important;
  }
  body.tw1-touch-layout #tw1-mobile-drawer #radar-playback-bar .playback-play-btn {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    flex: 0 0 38px;
  }
  body.tw1-touch-layout #tw1-mobile-drawer #radar-playback-bar:not(.collapsed) {
    display: grid;
    grid-template-columns: 38px minmax(0,1fr) auto;
    gap: 8px;
    align-items: center;
  }
  body.tw1-touch-layout #tw1-mobile-drawer #radar-playback-bar.collapsed .playback-time-label,
  body.tw1-touch-layout #tw1-mobile-drawer #radar-playback-bar.collapsed .playback-scrub-slider,
  body.tw1-touch-layout #tw1-mobile-drawer #radar-playback-bar.collapsed .playback-count-label,
  body.tw1-touch-layout #tw1-mobile-drawer #radar-playback-bar.collapsed .playback-speed-btn {
    display: none !important;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-page {
    overscroll-behavior: contain;
  }
}

/* v20 playback chrome: the play control lives beside the grab handle; the
   timeline itself lives inside the drawer. */
@media (pointer: coarse), (max-width: 640px) {
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-grab-zone {
    display:grid; grid-template-columns:48px 1fr 48px; align-items:center; justify-items:center;
    padding:0 8px;
  }
  .tw1-drawer-play-trigger,.tw1-drawer-play-close {
    /* Fully round rather than an 11px-radius square chip — reads clearly as
       a play control instead of just another squared-off icon button next
       to the pill-shaped grab handle. */
    width:38px;height:38px;border:0;border-radius:999px;display:flex;align-items:center;justify-content:center;
    background:rgba(255,255,255,.075);color:#fff;box-shadow:none;
  }
  .tw1-drawer-play-trigger svg { width:17px;height:17px; }
  .tw1-drawer-play-trigger.active { background:var(--accent-soft);color:var(--accent); }
  .tw1-drawer-play-close { font-size:25px;font-weight:300;line-height:1;display:none; }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-playback-slot {
    margin:4px 0 8px; border-top:1px solid rgba(255,255,255,.06); border-bottom:1px solid rgba(255,255,255,.06);
  }
  body.tw1-touch-layout #tw1-mobile-drawer #radar-playback-bar .tw1-mobile-hidden-play { display:none !important; }
  body.tw1-touch-layout #tw1-mobile-drawer #radar-playback-bar {
    display:flex !important; min-height:50px; gap:8px; align-items:center;
  }
  body.tw1-touch-layout #tw1-mobile-drawer #radar-playback-bar.collapsed { display:none !important; }
  body.tw1-touch-layout #tw1-mobile-drawer #radar-playback-bar .playback-time-label { min-width:46px;font-size:11px; }
  body.tw1-touch-layout #tw1-mobile-drawer #radar-playback-bar .playback-count-label { font-size:10px;opacity:.65; }
  body.tw1-touch-layout #tw1-mobile-drawer #radar-playback-bar .playback-speed-btn { font-size:10px;padding:5px 7px; }
  body.tw1-touch-layout #tw1-mobile-drawer #radar-playback-bar .playback-scrub-slider { flex:1;min-width:0; }
}

@media (pointer: coarse), (max-width: 640px) {
  body.tw1-touch-layout #tw1-model-playback { display:none; margin:4px 0 8px; padding:8px 4px; align-items:center; gap:9px; border-top:1px solid rgba(255,255,255,.06); border-bottom:1px solid rgba(255,255,255,.06); }
  body.tw1-touch-layout #tw1-model-playback.active { display:flex; }
  body.tw1-touch-layout #tw1-model-playback input { flex:1; min-width:0; }
  body.tw1-touch-layout #tw1-model-time { font:600 10px/1 "IBM Plex Mono",monospace; opacity:.7; min-width:28px; text-align:right; }
}

/* v22: active mobile playback replaces the drawer handle row itself. */
@media (pointer: coarse), (max-width: 640px) {
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-grab-zone.playback-active {
    display:block;
    position:relative;
    padding:0;
  }
  /* The white grab pill must fully disappear while playback chrome takes
     over the handle row — display:none alone should already do it, but this
     view relies on the grab-zone's height staying in sync with its content
     across several breakpoints (58px/64px/54px), so opacity+pointer-events
     are added as a belt-and-braces guard against any stacking-order surprise
     and everything is !important since this same class is targeted by
     several other breakpoint-specific rules in this file. */
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-grab-zone.playback-active .tw1-drawer-grab {
    display:none !important;
    opacity:0 !important;
    pointer-events:none !important;
  }
  /* Centered with top:50%/translateY instead of fixed inset/top values so
     it stays vertically centered in the grab zone regardless of which
     breakpoint's grab-zone height (54–64px) is active, rather than only
     lining up correctly at one specific height. */
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-grab-zone.playback-active #radar-playback-bar {
    position:absolute !important;
    top:50% !important;
    left:52px !important;
    right:52px !important;
    transform:translateY(-50%) !important;
    width:auto !important;
    min-height:0;
    margin:0 !important;
    padding:0 4px !important;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    z-index:1;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-grab-zone.playback-active #radar-playback-bar:not(.collapsed) {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
    align-items:center;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-grab-zone.playback-active .tw1-drawer-play-trigger,
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-grab-zone.playback-active .tw1-drawer-play-close {
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    z-index:3;
  }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-grab-zone.playback-active .tw1-drawer-play-trigger { left:8px; }
  body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-grab-zone.playback-active .tw1-drawer-play-close { right:8px; }
}


/* ═══════════════════════════════════════════════════════════════════════
   v36 — compact touch drawer + dedicated Volume/Cross Section workspace
   Volume/Cross Section are never drawer-embedded. Their split panels own
   the lower half of the screen while the map and volume selection box stay
   visible above. The controls drawer remains available when those tools are
   closed.
   ═══════════════════════════════════════════════════════════════════════ */

/* Immersive tools temporarily take over the touch workspace. */
@media (pointer: coarse), (max-width: 640px) {
    body.vol-split-active #tw1-mobile-drawer,
    body.cs-split-active #tw1-mobile-drawer {
        display: none !important;
        pointer-events: none !important;
    }

    /* Keep the ordinary drawer compact rather than making every tool a
       full-width giant row. */
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-page {
        padding-left: 10px;
        padding-right: 10px;
        padding-bottom: calc(14px + var(--sab,0px));
    }
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-row {
        grid-template-columns: minmax(0,1fr) 48px;
        gap: 7px;
    }
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-tools-trigger,
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-mode-trigger {
        min-height: 44px;
        height: 44px;
        border-radius: 11px;
    }
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-tools-trigger {
        padding: 0 11px;
        gap: 8px;
        font-size: 13px;
    }
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-mode-trigger svg {
        width: 21px;
        height: 21px;
    }
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-tools-menu {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-top: 7px;
    }
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-tool-option,
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-mode-option {
        min-height: 42px;
        border-radius: 10px;
        padding: 7px 9px;
        font-size: 12px;
    }
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-tool-option {
        display: flex;
        align-items: center;
        gap: 7px;
    }
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-tool-option .tool-option-chevron {
        margin-left: auto;
    }
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-content {
        margin-top: 8px;
    }

    /* Dedicated lower-half workspace. Keep the renderer compact enough that
       the map remains a real, useful map above it. */
    body.vol-split-active #volume-panel,
    body.cs-split-active #cross-section-panel {
        z-index: 9100;
    }
}

/* iPad / large touch screens: a small right-side drawer. It still uses the
   same vertical drag mechanic; only its footprint and anchor change. */
@media (pointer: coarse) and (min-width: 641px) {
    body.tw1-touch-layout #tw1-mobile-drawer {
        left: auto !important;
        right: 14px !important;
        bottom: calc(14px + var(--sab,0px)) !important;
        width: min(31vw, 360px) !important;
        height: min(46dvh, 500px) !important;
        border-radius: 16px !important;
        transform: translateY(calc((1 - var(--drawer-open)) * (100% - 58px))) !important;
        box-shadow: 0 12px 42px rgba(0,0,0,.48) !important;
    }
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-grab-zone {
        height: 54px;
        min-height: 54px;
    }
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-page {
        height: calc(100% - 54px);
        padding: 0 10px 14px;
    }
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-row {
        grid-template-columns: minmax(0,1fr) 48px;
    }
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-tools-menu {
        grid-template-columns: 1fr 1fr;
    }
}

/* iPhone-sized screens: full-width, but shallow and compact. */
@media (max-width: 640px) and (pointer: coarse) {
    body.tw1-touch-layout #tw1-mobile-drawer {
        height: min(48dvh, 430px);
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   v37 — touch polish, compact Products controls, continuous radar smoothing
   ═══════════════════════════════════════════════════════════════════════ */
@media (pointer: coarse), (max-width: 640px) {
    /* Critical: the broad drawer transition rule above must NOT run while the
       finger is dragging. Without this higher-specificity override, iPad's
       sheet animates toward each pointer position and visibly lags behind the
       finger. */
    body.tw1-touch-layout #tw1-mobile-drawer.dragging {
        transition: none !important;
        -webkit-transition: none !important;
    }

    /* Products should be immediately visible. The rendering controls are a
       compact footer, not two giant rows consuming the top of the drawer. */
    body.tw1-touch-layout #tw1-mobile-drawer #products-panel-body {
        overflow: visible !important;
        flex: none !important;
    }
    body.tw1-touch-layout #tw1-mobile-drawer #products-panel .side-panel-section {
        margin-bottom: 8px !important;
        padding-bottom: 8px !important;
    }
    body.tw1-touch-layout #tw1-mobile-drawer #products-panel .side-panel-section-title {
        font-size: 10px !important;
        margin: 2px 0 5px !important;
        letter-spacing: .14em !important;
    }
    body.tw1-touch-layout #tw1-mobile-drawer #products-panel .product-row {
        min-height: 39px !important;
        padding: 6px 8px !important;
        margin-bottom: 4px !important;
        border-radius: 8px !important;
        gap: 7px !important;
    }
    body.tw1-touch-layout #tw1-mobile-drawer #products-panel .product-row-name {
        font-size: 11px !important;
        margin-bottom: 0 !important;
    }
    body.tw1-touch-layout #tw1-mobile-drawer #products-panel .product-row-desc {
        display: none !important;
    }
    body.tw1-touch-layout #tw1-mobile-drawer #products-panel .product-row-unit {
        font-size: 9px !important;
    }

    /* Rendering controls: compact enough to sit after the products instead of
       pushing them below the fold. */
    body.tw1-touch-layout #tw1-mobile-drawer #products-panel > .side-panel-inner > .settings-group {
        margin: 5px 0 0 !important;
        padding: 5px 0 0 !important;
        border-top: 1px solid rgba(255,255,255,.07) !important;
    }
    body.tw1-touch-layout #tw1-mobile-drawer #products-panel > .side-panel-inner > .settings-group .settings-row {
        min-height: 36px !important;
        padding: 5px 2px !important;
        grid-template-columns: minmax(0,1fr) minmax(105px,46%) !important;
        gap: 7px !important;
    }
    body.tw1-touch-layout #tw1-mobile-drawer #products-panel > .side-panel-inner > .settings-group .settings-row-text {
        min-width: 0 !important;
    }
    body.tw1-touch-layout #tw1-mobile-drawer #products-panel > .side-panel-inner > .settings-group .settings-row-label {
        font-size: 10px !important;
    }
    body.tw1-touch-layout #tw1-mobile-drawer #products-panel > .side-panel-inner > .settings-group .settings-row-desc {
        display: none !important;
    }
    body.tw1-touch-layout #tw1-mobile-drawer #products-panel > .side-panel-inner > .settings-group .settings-slider-wrap {
        display: grid !important;
        grid-template-columns: minmax(0,1fr) 30px !important;
        gap: 6px !important;
        align-items: center !important;
    }
    body.tw1-touch-layout #tw1-mobile-drawer #products-panel > .side-panel-inner > .settings-group input[type="range"] {
        width: 100% !important;
        min-width: 0 !important;
    }
    body.tw1-touch-layout #tw1-mobile-drawer #products-panel > .side-panel-inner > .settings-group .settings-slider-val {
        width: 30px !important;
        font-size: 9px !important;
    }
}

/* On the iPad-sized right drawer, let the content scroll naturally while the
   grab zone remains the only vertical drag surface. */
@media (pointer: coarse) and (min-width: 641px) {
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-page {
        scroll-behavior: auto !important;
    }
    body.tw1-touch-layout #tw1-mobile-drawer .tw1-drawer-grab-zone {
        touch-action: none !important;
        user-select: none;
        -webkit-user-select: none;
    }
}

/* ── Embed mode (each Multipane pane is this whole app in an iframe) ──── */
body.tw1-embed #top-bar,
body.tw1-embed #bottom-strip,
body.tw1-embed #top-progress-bar,
body.tw1-embed .side-panel,
body.tw1-embed #multipane-view {
    display: none !important;
}

/* ── Multipane ──────────────────────────────────────────────────────────
   Desktop: left/right panes, one shared bar pinned across the top of the
   whole view — left half picks the left pane's product, right half picks
   the right pane's.
   Mobile (≤900px): top/bottom panes. The shared top bar becomes just the
   top pane's picker; a second bar sitting between the two panes (
   #multipane-group-b-mobile) picks the bottom pane's product instead. */
#multipane-view {
    position: fixed;
    inset: 0;
    z-index: 4500;
    background: var(--bg-0);
    display: flex;
    flex-direction: column;
}
#multipane-view.hidden { display: none; }

#multipane-topbar {
    flex: 0 0 auto;
    display: flex;
    align-items: stretch;
    height: 46px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-1);
    box-shadow: inset 0 -1px 0 var(--accent-line);
}
.multipane-select-group {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    overflow-x: auto;
    scrollbar-width: none;
}
.multipane-select-group::-webkit-scrollbar { display: none; }
#multipane-topbar .multipane-select-group + .multipane-select-group {
    border-left: 1px solid var(--border);
}
.multipane-product-btn {
    flex: 0 0 auto;
    padding: 6px 11px;
    font: 600 11px/1 "IBM Plex Sans", sans-serif;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
}
.multipane-product-btn:hover { color: var(--text); }
.multipane-product-btn.active {
    color: var(--accent);
    border-color: var(--accent-line);
    background: var(--accent-soft);
}
#multipane-close {
    flex: 0 0 auto;
    width: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-left: 1px solid var(--border);
    cursor: pointer;
}
#multipane-close:hover { color: var(--accent); }

#multipane-panes {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: row; /* desktop: left | right */
}
.multipane-pane {
    position: relative;
    flex: 1 1 50%;
    min-width: 0;
    min-height: 0;
}
#multipane-panes .multipane-pane + .multipane-select-group + .multipane-pane,
#multipane-panes .multipane-pane + .multipane-pane {
    border-left: 1px solid var(--border);
}
.multipane-pane iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: var(--bg-0);
}

/* The mobile-only middle picker bar is hidden entirely on desktop, and the
   desktop-only right-hand group in the shared top bar is hidden on mobile
   (its buttons are duplicated into the middle bar instead). */
#multipane-group-b-mobile { display: none; }

@media (max-width: 900px) {
    #multipane-panes { flex-direction: column; }
    .multipane-pane + .multipane-pane { border-left: 0; }
    #multipane-topbar .multipane-select-group:nth-child(2) { display: none; }
    #multipane-group-b-mobile {
        display: flex;
        flex: 0 0 auto;
        height: 42px;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        background: var(--bg-1);
    }
}

/* ── Animation Studio ───────────────────────────────────────────── */
.tw1-animation-studio {
    position:absolute;
    left:14px;
    right:14px;
    bottom:14px;
    z-index:80;
    background:rgba(8,9,12,.96);
    border:1px solid rgba(255,255,255,.14);
    border-radius:10px;
    box-shadow:0 12px 40px rgba(0,0,0,.45);
    color:#fff;
    font-family:Inter,system-ui,sans-serif;
    overflow:hidden;
    backdrop-filter:blur(12px);
}
.tw1-animation-studio.hidden{display:none}
.tw1-icon-dependent.hidden{display:none}
.tw1-icon-upload{position:relative;overflow:hidden;cursor:pointer}.tw1-icon-upload input{position:absolute;inset:0;opacity:0;cursor:pointer}
.tw1-anim-head{display:flex;align-items:center;justify-content:space-between;padding:9px 12px;border-bottom:1px solid rgba(255,255,255,.09)}
.tw1-anim-title{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
.tw1-anim-subtitle{font-size:10px;color:rgba(255,255,255,.45);margin-top:2px}
.tw1-anim-head-actions,.tw1-anim-toolbar{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.tw1-anim-head-actions{gap:5px}
.tw1-anim-small,.tw1-anim-tool,.tw1-anim-main{border:1px solid rgba(255,255,255,.13);background:rgba(255,255,255,.055);color:#eee;border-radius:5px;padding:6px 9px;font-size:9px;font-weight:700;letter-spacing:.07em;cursor:pointer}
.tw1-anim-main{background:rgba(255,176,32,.16);border-color:rgba(255,176,32,.35);color:#ffb020;min-width:54px}
.tw1-anim-tool:hover,.tw1-anim-small:hover{background:rgba(255,255,255,.1)}
.tw1-anim-toolbar{padding:7px 10px;border-bottom:1px solid rgba(255,255,255,.08)}
.tw1-anim-duration,.tw1-anim-vignette{font-size:9px;color:rgba(255,255,255,.5);display:flex;align-items:center;gap:5px;margin-left:auto}
.tw1-anim-duration input{width:54px;background:#111318;border:1px solid rgba(255,255,255,.12);color:#fff;border-radius:4px;padding:5px}
.tw1-anim-vignette{margin-left:0}.tw1-anim-vignette select{background:#111318;color:#fff;border:1px solid rgba(255,255,255,.12);border-radius:4px;padding:5px}
.tw1-anim-import{position:relative;overflow:hidden}.tw1-anim-import input{position:absolute;inset:0;opacity:0;cursor:pointer}
.tw1-anim-time-row{display:grid;grid-template-columns:58px 1fr 58px;gap:8px;align-items:center;padding:7px 10px 3px}
.tw1-anim-time-row span{font:10px/1 monospace;color:rgba(255,255,255,.65)}
.tw1-anim-time-row span:last-child{text-align:right}
.tw1-anim-time{width:100%;accent-color:#ffb020}
.tw1-anim-ruler{height:16px;margin:0 10px;position:relative;border-bottom:1px solid rgba(255,255,255,.1)}
.tw1-anim-ruler span{position:absolute;bottom:2px;transform:translateX(-50%);font:8px monospace;color:rgba(255,255,255,.3)}
.tw1-anim-tracks{padding:4px 10px 7px}
.tw1-anim-track{display:grid;grid-template-columns:105px 1fr;min-height:25px;border-bottom:1px solid rgba(255,255,255,.045);align-items:center}
.tw1-anim-track>span{font:8px/1 monospace;letter-spacing:.06em;color:rgba(255,255,255,.45)}
.tw1-track-lane{height:25px;position:relative}
.tw1-key{position:absolute;top:6px;width:9px;height:9px;background:#ffb020;transform:translateX(-50%) rotate(45deg);border-radius:1px;border:1px solid #171717;cursor:pointer}
.tw1-key.selected{background:#fff;box-shadow:0 0 0 2px rgba(255,176,32,.35)}
.tw1-anim-inspector{border-top:1px solid rgba(255,255,255,.08);padding:7px 10px;font-size:9px;color:rgba(255,255,255,.55);min-height:27px}
.tw1-anim-inspector-title{display:inline-block;color:#ffb020;font-weight:700;margin-right:8px}
.tw1-animation-vignette{position:fixed;inset:0;z-index:75;pointer-events:none;background:#000;opacity:0;display:none;transition:opacity .05s linear}
/* On-map move gizmo for Animation Studio's uploaded icon: a vertical-axis
   handle above the icon and a horizontal-axis handle to its right, each
   draggable independently — together they work like a 2D move/work-plane
   widget for repositioning the icon directly on the map. */
.tw1-icon-gizmo-arrow{position:absolute;z-index:3050;width:28px;height:28px;margin:-14px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:rgba(10,14,20,.92);border:2px solid #ffb100;color:#ffb100;font-size:13px;line-height:1;cursor:grab;touch-action:none;box-shadow:0 0 0 3px rgba(255,177,0,.18),0 2px 6px rgba(0,0,0,.5);user-select:none}
.tw1-icon-gizmo-arrow:hover{background:rgba(255,177,0,.18)}
.tw1-icon-gizmo-arrow.dragging{cursor:grabbing;background:#ffb100;color:#111}
.tw1-icon-gizmo-arrow.hidden{display:none}
.tw1-icon-setup{margin:8px 0;padding:10px;border:1px solid rgba(255,255,255,.16);border-radius:8px;background:rgba(8,12,18,.94);position:relative;z-index:5}.tw1-icon-setup-title{font-size:11px;font-weight:800;letter-spacing:.12em;margin-bottom:8px}.tw1-icon-setup-grid{display:grid;grid-template-columns:repeat(4,minmax(120px,1fr));gap:8px}.tw1-icon-setup-grid label{display:flex;flex-direction:column;gap:4px;font-size:10px}.tw1-icon-setup-grid input,.tw1-icon-setup-grid select{min-width:0;background:#111923;color:#fff;border:1px solid #33404d;border-radius:4px;padding:5px}.tw1-icon-setup-actions{display:flex;gap:7px;margin-top:8px}.tw1-icon-setup.hidden{display:none!important}@media(max-width:900px){.tw1-icon-setup-grid{grid-template-columns:repeat(2,minmax(120px,1fr))}}
.tw1-icon-nudge-row{display:flex;align-items:center;gap:14px;margin-top:10px;flex-wrap:wrap}
.tw1-icon-nudge-pad{display:grid;grid-template-columns:32px 32px 32px;grid-template-areas:". up ." "left down right";gap:3px;flex:0 0 auto}
.tw1-icon-nudge-btn{width:32px;height:28px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.06);color:#ffb020;border-radius:5px;cursor:pointer;font-size:11px;line-height:1;display:flex;align-items:center;justify-content:center}
.tw1-icon-nudge-btn:hover{background:rgba(255,176,32,.18);border-color:rgba(255,176,32,.4)}
.tw1-icon-nudge-btn:active{background:rgba(255,176,32,.32)}
.tw1-icon-nudge-btn.pos-up{grid-area:up}.tw1-icon-nudge-btn.pos-left{grid-area:left}.tw1-icon-nudge-btn.pos-down{grid-area:down}.tw1-icon-nudge-btn.pos-right{grid-area:right}
.tw1-icon-nudge-step{font-size:9px;color:rgba(255,255,255,.55);display:flex;flex-direction:column;gap:4px}
.tw1-icon-nudge-step select{background:#111923;color:#fff;border:1px solid #33404d;border-radius:4px;padding:5px}
.tw1-icon-nudge-row .tw1-path-status{flex:1 1 180px}
@media (max-width:700px){
 .tw1-animation-studio{left:6px;right:6px;bottom:6px}.tw1-anim-track{grid-template-columns:75px 1fr}.tw1-anim-duration{margin-left:0}
}

.tw1-anim-history-time{background:#111318;color:#fff;border:1px solid rgba(255,255,255,.12);border-radius:4px;padding:5px;font:9px monospace;max-width:190px}
.tw1-route-editor{border-top:1px solid rgba(255,255,255,.08);padding:9px 10px;background:rgba(255,255,255,.025)}
.tw1-route-editor.hidden{display:none}
.tw1-route-editor-title{font-size:9px;font-weight:800;letter-spacing:.08em;color:#ffb020;margin-bottom:7px}
.tw1-route-grid{display:grid;grid-template-columns:1fr 1fr 110px 110px;gap:7px}
.tw1-route-grid label,.tw1-route-row label{font-size:8px;color:rgba(255,255,255,.48);display:flex;flex-direction:column;gap:4px}
.tw1-route-grid input,.tw1-route-row select{background:#111318;color:#fff;border:1px solid rgba(255,255,255,.12);border-radius:4px;padding:6px;font:10px system-ui}
.tw1-route-row{display:flex;align-items:end;gap:7px;margin-top:7px}
.tw1-route-status,.tw1-path-status{font-size:9px;color:rgba(255,255,255,.5);margin-top:6px}
.tw1-path-status{padding:0 10px 7px}
@media (max-width:700px){.tw1-route-grid{grid-template-columns:1fr 1fr}.tw1-route-row{flex-wrap:wrap}}

/* ── Animation Studio workspace: map / controls / timeline ─────────── */
body.tw1-animation-workspace {
    overflow: hidden !important;
}
body.tw1-animation-workspace #map {
    position: absolute !important;
    inset: auto !important;
    left: 0 !important;
    top: 44px !important;
    right: 390px !important;
    bottom: 270px !important;
    width: auto !important;
    height: auto !important;
    z-index: 1 !important;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 0 0 8px 0;
    overflow: hidden;
}
body.tw1-animation-workspace #animation-studio {
    position: fixed !important;
    inset: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 80 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    backdrop-filter: none !important;
    pointer-events: none !important;
}
body.tw1-animation-workspace #animation-studio .tw1-anim-controls {
    position: absolute !important;
    top: 44px !important;
    right: 0 !important;
    bottom: 270px !important;
    width: 390px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: rgba(8,9,12,.97) !important;
    border-left: 1px solid rgba(255,255,255,.14) !important;
    border-bottom: 1px solid rgba(255,255,255,.14) !important;
    box-shadow: -10px 0 30px rgba(0,0,0,.25) !important;
    pointer-events: auto !important;
    padding-bottom: 12px !important;
}
body.tw1-animation-workspace #animation-studio .tw1-anim-controls .tw1-anim-head,
body.tw1-animation-workspace #animation-studio .tw1-anim-controls .tw1-anim-toolbar {
    width: 100%;
    box-sizing: border-box;
}
body.tw1-animation-workspace #animation-studio .tw1-anim-timeline {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    height: 270px !important;
    box-sizing: border-box !important;
    overflow: auto !important;
    background: rgba(8,9,12,.98) !important;
    border-top: 1px solid rgba(255,255,255,.18) !important;
    box-shadow: 0 -12px 35px rgba(0,0,0,.38) !important;
    pointer-events: auto !important;
    padding-bottom: 8px !important;
}
body.tw1-animation-workspace #animation-studio .tw1-anim-timeline .tw1-anim-time-row {
    position: sticky;
    top: 0;
    z-index: 4;
    background: rgba(8,9,12,.98);
}
body.tw1-animation-workspace #animation-studio .tw1-anim-timeline .tw1-anim-ruler,
body.tw1-animation-workspace #animation-studio .tw1-anim-timeline .tw1-anim-tracks,
body.tw1-animation-workspace #animation-studio .tw1-anim-timeline .tw1-anim-inspector {
    width: auto;
}
body.tw1-animation-workspace #animation-studio .tw1-anim-timeline .tw1-anim-inspector {
    margin-top: 5px;
}
body.tw1-animation-workspace #animation-studio .tw1-anim-timeline .tw1-route-editor,
body.tw1-animation-workspace #animation-studio .tw1-anim-timeline .tw1-icon-setup,
body.tw1-animation-workspace #animation-studio .tw1-anim-timeline > .tw1-path-status {
    display: none !important;
}
body.tw1-animation-workspace #animation-studio .tw1-anim-controls .tw1-route-editor,
body.tw1-animation-workspace #animation-studio .tw1-anim-controls .tw1-icon-setup {
    margin-left: 10px;
    margin-right: 10px;
}
body.tw1-animation-workspace #animation-studio .tw1-anim-controls .tw1-path-status {
    box-sizing: border-box;
}
body.tw1-animation-workspace #animation-studio .tw1-anim-timeline .tw1-anim-track {
    min-height: 30px;
}
body.tw1-animation-workspace #animation-studio .tw1-anim-timeline .tw1-track-lane {
    height: 30px;
}
@media (max-width: 800px) {
    body.tw1-animation-workspace #map {
        right: 0 !important;
        bottom: 300px !important;
    }
    body.tw1-animation-workspace #animation-studio .tw1-anim-controls {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        bottom: 300px !important;
    }
    body.tw1-animation-workspace #animation-studio .tw1-anim-timeline {
        height: 300px !important;
    }
}
