:root {
    /* Base Color Palette - Defaults to Dark Mode (Premium Aesthetic) */
    --bg-page: #000000; /* Pure black for maximum contrast in blend */
    --bg-panel: rgba(18, 18, 22, 0.7);
    --bg-panel-hover: rgba(30, 30, 36, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    
    --text-primary: #FFFFFF;
    --text-secondary: #9BA1A6;
    
    --accent-gradient: linear-gradient(135deg, #00FFA3 0%, #03E1FF 100%);
    --accent-color: #00FFA3;
    
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 15px rgba(0, 255, 163, 0.3);

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode Overrides */
@media (prefers-color-scheme: light) {
    :root {
        --bg-page: #F8F9FA; /* Blends to light gray/white */
        --bg-panel: rgba(255, 255, 255, 0.7);
        --bg-panel-hover: rgba(255, 255, 255, 0.9);
        --border-color: rgba(0, 0, 0, 0.08);
        
        --text-primary: #1A1A1E;
        --text-secondary: #6B7280;
        
        --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    }
}

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

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

#app {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* Layer Control Sidebar Customization */
.leaflet-control-layers {
    width: 298px;
    background: var(--bg-panel) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-soft) !important;
    padding: 16px !important;
    color: var(--text-primary) !important;
    font-family: inherit !important;
    margin-top: 20px !important;
    margin-left: 20px !important;
    transition: all var(--transition-smooth);
}

.leaflet-control-layers-base {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.leaflet-control-layers label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
    font-size: 13px;
    cursor: pointer;
}

.leaflet-control-layers input[type="radio"],
.leaflet-control-layers input[type="checkbox"] {
    accent-color: var(--accent-color);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Hide the default separator since we add our own border */
.leaflet-control-layers-separator {
    display: none !important;
}

/* Collapsible section headers inside layer control */
.layer-section {
    margin-bottom: 8px;
}

.layer-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    padding: 6px 4px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.layer-section-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.layer-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.layer-section-toggle {
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform var(--transition-fast);
    line-height: 1;
}

.layer-section.collapsed .layer-section-toggle {
    transform: rotate(-90deg);
}

.layer-section-body {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 1000px;
    opacity: 1;
}

.layer-section.collapsed .layer-section-body {
    max-height: 0;
    opacity: 0;
}

/* Base state for Leaflet control when not expanded */
.leaflet-control-layers:not(.leaflet-control-layers-expanded) {
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50% !important;
    margin-top: 16px !important;
    margin-left: 16px !important;
}

/* Map Container */
.map-container {
    flex-grow: 1;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 1;
}

#map {
    height: 100%;
    width: 100%;
    background-color: var(--bg-page);
}

/* Leaflet Customizations - Dark Mode Overrides */
.leaflet-control-zoom {
    border: 1px solid var(--border-color) !important;
    background: var(--bg-panel) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-soft) !important;
    border-radius: var(--radius-sm) !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    color: var(--text-primary) !important;
    background: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
    transition: var(--transition-fast) !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.leaflet-control-attribution {
    background: var(--bg-panel) !important;
    color: var(--text-secondary) !important;
    padding: 4px 12px !important;
    border-radius: var(--radius-sm);
    margin: 10px !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
}


/* New UI Overlay Controls */
.ui-overlay {
    position: absolute;
    bottom: calc(30px + env(safe-area-inset-bottom));
    left: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    gap: 12px;
    pointer-events: none;
}

.ui-overlay > * {
    pointer-events: auto;
}

.glass-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    transition: all var(--transition-fast);
}

.glass-btn:hover {
    background: var(--bg-panel-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.glass-btn:active {
    transform: translateY(0);
}

.opacity-panel-inline {
    display: none; /* Initially hidden, shown via JS after move */
    flex-direction: column;
}

.layer-control-separator {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#opacity-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
}

#opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 163, 0.4);
    transition: transform 0.1s ease-in-out;
}

#opacity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* User Location Marker Animation */
.user-position-dot {
    width: 16px;
    height: 16px;
    background: #03E1FF;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(3, 225, 255, 0.8);
    position: relative;
    z-index: 10;
}

.user-position-dot::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid #03E1FF;
    animation: pulse 2s infinite ease-out;
    opacity: 0;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(3.5);
        opacity: 0;
    }
}

/* Marker Icons */
.map-icon {
    font-size: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    border: 2px solid var(--text-primary);
    border-radius: 50%;
    box-shadow: var(--shadow-soft);
    background: var(--bg-panel);
    backdrop-filter: blur(4px);
}

.train-marker {
    background: #00d8ff;
}

.airport-marker {
    background: #FF5252;
}

.camping-marker {
    background: #00FFA3;
}

.hut-marker {
    background: #FF8C00;
}

.leaflet-popup-content-wrapper {
    max-height: 60vh;
    overflow-y: auto;
    /* Thin scrollbar so it doesn't clash with the close button */
    scrollbar-width: thin;
    scrollbar-color: rgba(128, 128, 128, 0.4) transparent;
}

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

.leaflet-popup-content-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.leaflet-popup-content-wrapper::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.4);
    border-radius: 2px;
}

/* Keep the close button above the scrollbar at all times */
.leaflet-popup-close-button {
    z-index: 10 !important;
}

.leaflet-popup-content {
    max-height: none;
}

.bivakzone-marker {
    background: #BF5FFF;
}

.water-tap-marker {
    background: #2AA9FF;
}

.paid-hiking-marker {
    background: #E53935;
}

.gpx-poi-marker {
    background: #FF6B35;
}

/* Brand Identification */
.brand-tag {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 12px 24px;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 40px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.3px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    opacity: 0.8;
    margin-top: -1px;
}

/* --- Mobile Responsiveness (Small Screens like S23) --- */
@media (max-width: 500px) {
    /* Hide Brand Tag on mobile as requested */
    .brand-tag {
        display: none !important;
    }

    /* Base Layer Control (Collapsed State) */
    .leaflet-control-layers {
        width: 48px !important;
        height: 48px !important;
        margin: 12px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        background: var(--bg-panel) !important;
        backdrop-filter: blur(12px) !important;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
        border: 1px solid var(--border-color) !important;
    }

    /* Expanded State Overlay */
    .leaflet-control-layers.leaflet-control-layers-expanded {
        width: calc(100vw - 24px) !important;
        height: auto !important;
        max-height: 80vh;
        border-radius: var(--radius-md) !important;
        padding: 20px !important;
        display: block;
        overflow-y: auto;
    }

    /* Force the icon toggle to be centered in collapsed state */
    .leaflet-control-layers:not(.leaflet-control-layers-expanded) .leaflet-control-layers-toggle {
        width: 48px !important;
        height: 48px !important;
        background-size: 26px 26px !important;
        margin: 0 !important;
        display: block;
    }

    /* Keep the toggle icon visible as a 'close' button affordance */
    .leaflet-control-layers-expanded .leaflet-control-layers-toggle {
        display: block !important;
        position: absolute;
        top: 10px;
        right: 10px;
        width: 32px !important;
        height: 32px !important;
        background-size: 20px 20px !important;
        opacity: 0.6;
        z-index: 10;
    }

    /* Push first section below the close button so the ▼ toggle doesn't overlap */
    .leaflet-control-layers-expanded .layer-section:first-child {
        margin-top: 20px;
    }

    .leaflet-control-layers-list {
        padding: 0 !important;
    }

    .layer-section {
        margin-bottom: 4px;
    }

    .layer-section-header {
        padding: 8px 4px;
    }

    .leaflet-control-layers-base {
        margin-bottom: 16px;
        padding-bottom: 16px;
    }

    .leaflet-control-layers label {
        font-size: 12px;
        margin-bottom: 2px;
        gap: 10px;
    }

    .leaflet-control-layers input[type="radio"],
    .leaflet-control-layers input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    /* UI Overlay Adjustments */
    .ui-overlay {
        bottom: calc(16px + env(safe-area-inset-bottom));
        left: 12px;
        gap: 10px;
    }

    .glass-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    /* Move Zoom Control to be more accessible on right side bottom */
    .leaflet-bottom.leaflet-right {
        bottom: calc(12px + env(safe-area-inset-bottom)) !important;
        right: 4px !important;
    }

    .leaflet-control-zoom {
        margin-right: 8px !important;
        margin-bottom: 8px !important;
        transform: scale(0.9);
        transform-origin: bottom right;
    }

    /* Markers - slightly larger tap areas */
    .map-icon {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    /* Popups on mobile */
    .leaflet-popup-content-wrapper {
        border-radius: var(--radius-md) !important;
        background: var(--bg-panel) !important;
        backdrop-filter: blur(12px);
        max-height: 40vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        max-width: calc(100vw - 20px) !important;
        box-sizing: border-box !important;
    }

    /* Prevent the content from exceeding the wrapper when the scrollbar appears */
    .leaflet-popup-content {
        font-size: 13px !important;
        margin: 12px 14px !important;
        max-height: none !important;
        width: auto !important;
        box-sizing: border-box !important;
    }

    /* Ensure popup tip also respects panel width */
    .leaflet-popup {
        max-width: calc(100vw - 20px) !important;
    }
}

/* --- Route Planning UI --- */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-lg);
    z-index: 1001;
    transition: all var(--transition-smooth);
}

.bottom-panel {
    position: absolute;
    bottom: calc(30px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 320px;
}

.panel-content {
    padding: 20px 24px;
}

.route-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-item .label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-item .value {
    font-size: 20px;
    font-weight: 700;
}

.route-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.action-btn.primary {
    background: var(--accent-gradient);
    color: #000;
    border: none;
}

.action-btn.primary:hover {
    box-shadow: var(--shadow-glow);
}

.action-btn.danger:hover {
    background: rgba(255, 59, 48, 0.2);
    border-color: rgba(255, 59, 48, 0.4);
    color: #FF3B30;
}

/* Customizing Leaflet Routing Machine */
.leaflet-routing-container {
    display: none !important; /* We use our own UI */
}

.leaflet-routing-alt {
    display: none !important;
}

/* Routing line style */
path.leaflet-interactive.leaflet-ant-path {
    stroke-dasharray: 10, 15;
    animation: leaflet-ant-path-animation 15s linear infinite;
}

.leaflet-routing-geocoder {
    display: none;
}

/* Custom Route Markers */
.route-waypoint {
    width: 14px;
    height: 14px;
    background: #fff;
    border: 3px solid #03E1FF;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.route-waypoint.start {
    background: #03E1FF;
    border-color: #fff;
}

.route-waypoint.end {
    background: #FF3B30;
    border-color: #fff;
}

/* Planning Mode Cursor */
.planning-mode #map {
    cursor: crosshair !important;
}

@media (max-width: 500px) {
    .bottom-panel {
        width: calc(100% - 32px);
        bottom: calc(16px + env(safe-area-inset-bottom));
    }
    
    .panel-content {
        padding: 16px;
    }
    
    .route-stats {
        gap: 20px;
    }
    
    .stat-item .value {
        font-size: 18px;
    }
}

.gpx-panel-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

/* --- About Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 1;
    transition: opacity var(--transition-smooth);
}

.modal-overlay[aria-hidden="true"] {
    display: none;
}

.modal-box {
    position: relative;
    width: min(480px, calc(100vw - 32px));
    padding: 36px 32px 28px;
    border-radius: var(--radius-lg);
    animation: modal-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes modal-pop {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 14px;
}

.modal-body {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 18px;
}

.modal-body strong {
    color: var(--text-primary);
}

.modal-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.modal-features li {
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-android {
    margin-bottom: 20px;
}

.android-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    background: var(--accent-gradient);
    color: #000;
    font-weight: 700;
    font-size: 14px;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.android-download-btn:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.modal-footer {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    opacity: 0.7;
}

/* --- Rainfall Legend --- */
.rain-legend {
    position: absolute;
    bottom: calc(30px + env(safe-area-inset-bottom));
    right: 20px;
    z-index: 1000;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 130px;
    border-radius: var(--radius-md);
    pointer-events: none;
}

.rain-legend-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    letter-spacing: 0.3px;
}

.rain-legend-scale {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: stretch;
}

.rain-legend-bar {
    width: 16px;
    flex-shrink: 0;
    border-radius: 4px;
    /* Gradient mirrors the colour ramp in make_rain_tiles.py, top = wet, bottom = dry */
    background: linear-gradient(to bottom,
        rgb(0, 0, 70),
        rgb(0, 0, 120),
        rgb(0, 0, 160),
        rgb(0, 40, 180),
        rgb(40, 80, 200),
        rgb(70, 120, 220),
        rgb(100, 160, 235),
        rgb(173, 216, 230)
    );
}

.rain-legend-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.rain-legend-sub {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: center;
    opacity: 0.7;
    font-style: italic;
}

@media (max-width: 500px) {
    .rain-legend {
        bottom: calc(16px + env(safe-area-inset-bottom));
        right: 8px;
        padding: 10px 12px;
        min-width: 110px;
    }
    .rain-legend-title { font-size: 11px; }
    .rain-legend-labels { font-size: 9px; }
}

/* --- Wilderness Quality Legend --- */
.wqi-legend {
    position: absolute;
    bottom: calc(30px + env(safe-area-inset-bottom));
    right: 20px;
    z-index: 1000;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 130px;
    border-radius: var(--radius-md);
    pointer-events: none;
}

.wqi-legend-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    letter-spacing: 0.3px;
}

.wqi-legend-scale {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: stretch;
}

.wqi-legend-bar {
    width: 16px;
    flex-shrink: 0;
    border-radius: 4px;
    /* Gradient mirrors the colour ramp in make_wqi_tiles.py, top = wild, bottom = modified */
    background: linear-gradient(to bottom,
        rgb(0, 65, 20),
        rgb(15, 90, 30),
        rgb(30, 115, 45),
        rgb(50, 140, 60),
        rgb(80, 165, 80),
        rgb(120, 185, 110),
        rgb(160, 205, 140),
        rgb(200, 225, 180),
        rgb(235, 245, 225)
    );
}

.wqi-legend-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.wqi-legend-sub {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: center;
    opacity: 0.7;
    font-style: italic;
}

@media (max-width: 500px) {
    .wqi-legend {
        bottom: calc(16px + env(safe-area-inset-bottom));
        right: 8px;
        padding: 10px 12px;
        min-width: 110px;
    }
    .wqi-legend-title { font-size: 11px; }
    .wqi-legend-labels { font-size: 9px; }
}

/* Handle landscape or very small heights */
@media (max-height: 600px) {
    .leaflet-control-layers {
        max-height: 250px;
        overflow-y: auto;
    }
}

/* Unpaved Paths spinner inside layer control */
.unpaved-spinner {
    display: none;
    width: 10px;
    height: 10px;
    margin-left: 6px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: unpaved-spin 0.8s linear infinite;
    vertical-align: middle;
}

.unpaved-spinner.visible {
    display: inline-block;
}

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