/* LumaHUB Modern Floating UI — BRAND DARK MODE (same palette as website, inverted) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    /* Luma Aerials Authentic Desktop Brand (Dark Copper) */
    --background: #0D0A08;
    /* luma-smoke */
    --glass-bg: rgba(13, 10, 8, 0.85);
    --glass-border: #2E1A0E;
    /* luma-border */
    --primary: #C8764A;
    /* luma-orange */
    --accent: #5C3520;
    /* luma-mid */
    --destructive: #C0392B;
    --foreground: #F5EDE6;
    /* luma-light */
    --text-muted: #8C7060;
    /* luma-muted */
    --border: #2E1A0E;
    /* luma-border */
    --radius: 4px;
    --surface-1: #1A1008;
    /* luma-surface */
    --surface-2: #2E1A0E;
    /* luma-border */
    --surface-3: rgba(26, 16, 8, 0.5);
    --border-strong: #5C3520;
    /* luma-mid */
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow: hidden;
    background-color: var(--background);
    color: var(--foreground);
}

/* --- Layout --- */
.view-shell,
#map-plane,
#map,
#pc-plane {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
}

/* 5. 3D VIEWER CONTAINER (Floating Window) - OVERRIDE */
#pc-plane {
    top: 100px !important;
    bottom: 80px !important;
    left: 100px !important;
    right: 100px !important;
    width: auto !important;
    height: auto !important;
    border-radius: 20px;
    overflow: hidden;
    border: none;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    background: var(--background);
}

#pc-frame {
    width: 100%;
    height: 100%;
    border: none !important;
    display: block;
}

.ui-layer {
    position: relative;
    z-index: 5000;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 1. TOP LEFT: LOGO CORNER */
/* 1. TOP LEFT: LOGO CORNER */
.logo-corner {
    position: absolute;
    top: 14px;
    left: 24px;
    /* Aligned with Sidebar content padding */
    z-index: 6000;
    pointer-events: auto;
    background: transparent;
    padding: 0;
    border: none;
    display: flex;
    align-items: center;
}

.logo-text {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 24px;
    letter-spacing: 1px;
    line-height: 1;
    color: var(--foreground);
    text-transform: none;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    gap: 6px;
}

.text-luma {
    color: var(--primary);
}

.text-aerials {
    color: var(--foreground);
    font-weight: 500;
}

/* 2. TOP CENTER: HEADER & TABS */
.center-header {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5001;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Title Pill */
.title-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--background);
    padding: 8px 24px;
    border-radius: 999px;
    border: 1px solid var(--border);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.brand-name {
    font-weight: 800;
    font-size: 16px;
    color: var(--foreground);
    letter-spacing: -0.5px;
}

.project-id {
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    color: var(--primary);
    border-left: 1px solid var(--border-strong);
    padding-left: 12px;
}

/* Mode Tabs (Under Title) */
.mode-tabs {
    display: flex;
    background: rgba(29, 18, 18, 0.88);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
    border: 1px solid var(--border);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s;
    text-transform: uppercase;
}

.tab-btn:hover {
    color: var(--foreground);
    background: var(--surface-3);
}

.tab-btn.active {
    background: var(--primary);
    color: var(--background);
    font-weight: 800;
}

/* 3D Sub Controls (Row 3 - Under Tabs) */
/* Specific positioning for 3D Controls (Bottom Center) */
#sub-controls-3d {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding: 6px 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-radius: 6px;
    border: 1px solid var(--border);

    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.sub-btn {
    background: var(--surface-1);
    border: 1px solid var(--border);
    color: var(--foreground);
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.sub-btn:hover {
    border-color: var(--primary);
    color: var(--foreground);
}

.sub-btn.active {
    background: var(--primary);
    color: var(--background);
    border-color: var(--primary);
    font-weight: 700;
}

/* 3. TOP RIGHT: CONTROLS */
.header-right {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 5001;
    pointer-events: auto;
    display: flex;
    gap: 12px;
    align-items: center;
}

.basemap-group-small {
    display: flex;
    gap: 4px;
    background: var(--glass-bg);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.basemap-group-small button {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.basemap-group-small button:hover {
    color: var(--foreground);
    background: var(--surface-2);
}

/* Field Notes Textarea — dark-themed, no white background */
.field-notes-textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface-2, #2E1A0E);
    color: var(--foreground, #F5EDE6);
    border: 1px solid var(--glass-border, #2E1A0E);
    padding: 8px 10px;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    resize: vertical;
    min-height: 80px;
    outline: none;
    transition: border-color 0.2s;
    line-height: 1.5;
}

.field-notes-textarea:focus {
    border-color: var(--primary, #C8764A);
}

.field-notes-textarea::placeholder {
    color: var(--text-muted, #8C7060);
    font-style: italic;
}

/* Save Session button — full-width action button */
.btn-save-session-full {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 8px;
    padding: 9px 12px;
    background: var(--primary, #C8764A);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
    transition: background 0.2s, transform 0.1s;
}

.btn-save-session-full:hover {
    background: var(--border-strong, #5C3520);
    transform: translateY(-1px);
}

.btn-save-session-full .material-symbols-outlined {
    font-size: 16px;
}

/* Download assets button */
.btn-download-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: transparent;
    border: 1px solid var(--glass-border, #2E1A0E);
    border-radius: 6px;
    color: var(--text-muted, #8C7060);
    font-size: 13px;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    text-decoration: none;
}

.btn-download-all:hover {
    border-color: var(--primary, #C8764A);
    color: var(--foreground, #F5EDE6);
}

.btn-download-all .material-symbols-outlined {
    font-size: 16px;
}

/* Logged-in user name pill in header */
#header-user-greeting {
    display: none;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface-1);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 4px 12px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    background: var(--surface-1);
    border: 1px solid var(--border);
    color: var(--foreground);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: 0.2s;
}

.btn-logout:hover {
    background: var(--destructive);
    border-color: var(--destructive);
}

/* 4. FLOATING SIDEBARS */
.floating-sidebar {
    position: absolute;
    z-index: 5001;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.left-f {
    top: 140px;
    left: 20px;
    width: 240px;
}

.right-f {
    top: 70px;
    bottom: auto;
    /* Was bottom: 80px */
    right: 20px;
    width: 300px;
}

/* Collapsible Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--primary);
    /* Strong Brand Line */
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.panel-header {
    padding: 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    background: rgba(255, 255, 255, 0.05);
    /* Slight header tint */
}

.nav-list {
    padding: 8px;
    margin: 0;
    border-top: 1px solid var(--border);
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    transition: 0.2s;
}

.nav-item:hover {
    background: var(--surface-2);
    color: var(--foreground);
}

.nav-item.active {
    background: rgba(238, 123, 0, 0.20);
    color: var(--primary);
    border-left: 2px solid var(--primary);
}

.nav-item .material-symbols-outlined {
    font-size: 18px;
}

/* Disabled Nav Items (Coming Soon) */
.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-item.disabled:hover {
    background: transparent;
    color: var(--text-muted);
}

/* Coming Soon Badge */
.coming-soon-badge {
    font-size: 8px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), rgba(255, 255, 255, 0.22));
    color: var(--foreground);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
}

/* AI Section Panel - Purple accent for Enterprise */
.ai-section.glass-panel {
    border-left-color: rgba(255, 255, 255, 0.22);
}

/* Right Sidebar Specifics */
.info-panel {
    height: auto;
    max-height: 60vh;
    overflow-y: auto;
    padding: 16px;
    border-left: none;
    border-right: 4px solid var(--primary);
}

.right-f.collapsed {
    /* Slide out completely (width + margin + shadow allowance) */
    transform: translateX(340px);
}

.toggle-btn-right {
    position: absolute;
    left: -36px;
    top: 10px;
    width: 36px;
    height: 40px;
    background: var(--primary);
    border: none;
    display: flex !important;
    /* Force visible on all devices */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px 0 0 6px;
    box-shadow: -5px 0 10px rgba(0, 0, 0, 0.5);
    z-index: 10;
    color: var(--background);
    transition: all 0.2s ease;
}

.toggle-btn-right:hover {
    background: var(--accent);
    filter: brightness(1.05);
}

.toggle-btn-right span {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.right-f.collapsed .toggle-btn-right span {
    transform: rotate(180deg);
}

/* Re-Center Button */
.btn-recent {
    background: var(--background);
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 0 10px rgba(238, 123, 0, 0.20);
}

.btn-recent:hover {
    background: var(--primary);
    color: var(--background);
}

/* Map HUDs */
.map-elev-hud {
    position: absolute;
    bottom: 72px;
    /* Above timeline dock (52px) + buffer */
    right: 340px;
    /* Clear of right sidebar (300px wide at right:20px) */
    background: var(--background);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 14px;
    border-radius: 6px;
    z-index: 5000;
    font-family: monospace;
    font-weight: bold;
    max-width: 420px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* Zoom Control Override - HIDDEN */
.leaflet-control-zoom {
    display: none !important;
}

.leaflet-bar a {
    background-color: var(--background) !important;
    color: var(--foreground) !important;
    border-bottom: 1px solid var(--border) !important;
}

.leaflet-bar a:hover {
    background-color: var(--primary) !important;
    color: var(--background) !important;
}

/* HUD Box (Draw Instructions / Measurement Results) */
.hud-box {
    /* Controlled by JS show/hide — do NOT override with display:none here */
    background: rgba(13, 10, 8, 0.88);
    border: 1px solid var(--primary);
    color: var(--foreground);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    backdrop-filter: blur(8px);
}

/* ============================================================
   TIMELINE DOCK (Bottom Bar for Multi-Date Navigation)
   ============================================================ */
.timeline-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: rgba(29, 18, 18, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 6000;
    padding: 0 20px;
}

.timeline-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    max-width: 60vw;
    scrollbar-width: none;
}

.timeline-pills::-webkit-scrollbar {
    display: none;
}

.date-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 1px solid transparent;
    gap: 2px;
    min-width: 70px;
}

.date-pill .pill-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-pill .pill-date {
    font-size: 10px;
    font-weight: 400;
    color: var(--text-muted);
}

.date-pill:hover {
    background: rgba(238, 123, 0, 0.18);
    color: var(--foreground);
    border-color: rgba(238, 123, 0, 0.35);
}

.date-pill:hover .pill-date {
    color: rgba(255, 255, 255, 0.82);
}

.date-pill.active {
    background: var(--accent);
    color: var(--background);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(238, 123, 0, 0.35);
}

.date-pill.active .pill-label {
    color: var(--background);
}

.date-pill.active .pill-date {
    color: rgba(0, 0, 0, 0.6);
}

.timeline-nav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.timeline-nav:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--foreground);
    border-color: var(--border-strong);
}

.timeline-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.timeline-divider {
    width: 1px;
    height: 28px;
    background: var(--surface-3);
    margin: 0 8px;
}

.timeline-compare {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-compare:hover {
    background: var(--primary);
    color: var(--background);
}

.timeline-compare .material-symbols-outlined {
    font-size: 18px;
}

/* ============================================================
   COMPARE OVERLAY (Split-Screen Slider Mode)
   ============================================================ */
.compare-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--background);
    z-index: 8000;
    display: flex;
    flex-direction: column;
}

.compare-overlay.hidden {
    display: none;
}

.compare-header {
    height: 56px;
    background: rgba(29, 18, 18, 0.92);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.compare-close {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--foreground);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}

.compare-close:hover {
    background: var(--destructive);
    border-color: var(--destructive);
}

.compare-selectors {
    display: flex;
    align-items: center;
    gap: 16px;
}

.compare-select {
    background: var(--surface-1);
    border: 1px solid var(--border-strong);
    color: var(--foreground);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.compare-vs {
    color: rgba(255, 255, 255, 0.42);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.compare-viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.compare-map {
    position: absolute;
    top: 0;
    height: 100%;
    width: 100%;
}

#compare-map-a {
    left: 0;
    clip-path: inset(0 50% 0 0);
}

#compare-map-b {
    left: 0;
    clip-path: inset(0 0 0 50%);
}

.compare-slider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: var(--primary);
    cursor: ew-resize;
    z-index: 100;
    transform: translateX(-50%);
}

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.slider-handle::before {
    content: '⟷';
    color: var(--background);
    font-size: 18px;
    font-weight: bold;
}

/* Tablet Constraints (Portrait & Landscape: 601px - 1024px) */
@media (min-width: 601px) and (max-width: 1024px) {
    .floating-sidebar {
        max-height: none;
        /* Let usage define height via top/bottom */
        overflow-y: auto;
    }

    .left-f {
        top: 140px !important;
        bottom: auto !important;
        max-height: calc(100vh - 220px);
        /* Stop before timeline */
    }

    /* Right sidebar: Anchor TOP and BOTTOM to create a vertical strip */
    .right-f {
        top: 140px !important;
        bottom: 80px !important;
        /* Stop at timeline */
        height: auto !important;
    }
}

.hidden-force {
    display: none !important;
}

/* ============================================================
   MOBILE RESPONSIVE - Full Feature Support
   ============================================================ */

/* Mobile Breakpoint (Phones Only - 600px and below) */
@media (max-width: 600px) {

    /* === HEADER ADJUSTMENTS === */
    .logo-corner {
        top: 10px;
        left: 12px;
    }

    .logo-text {
        font-size: 18px;
    }

    .center-header {
        top: 10px;
        gap: 8px;
    }

    .title-pill {
        padding: 6px 12px;
        gap: 8px;
        max-width: 160px;
        /* Prevent overlap */
    }

    .brand-name {
        font-size: 14px;
    }

    .project-id {
        font-size: 12px;
        padding-left: 8px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        max-width: 80px;
    }

    .mode-tabs {
        padding: 3px;
        gap: 2px;
    }

    .tab-btn {
        padding: 5px 12px;
        font-size: 11px;
    }

    .header-right {
        top: 10px;
        right: 12px;
        gap: 8px;
    }

    .basemap-group-small {
        display: none;
        /* Hide on tablet - can add to drawer */
    }

    .btn-logout {
        padding: 6px 12px;
        font-size: 11px;
    }

    /* === SIDEBARS BECOME BOTTOM DRAWER === */
    .floating-sidebar.left-f {
        position: fixed;
        top: auto;
        bottom: 56px;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 35vh;
        /* Reduced from 50vh */
        overflow-y: auto;
        flex-direction: column;
        gap: 6px;
        padding: 10px 12px;
        background: rgba(29, 18, 18, 0.92);
        backdrop-filter: blur(20px);
        border-radius: 16px 16px 0 0;
        border: 1px solid var(--glass-border);
        border-bottom: none;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: 6010;
        /* Above Timeline */
    }

    .floating-sidebar.left-f.open {
        transform: translateY(0);
    }

    .floating-sidebar.right-f {
        position: fixed;
        top: auto;
        bottom: 56px;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 30vh;
        /* Reduced */
        overflow-y: auto;
        padding: 10px 12px;
        background: rgba(29, 18, 18, 0.92);
        backdrop-filter: blur(20px);
        border-radius: 16px 16px 0 0;
        border: 1px solid var(--glass-border);
        border-bottom: none;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: 6010;
        /* Above Timeline */
    }

    .floating-sidebar.right-f.open {
        transform: translateY(0);
    }

    /* Hide toggle button on mobile - use bottom nav instead */
    .toggle-btn-right {
        display: none;
    }

    /* === GLASS PANELS IN DRAWER === */
    .glass-panel {
        border-radius: 10px;
        margin-bottom: 6px;
        padding: 8px !important;
    }

    .glass-panel h3,
    .panel-header {
        font-size: 11px !important;
        margin-bottom: 6px !important;
    }

    .nav-list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        /* 3 columns */
        gap: 6px;
        padding: 4px;
    }

    .nav-item {
        padding: 8px 4px;
        justify-content: center;
        text-align: center;
        font-size: 10px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.08);
        flex-direction: column;
        gap: 2px;
    }

    .nav-item .material-symbols-outlined {
        font-size: 18px;
    }

    /* Hide text on very small items, show icon only */
    .nav-item span:not(.material-symbols-outlined) {
        font-size: 9px;
    }

    /* === RE-CENTER BUTTON === */
    .btn-recent {
        width: 100%;
        padding: 10px;
        font-size: 12px;
        display: none;
        /* Hide in drawer - use bottom nav Center button */
    }

    /* === MAP ELEVATION HUD === */
    .map-elev-hud {
        bottom: 70px;
        right: 12px;
        padding: 6px 10px;
        font-size: 12px;
    }

    /* === TIMELINE DOCK === */
    .timeline-dock {
        height: 48px;
        padding: 0 10px;
        gap: 4px;
    }

    .timeline-pills {
        max-width: 50vw;
    }

    .date-pill {
        padding: 6px 12px;
        font-size: 11px;
        min-width: 60px;
    }

    .date-pill .pill-label {
        font-size: 10px;
    }

    .date-pill .pill-date {
        font-size: 9px;
    }

    .timeline-nav {
        width: 32px;
        height: 32px;
    }

    .timeline-compare span:not(.material-symbols-outlined) {
        display: none;
    }

    .timeline-compare {
        padding: 6px 10px;
    }

    /* === 3D VIEWER FRAME === */
    #pc-plane {
        top: 140px !important;
        /* Below header + tabs + 3D controls */
        bottom: 60px !important;
        /* Above bottom nav */
        left: 5px !important;
        right: 5px !important;
        border-radius: 8px;
        z-index: 100;
    }

    #sub-controls-3d {
        position: fixed !important;
        top: 100px !important;
        /* Below the mode tabs */
        bottom: auto !important;
        left: 50%;
        transform: translateX(-50%);
        z-index: 5000;
        bottom: 120px !important;
        /* Clear the timeline/nav area */
        background: rgba(0, 0, 0, 0.8);
        padding: 6px 12px;
        border-radius: 8px;
    }

    .sub-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    /* === INFO PANEL (Right Sidebar Content) === */
    .info-panel {
        max-height: none;
        padding: 12px;
    }

    .data-group h3 {
        font-size: 11px;
    }

    .data-group .row {
        font-size: 12px;
    }

    /* === COMPARE OVERLAY === */
    .compare-header {
        height: 50px;
        padding: 0 12px;
    }

    .compare-selectors {
        gap: 8px;
    }

    .compare-select {
        padding: 6px 10px;
        font-size: 12px;
    }

    .compare-vs {
        font-size: 10px;
    }
}

/* Phone Breakpoint (480px and below) */
@media (max-width: 480px) {

    .logo-corner {
        display: none;
        /* Hide logo on very small screens */
    }

    .center-header {
        left: 10px;
        transform: none;
    }

    .title-pill {
        padding: 5px 12px;
    }

    .brand-name {
        display: none;
        /* Just show project name */
    }

    .project-id {
        border: none;
        padding-left: 0;
    }

    .mode-tabs {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(29, 18, 18, 0.96);
        border-top: 1px solid var(--border);
        border-radius: 0;
        padding: 6px 10px;
        justify-content: space-around;
        z-index: 6000;
    }

    .tab-btn {
        flex: 1;
        padding: 10px 8px;
        font-size: 10px;
        border-radius: 8px;
    }

    .header-right {
        top: 8px;
        right: 8px;
    }

    .btn-logout {
        padding: 5px 10px;
        font-size: 10px;
    }

    /* Sidebars adjust for phone */
    .floating-sidebar.left-f,
    .floating-sidebar.right-f {
        bottom: 52px;
        /* Above bottom tabs */
        max-height: 60vh;
    }

    .nav-item {
        flex: 1 1 100%;
        padding: 14px;
    }

    /* Map HUD */
    .map-elev-hud {
        bottom: 62px;
        font-size: 11px;
    }

    /* 3D Viewer */
    #pc-plane {
        top: 60px !important;
        bottom: 52px !important;
        left: 5px !important;
        right: 5px !important;
    }

    #sub-controls-3d {
        bottom: 60px;
    }

    /* Timeline */
    .timeline-dock {
        bottom: 52px;
        height: 44px;
    }

    .date-pill {
        padding: 5px 10px;
        min-width: 50px;
    }
}

/* ============================================================
   MOBILE BOTTOM NAVIGATION BAR
   ============================================================ */

.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: rgba(29, 18, 18, 0.96);
        backdrop-filter: blur(20px);
        border-top: 1px solid var(--border);
        justify-content: space-around;
        align-items: center;
        z-index: 6000;
        padding: 0 10px;
    }

    .mobile-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        background: none;
        border: none;
        color: var(--text-muted);
        padding: 8px 16px;
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.2s;
        min-width: 60px;
    }

    .mobile-nav-btn:active {
        background: rgba(255, 255, 255, 0.1);
    }

    .mobile-nav-btn.active {
        color: var(--primary);
    }

    .mobile-nav-btn .material-symbols-outlined {
        font-size: 24px;
    }

    .mobile-nav-btn span:last-child {
        font-size: 10px;
        font-weight: 600;
    }
}

/* ============================================================
   TOUCH OPTIMIZATION
   ============================================================ */

@media (pointer: coarse) {

    /* Touch devices need larger tap targets */
    .nav-item {
        min-height: 48px;
    }

    .tab-btn {
        min-height: 44px;
    }

    .btn-recent,
    .btn-logout,
    .timeline-nav,
    .timeline-compare {
        min-height: 44px;
    }

    .date-pill {
        min-height: 40px;
    }

    /* Disable hover effects on touch */
    .nav-item:hover {
        background: transparent;
    }

    .nav-item:active {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* ============================================================
   DRAWER TOGGLE HANDLE
   ============================================================ */

.drawer-handle {
    display: none;
}

@media (max-width: 768px) {
    .drawer-handle {
        display: block;
        width: 40px;
        height: 4px;
        background: var(--border-strong);
        border-radius: 2px;
        margin: 0 auto 12px;
    }
}