/* ============================================
   Clean World Dashboard Pro — Styles
   ============================================ */

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2236;
    --bg-card-hover: #1f2a42;
    --border: #1e2d4a;
    --border-light: #2a3a5c;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --green: #22c55e;
    --green-dim: rgba(34,197,94,0.15);
    --emerald: #10b981;
    --blue: #3b82f6;
    --blue-dim: rgba(59,130,246,0.15);
    --amber: #f59e0b;
    --amber-dim: rgba(245,158,11,0.15);
    --red: #ef4444;
    --red-dim: rgba(239,68,68,0.15);
    --slate: #64748b;
    --slate-dim: rgba(100,116,139,0.15);
    --emerald-dim: rgba(16,185,129,0.15);
    --panel-width: 320px;
    --topbar-height: 64px;
    --timeline-height: 72px;
    --radius: 10px;
    --radius-sm: 6px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* ---- Top Bar ---- */
.top-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background: rgba(10,14,23,0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
}

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

.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { width: 36px; height: 36px; color: var(--text-secondary); }
.logo h1 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.logo .subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.year-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.year-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.year-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 700;
    color: var(--green);
    line-height: 1;
    letter-spacing: -0.02em;
}

.scenario-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}
.scenario-selector label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.scenario-selector select,
.playback-speed select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
.scenario-selector select:hover,
.playback-speed select:hover {
    border-color: var(--border-light);
}

.data-source-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
}
.pulse {
    width: 6px; height: 6px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

/* ---- Main Dashboard Grid ---- */
.dashboard {
    position: fixed;
    top: var(--topbar-height);
    left: 0; right: 0;
    bottom: var(--timeline-height);
    display: grid;
    grid-template-columns: var(--panel-width) 1fr var(--panel-width);
    gap: 0;
}

/* ---- Panels ---- */
.panel {
    background: rgba(17,24,39,0.85);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.panel-right {
    border-right: none;
    border-left: 1px solid var(--border);
}
.panel::-webkit-scrollbar { width: 4px; }
.panel::-webkit-scrollbar-track { background: transparent; }
.panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.panel-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.panel-header h2 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

/* ---- KPI Cards ---- */
.kpi-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.kpi-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.25s ease;
    cursor: default;
}
.kpi-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-1px);
}
.kpi-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.kpi-icon svg { width: 20px; height: 20px; }
.kpi-icon.green { background: var(--green-dim); color: var(--green); }
.kpi-icon.amber { background: var(--amber-dim); color: var(--amber); }
.kpi-icon.red { background: var(--red-dim); color: var(--red); }
.kpi-icon.blue { background: var(--blue-dim); color: var(--blue); }
.kpi-icon.emerald { background: var(--emerald-dim); color: var(--emerald); }
.kpi-icon.slate { background: var(--slate-dim); color: var(--slate); }

.kpi-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.kpi-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kpi-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.kpi-delta {
    font-size: 11px;
    font-weight: 500;
}
.kpi-delta.positive { color: var(--green); }
.kpi-delta.negative { color: var(--red); }
.kpi-delta.neutral { color: var(--text-muted); }

/* ---- Map ---- */
.map-container {
    position: relative;
    overflow: hidden;
}
#map {
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
}

/* Leaflet overrides */
.leaflet-container {
    background: var(--bg-primary) !important;
    font-family: 'Inter', sans-serif !important;
}
.leaflet-control-zoom {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    overflow: hidden;
}
.leaflet-control-zoom a {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    font-size: 16px !important;
}
.leaflet-control-zoom a:hover {
    background: var(--bg-card-hover) !important;
}
.leaflet-control-attribution {
    background: rgba(10,14,23,0.8) !important;
    color: var(--text-muted) !important;
    font-size: 9px !important;
}
.leaflet-control-attribution a { color: var(--text-muted) !important; }

.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5) !important;
}
.leaflet-popup-tip { background: var(--bg-card) !important; }
.leaflet-popup-content {
    margin: 14px 16px !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
}

.map-overlay-controls {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 800;
}
.map-layer-selector {
    display: flex;
    gap: 2px;
    background: rgba(10,14,23,0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px;
}
.map-layer-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.map-layer-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.map-layer-btn.active {
    color: var(--text-primary);
    background: var(--bg-card);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.map-legend {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 800;
    background: rgba(10,14,23,0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    min-width: 200px;
}
.map-legend h4 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.legend-scale { display: flex; flex-direction: column; gap: 4px; }
.legend-bar {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #7f1d1d, #dc2626, #f59e0b, #84cc16, #22c55e);
}
.legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* ---- Chart Cards ---- */
.chart-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    transition: border-color 0.25s;
}
.chart-card:hover { border-color: var(--border-light); }
.chart-card h3 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}
.chart-card canvas {
    width: 100% !important;
    max-height: 160px;
}

/* ---- Timeline Bar ---- */
.timeline-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--timeline-height);
    background: rgba(10,14,23,0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
}
.timeline-content {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
}

.play-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--green);
    border: none;
    border-radius: 50%;
    color: #000;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.play-btn:hover { background: #16a34a; transform: scale(1.05); }
.play-btn svg { width: 16px; height: 16px; }

.timeline-slider-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.timeline-ticks {
    display: flex;
    justify-content: space-between;
    padding: 0 2px;
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* Range slider styling */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; height: 20px;
    background: var(--green);
    border: 3px solid var(--bg-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(34,197,94,0.4);
    transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
input[type="range"]::-moz-range-thumb {
    width: 20px; height: 20px;
    background: var(--green);
    border: 3px solid var(--bg-primary);
    border-radius: 50%;
    cursor: pointer;
}

.playback-speed {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.playback-speed label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ---- Country Popup ---- */
.country-popup {
    min-width: 220px;
}
.country-popup h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.country-popup .popup-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 12px;
}
.country-popup .popup-row .popup-label {
    color: var(--text-muted);
}
.country-popup .popup-row .popup-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ---- Mobile Tab Bar (hidden on desktop) ---- */
.mobile-tabs {
    display: none;
}
.mobile-panel {
    display: none;
}

/* ---- Responsive ---- */
@media (max-width: 1400px) {
    :root {
        --panel-width: 280px;
    }
}

/* ===== TABLET ===== */
@media (max-width: 1100px) {
    :root {
        --panel-width: 260px;
    }
    .dashboard {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    .panel-left, .panel-right {
        border: none;
        border-bottom: 1px solid var(--border);
        max-height: 200px;
    }
    .panel-right { border-top: 1px solid var(--border); border-bottom: none; }
    .kpi-grid {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .kpi-card { flex: 1 1 calc(50% - 5px); }
    .chart-stack { flex-direction: row; }
    .chart-card { flex: 1; }
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    :root {
        --topbar-height: 56px;
        --timeline-height: 56px;
        --mobile-tab-height: 56px;
    }

    html, body {
        overflow: hidden;
        -webkit-overflow-scrolling: touch;
    }

    /* ---- Top Bar Mobile ---- */
    .top-bar {
        height: var(--topbar-height);
        padding: 0 12px;
        gap: 8px;
    }
    .top-bar-left .logo .subtitle { display: none; }
    .logo h1 { font-size: 13px; }
    .logo-icon { width: 28px; height: 28px; }
    .logo { gap: 8px; }

    .year-display { gap: 0; }
    .year-label { font-size: 7px; letter-spacing: 0.1em; }
    .year-value { font-size: 22px; }

    /* Hide desktop-only controls on mobile */
    .top-bar-right .scenario-selector,
    .top-bar-right .data-source-badge {
        display: none;
    }

    /* ---- Dashboard — full screen map ---- */
    .dashboard {
        position: fixed;
        top: var(--topbar-height);
        left: 0; right: 0;
        bottom: calc(var(--timeline-height) + var(--mobile-tab-height));
        display: block;
        grid-template-columns: none;
    }

    /* Hide desktop side panels on mobile */
    .panel-left,
    .panel-right {
        display: none !important;
    }

    /* Map fills all available space */
    .map-container {
        width: 100%;
        height: 100%;
    }

    /* Map overlay controls — compact */
    .map-overlay-controls {
        top: 8px;
    }
    .map-layer-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    /* Map legend — smaller */
    .map-legend {
        bottom: 8px;
        left: 8px;
        padding: 8px 12px;
        min-width: 160px;
    }
    .map-legend h4 { font-size: 9px; margin-bottom: 6px; }
    .legend-labels { font-size: 8px; }

    /* Leaflet controls */
    .leaflet-control-zoom { top: 40px !important; }
    .leaflet-control-zoom a {
        width: 28px !important;
        height: 28px !important;
        line-height: 28px !important;
        font-size: 14px !important;
    }

    /* ---- Timeline — compact ---- */
    .timeline-bar {
        height: var(--timeline-height);
        bottom: var(--mobile-tab-height);
    }
    .timeline-content {
        padding: 0 10px;
        gap: 8px;
    }
    .play-btn {
        width: 34px;
        height: 34px;
    }
    .play-btn svg { width: 13px; height: 13px; }
    .timeline-ticks { font-size: 8px; }
    .timeline-ticks span:nth-child(2),
    .timeline-ticks span:nth-child(4) {
        display: none;
    }
    /* Hide speed selector on mobile (moved to settings panel) */
    .playback-speed { display: none; }

    input[type="range"]::-webkit-slider-thumb {
        width: 22px; height: 22px;
    }
    input[type="range"]::-moz-range-thumb {
        width: 22px; height: 22px;
    }

    /* ---- Mobile Tab Bar ---- */
    .mobile-tabs {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0; right: 0;
        height: var(--mobile-tab-height);
        background: rgba(10, 14, 23, 0.97);
        backdrop-filter: blur(20px);
        border-top: 1px solid var(--border);
        z-index: 1100;
        padding: 0;
    }
    .mobile-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: none;
        border: none;
        color: var(--text-muted);
        font-family: 'Inter', sans-serif;
        font-size: 9px;
        font-weight: 500;
        cursor: pointer;
        transition: color 0.2s;
        padding: 4px 0;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-tab svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
    .mobile-tab.active {
        color: var(--green);
    }
    .mobile-tab:active {
        transform: scale(0.95);
    }

    /* ---- Mobile Panels ---- */
    .mobile-panel {
        display: none;
        position: fixed;
        top: var(--topbar-height);
        left: 0; right: 0;
        bottom: calc(var(--timeline-height) + var(--mobile-tab-height));
        background: var(--bg-primary);
        z-index: 900;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        animation: panelSlideUp 0.25s ease-out;
    }
    .mobile-panel.visible {
        display: block;
    }

    @keyframes panelSlideUp {
        from { opacity: 0; transform: translateY(20px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .mobile-panel-header {
        position: sticky;
        top: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        background: rgba(10, 14, 23, 0.95);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        z-index: 10;
    }
    .mobile-panel-header h2 {
        font-size: 14px;
        font-weight: 700;
        color: var(--text-primary);
    }
    .mobile-panel-close {
        width: 32px; height: 32px;
        display: flex; align-items: center; justify-content: center;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 50%;
        color: var(--text-secondary);
        font-size: 18px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    /* ---- Mobile KPI Grid ---- */
    .mobile-kpi-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 12px;
    }
    .mobile-kpi-card {
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 14px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
    }
    .mobile-kpi-card .mkpi-header {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .mobile-kpi-card .mkpi-icon {
        width: 32px; height: 32px;
        display: flex; align-items: center; justify-content: center;
        border-radius: var(--radius-sm);
        flex-shrink: 0;
    }
    .mobile-kpi-card .mkpi-icon svg { width: 16px; height: 16px; }
    .mobile-kpi-card .mkpi-icon.green { background: var(--green-dim); color: var(--green); }
    .mobile-kpi-card .mkpi-icon.amber { background: var(--amber-dim); color: var(--amber); }
    .mobile-kpi-card .mkpi-icon.red { background: var(--red-dim); color: var(--red); }
    .mobile-kpi-card .mkpi-icon.blue { background: var(--blue-dim); color: var(--blue); }
    .mobile-kpi-card .mkpi-icon.emerald { background: var(--emerald-dim); color: var(--emerald); }
    .mobile-kpi-card .mkpi-icon.slate { background: var(--slate-dim); color: var(--slate); }

    .mobile-kpi-card .mkpi-label {
        font-size: 10px;
        font-weight: 500;
        color: var(--text-muted);
        line-height: 1.2;
    }
    .mobile-kpi-card .mkpi-value {
        font-family: 'JetBrains Mono', monospace;
        font-size: 22px;
        font-weight: 700;
        letter-spacing: -0.02em;
        line-height: 1;
    }
    .mobile-kpi-card .mkpi-delta {
        font-size: 10px;
        font-weight: 500;
    }
    .mobile-kpi-card .mkpi-delta.positive { color: var(--green); }
    .mobile-kpi-card .mkpi-delta.negative { color: var(--red); }
    .mobile-kpi-card .mkpi-delta.neutral { color: var(--text-muted); }

    /* Full-width card for the last odd one */
    .mobile-kpi-card.full-width {
        grid-column: 1 / -1;
    }

    /* ---- Mobile Charts ---- */
    .mobile-chart-stack {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    .mobile-chart-card {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 14px;
    }
    .mobile-chart-card h3 {
        font-size: 11px;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 10px;
    }
    .mobile-chart-card canvas {
        width: 100% !important;
        max-height: 200px;
    }

    /* ---- Mobile Settings ---- */
    .mobile-settings-content {
        padding: 12px 16px;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    .mobile-setting-row {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .mobile-setting-row > label {
        font-size: 11px;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }
    .mobile-setting-row select {
        background: var(--bg-card);
        border: 1px solid var(--border);
        color: var(--text-primary);
        padding: 12px 14px;
        border-radius: var(--radius-sm);
        font-family: 'Inter', sans-serif;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        outline: none;
        -webkit-appearance: none;
    }
    .mobile-layer-btns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .mobile-layer-btn {
        padding: 10px 8px;
        font-size: 12px;
        font-weight: 500;
        font-family: 'Inter', sans-serif;
        color: var(--text-muted);
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        cursor: pointer;
        transition: all 0.2s;
        text-align: center;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-layer-btn.active {
        color: var(--text-primary);
        background: var(--bg-card-hover);
        border-color: var(--green);
        box-shadow: 0 0 8px rgba(34,197,94,0.2);
    }
    .data-badge-row {
        flex-direction: row !important;
        align-items: center;
        gap: 8px;
        padding: 12px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        font-size: 12px;
        color: var(--text-muted);
    }

    /* ---- Leaflet Popup — Touch friendly ---- */
    .leaflet-popup-content-wrapper {
        max-width: calc(100vw - 60px) !important;
    }
    .leaflet-popup-content {
        margin: 10px 12px !important;
        font-size: 12px !important;
    }
    .country-popup { min-width: 180px; }
    .country-popup h3 { font-size: 14px; }
}

/* ===== SMALL PHONE (<360px) ===== */
@media (max-width: 360px) {
    .logo h1 { font-size: 11px; }
    .year-value { font-size: 18px; }
    .top-bar { padding: 0 8px; }
    .mobile-kpi-grid { grid-template-columns: 1fr; }
    .mobile-kpi-card .mkpi-value { font-size: 18px; }
    .map-layer-btn { padding: 4px 7px; font-size: 9px; }
}
