:root {
    --bg-color: #ffffff;
    --text-color: #222222;
    --border-color: #dddddd;
    --hud-bg: rgba(255, 255, 255, 0.9);
    --accent: #d1211b; /* Homepage Rot */
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    /* overflow: hidden removed */
}

#map {
    width: 100%;
    height: 1100px; /* Increased from 1000px per user request */
    z-index: 1;
}

/* HUD elements */
#hud {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 5000 !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

/* Row 1: logo/title + control buttons side by side */
.hud-row1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.hud-left {
    display: flex;
    align-items: center;
    background: var(--hud-bg);
    padding: 10px 24px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    pointer-events: auto;
    color: var(--text-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.hud-logo {
    height: 80px;
    border-radius: 4px;
    margin-right: 15px;
    display: block;
}

.hud-titles h1 {
    margin: 0 0 5px 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.hud-titles h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-color);
}

/* Mode Switcher - Hidden in menu refactor */
.mode-switcher {
    display: none !important;
    gap: 6px;
    background: var(--hud-bg);
    padding: 6px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    pointer-events: auto;
    width: fit-content;
    margin: 10px auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.mode-btn {
    background: transparent;
    color: var(--text-color);
    border: 1px solid transparent;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.mode-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.mode-btn:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 12px rgba(30, 144, 255, 0.35);
}

.hud-right {
    pointer-events: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
}



.control-btn {
    background: var(--hud-bg);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(30, 144, 255, 0.2);
    border-color: var(--accent);
}

.control-btn svg {
    width: 18px;
    height: 18px;
}

/* Legend Panels (shared) - Hidden by default */
.legend-panel {
    position: absolute;
    bottom: 140px;
    left: 10px;
    z-index: 1000;
    background: rgba(209, 33, 27, 0.92); /* Homepage Rot */
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(209, 33, 27, 0.4);
    display: none; /* Controlled by app.js */
}

/* Storm Cell ETA List in Sidebar */
.storm-etas {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.storm-eta-title {
    font-size: 11px;
    font-weight: 700;
    color: #445566;
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.storm-eta-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 2px 0;
    color: #ffffff;
}

.eta-time {
    font-weight: 700;
    color: #ffa500; /* Orange for interest */
}

/* Warnings Toggle Button */
.btn-warnings {
    color: #ffcc00;
    border-color: rgba(255, 204, 0, 0.3);
}

.btn-warnings.active {
    background: rgba(255, 204, 0, 0.2);
    border-color: #ffcc00;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
}

/* PWS Toggle Button */
.btn-pws {
    color: #48dbfb;
    border-color: rgba(72, 219, 251, 0.3);
}

.btn-pws.active {
    background: rgba(72, 219, 251, 0.2);
    border-color: #48dbfb;
    box-shadow: 0 0 10px rgba(72, 219, 251, 0.3);
}

/* Lightning Toggle Button */
.btn-lightning {
    color: #ffd700;
    border-color: rgba(255, 215, 0, 0.3);
}

.btn-lightning.active {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* Report Button Highlight */
.btn-report {
    color: #ff3e3e; /* Bright Red/Orange */
    border-color: rgba(255, 62, 62, 0.4);
    font-weight: 800 !important;
    background: rgba(255, 62, 62, 0.05);
    box-shadow: 0 0 12px rgba(255, 62, 62, 0.15);
}

.btn-report:hover {
    background: rgba(255, 62, 62, 0.2) !important;
    border-color: #ff3e3e !important;
    box-shadow: 0 0 15px rgba(255, 62, 62, 0.4) !important;
}

/* Proximity Alert Banner */
.proximity-alert {
    position: absolute;
    top: 110px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    background: rgba(255, 68, 0, 0.9);
    color: white;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 15px;
    display: none; /* Shown by JS */
    align-items: center;
    gap: 12px;
    box-shadow: 0 0 20px rgba(255, 68, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: proximity-pulse 1.5s infinite ease-in-out;
    pointer-events: auto;
}

@keyframes proximity-pulse {
    0% { transform: translateX(-50%) scale(1); box-shadow: 0 0 15px rgba(255, 68, 0, 0.4); }
    50% { transform: translateX(-50%) scale(1.05); box-shadow: 0 0 30px rgba(255, 68, 0, 0.8); }
    100% { transform: translateX(-50%) scale(1); box-shadow: 0 0 15px rgba(255, 68, 0, 0.4); }
}

.legend-panel h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
}

/* Animations Controls */
.animation-panel {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(209, 33, 27, 0.92); /* Homepage Rot */
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(209, 33, 27, 0.5);
    z-index: 1000;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e0e8f0;
    transition: all 0.3s ease;
    pointer-events: auto;
    width: auto;
    min-width: fit-content;
}

.play-btn {
    background: #ffffff;
    color: var(--accent);
    border: none;
    padding: 0 12px;    /* Reduced from 15px */
    height: 28px;       /* Reduced from 36px */
    border-radius: 14px; /* Matches height / 2 */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;           /* Reduced from 8px */
    font-weight: 700;
    font-size: 12px;    /* Reduced from 13px */
    transition: background 0.2s, transform 0.1s;
}

.play-btn:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.play-btn:active {
    transform: scale(0.95);
}

.anim-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 150px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
}

.anim-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--accent);
    cursor: pointer;
    transition: background 0.1s;
}

.anim-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--accent);
    cursor: pointer;
}

#anim-time {
    font-size: 13px;
    font-weight: 600;
    min-width: 45px;
    text-align: right;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 15px;
    margin-bottom: 8px;
    color: #ffffff;
}

.legend-color,
.legend-line,
.legend-box {
    width: 22px;
    height: 22px;
    margin-right: 12px;
    display: inline-block;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Stormtracker Legend Colors */
.radar-light {
    background: #00ff00;
    opacity: 0.6;
}

.radar-heavy {
    background: #ff00ff;
    opacity: 0.8;
}

.track-line {
    height: 4px;
    background: #ffaa00;
    margin-top: 8px;
    margin-bottom: 7px;
}

.cell-box {
    border: 2px solid red;
    background: rgba(255, 0, 0, 0.2);
}

.meso-box {
    border: 2px solid #ff00ff;
    background: rgba(255, 0, 255, 0.1);
}

.storm-meso-alert {
    background: rgba(255, 0, 255, 0.1) !important;
    border-left: 3px solid #ff00ff !important;
    animation: meso-pulse 2s infinite ease-in-out;
}

@keyframes meso-pulse {
    0% { background: rgba(255, 0, 255, 0.05); }
    50% { background: rgba(255, 0, 255, 0.2); }
    100% { background: rgba(255, 0, 255, 0.05); }
}

/* Doppler Legend Colors */
.doppler-toward {
    background: #0055ff;
}

.doppler-neutral {
    background: #88aa88;
}

.doppler-away {
    background: #ff2200;
}

.legend-subtitle {
    margin-top: 6px;
    font-size: 12px;
    color: #555555;
    font-style: italic;
}

/* Radar Analyse Legend Colors */
.analyse-light {
    background: #80d0ff;
}

.analyse-moderate {
    background: #00cc44;
}

.analyse-heavy {
    background: #ffaa00;
}

.analyse-extreme {
    background: #cc0000;
}

/* ICON Model Legend Colors */
.icon-light {
    background: #a0d8ef;
}

.icon-moderate {
    background: #2196f3;
}

.icon-heavy {
    background: #ff9800;
}

.icon-extreme {
    background: #d32f2f;
}

/* Satellite Legend Colors */
.sat-cloud {
    background: #f0f0f0;
    border: 1px solid #aaa;
}

.sat-thin {
    background: #b0c8e8;
    opacity: 0.8;
}

.sat-clear {
    background: #2a4060;
    border: 1px solid #3a5068;
}

/* Satellite Sub-Toolbar */
.satellite-subtoolbar {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(15, 25, 35, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 30px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
    animation: fadeSlideDown 0.25s ease;
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.satellite-subtoolbar-label {
    font-size: 13px;
    font-weight: 600;
    color: #a0b8cc;
    white-space: nowrap;
    margin-right: 4px;
}

.sat-sub-btn {
    background: transparent;
    color: #88aabb;
    border: 1px solid rgba(255,255,255,0.12);
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sat-sub-btn:hover {
    color: #e0e8f0;
    background: rgba(255, 255, 255, 0.07);
}

.sat-sub-btn.active {
    background: linear-gradient(135deg, #1c6fcf, #2ea8e0);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(30, 144, 255, 0.4);
}

/* Customizing Leaflet Dark Mode */
.leaflet-container {
    background: #0d1520;
}

/* Leaflet Popups */
.leaflet-popup-content-wrapper {
    background: #1a2634;
    color: #e0e8f0;
    border: 1px solid #3a5068;
    border-radius: 6px;
}

.leaflet-popup-tip {
    background: #1a2634;
}

.leaflet-popup-content {
    margin: 12px;
}

.popup-title {
    font-weight: bold;
    font-size: 22px;
    margin-bottom: 12px;
    border-bottom: 2px solid #3a5068;
    padding-bottom: 8px;
    color: #ffaa00;
}

.popup-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    margin-bottom: 6px;
}

.popup-label {
    color: #8899aa;
    margin-right: 15px;
}

.popup-val {
    font-weight: 600;
}

/* ============================================================
   STORM INFO PANEL (right side, always visible)
   ============================================================ */
.storm-info-panel {
    position: absolute;
    top: 220px;
    right: 20px;
    z-index: 1000;
    width: 230px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    background: var(--hud-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 10px;
    backdrop-filter: blur(8px);
    display: none;
    /* shown by JS in storm mode */
    flex-direction: column;
    gap: 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.55);
}

body.admin-mode .storm-info-panel {
    display: flex !important;
}

.storm-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--text-color);
    text-transform: uppercase;
}

.storm-info-icon {
    font-size: 16px;
}

.storm-no-data {
    padding: 16px 14px;
    font-size: 13px;
    color: #666666;
    font-style: italic;
}

.storm-cell-card {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-color);
}

.storm-cell-card:last-child {
    border-bottom: none;
}

.storm-cell-id {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.storm-severity-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.severity-low {
    background: #44cc66;
}

.severity-medium {
    background: #ffaa00;
}

.severity-high {
    background: #ff4400;
}

.severity-extreme {
    background: #cc00ff;
    box-shadow: 0 0 6px #cc00ff88;
}

.storm-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-bottom: 4px;
    color: #666666;
}

.storm-stat:last-child {
    margin-bottom: 0;
}

.storm-stat-label {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.storm-stat-label span {
    font-size: 13px;
}

.storm-stat-val {
    font-weight: 600;
    color: #222222;
    text-align: right;
}

.storm-stat-val.danger {
    color: #ff6644;
}

.storm-info-footer {
    padding: 8px 14px;
    font-size: 11px;
    color: #666666;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* ============================================================
   SATELLITE LOADING INDICATOR
   ============================================================ */
#sat-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    background: rgba(10, 18, 28, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 30px;
    padding: 12px 22px;
    display: none;
    align-items: center;
    gap: 12px;
    color: #c0d0e0;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.sat-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(30, 144, 255, 0.25);
    border-top-color: #1E90FF;
    border-radius: 50%;
    animation: sat-spin 0.75s linear infinite;
    flex-shrink: 0;
}

@keyframes sat-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   PWS MARKERS (Personal Weather Stations)
   ============================================================ */
.pws-div-icon {
    background: transparent;
    border: none;
}

.pws-marker {
    background: rgba(15, 25, 35, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 8px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    color: #e0e8f0;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 140px;
    transition: transform 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.pws-marker:hover {
    transform: scale(1.05);
    background: rgba(30, 45, 60, 0.95);
    border-color: rgba(255, 255, 255, 0.3);
}

.pws-name {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: #8899aa;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 3px;
    width: 100%;
    text-align: center;
}

.pws-values {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 15px;
    font-weight: 600;
}

.pws-val {
    display: flex;
    align-items: center;
    gap: 3px;
}

.pws-val.temp { color: #ff6b6b; }
.pws-val.gust { color: #feca57; }
.pws-val.rain { color: #48dbfb; }

/* ============================================================
   COMBINED DWD WARNING & KONRAD POPUP
   ============================================================ */
.custom-popup .leaflet-popup-content-wrapper {
    background: rgba(15, 25, 35, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.custom-popup .leaflet-popup-tip {
    background: rgba(15, 25, 35, 0.95);
}

.combined-popup {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.warn-title {
    color: #ff4757;
    font-size: 28px;
    border-bottom-color: rgba(255, 71, 87, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
}

.warn-desc {
    font-size: 20px;
    color: #c8d6e5;
    line-height: 1.5;
    white-space: pre-wrap;
    /* No max-height for export — show entire warning */
    padding-right: 5px;
}

.warn-desc::-webkit-scrollbar {
    width: 4px;
}

.warn-desc::-webkit-scrollbar-thumb {
    background: rgba(255, 71, 87, 0.5);
    border-radius: 2px;
}
/* Stormtracker Ultra: Popups & Expert Bar */
.combined-popup { min-width: 320px; padding: 5px; }
.popup-row svg { vertical-align: middle; margin-left: 10px; border-radius: 4px; background: rgba(255,255,255,0.05); }
.warn-title i { margin-right: 10px; color: #ffaa00; }
.expert-controls-bar { z-index: 10000 !important; }

/* ============================================================
   MOBILE RESPONSIVENESS (iFrame & Smartphone)
   ============================================================ */
@media (max-width: 768px) {
    /* --- Flexbox Body Layout --- */
    body {
        display: flex !important;
        flex-direction: column !important;
        height: 100vh !important;
        overflow: hidden !important;
        background: #111b27 !important;
    }

    #map {
        flex: 1 1 0 !important; /* Grow to fill all space */
        height: auto !important;
        width: 100% !important;
        position: relative !important;
        order: 1; /* Top position in the flex flow */
    }

    /* 1. HUD Top Area (Remains absolute, overlays map) */
    #hud {
        top: 4px;
        left: 4px;
        right: 4px;
        flex-direction: column;
        gap: 4px;
        align-items: stretch;
        z-index: 1000;
        /* DO NOT change #hud to order, keep it absolute */
    }

    .hud-row1 {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .hud-left {
        padding: 4px 6px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hud-logo {
        height: 24px;
        margin-right: 8px;
    }

    .hud-titles h1 {
        font-size: 13px;
        margin-bottom: 0px;
    }

    .hud-titles h2 {
        font-size: 10px;
    }



    .hud-right {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 4px;
        padding-bottom: 2px;
        -ms-overflow-style: none;
        scrollbar-width: none;
        justify-content: flex-start;
        width: 100%;
        pointer-events: none !important; /* Allow clicks to pass through to map */
    }
    .hud-right > * {
        pointer-events: auto !important; /* Keep buttons clickable */
    }

    .hud-right::-webkit-scrollbar { display: none; }
    .control-btn { padding: 6px 8px; font-size: 11px; flex-shrink: 0; min-height: 34px; }

    /* 2. Bottom Panels Stacked Outside Map */
    .legend-panel {
        position: static !important;
        order: 2; /* Below map */
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 6px 8px !important;
        max-width: 100% !important;
        background: rgba(25, 35, 50, 1) !important;
        border-radius: 0 !important;
        z-index: 2000 !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        justify-content: space-between !important;
    }
    .legend-panel:not([style*="display: none"]) {
        display: flex !important;
    }

    .legend-panel h3 { display: none; }
    .legend-item { font-size: 10px; margin-bottom: 0; display: flex; align-items: center; width: 48%; color: #ffffff !important; }
    .legend-color, .legend-line, .legend-box { width: 10px; height: 10px; margin-right: 4px; }
    .legend-subtitle { color: #ffffff !important; }

    .storm-info-panel {
        position: absolute !important;
        bottom: 50px !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        background: rgba(20, 25, 35, 0.9) !important;
        padding: 5px !important;
        z-index: 2000;
        pointer-events: none !important; /* Allow clicks to pass through empty areas */
    }
    .storm-info-panel > * {
        pointer-events: auto !important;
    }

    .storm-info-header, .storm-info-footer { display: flex; }
    .storm-info-header span { font-size: 11px; }
    #storm-cell-list { display: flex; flex-direction: row; gap: 6px; padding: 2px; overflow-x: auto; }
    .storm-cell-card { min-width: 140px; border-bottom: none; border-right: 1px solid rgba(255, 255, 255, 0.1); padding: 4px 8px; }
    .storm-cell-id { font-size: 11px; margin-bottom: 4px; }
    .storm-stat { font-size: 10px; margin-bottom: 2px; }
    .storm-stat-label span { display: none; }
    .storm-etas { display: none; }

    .animation-panel {
        position: static !important;
        order: 4; /* At the very bottom */
        width: 100% !important;
        box-sizing: border-box !important;
        border-radius: 0 !important;
        padding: 4px 8px !important;  /* Extremely slim in mobile */
        margin: 0 !important;
        background: rgba(15, 25, 35, 1) !important;
        z-index: 2000 !important;
        display: flex; /* Keep the play button/slider working */
        color: #ffffff !important;
    }
    .anim-slider { width: 100%; margin-top: 0; }
    .play-btn { height: 26px; padding: 0 10px; font-size: 11px; } /* Slimmer button for mobile */
    #anim-time { color: #ffffff !important; font-size: 11px !important; min-width: 40px !important; }

    /* Other active overlays */
    .satellite-subtoolbar { top: 125px; width: 100%; left: 0; overflow-x: auto; justify-content: flex-start; padding: 4px 6px; pointer-events: none !important; }
    .satellite-subtoolbar > * { pointer-events: auto !important; }
    .sat-sub-btn { font-size: 10px; padding: 4px 8px; }
    .expert-controls-bar { top: 125px; right: 4px; left: 4px; flex-wrap: nowrap; overflow-x: auto; gap: 4px; justify-content: flex-start; -ms-overflow-style: none; scrollbar-width: none; pointer-events: none !important; }
    .expert-controls-bar > * { pointer-events: auto !important; }
    .expert-btn { font-size: 10px; padding: 6px; flex-shrink: 0; }

    /* --- Popup Fix for Mobile --- */
    .combined-popup {
        min-width: 220px !important;
        max-width: 250px !important;
    }
    .warn-title {
        font-size: 14px !important;
        padding-bottom: 5px !important;
    }
    .warn-desc {
        font-size: 12px !important;
        max-height: 120px !important;
        overflow-y: auto !important;
        line-height: 1.3 !important;
    }
    .leaflet-popup-content {
        margin: 8px 12px !important;
    }
}


/* ============================================================
   WEATHER STATION COMPACT DOTS
   ============================================================ */
.station-div-icon {
    background: transparent;
    border: none;
}
.station-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px rgba(0,0,0,0.4);
    border: 2px solid rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.9);
    transition: transform 0.2s;
    cursor: pointer;
}
.station-dot:hover {
    transform: scale(1.15);
    z-index: 1000 !important;
}

/* ============================================================
   REPORT MODAL & RAINSAFE WIDGET
   ============================================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 15000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 0;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #1a2634;
    color: #e0e8f0;
    width: 90%;
    max-width: 450px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    overflow-y: auto;
    max-height: 90vh;
}

.modal-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--accent);
}

.close-modal {
    font-size: 28px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
#report-type {
    background: #0d1520;
    border: 1px solid #3a5068;
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}

.modal-body label {
    font-size: 14px;
    font-weight: 600;
}

.modal-body select, .modal-body textarea {
    background: #0d1520;
    border: 1px solid #3a5068;
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    font-family: inherit;
}

.modal-body textarea {
    min-height: 80px;
    resize: vertical;
}

.submit-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.submit-btn:hover {
    background: #e63e37;
}

.rainsafe-widget {
    position: fixed;
    top: 150px;
    left: 20px;
    background: rgba(15, 25, 35, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px 18px;
    z-index: 11000; /* Increased to be above HUD */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    color: white;
    min-width: 180px;
    animation: slideInLeft 0.3s ease-out;
    pointer-events: auto !important;
}
.rainsafe-plz-input {
    margin-top: 8px;
    display: flex;
    gap: 5px;
}
#rainsafe-plz {
    background: #1c2a3a;
    border: 1px solid #3a5068;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    width: 100%;
    font-size: 11px;
}

@keyframes slideInLeft {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.rainsafe-header {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    color: #48dbfb;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#rainsafe-status {
    font-size: 16px;
    font-weight: 700;
}

/* removed */ .expert-btn-removed {
    background: var(--accent);
    color: white;
    border-color: rgba(255,255,255,0.3);
}

/* removed */ .expert-btn-removed-hover {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 600px) {
    .rainsafe-widget {
        top: 240px; /* Moved down to avoid overlap with Expert Bar (at 125px) */
        left: 5px;
        right: 5px;
        min-width: auto;
        padding: 8px 12px;
        border-radius: 10px;
    }
    .rainsafe-header {
        font-size: 10px;
        margin-bottom: 4px;
    }
    #rainsafe-status {
        font-size: 13px;
    }
    .rainsafe-plz-input {
        margin-top: 5px;
    }
    #rainsafe-plz {
        padding: 3px 6px;
        font-size: 10px;
    }
}

/* User Report Markers visibility fix */
.report-marker {
    z-index: 5000 !important;
}

/* --- Archive Panel --- */
.archive-panel {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: rgba(209, 33, 27, 0.95); /* Homepage Rot */
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(209, 33, 27, 0.5);
    color: white;
}
.archive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #ffffff;
}
.archive-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.archive-slider {
    width: 100%;
    cursor: pointer;
}
.archive-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #ccc;
}
.play-btn-arch, .close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
}
.play-btn-arch:hover, .close-btn:hover { color: #ffa500; }

/* Mobile adjustments */

/* --- Community Stats Panel --- */
.stats-panel {
    position: fixed;
    top: 140px;
    left: 20px;
    width: 220px;
    background: rgba(10, 15, 30, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px;
    z-index: 900;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}
.stats-title {
    font-size: 0.8rem;
    font-weight: bold;
    color: #00ccff;
    text-transform: uppercase;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
}
.stats-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.stat-count {
    font-weight: 800;
    color: #ffa500;
}
.stat-loading { font-size: 0.7rem; font-style: italic; color: #888; }

/* Mobile: Hide or Small version */
@media (max-width: 768px) {
    .stats-panel { top: 75px; left: 5px; width: 140px; transform: scale(0.9); }
    .stats-list { flex-direction: column; }
}

.webcam-marker-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(26, 38, 52, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 1000;
}

.webcam-marker-icon:hover {
    transform: scale(1.2);
    background: #1c6fcf;
}



/* Hide storm info panel entirely on mobile touch devices */
@media (pointer: coarse) {
    .storm-info-panel {
        display: none !important;
    }
}

/* --- Fullscreen Button --- */
.fullscreen-btn {
    position: absolute;
    bottom: 25px;
    left: 20px;
    z-index: 1000;
    background: rgba(25, 35, 50, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
}
.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}
/* Responsive HUD */
@media (max-width: 768px) {
    .hud-row1 {
        flex-wrap: wrap;
    }
    .hud-left {
        width: 100%;
        margin-bottom: 5px;
        box-sizing: border-box;
    }
    .hud-logo {
        height: 50px;
        margin-right: 10px;
    }
    .hud-titles h1 {
        font-size: 16px;
    }
    .hud-titles h2 {
        font-size: 11px;
    }
    .hud-left {
        padding: 8px 15px;
    }
    .control-btn span {
        display: none;
    }
    .control-btn {
        padding: 10px;
        border-radius: 50%;
    }
    /* In mobile, keep GPS, Melden and Menü, hide others */
    .hud-right .control-btn:not(#btn-locate):not(#btn-report):not(#storm-menu-trigger),
    #hud-right-controls > button:not(#btn-locate):not(#btn-report):not(#storm-menu-trigger) {
         display: none;
    }
    .hud-right {
        z-index: 6000;
        width: 100%;
        justify-content: flex-end;
        pointer-events: none !important;
    }
    .hud-right > * {
        pointer-events: auto !important;
    }
    
    /* Animation / Archive Slider Fix */
    .animation-panel, .archive-panel {
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        transform: none !important;
        max-width: none !important;
        box-sizing: border-box;
    }
    .anim-slider, .archive-slider {
        width: 100%;
        flex: 1 1 0px;
    }
}

/* --- Menu System (Glassmorphism) --- */
.menu-container {
    position: relative;
    pointer-events: auto;
}

.menu-container {
    position: relative;
}

.menu-trigger {
    background: var(--accent);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 22px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(209, 33, 27, 0.3);
    z-index: 10000;
    pointer-events: auto !important;
}

.menu-trigger:hover {
    background: #e0241d;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(209, 33, 27, 0.4);
}

.menu-trigger.active {
    background: #b01c17;
}

.menu-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 220px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 5px;
    z-index: 100000 !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform-origin: top right;
    animation: menuFadeIn 0.2s ease-out;
    pointer-events: auto !important;
}

@media (max-width: 768px) {
    .menu-dropdown {
        position: fixed !important;
        top: 80px !important; /* Move it to the TOP on mobile since the HUD is at the top */
        bottom: auto !important;
        right: 15px !important;
        left: 15px !important;
        min-width: 0 !important;
        transform-origin: top center !important;
        z-index: 1000000 !important;
        pointer-events: auto !important;
    }
    @keyframes menuFadeIn {
        from { opacity: 0; transform: scale(0.95) translateY(10px); }
        to { opacity: 1; transform: scale(1) translateY(0); }
    }
}

.menu-dropdown.show {
    display: flex;
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(-5px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.menu-dropdown a {
    color: #333;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.menu-dropdown a i {
    width: 20px;
    text-align: center;
    color: var(--accent);
}

.menu-dropdown a:hover {
    background: rgba(209, 33, 27, 0.08);
    color: var(--accent);
}

.menu-dropdown a.active {
    background: rgba(209, 33, 27, 0.1);
    color: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(209, 33, 27, 0.2);
}
