﻿/* =========================================================
   map.css — GIMS Interactive Maps (GeoForestry-like)
   - Fullscreen map
   - Floating right panel + icon-only collapse toggle
   - SUPARCO blue theme (no green)
========================================================= */

/* ---------- Page / Shell overrides (full bleed map) ---------- */
:root {
    --topbar-h: 78px; /* adjust if your header is taller/shorter */
}

html, body {
    height: 100%;
}

body {
    overflow: hidden; /* IMPORTANT: no page scroll like GeoForestry */
}
/* kill bootstrap container width/padding if layout wraps body */
.container, .container-fluid {
    max-width: none !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* make your layout wrappers stretch full height */
.shell--no-sidebar,
.main--no-sidebar {
    height: 100%;
    min-height: 100%;
    width: 100%;
    max-width: none !important;
}

/* ensure header takes fixed height and doesn't collapse */
.topbar {
    height: var(--topbar-h);
    flex: 0 0 var(--topbar-h);
    width: 100%;
}

.header-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

/* map page main area must consume remaining viewport */
.g-content--map {
    height: calc(100vh - var(--topbar-h)) !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* FULLSCREEN shell for the map */
.map-shell--fullscreen {
    height: calc(100vh - var(--topbar-h)) !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.map-card--fullscreen {
    height: 100% !important;
    width: 100% !important;
    border-radius: 0 !important;
    overflow: hidden;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.map-wrap--fullscreen {
    position: relative;
    height: 100% !important;
    width: 100% !important;
    min-height: 0 !important;
    overflow: hidden;
}

/* Leaflet target must fill its parent */
#gimsMap {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Provide same background to wrapper */
.map-wrap {
    background: radial-gradient(circle at top, rgba(14, 165, 233, .18), #ffffff 65%);
}

/* ---------- HUD coords ---------- */
.hud {
    position: absolute;
    left: 12px;
    bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: radial-gradient(circle at top, rgba(14,165,233,.20), rgba(255,255,255,.95));
    border: 1px solid rgba(14,165,233,.25);
    box-shadow: 0 10px 22px rgba(2,6,23,.10);
    font-size: .78rem;
    color: rgba(15,23,42,.80);
    pointer-events: none;
    z-index: 650;
}

/* ---------- Mobile search ---------- */
.mini-search {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: grid;
    grid-template-columns: 28px 1fr 56px;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(14,165,233,.18);
    box-shadow: 0 16px 40px rgba(2,6,23,.10);
    z-index: 700;
}

    .mini-search input {
        border: 1px solid rgba(15,23,42,.12);
        border-radius: 12px;
        padding: 8px 10px;
    }

    .mini-search button {
        border: 1px solid rgba(15,23,42,.12);
        border-radius: 12px;
        padding: 8px 10px;
    }

/* ---------- Legend ---------- */
.g-legend {
    position: absolute;
    left: 12px;
    bottom: 50px;
    background: radial-gradient(circle at top, rgba(14,165,233,.20), rgba(255,255,255,.95));
    border: 1px solid rgba(14,165,233,.28);
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 20px 50px rgba(2,6,23,.12);
    z-index: 650;
    min-width: 170px;
}

.g-legend-title {
    color: #0f172a;
    margin-bottom: 6px;
}

.g-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(15,23,42,.75);
    font-size: .82rem;
}

    .g-legend-row.small {
        margin-top: 6px;
        font-size: .75rem;
        color: #64748b;
    }

.swatch {
    width: 14px;
    height: 10px;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid rgba(2,6,23,.12);
}

.sw-glacier {
    background: #3b82f6; /* matches Leaflet glacier layer */
}

.sw-lake {
    background: #06b6d4; /* matches Leaflet lake layer */
}

/* ---------- Crosshair overlay ---------- */
.crosshair {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 600;
}

    .crosshair:before,
    .crosshair:after {
        content: "";
        position: absolute;
        background: rgba(15,23,42,.35);
    }

    .crosshair:before {
        width: 1px;
        top: 8px;
        bottom: 8px;
        left: 50%;
        transform: translateX(-0.5px);
    }

    .crosshair:after {
        height: 1px;
        left: 8px;
        right: 8px;
        top: 50%;
        transform: translateY(-0.5px);
    }

/* ---------- Floating footer/status ---------- */
.map-footer--floating {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 700;
    border-radius: 14px;
    backdrop-filter: blur(10px);
    background: radial-gradient(circle at top, rgba(14,165,233,.18), rgba(255,255,255,.92));
    border: 1px solid rgba(14,165,233,.25);
    box-shadow: 0 14px 30px rgba(2,6,23,.12);
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.hint {
    color: rgba(15,23,42,.62);
    font-size: .82rem;
    display: flex;
    gap: 8px;
    align-items: center;
    font-weight: 700;
}

.status {
    font-size: .82rem;
    color: rgba(15,23,42,.80);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

    .dot.ok {
        background: #0ea5e9; /* blue instead of green */
    }

    .dot.warn {
        background: #f59e0b;
    }

/* =====================================================
   Right panel (floating)
===================================================== */
.side-card--floating {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 360px;
    max-width: calc(100vw - 24px);
    height: calc(100% - 24px);
    z-index: 800;
    border-radius: 18px;
    background: radial-gradient(circle at top, rgba(14,165,233,.18), rgba(255,255,255,.96) 60%);
    border: 1px solid rgba(14,165,233,.22);
    box-shadow: 0 18px 45px rgba(2,6,23,.18);
    display: flex;
    flex-direction: column;
    transition: transform .28s ease, opacity .28s ease;
}

    /* Collapsed: slide out completely (no vertical bar) */
    .side-card--floating.is-collapsed {
        transform: translateX(calc(100% + 18px));
        opacity: 0;
        pointer-events: none;
    }

/* Panel header */
.side-float-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(15,23,42,.08);
    background: linear-gradient(180deg, rgba(14,165,233,.22), rgba(255,255,255,.88));
    height: 55px;
}

.side-float-title {
    font-weight: 900;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.side-float-body {
    padding: 10px 12px;
    overflow: auto;
    min-height: 0;
}

/* =====================================================
   Toggle icon (ALWAYS visible) — place this button outside <aside>
   Class: .side-panel-toggle (id=btnPanelToggle)
===================================================== */
.side-panel-toggle {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,.15);
    background: rgba(255,255,255,.96);
    box-shadow: 0 12px 30px rgba(2,6,23,.18);
    cursor: pointer;
    z-index: 900;
    transition: transform .15s ease;
}

    .side-panel-toggle:hover {
        transform: scale(1.06);
    }

    .side-panel-toggle i {
        font-size: 18px;
        color: #0f172a;
    }

    .side-panel-toggle.is-collapsed i {
        transform: rotate(180deg);
    }

/* =====================================================
   Controls inside panel
===================================================== */
.side-title {
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
    margin: 6px 0 8px;
}

.group {
    border: 1px solid rgba(15,23,42,.10);
    border-radius: 14px;
    padding: 10px;
    background: rgba(255,255,255,.70);
    margin-bottom: 12px;
}

.group-title {
    display: flex;
    justify-content: space-between;
    color: #000;
    font-size: .78rem;
    margin-bottom: 8px;
}

.mini {
    opacity: .9;
}

/* Radios */
.radio-row {
    display: grid;
    grid-template-columns: 18px 1fr; /* radio + FULL text width */
    column-gap: 12px;
    row-gap: 2px;
    align-items: start;
    padding: 10px 10px;
    border-radius: 12px;
    cursor: pointer;
}

    .radio-row:hover {
        background: rgba(14,165,233,.06);
    }

    .radio-row input {
        margin: 12px 0px 0px 0px;
    }

.radio-ui {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(15,23,42,.20);
}

.row-text b {
    display: block;
    font-weight: 900;
}

.row-text small {
    display: block;
    color: rgba(15,23,42,.62);
    font-size: .78rem;
    margin-top: 2px;
        
}

/* Toggles */
.toggle-row {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border-radius: 12px;
}

    .toggle-row:hover {
        background: rgba(14,165,233,.06);
    }

.layer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Zoom icon button inside rows */
.layer-zoom {
    border: 1px solid rgba(15,23,42,.15);
    background: #fff;
    border-radius: 10px;
    padding: 4px 7px;
    line-height: 1;
    cursor: pointer;
    color: #0f172a;
}

    .layer-zoom:hover {
        background: rgba(14,165,233,.10);
        border-color: rgba(14,165,233,.35);
        color: #0ea5e9;
    }

/* Pills */
.pill {
    font-size: .70rem;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(14,165,233,.30);
    background: rgba(14,165,233,.15);
    color: #0f172a;
}

    .pill.warn {
        background: rgba(245,158,11,.14);
        border-color: rgba(245,158,11,.22);
    }

    .pill.soft {
        background: rgba(15,23,42,.06);
        border-color: rgba(15,23,42,.12);
    }

/* Sliders */
.slider-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 8px;
    color: rgba(15,23,42,.70);
    font-size: .78rem;
}

    .slider-row input[type="range"] {
        width: 60%;
        accent-color: #0ea5e9;
    }

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
}

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15,23,42,.18);
    transition: .2s;
    border-radius: 999px;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 3px;
        top: 3px;
        background: white;
        transition: .2s;
        border-radius: 999px;
        box-shadow: 0 8px 16px rgba(2,6,23,.18);
    }

.switch input:checked + .slider {
    background: rgba(14,165,233,.55); /* blue */
}

    .switch input:checked + .slider:before {
        transform: translateX(18px);
    }

/* Tools grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding: 10px 10px;
    border-radius: 14px;
    border: 1px solid rgba(14,165,233,.30);
    background: rgba(255,255,255,.92);
    box-shadow: 0 14px 28px rgba(2,6,23,.08);
}

    .tool-btn:hover {
        background: rgba(14,165,233,.08);
    }

/* =====================================================
   Feature Info box + table (FIXED)
===================================================== */
.info-box {
    border: 1px solid rgba(15,23,42,.10);
    border-radius: 14px;
    background: rgba(255,255,255,.88);
    padding: 10px;
    color: rgba(15,23,42,.80);
    font-size: .82rem;
    min-height: 120px;
    overflow: auto; /* IMPORTANT */
}

/* Card */
.info-card {
    border: 1px solid rgba(15,23,42,.10);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.info-head {
    padding: 12px 12px 10px;
    background: radial-gradient(circle at top, rgba(14,165,233,.25), rgba(255,255,255,.92));
    border-bottom: 1px solid rgba(15,23,42,.08);
}

.info-title {
    color: #0f172a;
    line-height: 1.15;
}

.info-sub {
    margin-top: 3px;
    font-size: .80rem;
    color: #64748b;
}

/* Table layout FIX */
.info-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13px;
    margin-top: 8px;
}

    .info-table tr {
        border-bottom: 1px solid #f1f5f9;
    }

    .info-table td {
        padding: 8px 6px;
        vertical-align: top;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

        /* Label column */
        .info-table td:first-child {
            width: 46%;
            color: #64748b;
            text-align: left;
            white-space: normal;
        }

        /* Value column */
        .info-table td:last-child {
            width: 54%;
            text-align: left !important; /* DO NOT right align */
            color: #0f172a;
            white-space: normal;
        }

/* Raw JSON view */
.raw-json {
    white-space: pre-wrap;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12px;
    background: #0b1220;
    color: #e5e7eb;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.12);
}

/* =====================================================
   Loader overlay (kept)
===================================================== */
.gims-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(247,250,252,.80);
    backdrop-filter: blur(6px);
}

    .gims-loading-overlay.fade-out {
        opacity: 0;
        pointer-events: none;
        transition: opacity .55s ease;
    }

.gims-loading-panel {
    width: min(560px, 92vw);
    border-radius: 18px;
    border: 1px solid rgba(15,23,42,.12);
    background: rgba(255,255,255,.92);
    box-shadow: 0 30px 90px rgba(2,6,23,.16);
    padding: 14px;
}

.gims-loading-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 6px 10px;
}

.spinner-ring {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 3px solid rgba(15,23,42,.10);
    border-top-color: #0ea5e9;
    border-right-color: rgba(14,165,233,.55);
    animation: spin .75s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.gims-loading-title {
    font-weight: 900;
    color: #0b1220;
}

.gims-loading-subtitle {
    color: rgba(15,23,42,.62);
    font-weight: 800;
    font-size: .84rem;
}

.gims-loading-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 8px 6px 10px;
}

.loading-step {
    border: 1px solid rgba(15,23,42,.10);
    border-radius: 14px;
    background: rgba(255,255,255,.70);
    padding: 8px 8px;
    font-weight: 900;
    font-size: .76rem;
    color: rgba(15,23,42,.70);
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(15,23,42,.18);
}

.loading-step.is-active {
    border-color: rgba(14,165,233,.28);
    background: rgba(14,165,233,.08);
}

    .loading-step.is-active .step-dot {
        background: #0ea5e9;
    }

.loading-step.is-done .step-dot {
    background: #0ea5e9;
}

.gims-loading-progress {
    height: 10px;
    border-radius: 999px;
    background: rgba(15,23,42,.08);
    overflow: hidden;
    margin: 0 6px 8px;
}

.gims-loading-progress-inner {
    height: 100%;
    width: 5%;
    background: linear-gradient(90deg, rgba(14,165,233,1), rgba(2,132,199,1));
    border-radius: 999px;
    transition: width .25s ease;
}
/* =============================
   Analysis window under Draw toolbar (top-left)
============================= */
.analysis-drawer {
    position: absolute;
    left: 12px;
    top: 120px; /* fallback; JS will override precisely */
    width: 420px;
    max-width: calc(100vw - 24px);
    max-height: calc(100% - 24px - 120px);
    z-index: 820;
    border-radius: 18px;
    background: radial-gradient(circle at top, rgba(14,165,233,.18), rgba(255,255,255,.96) 60%);
    border: 1px solid rgba(14,165,233,.22);
    box-shadow: 0 18px 45px rgba(2,6,23,.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform .22s ease, opacity .22s ease;
}

    /* collapsed -> slide down slightly, keep FAB visible */
    .analysis-drawer.is-collapsed {
        transform: translateY(14px);
        opacity: 0;
        pointer-events: none;
    }

/* FAB at top-left near tools */
.analysis-fab {
    position: absolute;
    left: 12px;
    top: 120px; /* fallback; JS will override */
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(15,23,42,.15);
    background: rgba(255,255,255,.96);
    box-shadow: 0 12px 30px rgba(2,6,23,.18);
    cursor: pointer;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .analysis-fab.is-hidden {
        display: none;
    }

.leaflet-control-scale {
    display: none !important;
}

/* MiniMap should not be constrained by the leaflet control stack */
.leaflet-control-minimap {
    box-shadow: 0 14px 30px rgba(2,6,23,.18);
    border-radius: 10px;
    overflow: hidden;
}

/* Crosshair overlay (CENTER) */
.crosshair {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 700; /* above map tiles */
    display: none; /* default OFF */
}

    .crosshair::before,
    .crosshair::after {
        content: "";
        position: absolute;
        background: rgba(15,23,42,.40);
    }

    .crosshair::before {
        width: 1px;
        top: 10px;
        bottom: 10px;
        left: 50%;
        transform: translateX(-0.5px);
    }

    .crosshair::after {
        height: 1px;
        left: 10px;
        right: 10px;
        top: 50%;
        transform: translateY(-0.5px);
    }


/* Make sure Leaflet controls stay clickable above map */
.leaflet-top,
.leaflet-bottom {
    z-index: 900;
}

/* Optional: tighter analysis header/tabs */
.analysis-head {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(15,23,42,.08);
    background: linear-gradient(180deg, rgba(14,165,233,.22), rgba(255,255,255,.88));
}

.analysis-title {
    font-weight: 900;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analysis-sub {
    margin-left: 10px;
    font-size: .80rem;
    color: #64748b;
    font-weight: 800;
}

.analysis-tabs {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(15,23,42,.08);
    background: rgba(255,255,255,.72);
}

.analysis-tab {
    border: 1px solid rgba(15,23,42,.10);
    background: rgba(255,255,255,.92);
    border-radius: 12px;
    padding: 8px 10px;
    font-weight: 900;
    display: flex;
    gap: 8px;
    align-items: center;
}

    .analysis-tab.is-active {
        border-color: rgba(14,165,233,.28);
        background: rgba(14,165,233,.08);
    }

.analysis-body {
    padding: 10px 12px;
    overflow: auto;
    min-height: 0;
}

.analysis-pane {
    display: none;
}

    .analysis-pane.is-active {
        display: block;
    }

/* Analysis FAB container */
.analysis-fab {
    position: absolute;
    display: flex;
    flex-direction: column; /* icon above text */
    align-items: center;
    gap: 6px;
    padding: 10px 8px 12px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(15,23,42,.15);
    box-shadow: 0 12px 30px rgba(2,6,23,.18);
    z-index: 900;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
    margin-left: 4px;
}

    /* Icon */
    .analysis-fab i {
        font-size: 18px;
        color: #0f172a;
    }

/* Vertical label under icon */
.analysis-label {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
    color: #0f172a;
    writing-mode: vertical-rl; /* vertical text */
    text-orientation: mixed;
    transform: rotate(180deg); /* bottom → top */
    line-height: 1;
}

/* Hover effect */
.analysis-fab:hover {
    background: rgba(14,165,233,.08);
    border-color: rgba(14,165,233,.35);
    transform: scale(1.05);
}

/* Hidden state */
.analysis-fab.is-hidden {
    display: none;
}
/* =========================
   Topbar background (blue)
========================= */
.topbar {
    /* full width look */
    width: 100%;
    padding: 10px 14px;
    /* the background you asked */
    background: radial-gradient(circle at top, rgba(14, 165, 233, .18), #ffffff);
    /* glass + separation */
    border-bottom: 1px solid rgba(14,165,233,.22);
    box-shadow: 0 10px 28px rgba(2,6,23,.08);
    backdrop-filter: blur(10px);
    /* if your layout adds margins */
    margin: 0;
}

/* optional: keep it visually “sticky” */
.topbar {
    position: sticky;
    top: 0;
    z-index: 2000;
}

    /* optional: nicer badge contrast on light gradient */
    .topbar .badge-soft {
        background: rgba(255,255,255,.75);
        border: 1px solid rgba(14,165,233,.22);
    }

    /* optional: search pill style */
    .topbar .search-inline input {
        background: rgba(255,255,255,.92);
        border: 1px solid rgba(14,165,233,.22);
        border-radius: 12px;
    }


/* ==========================
   Analytics Drawer (pro)
========================== */
.analysis-drawer {
    position: absolute;
    width: 360px;
    max-width: calc(100vw - 24px);
    z-index: 920;
    border-radius: 18px;
    border: 1px solid rgba(14,165,233,.22);
    background: radial-gradient(circle at top, rgba(14,165,233,.18), rgba(255,255,255,.96) 60%);
    box-shadow: 0 18px 45px rgba(2,6,23,.18);
    overflow: hidden;
    transform-origin: top left;
    transition: transform .22s ease, opacity .22s ease;
}

    .analysis-drawer.is-collapsed {
        transform: scale(.94);
        opacity: 0;
        pointer-events: none;
    }

.analysis-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(14,165,233,.26), rgba(255,255,255,.90));
    border-bottom: 1px solid rgba(15,23,42,.08);
}

.analysis-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
    min-width: 0;
}

.analysis-title-text {
    letter-spacing: .08em;
}

.analysis-sub {
    margin-left: 6px;
    font-size: .78rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
}

.analysis-head-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,.12);
    background: rgba(255,255,255,.95);
    box-shadow: 0 10px 20px rgba(2,6,23,.08);
    cursor: pointer;
}

    .icon-btn:hover {
        background: rgba(14,165,233,.08);
        border-color: rgba(14,165,233,.35);
        color: #0ea5e9;
    }

/* KPI chips */
.analysis-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(15,23,42,.08);
    background: rgba(255,255,255,.70);
}

.kpi-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(14,165,233,.25);
    background: rgba(14,165,233,.10);
    font-size: .78rem;
    color: #0f172a;
}

/* Tabs (sticky-ish) */
.analysis-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255,255,255,.78);
    border-bottom: 1px solid rgba(15,23,42,.08);
}

.analysis-tab {
    flex: 1;
    border: 1px solid rgba(15,23,42,.12);
    background: #fff;
    border-radius: 12px;
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .analysis-tab.is-active {
        border-color: rgba(14,165,233,.40);
        background: rgba(14,165,233,.10);
        color: #0f172a;
    }

/* Body */
.analysis-body {
    padding: 10px 12px;
    max-height: 56vh;
    overflow: auto;
}

.analysis-pane {
    display: none;
}

    .analysis-pane.is-active {
        display: block;
    }

/* Attributes toolbar */
.analysis-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.analysis-search {
    flex: 1;
    position: relative;
}

    .analysis-search i {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        color: #64748b;
        pointer-events: none;
    }

    .analysis-search input {
        width: 100%;
        border: 1px solid rgba(15,23,42,.12);
        border-radius: 12px;
        padding: 9px 10px 9px 32px;
        outline: none;
    }

        .analysis-search input:focus {
            border-color: rgba(14,165,233,.45);
            box-shadow: 0 0 0 3px rgba(14,165,233,.15);
        }

.analysis-toolbar-actions {
    display: flex;
    gap: 8px;
}

.mini-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,.12);
    background: #fff;
    cursor: pointer;
}

    .mini-btn:hover {
        background: rgba(14,165,233,.08);
        border-color: rgba(14,165,233,.35);
        color: #0ea5e9;
    }

/* Chart cards */
.chart-card {
    border: 1px solid rgba(15,23,42,.10);
    border-radius: 16px;
    background: rgba(255,255,255,.90);
    overflow: hidden;
    margin-bottom: 12px;
}

.chart-head {
    padding: 12px;
    border-bottom: 1px solid rgba(15,23,42,.08);
    background: radial-gradient(circle at top, rgba(14,165,233,.18), rgba(255,255,255,.94));
}

.chart-title {
    color: #0f172a;
    display: flex;
    gap: 8px;
    align-items: center;
}

.chart-sub {
    margin-top: 4px;
    font-size: .78rem;
    color: #64748b;
}

.chart-placeholder {
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.ph-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(14,165,233,.25);
    background: rgba(14,165,233,.10);
}

.ph-title {
    color: #0f172a;
}

.ph-sub {
    color: #64748b;
    font-size: .82rem;
    margin-top: 2px;
}

.stats-box {
    padding: 12px;
    color: #0f172a;
}

/* Actions pane note */
.note-box {
    margin-top: 10px;
    border: 1px dashed rgba(14,165,233,.35);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(14,165,233,.08);
    color: #0f172a;
}

/* Analysis FAB (pill with vertical label) - your requested style */
.analysis-fab {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(15,23,42,.15);
    box-shadow: 0 12px 30px rgba(2,6,23,.18);
    z-index: 930;
    cursor: pointer;
}

    .analysis-fab i {
        font-size: 18px;
        color: #0f172a;
    }

.analysis-label {
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .14em;
    color: #0f172a;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    line-height: 1;
}

/* Hide FAB when drawer open */
.analysis-fab.is-hidden {
    display: none;
}
/* ---------- Analytics Highslide-style modal ---------- */
.a-hidden {
    display: none;
}

.a-modal {
    position: fixed;
    inset: 0;
    z-index: 5000; /* above leaflet */
}

.a-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, .45);
    backdrop-filter: blur(2px);
}

.a-card {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(980px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255,255,255,.92);
    box-shadow: 0 22px 60px rgba(2,6,23,.35);
    border: 1px solid rgba(15,23,42,.12);
}

.a-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(180deg, rgba(14,165,233,.18), rgba(255,255,255,.88));
    border-bottom: 1px solid rgba(15,23,42,.10);
}

.a-title {
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: .02em;
}

    .a-title i {
        font-size: 18px;
    }

.a-sub {
    margin-left: 10px;
    color: #64748b;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 48vw;
}

.a-actions {
    display: flex;
    gap: 8px;
}

.a-iconbtn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(15,23,42,.12);
    background: rgba(255,255,255,.85);
    display: grid;
    place-items: center;
    cursor: pointer;
}

    .a-iconbtn:hover {
        background: rgba(255,255,255,1);
    }

.a-kpis {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(15,23,42,.08);
    background: rgba(255,255,255,.70);
}

.a-kpi {
    flex: 1;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,.10);
    background: rgba(255,255,255,.88);
    padding: 8px 10px;
}

    .a-kpi .k {
        display: block;
        font-size: 11px;
        color: #64748b;
    }

    .a-kpi .v {
        display: block;
        font-size: 13px;
        color: #0f172a;
    }

.a-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(15,23,42,.08);
    background: rgba(255,255,255,.75);
}

.a-tab {
    border: 1px solid rgba(15,23,42,.10);
    background: rgba(255,255,255,.86);
    border-radius: 12px;
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .a-tab.is-active {
        border-color: rgba(14,165,233,.45);
        box-shadow: 0 8px 18px rgba(14,165,233,.12);
    }

.a-body {
    padding: 12px 14px 14px;
    overflow: auto;
}

.a-pane {
    display: none;
}

    .a-pane.is-active {
        display: block;
    }

.a-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.a-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(15,23,42,.10);
    border-radius: 12px;
    background: rgba(255,255,255,.9);
    padding: 8px 10px;
}

    .a-search input {
        border: 0;
        outline: 0;
        width: 100%;
        background: transparent;
    }

.a-toolbar-actions {
    display: flex;
    gap: 8px;
}

.a-mini {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,.10);
    background: rgba(255,255,255,.9);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.a-section {
    border: 1px solid rgba(15,23,42,.10);
    border-radius: 14px;
    background: rgba(255,255,255,.88);
    padding: 12px;
    margin-bottom: 12px;
}

.a-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.a-muted {
    color: #64748b;
    font-size: 12px;
}

.a-chart-ph {
    margin-top: 10px;
    border: 1px dashed rgba(15,23,42,.18);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: center;
    color: #64748b;
    background: rgba(241,245,249,.65);
}

    .a-chart-ph .t {
        color: #0f172a;
    }

    .a-chart-ph .s {
        font-size: 12px;
    }

.a-stats {
    color: #0f172a;
}

.a-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
}

@media (max-width: 640px) {
    .a-grid {
        grid-template-columns: 1fr;
    }

    .a-sub {
        max-width: 60vw;
    }
}

.a-note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(14,165,233,.25);
    background: rgba(14,165,233,.10);
    color: #0f172a;
}

/* Smooth "highslide" entrance */
.a-modal .a-card {
    animation: aPop .18s ease-out;
}

@keyframes aPop {
    from {
        transform: translate(-50%,-48%) scale(.98);
        opacity: .6;
    }

    to {
        transform: translate(-50%,-50%) scale(1);
        opacity: 1;
    }
}
/* ===========================
   Professional Analytics FAB
   =========================== */
.analysis-fab {
    position: absolute; /* you already set left/top via JS */
    z-index: 950;
    display: flex;
    flex-direction: column; /* icon above, label below */
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 48px; /* one clean pill */
    padding: 10px 8px;
    border-radius: 16px;
    border: 1px solid rgba(15,23,42,.18);
    background: rgba(255,255,255,.96);
    box-shadow: 0 14px 34px rgba(2,6,23,.18);
    backdrop-filter: blur(8px);
    cursor: pointer;
    user-select: none;
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

    .analysis-fab:hover {
        transform: translateY(-1px);
        border-color: rgba(14,165,233,.35);
        box-shadow: 0 16px 42px rgba(2,6,23,.22);
    }

    .analysis-fab:active {
        transform: translateY(0px) scale(.99);
    }

/* icon container */


.analysis-fab__icon i {
    font-size: 18px;
    color: #0f172a;
}

/* vertical label: clean + readable + professional */
.analysis-fab__label {
    writing-mode: vertical-rl; /* vertical text */
    transform: rotate(180deg); /* make it read top->bottom */
    letter-spacing: .18em;
    font-weight: 900;
    font-size: 10px;
    color: rgba(15,23,42,.78);
    line-height: 1;
}

/* hidden state you already use */
.analysis-fab.is-hidden {
    display: none !important;
}
/* =========================================================
   FLIP SIDES:
   - Map Controls panel -> LEFT
   - Analytics FAB -> RIGHT
   Keep original glacier blue theme
========================================================= */

/* ---------- Left floating panel (was right) ---------- */
.side-card--floating {
    left: 12px;
    right: auto;
}

    /* collapsed should slide LEFT out of view */
    .side-card--floating.is-collapsed {
        transform: translateX(calc(-100% - 18px));
    }

/* Panel header / borders keep your glacier-blue look (consistent) */
.side-card--floating,
.side-float-head {
    border-color: rgba(14,165,233,.22);
}

/* ---------- Toggle button moves with panel ---------- */
.side-panel-toggle {
    left: 18px;
    right: auto;
}

    /* rotate icon when collapsed (optional) */
    .side-panel-toggle.is-collapsed i {
        transform: rotate(180deg);
    }

/* ---------- Analytics FAB to RIGHT side ---------- */
.analysis-fab {
    right: 18px;
    left: auto;
}

/* If you use any older .analysis-fab top/left duplicates, this forces right */
.analysis-fab__label,
.analysis-fab__icon {
    border-color: rgba(14,165,233,.25);
}

/* ---------- Keep Leaflet controls from fighting corners ---------- */
/* zoom control: keep it top-right so it doesn't collide with left panel */
.leaflet-top.leaflet-left .leaflet-control-zoom {
    display: none; /* we will add zoom to top-right in JS */
}

/* Optional: if you have other leaflet controls stacking weirdly */
.leaflet-top,
.leaflet-bottom {
    z-index: 900;
}
/* =========================================================
   Legend → BOTTOM RIGHT, just above the overview minimap
========================================================= */
.g-legend {
    left: auto !important;
    right: 14px !important;
    top: auto !important;
    bottom: 170px !important;        /* sits above the minimap (~150px) + margin */
    transform: none;
    z-index: 850;                    /* above tiles, below FAB */
    transition: opacity .3s ease, transform .3s ease;
}
.g-legend.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}
/* =========================================================
   ANALYTICS TAB (structure like screenshot)
   - Rounded left side
   - Vertical text
   - Docked under Leaflet zoom (top-right)
   - NO fixed colors (use your theme variables)
========================================================= */

/* make leaflet top-right a positioning anchor */
.leaflet-top.leaflet-right {
    position: relative;
}

/* The tab itself */
.analytics-tab {
    position: absolute;
    right: 0;
    top: 96px; /* under zoom control */
    width: 56px;
    height: 185px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* shape like screenshot: rounded left, squared right */
    border-radius: 18px 0 0 18px;
    /* structure only */
    border: 1px solid currentColor; /* uses currentColor; you can override */
    background: transparent; /* you set background in your theme */
    color: inherit; /* inherit theme text color */
    /* shadow like the screenshot */
    box-shadow: 0 18px 40px rgba(0,0,0,.25);
    cursor: pointer;
    user-select: none;
    z-index: 950;
    transition: opacity .18s ease, transform .18s ease;
}

    .analytics-tab:hover {
        transform: translateX(-2px);
    }

    .analytics-tab:active {
        transform: translateX(0px) scale(.99);
    }

/* Vertical text */
.analytics-tab__label {
    writing-mode: vertical-rl;
    transform: rotate(180deg); /* bottom -> top reading like your screenshot */
    font-weight: 900;
    letter-spacing: .22em;
    font-size: 12px;
    line-height: 1;
    /* spacing between letters like screenshot */
    text-transform: uppercase;
    transform: rotate(360deg); /* <-- 180° rotation */
}
.analytics-tab.is-hidden {
    opacity: 0;
    transform: translateX(8px);
}
.side-panel-toggle.is-hidden {
    display: none !important;
}
.side-close-btn {
    border: 1px solid rgba(15,23,42,.12);
    background: rgba(255,255,255,.9);
    border-radius: 12px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

    .side-close-btn:hover {
        opacity: .9;
    }


/* =========================================================
   MAP CONTROLS PANEL — SOLID THEME (NO TRANSPARENCY)
   Glacier / SUPARCO blue
========================================================= */

/* Main panel */
.side-card--floating {
    background: #f8fbff; /* solid glacier light */
    border: 1px solid #cfe8f6; /* glacier blue border */
    box-shadow: 0 20px 48px rgba(2,6,23,.18);
    backdrop-filter: none !important; /* kill glass */
}

/* Header */
.side-float-head {
    background: linear-gradient( 180deg, #e6f3fb, #f8fbff );
    border-bottom: 1px solid #cfe8f6;
}

/* Title */
.side-float-title {
    color: #0f172a;
}

/* Body */
.side-float-body {
    background: #f8fbff; /* solid */
}

/* Groups */
.group {
    background: #ffffff; /* solid white cards */
    border: 1px solid #e2eef7;
}

/* Group titles */
.group-title {
    color: #475569;
}

/* Rows hover (very subtle, solid) */
.radio-row:hover,
.toggle-row:hover {
    background: #eef7fd;
}

/* Pills */
.pill {
    background: #e6f3fb;
    border-color: #b7def2;
    color: #0f172a;
}

    .pill.warn {
        background: #fff2e0;
        border-color: #f6c37a;
    }

/* Sliders */
.slider-row {
    background: transparent;
}

    .slider-row input[type="range"] {
        accent-color: #0ea5e9;
    }

/* Close button */
.side-close-btn {
    background: #ffffff;
    border: 1px solid #cfe8f6;
    color: #0f172a;
}

    .side-close-btn:hover {
        background: #eef7fd;
    }

/* Tools buttons */
.tool-btn {
    background: #ffffff;
    border: 1px solid #cfe8f6;
    color: #0f172a;
}

    .tool-btn:hover {
        background: #eef7fd;
    }

/* Switch track */
.slider {
    background: #cbd5e1;
}

.switch input:checked + .slider {
    background: #0ea5e9;
}
/* =========================================================
   LEGEND — SOLID THEME (NO TRANSPARENCY)
   Glacier / SUPARCO blue
========================================================= */

.g-legend {
    background: #f8fbff; /* solid glacier light */
    border: 1px solid #cfe8f6; /* glacier blue border */
    box-shadow: 0 16px 36px rgba(2,6,23,.18);
    backdrop-filter: none !important; /* remove glass */
}

/* Title */
.g-legend-title {
    color: #0f172a;
    font-weight: 900;
}

/* Rows */
.g-legend-row {
    color: #334155;
}

    /* Small tip text */
    .g-legend-row.small {
        color: #64748b;
    }

/* Swatches */
.swatch {
    border: 1px solid #b7def2;
}

/* Glacier color swatch — matches Leaflet layer fillColor */
.sw-glacier {
    background: #3b82f6;
}

/* Lake color swatch — matches Leaflet layer fillColor */
.sw-lake {
    background: #06b6d4;
}

/* =========================================================
   ANALYTICS TAB — SOLID THEME (MATCH MAP CONTROLS + LEGEND)
========================================================= */

.analytics-tab {
    /* placement stays the same */
    position: absolute;
    right: 0;
    top: 96px;
    width: 56px;
    height: 185px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* STRUCTURE */
    border-radius: 18px 0 0 18px;
    /* SOLID THEME COLORS */
    background: #f8fbff; /* same glacier light as panels */
    border: 1px solid #cfe8f6; /* same border as legend/panel */
    color: #0f172a;
    box-shadow: 0 16px 36px rgba(2,6,23,.18);
    cursor: pointer;
    user-select: none;
    z-index: 950;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

    /* Hover */
    .analytics-tab:hover {
        background: #eef7fd; /* same hover as panel rows */
        border-color: #b7def2;
        transform: translateX(-2px);
    }

    /* Active (pressed) */
    .analytics-tab:active {
        background: #e6f3fb;
        transform: translateX(-1px) scale(.99);
    }

/* Label — upright letters */
.analytics-tab__label {
    writing-mode: vertical-rl;
    transform: rotate(180deg); /* bottom -> top reading like your screenshot */
    font-weight: 900;
    letter-spacing: .22em;
    font-size: 14px;
    line-height: 1;
    /* spacing between letters like screenshot */
    text-transform: uppercase;
    transform: rotate(360deg); /* <-- 180° rotation */
}

/* Hidden state (already used by JS) */
.analytics-tab.is-hidden {
    display: none !important;
}

/* =========================================================
   GLOBAL FONT — ROBOTO (ENTIRE PAGE)
========================================================= */
html,
body,
button,
input,
select,
textarea {
    font-family: "Roboto", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
}
/* =========================================================
   Leaflet Pulsing Pin — FINAL (hover works)
   ========================================================= */

/* Leaflet wrapper */
.leaflet-marker-icon.gims-pulse-pin {
    width: 30px !important;
    height: 42px !important;
    pointer-events: auto !important;
}

    /* pin body */
    .leaflet-marker-icon.gims-pulse-pin .pin {
        position: absolute;
        left: 50%;
        top: 10px;
        width: 16px;
        height: 16px;
        border-radius: 50% 50% 50% 0;
        transform: translateX(-50%) rotate(-45deg);
        box-shadow: 0 0 0 2px #ffffff;
    }

        /* inner dot */
        .leaflet-marker-icon.gims-pulse-pin .pin::after {
            content: "";
            position: absolute;
            top: 4px;
            left: 4px;
            width: 8px;
            height: 8px;
            background: #ffffff;
            border-radius: 50%;
        }

    /* halo ring (hidden by default) */
    .leaflet-marker-icon.gims-pulse-pin::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 24px;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        transform: translateX(-50%) scale(0.6);
        opacity: 0;
        pointer-events: none;
    }

    /* SHOW halo ONLY on hover */
    .leaflet-marker-icon.gims-pulse-pin:hover::after {
        animation: gims-halo 1.6s ease-out infinite;
        opacity: 1;
    }

/* Glacier */
.leaflet-marker-icon.gims-pin--glacier .pin {
    background: #0ea5e9;
}

.leaflet-marker-icon.gims-pin--glacier::after {
    background: rgba(14,165,233,.45);
}

/* Lake */
.leaflet-marker-icon.gims-pin--lake .pin {
    background: #22c55e;
}

.leaflet-marker-icon.gims-pin--lake::after {
    background: rgba(34,197,94,.45);
}

/* animation */
@keyframes gims-halo {
    0% {
        transform: translateX(-50%) scale(0.6);
        opacity: .7;
    }

    100% {
        transform: translateX(-50%) scale(2.6);
        opacity: 0;
    }
}

/* =========================================================
   RESPONSIVE — Interactive Maps
========================================================= */

/* Tablet */
@media (max-width: 991.98px) {
    .side-card--floating {
        width: 300px;
    }

    .analysis-drawer {
        width: 340px;
    }

    .gims-loading-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-tab {
        width: 44px;
        height: 140px;
    }

    .analytics-tab__label {
        font-size: 11px;
    }

    .map-footer--floating {
        flex-wrap: wrap;
        gap: 6px;
    }

    .topbar--blue .top-actions {
        gap: .35rem;
    }
}

/* Mobile */
@media (max-width: 767.98px) {
    :root {
        --topbar-h: auto;
    }

    .topbar {
        height: auto;
        flex: 0 0 auto;
        padding: .5rem .75rem;
        flex-wrap: wrap;
    }

    .topbar--blue {
        padding: .5rem .75rem;
    }

    .topbar--blue .header-logo {
        width: 28px;
        height: 28px;
    }

    .topbar--blue .top-heading {
        font-size: .78rem;
    }

    .topbar--blue .top-actions {
        flex-wrap: wrap;
        gap: .3rem;
    }

    .topbar--blue .badge-soft {
        font-size: .62rem;
        padding: .05rem .35rem;
    }

    /* Map takes remaining height */
    .g-content--map {
        height: calc(100vh - 56px) !important;
    }

    .map-shell--fullscreen {
        height: calc(100vh - 56px) !important;
    }

    /* Side panel becomes bottom sheet — collapsed by default on mobile */
    .side-card--floating {
        width: calc(100vw - 16px);
        max-width: none;
        left: 8px;
        right: 8px;
        height: 40vh;
        top: auto;
        bottom: 8px;
        border-radius: 16px;
        transform: translateY(calc(100% + 18px));
        opacity: 0;
        pointer-events: none;
    }

    .side-float-head {
        padding: 8px 10px;
        height: 42px;
    }

    .side-float-title {
        font-size: .82rem;
    }

    .side-float-body {
        padding: 8px 10px;
    }

    .group {
        padding: 8px;
        margin-bottom: 8px;
        border-radius: 10px;
    }

    .group-title {
        font-size: .72rem;
        margin-bottom: 4px;
    }

    .radio-row {
        font-size: .78rem;
        row-gap: 0;
    }

    .radio-row small {
        display: none;
    }

    .side-title {
        font-size: .78rem;
        margin: 4px 0 6px;
    }

    .toggle-row {
        padding: 6px 8px;
    }

    .pill {
        font-size: .62rem;
        padding: .08rem .35rem;
    }

    .side-card--floating.mobile-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .side-card--floating.is-collapsed {
        transform: translateY(calc(100% + 18px));
        opacity: 0;
        pointer-events: none;
    }

    /* Analysis drawer becomes bottom sheet */
    .analysis-drawer {
        width: calc(100vw - 24px);
        max-width: none;
        top: auto;
        bottom: 12px;
        left: 12px;
        right: 12px;
        max-height: 55vh;
    }

    .analysis-drawer.is-collapsed {
        transform: translateY(calc(100% + 18px));
    }

    /* Analytics modal full width */
    .a-card {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .a-kpis {
        flex-wrap: wrap;
    }

    .a-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .a-tab {
        white-space: nowrap;
        font-size: .72rem;
    }

    .a-sub {
        display: none;
    }

    .a-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Analytics tab hidden on mobile — accessible via panel instead */
    .analytics-tab {
        display: none !important;
    }

    /* Legend hidden on mobile */
    .g-legend {
        display: none !important;
    }

    /* Hide zoom controls on mobile */
    .leaflet-control-zoom {
        display: none !important;
    }

    .hud {
        font-size: .68rem;
        padding: 4px 8px;
        left: 8px;
        bottom: 8px;
    }

    .map-footer--floating {
        left: 8px;
        right: 8px;
        bottom: 8px;
        padding: 8px 10px;
        font-size: .72rem;
        flex-wrap: wrap;
    }

    .map-footer--floating .hint {
        font-size: .7rem;
    }

    .map-footer--floating .status {
        font-size: .7rem;
    }

    .gims-loading-steps {
        grid-template-columns: 1fr;
    }

    /* Panel toggle — prominent on mobile */
    .side-panel-toggle {
        width: 44px;
        height: 44px;
        top: auto;
        bottom: 16px;
        left: 16px;
        right: auto;
        border-radius: 14px;
        box-shadow: 0 8px 24px rgba(2,6,23,.22);
    }

    #btnSearch {
        font-size: .72rem;
        padding: .25rem .5rem;
    }
}

/* Small mobile */
@media (max-width: 575.98px) {
    .topbar--blue .badge-soft {
        display: none !important;
    }

    .search-inline {
        display: none !important;
    }

    #btnSearch {
        display: none !important;
    }

    .mini-search {
        top: 8px;
        left: 8px;
        right: 8px;
        padding: 8px;
        border-radius: 12px;
    }

    .side-card--floating {
        height: 50vh;
    }

    .topbar--blue .top-heading {
        font-size: .7rem;
        letter-spacing: .08em;
    }

    .a-card {
        width: calc(100vw - 12px);
        max-height: calc(100vh - 12px);
        border-radius: 12px;
    }

    .a-head {
        padding: 8px 10px;
    }

    .a-title {
        font-size: .82rem;
    }
}
