        /* ── Reset ── */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-font-smoothing: antialiased;
        }

        body {
            font-family: 'Inter', 'Segoe UI', sans-serif;
            height: 100vh;
            overflow: hidden;
            background: var(--bg-deep);
            color: var(--text-main);
        }

        #map {
            width: 100%;
            height: 100vh;
            z-index: 1;
            background: #08122a;
        }

        /* Tile artifact fix */
        .leaflet-tile-container img {
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            box-shadow: 0 0 1px rgba(0, 0, 0, 0.05);
        }

        .leaflet-tile {
            outline: 1px solid transparent;
        }

        /* Vypnutie plynulého objavovania dlaždíc (zabraňuje preblikávaniu pri rolovaní) */
        .no-fade-tile {
            transition: none !important;
        }

        /* ── Map vignette ── */
        #map::after {
            content: '';
            position: fixed;
            inset: 0;
            background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.42) 100%);
            pointer-events: none;
            z-index: 3;
        }

        /* ═══════════════════════════════════════════════════════════════
           WINDY-STYLE RIGHT SIDEBAR
           ═══════════════════════════════════════════════════════════════ */
        .layers-panel {
            position: fixed;
            top: 12px;
            right: 12px;
            left: auto;
            transform: none;
            width: auto;
            max-width: none;
            max-height: none;
            height: auto;
            z-index: 1001;
            background: transparent;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
            border: none;
            border-radius: 0;
            box-shadow: none;
            display: flex;
            flex-direction: row;
            align-items: flex-start;
            pointer-events: none;
        }

        .layers-panel:hover {
            box-shadow: none;
        }

        .layers-panel-header {
            display: none;
        }

        .layer-count {
            display: none;
        }

        .layers-list {
            display: none;
        }

        /* ── Icon buttons container: vertical column, top-right ── */
        .layer-bubble-bar {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            justify-content: flex-start;
            gap: 8px;
            width: auto;
            height: auto;
            padding: 0;
            background: transparent;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
            border: none;
            pointer-events: auto;
            flex-shrink: 0;
            order: 1;
            position: fixed;
            top: 12px;
            right: 12px;
            z-index: 1201;
            transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* When a drawer is open, shift the icon bar to the left of the drawer */
        .layer-bubble-bar.drawer-open {
            right: 314px;
        }

        .layer-bubble-slot {
            position: relative;
            min-width: 0;
            width: auto;
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 8px;
        }

        .layer-bubble-slot::before {
            content: attr(data-label);
            font-size: 12px;
            font-weight: 600;
            letter-spacing: 0.3px;
            text-transform: none;
            color: #e2e8f0;
            white-space: nowrap;
            pointer-events: none;
            text-shadow: 0 0 4px rgba(0, 0, 0, 1), 0 1px 3px rgba(0, 0, 0, 0.95), 0 2px 8px rgba(0, 0, 0, 0.8), 1px 1px 2px rgba(0, 0, 0, 0.9);
        }

        /* ── Glass icon buttons matching Time Window / Controls panel style ── */
        .layer-bubble-trigger {
            width: 44px;
            height: 44px;
            border: 1px solid rgba(59, 130, 246, 0.16);
            background: rgba(8, 20, 45, 0.82);
            backdrop-filter: blur(28px) saturate(160%);
            -webkit-backdrop-filter: blur(28px) saturate(160%);
            color: var(--text-dim);
            border-radius: 14px;
            padding: 0;
            font-size: 10px;
            font-weight: 600;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0;
            cursor: pointer;
            text-align: center;
            white-space: nowrap;
            transition: all 0.2s ease;
            position: relative;
            box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.8),
                        inset 0 1px 0 rgba(125, 180, 255, 0.07),
                        0 0 40px -20px rgba(6, 182, 212, 0.25);
        }

        .layer-bubble-trigger i:first-child {
            font-size: 16px;
            transition: color 0.2s, transform 0.2s;
        }

        /* Hide label inside button — shown via slot::before instead */
        .layer-bubble-trigger .layer-bubble-label {
            display: none;
        }

        .layer-bubble-count {
            position: absolute;
            top: -4px;
            right: -4px;
            min-width: 16px;
            height: 16px;
            border-radius: 999px;
            border: 1.5px solid rgba(6, 182, 212, 0.7);
            background: rgba(6, 182, 212, 0.3);
            color: #67e8f9;
            font-size: 9px;
            font-weight: 800;
            padding: 0 4px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
        }

        .layer-bubble-trigger:hover {
            border-color: rgba(6, 182, 212, 0.3);
            background: rgba(8, 20, 45, 0.92);
            color: var(--text-main);
            box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.8),
                        inset 0 1px 0 rgba(125, 180, 255, 0.12),
                        0 0 40px -20px rgba(6, 182, 212, 0.4);
            transform: translateY(-1px);
        }

        .layer-bubble-trigger:hover i:first-child {
            color: var(--primary);
            transform: scale(1.1);
        }

        .layer-bubble-slot.open .layer-bubble-trigger {
            background: var(--primary-dim);
            border-color: var(--accent);
            color: #fff;
            box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.8),
                        inset 0 1px 0 rgba(6, 182, 212, 0.15),
                        0 0 20px var(--accent-glow);
        }

        .layer-bubble-slot.open .layer-bubble-trigger i:first-child {
            color: var(--accent);
            transform: scale(1.1);
        }

        /* Hide chevron icon */
        .layer-bubble-trigger i:last-child {
            display: none;
        }

        /* ── Full-height drawer panel (slides from right edge) ── */
        .layer-bubble-menu {
            display: none;
            position: fixed;
            top: 0;
            right: 0;
            left: auto;
            width: 300px;
            height: 100vh;
            max-width: none;
            max-height: none;
            overflow-y: auto;
            z-index: 1100;
            background: rgba(8, 20, 45, 0.82);
            backdrop-filter: blur(28px) saturate(160%);
            -webkit-backdrop-filter: blur(28px) saturate(160%);
            border: none;
            border-left: 1px solid rgba(59, 130, 246, 0.16);
            border-radius: 0;
            padding: 20px 14px;
            box-shadow: -8px 0 60px rgba(0, 0, 0, 0.6),
                        inset 1px 0 0 rgba(125, 180, 255, 0.05);
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
            transform: translateX(100%);
            opacity: 0;
            pointer-events: auto;
        }

        .layer-bubble-menu.open {
            display: block;
            transform: translateX(0);
            opacity: 1;
        }

        /* Drawer panel header via ::before */
        .layer-bubble-menu::before {
            content: attr(data-title);
            display: block;
            font-size: 11px;
            font-weight: 700;
            color: var(--text-main);
            text-transform: uppercase;
            letter-spacing: 1.2px;
            padding-bottom: 14px;
            margin-bottom: 12px;
            border-bottom: 1px solid rgba(59, 130, 246, 0.14);
        }

        .active-layer-controls-card:hover {
            border-color: rgba(6, 182, 212, 0.35);
            box-shadow: 0 0 12px rgba(6, 182, 212, 0.12);
            transform: translateY(-1px);
        }

        .layer-bubble-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 10px 12px;
            border-radius: 12px;
            border: 1px solid rgba(59, 130, 246, 0.14);
            background: rgba(255, 255, 255, 0.04);
            margin-bottom: 6px;
            transition: all 0.15s ease;
            cursor: pointer;
        }

        .layer-bubble-item:hover {
            border-color: rgba(6, 182, 212, 0.3);
            background: rgba(6, 182, 212, 0.07);
            transform: translateX(-2px);
        }

        .layer-bubble-item:last-child {
            margin-bottom: 0;
        }

        .layer-bubble-item-name {
            color: var(--text-main);
            font-size: 12px;
            font-weight: 500;
            line-height: 1.3;
            padding-right: 6px;
        }

        .layer-bubble-toggle {
            min-width: 38px;
            height: 22px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.3);
            background: rgba(148, 163, 184, 0.1);
            color: #e2e8f0;
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 0.55px;
            cursor: pointer;
            transition: all 0.16s ease;
            flex-shrink: 0;
            box-shadow: none;
        }

        .layer-bubble-toggle.active {
            border-color: rgba(6, 182, 212, 0.6);
            background: linear-gradient(180deg, rgba(6, 182, 212, 0.34), rgba(6, 182, 212, 0.18));
            color: #e0f2fe;
            box-shadow: 0 2px 10px rgba(6, 182, 212, 0.25);
        }

        .layer-bubble-toggle:hover {
            transform: scale(1.05);
        }

        /* ── GloFAS category — amber accent ── */
        [data-category="glofas"] .layer-bubble-trigger {
            border-color: rgba(251, 191, 36, 0.2);
        }
        [data-category="glofas"] .layer-bubble-trigger:hover {
            border-color: rgba(251, 191, 36, 0.45);
        }
        [data-category="glofas"] .layer-bubble-trigger i:first-child {
            color: #fbbf24;
        }
        [data-category="glofas"] .layer-bubble-count {
            border-color: rgba(251, 191, 36, 0.6);
            background: rgba(251, 191, 36, 0.2);
            color: #fbbf24;
        }
        [data-category="glofas"].open .layer-bubble-trigger {
            background: rgba(251, 191, 36, 0.08);
            border-color: rgba(251, 191, 36, 0.45);
        }
        [data-category="glofas"].open .layer-bubble-trigger i:first-child {
            color: #fbbf24;
        }

        /* ── Layer Group ── */
        .layer-group {
            margin-bottom: 10px;
        }

        .layer-group-header {
            font-size: 10px;
            font-weight: 700;
            color: var(--text-dim);
            text-transform: uppercase;
            letter-spacing: 0.9px;
            margin-bottom: 5px;
            padding: 7px 6px;
            border-left: 2px solid var(--primary-border);
            cursor: pointer;
            user-select: none;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 6px;
            border-radius: 0 6px 6px 0;
        }

        .layer-group-header:hover {
            background: var(--primary-dim);
            border-left-color: var(--primary);
            color: var(--text-main);
        }

        .collapse-icon {
            font-size: 8px;
            transition: transform 0.2s;
            color: var(--primary);
        }

        .layer-group-content {
            max-height: 2000px;
            overflow: hidden;
            transition: max-height 0.3s ease, opacity 0.3s ease;
            opacity: 1;
        }

        .layer-group-content.collapsed {
            max-height: 0;
            opacity: 0;
        }

        /* ── Layer Item ── */
        .layer-item {
            margin-bottom: 6px;
            background: var(--glass-bg-light);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 8px 10px;
            transition: all 0.2s;
        }

        .layer-item:hover {
            background: rgba(6, 182, 212, 0.06);
            border-color: rgba(6, 182, 212, 0.15);
        }

        .layer-item.active {
            border-color: var(--primary-border);
            background: var(--primary-dim);
            box-shadow: 0 0 12px rgba(6, 182, 212, 0.12);
        }

        .layer-checkbox-row {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            padding: 1px 0;
        }

        .layer-checkbox-row input[type="checkbox"] {
            width: 15px;
            height: 15px;
            cursor: pointer;
            accent-color: var(--primary);
            border-radius: 4px;
        }

        .layer-checkbox-label {
            flex: 1;
            font-size: 11px;
            font-weight: 500;
            color: var(--text-main);
            cursor: pointer;
            user-select: none;
        }

        .layer-info-btn {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            border: 1px solid var(--border);
            background: rgba(255, 255, 255, 0.05);
            color: var(--text-dim);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.15s;
            font-size: 10px;
            flex-shrink: 0;
        }

        .layer-info-btn:hover,
        .layer-info-btn.active {
            color: var(--primary);
            border-color: var(--primary-border);
            background: var(--primary-dim);
        }

        .layer-legend-panel {
            margin-top: 7px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: rgba(0, 0, 0, 0.22);
            padding: 7px;
        }

        .layer-legend-title-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 5px;
        }

        .layer-legend-title {
            font-size: 9px;
            font-weight: 700;
            color: var(--text-dim);
            text-transform: uppercase;
            letter-spacing: 0.6px;
        }

        .layer-legend-scale {
            display: flex;
            gap: 2px;
        }

        .legend-scale-btn {
            width: 18px;
            height: 18px;
            border-radius: 4px;
            border: 1px solid rgba(255, 255, 255, 0.13);
            background: rgba(255, 255, 255, 0.06);
            color: var(--text-dim);
            font-size: 12px;
            line-height: 1;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            transition: background 0.12s, color 0.12s;
        }

        .legend-scale-btn:hover {
            background: rgba(255, 255, 255, 0.15);
            color: var(--text-main);
        }

        .layer-legend-content {
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            max-height: 400px;
            overflow: auto;
            scrollbar-width: thin;
            scrollbar-color: rgba(255,255,255,0.15) transparent;
        }

        .layer-legend-content img {
            /* Natural size, never upscaled; only shrunk to fit the panel */
            width: auto;
            max-width: 100%;
            height: auto;
            border-radius: 4px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            background: rgba(255, 255, 255, 0.9);
            display: block;
            transition: width 0.15s ease;
        }

        /* Keep the legend panel fitted when it is moved into the active-layer card.
           The card is a CSS-grid child; min-width:0 stops the large video-WMS legend
           PNG from driving the box to its intrinsic width and overflowing the sidebar. */
        .active-layer-controls-body [id^="active-layer-legend-host-"] {
            width: 100%;
            max-width: 100%;
            min-width: 0;
            box-sizing: border-box;
            overflow: hidden;
        }

        .active-layer-controls-body [id^="active-layer-legend-host-"] .layer-legend-panel {
            width: 100%;
            max-width: 100%;
            min-width: 0;
            box-sizing: border-box;
        }

        .layer-legend-empty {
            font-size: 10px;
            color: var(--text-dim);
            line-height: 1.3;
        }

        .forecast-range-note {
            margin-top: 5px;
            font-size: 10px;
            color: var(--text-dim);
            letter-spacing: 0.2px;
            line-height: 1.25;
        }

        .layer-checkbox-row input[type="checkbox"]:checked+.layer-checkbox-label {
            color: var(--primary);
            font-weight: 600;
        }

        /* ── Layer Controls (shown when active) ── */
        .layer-controls {
            display: none;
            margin-top: 9px;
            padding-top: 9px;
            border-top: 1px solid var(--border);
        }

        .layer-item.active .layer-controls {
            display: block;
        }

        .layer-control {
            margin-bottom: 8px;
        }

        .layer-control:last-child {
            margin-bottom: 0;
        }

        .layer-control-label {
            display: block;
            font-size: 9px;
            font-weight: 600;
            color: var(--text-dim);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 5px;
        }

        .layer-control-row {
            display: flex;
            align-items: center;
            gap: 7px;
        }

        /* Small range input inside layer controls */
        .layer-control input[type="range"] {
            flex: 1;
            height: 3px;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 2px;
            -webkit-appearance: none;
            appearance: none;
            outline: none;
        }

        .layer-control input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 13px;
            height: 13px;
            background: var(--primary);
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 0 6px var(--primary-glow);
            transition: transform 0.15s;
        }

        .layer-control input[type="range"]::-webkit-slider-thumb:hover {
            transform: scale(1.25);
        }

        .layer-control input[type="range"]::-webkit-slider-runnable-track {
            height: 3px;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 2px;
        }

        .layer-control input[type="datetime-local"] {
            width: 100%;
            background: rgba(8, 13, 30, 0.78);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 5px 8px;
            color: var(--text-main);
            font-size: 10px;
            font-family: 'JetBrains Mono', monospace;
            -webkit-appearance: none;
            appearance: none;
            transition: border-color 0.2s;
        }

        .layer-control input[type="datetime-local"]:focus {
            outline: none;
            border-color: var(--primary-border);
            box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.1);
        }

        .layer-control-value {
            font-size: 10px;
            font-weight: 600;
            font-family: 'JetBrains Mono', monospace;
            color: var(--primary);
            min-width: 30px;
            text-align: right;
        }

        /* ═══════════════════════════════════════════════════════════════
           BOTTOM CONTROL DOCK
           ═══════════════════════════════════════════════════════════════ */
        .ui-container {
            position: fixed;
            top: 12px;
            left: 74px;
            right: auto;
            width: min(280px, calc(100vw - 32px));
            z-index: 1000;
            display: flex;
            justify-content: flex-start;
        }

        .glass-panel {
            position: relative;
            background: rgba(8, 20, 45, 0.82);
            backdrop-filter: blur(28px) saturate(160%);
            -webkit-backdrop-filter: blur(28px) saturate(160%);
            border: 1px solid rgba(59, 130, 246, 0.16);
            border-radius: 20px;
            box-shadow: 0 20px 60px -15px rgba(0,0,0,0.8),
                        inset 0 1px 0 rgba(125, 180, 255, 0.07),
                        0 0 40px -20px rgba(6, 182, 212, 0.25);
            padding: 7px 14px 9px;
            max-width: 280px;
            width: 100%;
            overflow: hidden;
        }

        /* Animated gradient border glow */
        @keyframes border-flow {
            0% {
                background-position: 0% 50%;
            }

            50% {
                background-position: 100% 50%;
            }

            100% {
                background-position: 0% 50%;
            }
        }

        .glass-panel::before {
            content: '';
            position: absolute;
            top: -1px;
            left: -1px;
            right: -1px;
            bottom: -1px;
            border-radius: 21px;
            background: linear-gradient(135deg,
                rgba(59, 130, 246, 0.6),
                rgba(6, 182, 212, 0.45),
                rgba(99, 102, 241, 0.4),
                rgba(59, 130, 246, 0.6));
            background-size: 300% 300%;
            animation: border-flow 6s ease infinite;
            z-index: -1;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .glass-panel:hover::before {
            opacity: 1;
        }

        /* Bottom panel: disable bright glow on hover, use subtle shadow only */
        #bottom-glass-panel:hover::before {
            opacity: 0;
        }

        #bottom-glass-panel:hover {
            box-shadow: 0 20px 64px rgba(0, 0, 0, 0.7),
                        inset 0 1px 0 rgba(59, 130, 246, 0.18);
        }

        .controls-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 8px;
            align-items: start;
            margin-bottom: 0;
        }

        .control-item {
            display: flex;
            flex-direction: column;
        }

        .control-row-2 {
            display: flex;
            gap: 20px;
            align-items: center;
            padding-top: 14px;
            border-top: 1px solid var(--border);
        }

        label {
            display: block;
            margin-bottom: 3px;
            font-size: 9px;
            font-weight: 700;
            color: var(--text-dim);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        label i {
            margin-right: 5px;
            opacity: 0.75;
        }

        /* Selects & datetime-local (global) */
        select,
        input[type="datetime-local"] {
            width: 100%;
            background: rgba(8, 13, 30, 0.78);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 5px 10px;
            color: var(--text-main);
            font-size: 12px;
            font-weight: 500;
            transition: border-color 0.2s, box-shadow 0.2s;
            appearance: none;
            -webkit-appearance: none;
            font-family: inherit;
        }

        /* Stepper buttons */
        .time-stepper-btn {
            background: transparent;
            border: none;
            color: var(--primary);
            cursor: pointer;
            padding: 4px 6px;
            border-radius: 4px;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .time-stepper-btn:hover {
            background: var(--primary-dim);
            color: #fff;
        }

        .hour-toggle-btn {
            flex: 1;
            background: transparent;
            border: none;
            color: rgba(255,255,255,0.5);
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: 600;
            font-family: monospace;
            transition: all 0.2s;
        }

        .hour-toggle-btn:hover {
            color: #fff;
            background: rgba(59,130,246,0.2);
        }

        .hour-toggle-btn.hour-toggle-active {
            background: linear-gradient(135deg, #3b82f6, #06b6d4);
            color: #fff;
            box-shadow: 0 0 10px rgba(6,182,212,0.4);
        }

        .hour-toggle-btn.hour-toggle-disabled,
        .hour-toggle-btn:disabled {
            opacity: 0.25;
            cursor: not-allowed;
            pointer-events: none;
        }

        select:hover,
        input[type="datetime-local"]:hover {
            border-color: rgba(6, 182, 212, 0.3);
        }

        select:focus,
        input[type="datetime-local"]:focus {
            outline: none;
            border-color: var(--primary-border);
            background: rgba(8, 13, 30, 0.9);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
        }

        option {
            background: #0d1117;
            color: white;
            padding: 10px;
        }

        optgroup {
            background: #161b22;
            color: var(--primary);
        }

        /* Global range sliders */
        input[type="range"] {
            width: 100%;
            height: 5px;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 3px;
            outline: none;
            -webkit-appearance: none;
        }

        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 17px;
            height: 17px;
            background: var(--primary);
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 0 10px var(--primary-glow);
            transition: transform 0.15s;
            margin-top: -6px;
        }

        input[type="range"]::-webkit-slider-thumb:hover {
            transform: scale(1.2);
        }

        input[type="range"]::-webkit-slider-runnable-track {
            height: 5px;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 3px;
        }

        .range-value {
            font-family: 'JetBrains Mono', monospace;
            font-size: 14px;
            font-weight: 700;
            color: #fff;
            text-align: right;
            margin-top: 1px;
        }

        /* ── Buttons ── */
        .btn {
            background: rgba(0, 0, 0, 0.3);
            border: 1px solid var(--primary-border);
            color: var(--primary);
            padding: 9px 16px;
            border-radius: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-family: inherit;
        }

        .btn:hover {
            background: var(--primary-dim);
            color: #fff;
            transform: translateY(-1px);
            box-shadow: 0 4px 16px var(--primary-glow);
            border-color: var(--primary);
        }

        .btn-sm {
            padding: 6px 11px;
            font-size: 11px;
        }

        .btn-stop {
            border-color: rgba(248, 113, 113, 0.35);
            color: var(--danger);
            background: rgba(248, 113, 113, 0.08);
        }

        .btn-stop:hover {
            background: rgba(248, 113, 113, 0.18);
            color: #fff;
            box-shadow: 0 0 20px rgba(248, 113, 113, 0.3);
            border-color: var(--danger);
        }

        /* ── Info panel (bottom of dock) ── */
        .info-panel {
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .layer-title h3 {
            font-size: 10px;
            color: var(--text-dim);
            margin: 0 0 3px 0;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.6px;
        }

        .layer-details {
            font-size: 12px;
            color: rgba(255, 255, 255, 0.85);
            line-height: 1.4;
        }

        /* ── Scrollbar ── */
        ::-webkit-scrollbar {
            width: 4px;
            height: 4px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.12);
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--primary);
        }

        /* ── Leaflet overrides ── */
        .leaflet-control-attribution {
            background: rgba(8, 13, 30, 0.72) !important;
            backdrop-filter: blur(8px) !important;
            color: rgba(232, 241, 255, 0.58) !important;
            font-family: 'Inter', sans-serif !important;
            font-size: 10px !important;
            border-radius: 6px !important;
            border: none !important;
        }

        .leaflet-control-attribution a {
            color: var(--primary) !important;
        }

        .leaflet-control-zoom a {
            background: var(--glass-bg) !important;
            backdrop-filter: var(--glass-blur) !important;
            -webkit-backdrop-filter: var(--glass-blur) !important;
            border: 1px solid var(--glass-border) !important;
            color: var(--text-main) !important;
            transition: all 0.2s !important;
        }

        .leaflet-control-zoom a:hover {
            background: var(--primary-dim) !important;
            color: var(--primary) !important;
        }

        .leaflet-control-zoom {
            border: none !important;
            border-radius: 12px !important;
            overflow: hidden;
        }

        .leaflet-bar {
            border: none !important;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
        }

        /* ── GetFeatureInfo Popup ── */
        /* The popup is draggable by its body (like the static widgets). Once the user
           moves it, it detaches from its map anchor, so hide the pointer tip. */
        .leaflet-popup.popup-user-positioned .leaflet-popup-tip-container {
            display: none;
        }

        /* While actively dragging, suppress text selection so grabbing the popup body
           doesn't highlight its text. Selection is still allowed when not dragging. */
        .leaflet-popup.popup-dragging,
        .leaflet-popup.popup-dragging * {
            user-select: none !important;
            -webkit-user-select: none !important;
        }

        .leaflet-popup-content-wrapper {
            background: var(--glass-bg) !important;
            backdrop-filter: var(--glass-blur) !important;
            -webkit-backdrop-filter: var(--glass-blur) !important;
            border: 1px solid var(--glass-border) !important;
            border-radius: 16px !important;
            box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5) !important;
            touch-action: none;
        }

        .leaflet-popup-content {
            margin: 14px 16px !important;
            font-family: 'Inter', 'Segoe UI', sans-serif;
            color: var(--text-main) !important;
            line-height: 1.5;
        }

        .leaflet-popup-tip {
            background: var(--glass-bg) !important;
        }

        .leaflet-popup-close-button {
            color: var(--text-dim) !important;
            font-size: 20px !important;
            padding: 4px 8px !important;
        }

        /* After the popup is lifted out of the map, keep the close "×" visible and on
           top so it stays clickable in its detached, dragged state. */
        .leaflet-popup.popup-user-positioned .leaflet-popup-close-button {
            display: block !important;
            position: absolute !important;
            top: 0 !important;
            right: 0 !important;
            z-index: 2 !important;
        }

        .leaflet-popup-close-button:hover {
            color: var(--primary) !important;
        }

        .leaflet-popup-content::-webkit-scrollbar {
            width: 4px;
        }

        .leaflet-popup-content::-webkit-scrollbar-thumb {
            background: var(--primary);
            border-radius: 3px;
        }

        /* ── No-data banner ── */
        .no-data-banner {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 1500;
            background: rgba(10, 15, 30, 0.92);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            border: 1.5px solid rgba(251, 191, 36, 0.6);
            border-radius: 18px;
            padding: 22px 40px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 14px;
            box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(251, 191, 36, 0.15) inset;
            animation: fadeScaleIn 0.25s ease;
            pointer-events: none;
        }

        @keyframes fadeScaleIn {
            from {
                transform: translate(-50%, -50%) scale(0.92);
                opacity: 0;
            }
            to {
                transform: translate(-50%, -50%) scale(1);
                opacity: 1;
            }
        }

        .no-data-banner i {
            color: var(--warning);
            font-size: 32px;
            animation: pulseFade 2s ease-in-out infinite;
        }

        @keyframes pulseFade {

            0%,
            100% {
                opacity: 1;
            }

            50% {
                opacity: 0.5;
            }
        }

        .no-data-banner span {
            color: var(--text-main);
            font-size: 15px;
            font-weight: 600;
            letter-spacing: 0.3px;
            text-align: center;
        }

        /* ── Active-layers badge container (bottom dock) ── */
        #active-layers-panel {
            display: grid;
            grid-template-columns: 1fr;
            gap: 8px;
            margin-top: 4px;
            padding: 1px 0;
            min-height: 0;
        }

        .active-layer-controls-card {
            border: 1px solid rgba(6, 182, 212, 0.22);
            border-radius: 12px;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
            padding: 12px;
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(6, 182, 212, 0.06) inset;
        }

        .active-layer-controls-card.dragging {
            opacity: 0.5;
            border-color: var(--primary-border);
        }

        .active-layer-controls-header {
            display: flex;
            align-items: center;
            gap: 7px;
            font-size: 14px;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 9px;
            padding-bottom: 8px;
            border-bottom: 1px solid rgba(6, 182, 212, 0.2);
            cursor: move;
        }

        .active-layer-controls-header .active-layer-info-btn {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            border: 1px solid var(--border);
            background: rgba(255, 255, 255, 0.05);
            color: var(--text-dim);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.15s;
            font-size: 11px;
        }

        .active-layer-controls-header .active-layer-visibility-btn {
            margin-left: auto;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            border: 1px solid var(--border);
            background: rgba(255, 255, 255, 0.05);
            color: var(--text-dim);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.15s;
            font-size: 11px;
        }

        .active-layer-controls-header .active-layer-info-btn:hover,
        .active-layer-controls-header .active-layer-info-btn.active,
        .active-layer-controls-header .active-layer-visibility-btn:hover,
        .active-layer-controls-header .active-layer-visibility-btn.active {
            color: var(--primary);
            border-color: var(--primary-border);
            background: var(--primary-dim);
        }

        .active-layer-controls-header .active-layer-remove-btn {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            border: 1px solid var(--border);
            background: rgba(255, 255, 255, 0.05);
            color: var(--text-dim);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.15s;
            font-size: 11px;
        }

        .active-layer-controls-header .active-layer-remove-btn:hover,
        .active-layer-controls-header .active-layer-remove-btn:focus-visible {
            color: #fca5a5;
            border-color: rgba(239, 68, 68, 0.5);
            background: rgba(239, 68, 68, 0.18);
        }

        .active-layer-controls-body .layer-controls {
            display: block !important;
            margin-top: 0;
            padding-top: 0;
            border-top: none;
        }

        /* Slight readability boost for controls rendered inside active layer cards */
        #active-layers-panel .layer-control-label {
            font-size: 12px;
            margin-bottom: 7px;
        }

        #active-layers-panel .layer-control-value {
            font-size: 13px;
            min-width: 38px;
        }

        #active-layers-panel .layer-control input[type="range"] {
            height: 5px;
        }

        #active-layers-panel .layer-control-row {
            gap: 9px;
        }

        /* Text-only readability boost */
        #bottom-glass-panel label {
            font-size: 10px;
        }

        #bottom-glass-panel select,
        #bottom-glass-panel input[type="date"],
        #bottom-glass-panel input[type="datetime-local"] {
            font-size: 12px;
        }

        #bottom-glass-panel .layer-bubble-trigger {
            font-size: 12px;
        }

        .active-layer-empty {
            font-size: 11px;
            color: rgba(255, 255, 255, 0.45);
            font-style: italic;
        }

        /* ── Elevation date label (video layers) ── */
        [id^="elevation-date-"] {
            font-family: 'JetBrains Mono', monospace !important;
            font-size: 11px !important;
            color: var(--primary) !important;
            background: var(--primary-dim) !important;
            border: 1px solid var(--primary-border) !important;
            border-radius: 8px !important;
            padding: 5px 10px !important;
            text-align: center;
        }

        /* ── Drag handle bar ── */
        #bottom-panel-drag-handle>div {
            background: rgba(255, 255, 255, 0.15) !important;
            border-radius: 3px !important;
        }

        /* ── Minimize button style ── */
        #minimize-layers-panel,
        #minimize-bottom-panel {
            color: var(--text-dim) !important;
            transition: color 0.2s;
        }

        #minimize-layers-panel:hover,
        #minimize-bottom-panel:hover {
            color: var(--primary) !important;
        }

        /* ── Restore buttons ── */
        #restore-layers-panel,
        #restore-bottom-panel {
            background: var(--glass-bg) !important;
            backdrop-filter: var(--glass-blur) !important;
            -webkit-backdrop-filter: var(--glass-blur) !important;
            border: 1px solid var(--glass-border) !important;
            color: var(--primary) !important;
            transition: all 0.2s !important;
        }

        #restore-layers-panel:hover,
        #restore-bottom-panel:hover {
            background: var(--primary-dim) !important;
            border-color: var(--accent) !important;
            box-shadow: 0 0 14px var(--accent-glow) !important;
        }

        /* ── Responsive ── */
        @media (max-width: 1400px) {
            .controls-grid {
                grid-template-columns: 1fr;
                gap: 8px;
            }
        }

        @media (max-width: 1024px) {
            .control-item {
                min-width: 150px;
            }
        }

        /* ── Global keyboard focus ring (keyboard nav only) ── */
        :focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
        }

        /* ── Reduced-motion: neutralize animations/transitions (additive guard) ── */
        @media (prefers-reduced-motion: reduce) {
            /* WMS tile fade (Leaflet default tile opacity transition) */
            .leaflet-tile {
                transition: none !important;
            }
            /* Panel / menu transitions + any remaining animation */
            .layer-bubble-menu,
            .glass-panel,
            .layer-group-content,
            .active-layer-controls-card,
            * {
                transition: none !important;
                animation: none !important;
            }
        }

        /* Loading Banner */
        .loading-banner {
            position: fixed;
            top: 72px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 1500;
            background: rgba(10, 15, 30, 0.88);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            border: 1px solid var(--primary-border);
            border-radius: 14px;
            padding: 12px 24px;
            display: flex;
            align-items: center;
            gap: 10px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(6, 182, 212, 0.08) inset;
            animation: slideDown 0.3s ease;
            pointer-events: none;
        }

        .spinner {
            width: 16px;
            height: 16px;
            border: 2px solid rgba(255, 255, 255, 0.15);
            border-radius: 50%;
            border-top-color: var(--primary);
            animation: spin 0.8s linear infinite;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        .loading-banner span {
            color: var(--text-main);
            font-size: 12px;
            font-weight: 600;
            letter-spacing: 0.2px;
        }

        /* ── Reduced-motion: stop the loading spinner (spin keyframes above) ── */
        @media (prefers-reduced-motion: reduce) {
            .spinner {
                animation: none !important;
            }
            .loading-banner {
                animation: none !important;
            }
        }

        /* ── Share link button (glass icon button) ── */
        #share-link-btn {
            position: fixed; right: 16px; z-index: 1200;
            width: 44px; height: 44px; border-radius: 14px;
            border: 1px solid var(--glass-border);
            background: var(--glass-bg);
            backdrop-filter: blur(28px) saturate(160%);
            -webkit-backdrop-filter: blur(28px) saturate(160%);
            color: var(--text-dim); font-size: 16px; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            box-shadow: 0 20px 60px -15px rgba(0,0,0,0.8), inset 0 1px 0 rgba(125,180,255,0.07);
            transition: all 0.2s ease;
        }
        #share-link-btn { bottom: 16px; }
        #share-link-btn:hover {
            border-color: var(--accent-glow); background: var(--glass-bg);
            color: var(--accent); transform: translateY(-1px);
        }

        /* ── Toast system (U3) ────────────────────────────────── */
        #toast-container {
            position: fixed;
            left: 50%;
            bottom: 24px;
            transform: translateX(-50%);
            z-index: 1600;
            display: flex;
            flex-direction: column;
            gap: 8px;
            align-items: center;
            pointer-events: none;
        }

        .toast {
            pointer-events: auto;
            max-width: 90vw;
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            border-left: 3px solid var(--primary);
            backdrop-filter: var(--glass-blur);
            -webkit-backdrop-filter: var(--glass-blur);
            border-radius: 12px;
            padding: 10px 18px;
            color: var(--text-main);
            font-size: 13px;
            font-weight: 600;
            letter-spacing: 0.2px;
            box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(125, 180, 255, 0.07);
            opacity: 0;
            transform: translateY(8px);
            transition: opacity 0.25s ease, transform 0.25s ease;
        }

        .toast--visible {
            opacity: 1;
            transform: translateY(0);
        }

        .toast--info { border-left-color: var(--primary); }
        .toast--success { border-left-color: var(--success-color); }
        .toast--warning { border-left-color: var(--warning); }
        .toast--error { border-left-color: var(--danger); }

        @media (prefers-reduced-motion: reduce) {
            .toast,
            .toast--visible {
                transition: none !important;
            }
        }

        /* ── Onboarding empty-state (U4) ──────────────────────── */
        #onboarding-card {
            position: fixed;
            top: 80px;
            right: 72px;
            z-index: 1550;
            max-width: 260px;
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            backdrop-filter: var(--glass-blur);
            -webkit-backdrop-filter: var(--glass-blur);
            border-radius: 16px;
            padding: 16px 18px 14px;
            color: var(--text-main);
            box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(125, 180, 255, 0.07);
            animation: fadeScaleIn 0.25s ease;
        }

        #onboarding-card .onboarding-heading {
            font-size: 14px;
            font-weight: 700;
            margin: 0 24px 6px 0;
            color: var(--text-main);
        }

        #onboarding-card .onboarding-text {
            font-size: 12.5px;
            line-height: 1.4;
            margin: 0 0 10px;
            color: var(--text-dim);
        }

        #onboarding-card .onboarding-hint {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 11.5px;
            color: var(--text-dim);
            margin-bottom: 12px;
        }

        #onboarding-card .onboarding-hint i {
            color: var(--primary);
        }

        #onboarding-card .onboarding-gotit {
            appearance: none;
            border: 1px solid var(--primary-border);
            background: var(--primary-dim);
            color: var(--primary);
            font-size: 12.5px;
            font-weight: 600;
            border-radius: 10px;
            padding: 6px 14px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        #onboarding-card .onboarding-gotit:hover {
            border-color: var(--primary);
            color: var(--text-main);
        }

        #onboarding-card .onboarding-close {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
            background: transparent;
            color: var(--text-dim);
            font-size: 13px;
            cursor: pointer;
            border-radius: 8px;
            transition: color 0.2s ease;
        }

        #onboarding-card .onboarding-close:hover {
            color: var(--text-main);
        }

        @media (prefers-reduced-motion: reduce) {
            #onboarding-card {
                animation: none !important;
                transition: none !important;
            }
        }
