/* CraneNav NextBillion Login Test Styles */

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

html, body { 
    height: 100%; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
}
/* iOS/WKWebView: ensure full screen height incl. notch, with fallbacks */
html {
    height: 100% !important;
    height: 100svh !important;
    min-height: -webkit-fill-available !important;
}
body { 
    height: 100svh; 
    min-height: -webkit-fill-available; 
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100svh;
    min-height: -webkit-fill-available;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.3s ease-out;
}

.splash-screen.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.splash-content {
    text-align: center;
}

.splash-title {
    font-size: 2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.splash-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Login View */
.login-view { 
    display: none; /* Changed from flex - will be shown by showLogin() if needed */
    align-items: center; 
    justify-content: center; 
    min-height: 100vh; 
    background: #f5f5f5; 
}

.login-form { 
    max-width: 400px; 
    width: 100%; 
    padding: 2rem; 
    background: white; 
    border-radius: 8px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    /* OPTIMIZATION: CSS containment for isolated login form */
    contain: layout paint;
}

.login-title { 
    font-size: 1.5rem; 
    font-weight: 600; 
    text-align: center; 
    margin-bottom: 1.5rem; 
}

.form-group { 
    margin-bottom: 1rem; 
}

.form-input { 
    width: 100%; 
    padding: 0.75rem; 
    border: 1px solid #d1d5db; 
    border-radius: 4px; 
    font-size: 1rem; 
}

.form-input:focus { 
    outline: none; 
    border-color: #3b82f6; 
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); 
}

.login-btn { 
    width: 100%; 
    padding: 0.75rem; 
    background: #3b82f6; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    font-size: 1rem; 
    cursor: pointer; 
}

.login-btn:hover { 
    background: #2563eb; 
}

.login-btn:disabled { 
    background: #9ca3af; 
    cursor: not-allowed; 
}

.error-message { 
    color: #dc2626; 
    font-size: 0.875rem; 
    margin-top: 0.5rem; 
    display: none; 
}

.success-message { 
    color: #16a34a; 
    font-size: 0.875rem; 
    margin-top: 0.5rem; 
    display: none; 
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.terms-link {
    color: #3b82f6;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.terms-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.terms-checkbox-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-top: 0.5rem;
}

.terms-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.5;
}

.terms-checkbox {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.terms-checkbox-text {
    flex: 1;
}

.terms-link-inline {
    color: #3b82f6;
    text-decoration: none;
}

.terms-link-inline:hover {
    text-decoration: underline;
}

.terms-link-container {
    margin-top: 0.5rem;
}

.forgot-password-link {
    color: #0b5bd3;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.forgot-password-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* App View - Fixed container like Main branch .map-container */
.app-view { 
    display: none; 
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100svh !important; /* dynamic viewport height for iPhone */
    min-height: -webkit-fill-available !important; /* iOS fallback */
}

#mapContainer {
    /* Hardware acceleration for smooth map rendering and rotation */
    -webkit-transform: translateZ(0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform; 
    position: fixed !important; /* Match parent positioning to fill viewport - LOCKED */
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important; 
    height: 100vh !important; 
    height: 100svh !important; /* dynamic viewport height for iPhone - LOCKED */
    min-height: -webkit-fill-available !important; /* iOS fallback - LOCKED */
    z-index: 0 !important;
    /* PERFORMANCE OPTIMIZATION: CSS containment for better rendering performance */
    contain: layout style paint;
}
/* Force map layers to sit below our UI in iOS WKWebView */
#mapContainer * { 
    z-index: 0 !important; 
}
/* Reposition pin: MapLibre markers live under #mapContainer; universal z-index:0 lets the canvas cover them */
#mapContainer .maplibregl-canvas-container {
    z-index: 0 !important;
}
#mapContainer .maplibregl-marker {
    z-index: 6 !important;
}
/* Subtle dim during basemap style swap (not route calculation) */
#mapContainer.map-style-switching {
    opacity: 0.92;
    transition: opacity 0.12s ease;
}
/* UI overlay above map for WKWebView */
#uiOverlay { 
    position: fixed; 
    inset: 0; 
    z-index: 10000; 
    pointer-events: none;
    /* PERFORMANCE OPTIMIZATION: CSS containment for better rendering performance */
    contain: layout style paint;
}
#uiOverlay > * { 
    pointer-events: auto;
    /* PERFORMANCE OPTIMIZATION: CSS containment for UI elements */
    contain: layout style;
}
/* Navigation bars with proper z-index for iPhone */
#navBottomBar, .overlay-controls { 
    z-index: 10000 !important;
    /* PERFORMANCE OPTIMIZATION: CSS containment for better rendering performance */
    contain: layout style paint;
}

/* Mobile-specific fixes - Like Main branch */
@media (max-width: 768px) {
    body { 
        overflow: hidden !important; /* Prevent scrolling - LOCKED */
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
        height: 100svh !important; /* iPhone viewport height - LOCKED */
        min-height: -webkit-fill-available !important; /* iOS fallback - LOCKED */
    }
    .app-view {
        touch-action: manipulation !important; /* Prevent zoom/pan gestures */
        height: 100svh !important; /* iPhone viewport height - LOCKED */
        min-height: -webkit-fill-available !important; /* iOS fallback - LOCKED */
    }
    #mapContainer {
        touch-action: manipulation !important; /* Prevent zoom/pan gestures */
        height: 100svh !important; /* iPhone viewport height - LOCKED */
        min-height: -webkit-fill-available !important; /* iOS fallback - LOCKED */
    }
    /* Ensure inputs don't zoom on focus */
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Fallback for browsers without svh support (older iOS) */
:root { 
    --safe-vh: 1vh; 
}
@supports not (height: 100svh) {
    .app-view { 
        height: calc(var(--safe-vh) * 100) !important; 
        min-height: -webkit-fill-available !important; /* iOS fallback - LOCKED */
    }
    #mapContainer { 
        height: calc(var(--safe-vh) * 100) !important; 
        min-height: -webkit-fill-available !important; /* iOS fallback - LOCKED */
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        /* Don't subtract safe area insets - let padding/positioning handle safe areas */
    }
}

/* iPhone-specific viewport fix - ensure full screen coverage - LOCKED */
@supports (-webkit-touch-callout: none) {
    /* This targets iOS Safari specifically */
    html {
        height: 100svh !important;
        min-height: -webkit-fill-available !important;
        width: 100% !important;
    }
    body {
        height: 100svh !important;
        min-height: -webkit-fill-available !important;
        /* Removed position: fixed - was preventing app from extending to bottom */
        width: 100% !important;
        overflow: hidden !important;
    }
    .app-view {
        height: 100svh !important;
        min-height: -webkit-fill-available !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }
    #mapContainer {
        height: 100svh !important;
        min-height: -webkit-fill-available !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }
}


/* Overlay controls (top-left) - Compact for mobile */
.overlay-controls {
    position: absolute;
    top: calc(env(safe-area-inset-top) + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: min(90vw, 860px);
    max-width: calc(100vw - 36px - env(safe-area-inset-left) - env(safe-area-inset-right));
    display: flex;
    flex-direction: column;
    gap: 7px;
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-sizing: border-box;
    /* OPTIMIZATION: CSS containment for isolated UI component */
    contain: layout paint;
}

.overlay-input { 
    width: 85%;
    padding: 12.5px 10px;
    border: 0;
    border-radius: 16px;
    font-size: 13px;
    background: rgba(17,24,39,0.92);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

.overlay-select {
    width: 85%;
    padding: 12.5px 10px;
    border: 0;
    border-radius: 16px;
    font-size: 13px;
    background: rgba(17,24,39,0.92);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

.overlay-field {
    position: relative;
}

.overlay-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    /* Lock flex container to prevent button movement */
    flex-wrap: nowrap;
    justify-content: flex-start;
}

.overlay-button {
    background: #0071E3; /* updated blue color */
    color: #fff;
    padding: 14.4px 32px; /* reduced vertical padding by 10% from 16px */
    border: none;
    border-radius: 50px; /* pill shape - very rounded corners */
    font-size: 18px; /* clean, readable font size */
    font-weight: 500; /* medium weight like reference */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; /* clean sans-serif */
    cursor: pointer;
    width: fit-content;
    min-width: 120px; /* ensure consistent width */
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    /* Initial hidden state for animation */
    opacity: 0;
    transform: translateX(-40px);
    /* Smooth hardware-accelerated transitions */
    transition: all 400ms cubic-bezier(0.4, 0, 0.2, 1);
    /* Ensure buttons are accessible even when hidden */
    pointer-events: none;
    /* Lock position - prevent any movement */
    position: relative;
    flex-shrink: 0;
}

.overlay-button.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.overlay-button.start {
    background: #10b981; /* green */
    /* Lock Start button position - always next to Reset button */
    order: 2;
    margin-left: 0 !important;
    margin-right: 0 !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
}

/* Planning Menu (hamburger menu) - Top Right */
.planning-menu-container {
    position: absolute;
    top: calc(env(safe-area-inset-top) + 8px);
    right: calc(env(safe-area-inset-right) + 12px);
    /* Must sit above demo-guide overlay; dropdown z-index cannot escape parent stacking context */
    z-index: 2147483647 !important;
    isolation: isolate;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.planning-menu-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.planning-menu-btn:hover {
    transform: scale(1.05);
}

.planning-menu-btn:active {
    transform: scale(0.95);
}

.planning-menu-icon {
    display: block;
    flex-shrink: 0;
    pointer-events: none;
}

.planning-menu-icon .planning-menu-bar {
    fill: #ffffff;
}

/* Demo guide floating speech labels */
.demo-guide-labels {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100svh;
    overflow: visible;
    /* Full-screen is OK as long as hit-testing is fully disabled (see pointer-events rules below). */
    pointer-events: none !important;
    /* Mounted under #uiOverlay (before other HUD widgets) so #appView chrome (e.g. planning menu) paints above */
    z-index: 2147483643 !important;
}

.demo-guide-label {
    position: fixed;
    max-width: 240px;
    background: rgba(17, 24, 39, 0.95);
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.10);
    pointer-events: none;
    user-select: none;
}

.demo-guide-label::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid rgba(17, 24, 39, 0.95);
    pointer-events: none;
}

.demo-guide-permit-box {
    position: fixed;
    box-sizing: border-box;
    max-width: 460px;
    background: rgba(17, 24, 39, 0.95);
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.30);
    padding: 28px 34px 12px 14px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    white-space: normal;
    border: 1px solid rgba(255, 255, 255, 0.10);
    pointer-events: none;
    user-select: none;
}

.demo-guide-dismiss {
    position: absolute;
    top: 7px;
    right: 8px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    line-height: 20px;
    padding: 0;
    pointer-events: auto;
    user-select: none;
}

.demo-guide-dismiss:hover,
.demo-guide-dismiss:focus-visible {
    background: rgba(255, 255, 255, 0.24);
    outline: none;
}

.planning-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    padding: 8px 0;
    max-height: min(70vh, calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 56px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    z-index: 2147483647 !important;
}

.planning-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    user-select: none;
}

.planning-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.planning-menu-item:active {
    background: rgba(255, 255, 255, 0.15);
}

.planning-menu-item-text {
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    flex: 1;
}

.planning-menu-item-check {
    color: #10b981;
    font-size: 18px;
    font-weight: bold;
    margin-left: 12px;
    flex-shrink: 0;
    display: none;
}

.planning-menu-item.active .planning-menu-item-check {
    display: inline-block;
}

/* Country submenu arrow */
.planning-menu-item-arrow {
    color: #9ca3af;
    font-size: 18px;
    margin-left: 8px;
    transition: transform 0.15s ease;
}

/* Planning menu submenu */
.planning-menu-submenu {
    background: rgba(31, 41, 55, 0.98);
    border-left: 2px solid rgba(59, 130, 246, 0.5);
    margin: 4px 0;
    padding: 4px 0;
}

.planning-menu-submenu .planning-menu-item {
    padding-left: 32px;
}

/* NHVRgo: extra indent for gazetted route rows under each state */
.planning-menu-submenu.nhvrgo-state-routes {
    margin-left: 0;
    padding-left: 0;
}

.planning-menu-submenu.nhvrgo-state-routes .planning-menu-item {
    padding-left: 48px;
}

/* NHVRgo NSW (and similar): nested section headers under a state route panel */
.planning-menu-submenu.nhvrgo-state-routes .nhvrgo-nested-panel {
    margin: 0 0 2px 0;
    padding: 0 0 2px 0;
}

.planning-menu-submenu.nhvrgo-state-routes .nhvrgo-nested-panel > .planning-menu-item {
    padding-left: 56px;
}

.planning-menu-submenu.nhvrgo-state-routes .nhvrgo-nested-panel .nhvrgo-nested-panel > .planning-menu-item {
    padding-left: 64px;
}

.planning-menu-item.nhvrgo-route-item--loading {
    opacity: 0.65;
    pointer-events: none;
}

.planning-menu-item.nhvrgo-route-item--loading .planning-menu-item-text::after {
    content: ' …';
    opacity: 0.85;
}

/* LCV Routes (US): extra indent for route rows under each state */
.planning-menu-submenu.lcv-state-routes {
    margin-left: 0;
    padding-left: 0;
}

.planning-menu-submenu.lcv-state-routes .planning-menu-item {
    padding-left: 48px;
}

.planning-menu-item.lcv-route-item--loading {
    opacity: 0.65;
    pointer-events: none;
}

.planning-menu-item.lcv-route-item--loading .planning-menu-item-text::after {
    content: ' …';
    opacity: 0.85;
}

.planning-menu-item.staa-route-item--loading {
    opacity: 0.65;
    pointer-events: none;
}

.planning-menu-item.staa-route-item--loading .planning-menu-item-text::after {
    content: ' …';
    opacity: 0.85;
}

/* Map Style Menu - uses same styles as planning menu */
.map-style-menu-container,
.map-style-menu-container-nav {
    position: relative;
    /* Match planning menu stacking so dropdowns reliably paint above demo overlays */
    z-index: 2147483647 !important;
    isolation: isolate;
}
.map-style-menu-container .planning-menu-dropdown,
.map-style-menu-container-nav .planning-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
}

/* Finish marker menu (positioned near finish flag) */
.finish-marker-menu .planning-menu-dropdown {
    min-width: 180px;
}

/* Bridge popup icon buttons (satellite, street view, Google Earth) */
.bridge-popup-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    color: #374151;
    transition: background 0.15s, color 0.15s;
}
.bridge-popup-icon-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

/* Ensure Start button transform is reset when visible */
.overlay-button.start.visible {
    transform: translateX(0) !important;
}

/* Lock Reset button position */
#resetRouteBtn {
    order: 1;
    margin-left: 0 !important;
    margin-right: 0 !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
}

/* Hide snap button - snapping is now automatic */
#snapRouteBtn {
    display: none !important;
    order: 3;
    /* Remove from layout flow completely */
    position: absolute;
    visibility: hidden;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
}

/* Hide overlay controls during navigation for cleaner UI */
.overlay-controls.nav-active {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

/* Auto-suggest dropdown styling - matching original app.js */
.suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 240px;
    width: max(100%, 240px);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
    max-height: 50vh;
    overflow-y: auto;
    display: none;
    z-index: 1100;
    /* OPTIMIZATION: CSS containment for isolated dropdown component */
    contain: layout paint;
}

.suggestions.visible { 
    display: block; 
}

.suggestions .item { 
    padding: 8px 10px; 
    font-size: 14px; 
    cursor: pointer; 
}

.suggestions .item:hover { 
    background: #f3f4f6; 
}

/* Completely disable browser autocomplete styling */
input::-webkit-autofill,
input::-webkit-autofill:hover,
input::-webkit-autofill:focus,
input::-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(17,24,39,0.92) inset !important;
    -webkit-text-fill-color: #fff !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Hide browser autocomplete dropdown */
input::-webkit-calendar-picker-indicator {
    display: none !important;
}

/* Additional browser autocomplete prevention */
.overlay-input {
    -webkit-autocomplete: off;
    -moz-autocomplete: off;
    autocomplete: off;
}

/* Hide NextBillion attribution and controls */
.nextbillion-attribution,
.nextbillion-logo,
.mapboxgl-ctrl-attrib,
.mapboxgl-ctrl-logo,
[class*="nextbillion"],
[class*="mapboxgl-ctrl"] {
    display: none !important;
    visibility: hidden !important;
}

/* Hide browser suggestion chips */
input::-webkit-list-button,
input::-webkit-calendar-picker-indicator,
input::-webkit-clear-button,
input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hide any browser-generated suggestion elements */
input[list]::-webkit-calendar-picker-indicator,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Additional prevention for modern browsers */
.overlay-input::-webkit-autofill,
.overlay-input::-webkit-autofill:hover,
.overlay-input::-webkit-autofill:focus,
.overlay-input::-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(17,24,39,0.92) inset !important;
    -webkit-text-fill-color: #fff !important;
    transition: background-color 5000s ease-in-out 0s;
    background-color: transparent !important;
    background-image: none !important;
}

/* Hide any suggestion chips that might appear */
.overlay-field::after,
.overlay-field::before {
    display: none !important;
    content: none !important;
}

/* Ensure no browser-generated elements appear */
.overlay-input:focus::-webkit-credentials-auto-fill-button,
.overlay-input:hover::-webkit-credentials-auto-fill-button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}


/* GPS puck marker on map with directional arrow (25% larger: 40→50px container, 24→30px circle, glow scaled) */
.gps-puck-marker {
    width: 50px;
    height: 50px;
    position: relative;
    z-index: 1000 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Prevent interference with map interactions */
    /* Hardware acceleration for smooth rendering */
    -webkit-transform: translateZ(0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
}

.gps-puck-circle {
    width: 30px;
    height: 30px;
    background-color: #FF6600;
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 0 25px rgba(255,102,0,0.9), 0 4px 12px rgba(0,0,0,0.4);
    position: absolute;
    animation: pulse-puck 2s infinite;
    /* Hardware acceleration for smooth animation */
    -webkit-transform: translateZ(0);
    transform: translate3d(0, 0, 0);
    will-change: box-shadow;
}

.gps-puck-arrow {
    position: absolute;
    top: -10px;
    color: #FF6600;
    font-size: 25px;
    text-shadow: 0 0 5px white, 0 0 8px white, 0 2px 5px rgba(0,0,0,0.4);
    font-weight: bold;
    z-index: 1001;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.3));
    transform-origin: center center;
    /* Hardware acceleration - arrow always points straight up in heading up mode */
    -webkit-transform: translate3d(0, -50%, 0);
    transform: translate3d(0, -50%, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
}

@keyframes pulse-puck {
    0% {
        box-shadow: 0 0 19px rgba(255,102,0,0.7), 0 0 38px rgba(255,102,0,0.4), 0 3px 10px rgba(0,0,0,0.3);
    }
    50% {
        box-shadow: 0 0 31px rgba(255,102,0,1.0), 0 0 62px rgba(255,102,0,0.6), 0 3px 10px rgba(0,0,0,0.3);
    }
    100% {
        box-shadow: 0 0 19px rgba(255,102,0,0.7), 0 0 38px rgba(255,102,0,0.4), 0 3px 10px rgba(0,0,0,0.3);
    }
}

/* Green pulse when on Heavy Haul route – wedge and glow match circle */
@keyframes pulse-puck-green {
    0% {
        box-shadow: 0 0 19px rgba(16,185,129,0.7), 0 0 38px rgba(16,185,129,0.4), 0 3px 10px rgba(0,0,0,0.3);
    }
    50% {
        box-shadow: 0 0 31px rgba(16,185,129,1.0), 0 0 62px rgba(16,185,129,0.6), 0 3px 10px rgba(0,0,0,0.3);
    }
    100% {
        box-shadow: 0 0 19px rgba(16,185,129,0.7), 0 0 38px rgba(16,185,129,0.4), 0 3px 10px rgba(0,0,0,0.3);
    }
}

.gps-puck-marker.gps-puck-heavy-haul .gps-puck-circle {
    animation: pulse-puck-green 2s infinite;
}

/* Navigation session warning animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== HIGH-PERFORMANCE NAVIGATION STYLES ===== */

/* Animated instruction display */
.instruction-display {
    position: fixed;
    top: 20px;
    left: -100%;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    max-width: 280px;
    z-index: 1000;
    transition: left 0.3s ease-in-out;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.instruction-display.show {
    left: 20px;
}

.instruction-display.hide {
    left: -100%;
}

.instruction-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.instruction-text {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: #ffffff;
}

.instruction-distance {
    font-size: 14px;
    font-weight: 500;
    color: #a3a3a3;
    opacity: 0.9;
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    .instruction-display {
        top: 15px;
        left: -100%;
        right: auto;
        max-width: none;
        padding: 14px 18px;
    }
    
    .instruction-display.show {
        left: 15px;
    }
    
    .instruction-text {
        font-size: 15px;
    }
    
    .instruction-distance {
        font-size: 13px;
    }
}

/* Professional navigation styling */
.navigation-map {
    position: relative;
    width: 100%;
    height: 100%;
    background: #f8fafc;
}

/* Clean map interface during navigation */
.nav-active .map-container {
    background: #000;
}

.nav-active .maplibregl-map {
    filter: brightness(1.1) contrast(1.05);
}

/* Smooth transitions for all navigation elements */
.instruction-display,
.gps-puck-marker {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* REMOVED: Navigation UI Styles - turn-by-turn navigation removed */

/* Offline navigation resume (Phase 3b) */
.offline-nav-resume-modal {
    z-index: 2500;
}

.offline-nav-resume-modal-content {
    max-width: 420px;
    width: 100%;
}

.offline-nav-resume-message {
    margin: 0;
    line-height: 1.45;
    color: #1f2937;
}

.offline-nav-resume-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Bridge Modal Styles */
.bridge-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* OPTIMIZATION: CSS containment for isolated modal component */
    contain: layout paint;
}

/* Edit bridge: sharp map behind (no backdrop blur), hit-testing only on strip + card so gaps pass through to the map */
.bridge-modal.bridge-modal--edit-dock {
    z-index: 2147483647 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    contain: none;
    pointer-events: none;
    isolation: isolate;
}

/* Full-viewport dim (strip alone only dimmed part of the screen before this) */
.bridge-modal.bridge-modal--edit-dock::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.38);
    pointer-events: none;
}

.bridge-modal--edit-dock .bridge-modal-dismiss-strip,
.bridge-modal--edit-dock .bridge-radius-modal-content {
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

/* Footer Save hidden while repositioning mini-map — use "Save new location" first */
.bridge-modal.bridge-modal--edit-dock.reposition-adjusting .bridge-modal-footer #bridgeRadiusEditSubmit {
    display: none !important;
}

.bridge-modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.bridge-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.bridge-modal-title {
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.bridge-modal-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.bridge-modal-close:hover {
    color: #374151;
    background: #f3f4f6;
}

.bridge-modal-body {
    padding: 24px;
}

.bridge-info, .crane-info {
    margin-bottom: 20px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.bridge-name, .crane-name {
    color: #111827;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.bridge-details, .crane-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-label {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

.detail-value {
    color: #111827;
    font-size: 14px;
    font-weight: 600;
}

.compliance-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #ecfdf5;
    border: 1px solid #10b981;
    border-radius: 8px;
    margin-bottom: 20px;
}

.status-icon {
    font-size: 20px;
}

.status-text {
    color: #065f46;
    font-size: 14px;
    font-weight: 600;
}

.compliance-status.permit-aware-off {
    background: #fffbeb;
    border-color: #f59e0b;
}

.compliance-status.permit-aware-off .status-text {
    color: #92400e;
}

.bridge-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    justify-content: flex-end;
}

.bridge-radius-modal-content {
    max-width: 520px;
    position: relative;
}

/* Edit bridge: full-panel save state (spinner + dim) */
.bridge-radius-save-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border-radius: inherit;
    pointer-events: auto;
}

.bridge-modal--edit-dock .bridge-radius-save-overlay {
    border-radius: 16px 0 0 16px;
}

.bridge-radius-save-overlay__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 20px;
}

.bridge-radius-save-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #0b5bd3;
    border-radius: 50%;
    animation: route-loading-spin 0.8s linear infinite;
    transform: translateZ(0);
}

.bridge-radius-save-overlay__text {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #4b5563;
    text-align: center;
    max-width: 240px;
    line-height: 1.35;
}

.bridge-modal.bridge-radius-edit-saving .bridge-modal-dismiss-strip {
    pointer-events: none;
    opacity: 0.45;
}

/* Edit bridge: dock panel so map stays visible (Uber-style pin uses free map area) */
.bridge-modal--edit-dock {
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0;
}

.bridge-modal--edit-dock .bridge-modal-dismiss-strip {
    flex: 1 1 auto;
    align-self: stretch;
    min-width: 0;
    min-height: 48px;
    background: transparent;
    cursor: pointer;
    border: none;
}

.bridge-modal--edit-dock .bridge-radius-modal-content {
    flex: 0 0 min(360px, 100vw);
    max-width: min(360px, 100vw);
    width: 100%;
    max-height: min(92vh, 640px);
    margin: 0;
    border-radius: 16px 0 0 16px;
    box-shadow: -12px 0 48px rgba(0, 0, 0, 0.18);
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bridge-modal--edit-dock .bridge-modal-body {
    flex: 0 1 auto;
    overflow-y: auto;
    padding: 16px;
}

.bridge-modal--edit-dock .bridge-modal-header {
    padding: 14px 16px;
}

.bridge-modal--edit-dock .bridge-modal-footer {
    padding: 14px 16px;
}

.bridge-reposition-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.bridge-reposition-toggle-btn,
.bridge-reposition-reset-btn {
    width: 100%;
}

.bridge-reposition-mini-map-wrap {
    position: relative;
    width: 100%;
    height: 240px;
    margin-top: 8px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
    touch-action: none;
}

.bridge-reposition-mini-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.bridge-reposition-mini-map-crosshair {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    pointer-events: none;
    z-index: 2;
    border: 2px solid rgba(220, 38, 38, 0.95);
    border-radius: 50%;
    box-shadow: 0 0 0 1px #fff, 0 2px 12px rgba(0, 0, 0, 0.35);
}

.bridge-reposition-mini-map-crosshair::before,
.bridge-reposition-mini-map-crosshair::after {
    content: '';
    position: absolute;
    background: rgba(220, 38, 38, 0.85);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 1px #fff;
}

.bridge-reposition-mini-map-crosshair::before {
    width: 2px;
    height: 12px;
}

.bridge-reposition-mini-map-crosshair::after {
    width: 12px;
    height: 2px;
}

.bridge-reposition-coords-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.bridge-reposition-pin-host {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10050;
}

.bridge-reposition-pin {
    position: absolute;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    margin-top: -40px;
    background: radial-gradient(circle at 50% 32%, #fee2e2 0%, #ef4444 45%, #b91c1c 100%);
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.map-bridge-placement-menu {
    position: fixed;
    z-index: 100002;
    min-width: 200px;
    padding: 6px 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.map-bridge-placement-menu-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 15px;
    font-weight: 500;
    color: #111827;
    cursor: pointer;
}

.map-bridge-placement-menu-item:hover {
    background: #f3f4f6;
}

.map-bridge-placement-menu-waypoints {
    border-top: 1px solid #e5e7eb;
    margin-top: 4px;
    padding-top: 10px;
    font-weight: 600;
}

.map-bridge-placement-menu-cancel {
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    margin-top: 4px;
    padding-top: 10px;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-primary {
    background: #3b82f6;
    color: #ffffff;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Password Change Modal */
.password-change-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.password-change-modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.password-change-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.password-change-modal-title {
    color: #111827;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.password-change-modal-body {
    padding: 24px;
}

.password-change-modal-message {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.password-change-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-label {
    display: block;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-help-text {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-top: 4px;
}

.password-change-modal-footer {
    margin-top: 8px;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    /* REMOVED: Navigation UI mobile styles - turn-by-turn navigation removed */
    
    /* Ensure proper spacing for text fields on mobile (especially Android) */
    .overlay-input,
    .overlay-select {
        width: 84%; /* Additional 1% reduction on mobile for better right-side spacing */
    }
    
    .bridge-modal {
        padding: 10px;
    }

    .bridge-modal--edit-dock {
        flex-direction: column-reverse;
        justify-content: flex-end;
        padding: 0;
    }

    .bridge-modal--edit-dock .bridge-modal-dismiss-strip {
        flex: 0 0 auto;
        min-height: 120px;
        background: transparent;
    }

    .bridge-modal--edit-dock .bridge-radius-modal-content {
        flex: 0 1 auto;
        max-width: 100%;
        width: 100%;
        max-height: 55vh;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
    }

    .bridge-reposition-mini-map-wrap {
        height: 200px;
    }

    .bridge-modal.bridge-modal--edit-dock {
        padding: 0;
    }
    
    .bridge-modal-content {
        border-radius: 12px;
    }
    
    .bridge-modal-header {
        padding: 16px 20px;
    }
    
    .bridge-modal-body {
        padding: 20px;
    }
    
    .bridge-modal-footer {
        padding: 16px 20px;
        flex-direction: column;
    }

    .additional-waypoints-modal .bridge-modal-footer {
        flex-direction: row;
        padding: 10px 12px 12px;
    }

    .additional-waypoints-modal .bridge-modal-footer .btn {
        width: auto;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    /* Edit Bridge mobile: preserve mini-map visibility and reduce footer footprint */
    .bridge-modal--edit-dock .bridge-radius-modal-content {
        max-height: min(88vh, calc(100svh - 20px));
        display: flex;
        flex-direction: column;
    }

    .bridge-modal--edit-dock .bridge-modal-body {
        flex: 1 1 auto;
        overflow-y: auto;
        padding: 14px 14px 10px;
    }

    .bridge-modal--edit-dock .bridge-reposition-mini-map-wrap {
        height: clamp(200px, 34vh, 280px);
        margin-top: 6px;
    }

    .bridge-modal--edit-dock .bridge-modal-footer {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 8px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    }

    .bridge-modal--edit-dock .bridge-modal-footer .btn {
        width: auto;
        min-width: 92px;
        padding: 10px 14px;
        font-size: 16px;
        line-height: 1.1;
    }

    .bridge-modal--edit-dock .bridge-reposition-toggle-btn {
        width: auto;
        max-width: 100%;
        align-self: flex-start;
        padding: 10px 14px;
        font-size: 16px;
        line-height: 1.2;
        white-space: normal;
    }
}

/* High-Risk Bridges Modal Styles */
.high-risk-intro {
    color: #374151;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Compact planning prompt — panel width follows footer buttons */
.additional-waypoints-modal {
    padding: 12px;
    background: rgba(0, 0, 0, 0.45);
}

.additional-waypoints-modal .bridge-modal-content {
    max-width: calc(100vw - 24px);
    width: max-content;
}

.additional-waypoints-modal .bridge-modal-header {
    padding: 10px 12px;
    border-bottom: none;
}

.additional-waypoints-modal .bridge-modal-title {
    font-size: 15px;
    font-weight: 600;
}

.additional-waypoints-modal .bridge-modal-body {
    padding: 0 12px 8px;
    display: flex;
    justify-content: center;
}

.additional-waypoints-modal .bridge-modal-footer {
    padding: 10px 12px 12px;
    gap: 8px;
    border-top: none;
    flex-wrap: nowrap;
}

.additional-waypoints-modal .bridge-modal-footer .btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 13px;
}

.additional-waypoints-modal .additional-waypoints-input {
    width: 52px;
    padding: 8px 6px;
    font-size: 16px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-sizing: border-box;
}

.high-risk-bridges-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.high-risk-bridge-item {
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: 8px;
}

.high-risk-bridge-item .bridge-item-name {
    color: #111827;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.high-risk-bridge-item .bridge-item-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.high-risk-bridge-item .bridge-item-detail {
    color: #6b7280;
    font-size: 14px;
}

.high-risk-bridge-item .bridge-item-detail strong {
    color: #374151;
    font-weight: 600;
}

/* Dark mode support for high-risk bridges modal */
@media (prefers-color-scheme: dark) {
    .high-risk-bridge-item {
        background: #1f1f1f;
        border-color: #7f1d1d;
        border-left-color: #dc2626;
    }
    
    .high-risk-bridge-item .bridge-item-name {
        color: #f9fafb;
    }
    
    .high-risk-bridge-item .bridge-item-detail {
        color: #9ca3af;
    }
    
    .high-risk-bridge-item .bridge-item-detail strong {
        color: #e5e7eb;
    }
}

@media (max-width: 768px) {
    .high-risk-bridges-list {
        max-height: 300px;
    }
}

/* High-Risk Bridges Modal - Positioned below Reset/Start buttons in planning layout */
#highRiskBridgesModal {
    /* Override full-screen overlay positioning for planning layout */
    position: fixed !important;
    top: auto !important;
    bottom: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 90vw !important;
    max-width: calc(100vw - 36px - env(safe-area-inset-left) - env(safe-area-inset-right)) !important;
    height: auto !important;
    min-height: auto !important;
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(4px) !important;
    padding: 0 !important;
    /* Position below overlay-controls: top of overlay-controls + estimated height + gap */
    /* overlay-controls starts at calc(env(safe-area-inset-top) + 8px) */
    /* Estimated height: crane select (~50px) + origin (~50px) + destination (~50px) + buttons (~60px) + gaps (~21px) = ~231px */
    /* Add 16px gap below buttons */
    top: calc(env(safe-area-inset-top) + 8px + 231px + 16px) !important;
    z-index: 1001 !important; /* Just above overlay-controls (1000) */
    /* Only show in planning layout (when overlay-controls is visible) */
    display: none !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
}

/* When modal is shown, use flex display */
#highRiskBridgesModal[style*="display: flex"],
#highRiskBridgesModal[style*="display:flex"] {
    display: flex !important;
}

/* Position modal content */
#highRiskBridgesModal .bridge-modal-content {
    margin-top: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 280px) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Hide modal during navigation (when overlay-controls has nav-active class) */
/* Note: This requires JavaScript to add/remove nav-active class, but CSS provides fallback */
.overlay-controls.nav-active ~ #highRiskBridgesModal {
    display: none !important;
}

/* Snap-to-Roads Diagnostic Modal Styles */
.snap-diagnostic-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.snap-diagnostic-modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.snap-diagnostic-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.snap-diagnostic-modal-title {
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.snap-diagnostic-modal-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.snap-diagnostic-modal-close:hover {
    color: #374151;
    background: #f3f4f6;
}

.snap-diagnostic-modal-body {
    padding: 24px;
}

.snap-diagnostic-icon {
    text-align: center;
    margin-bottom: 16px;
}

.snap-diagnostic-message {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 16px;
    color: #111827;
}

.snap-diagnostic-details {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    max-height: 300px;
    overflow-y: auto;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    margin-top: 16px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.snap-diagnostic-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    justify-content: flex-end;
}

/* Mobile responsive styles for diagnostic modal */
@media (max-width: 640px) {
    .snap-diagnostic-modal {
        padding: 10px;
    }
    
    .snap-diagnostic-modal-content {
        max-width: 100%;
        max-height: 95vh;
    }
    
    .snap-diagnostic-modal-header {
        padding: 16px 20px;
    }
    
    .snap-diagnostic-modal-body {
        padding: 20px;
    }
    
    .snap-diagnostic-modal-footer {
        padding: 16px 20px;
    }
    
    .snap-diagnostic-details {
        max-height: 200px;
        font-size: 12px;
    }
}

/* Terms of Service Modal Styles */
.terms-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* OPTIMIZATION: CSS containment for isolated modal component */
    contain: layout paint;
}

/* Hide overlay controls when terms modal is open */
.overlay-controls.terms-modal-open {
    opacity: 0;
    pointer-events: none;
}

.terms-modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.terms-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.terms-modal-title {
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.terms-modal-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.terms-modal-close:hover {
    color: #374151;
    background: #f3f4f6;
}

.terms-modal-body {
    padding: 0;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.terms-modal-body iframe {
    flex: 1;
    min-height: 500px;
}

/* Mobile responsive styles for terms modal */
@media (max-width: 768px) {
    .terms-modal {
        padding: 10px;
    }
    
    .terms-modal-content {
        max-width: 100%;
        max-height: 95vh;
    }
    
    .terms-modal-header {
        padding: 16px 20px;
    }
    
    .terms-modal-body iframe {
        min-height: 400px;
    }
}

/* Instructions Modal Styles */
.instructions-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* OPTIMIZATION: CSS containment for isolated modal component */
    contain: layout paint;
}

/* Hide overlay controls when instructions modal is open */
.overlay-controls.instructions-modal-open {
    opacity: 0;
    pointer-events: none;
}

.instructions-modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.instructions-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.instructions-modal-title {
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.instructions-modal-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instructions-modal-close:hover {
    color: #374151;
    background: #f3f4f6;
}

.instructions-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.instructions-image-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.instructions-image-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.instructions-image-title {
    color: #111827;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.instructions-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: block;
}

/* Mobile responsive styles for instructions modal */
@media (max-width: 640px) {
    .instructions-modal {
        padding: 10px;
    }
    
    .instructions-modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .instructions-modal-header {
        padding: 16px 20px;
    }
    
    .instructions-modal-title {
        font-size: 16px;
    }
    
    .instructions-modal-body {
        padding: 20px;
    }
    
    .instructions-image-container {
        gap: 24px;
    }
    
    .instructions-image-section {
        gap: 12px;
    }
    
    .instructions-image-title {
        font-size: 14px;
    }
}

/* Saved Trips Modal */
.saved-trips-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    contain: layout paint;
}

/* Hide overlay controls when saved trips modal is open */
.overlay-controls.saved-trips-modal-open {
    opacity: 0;
    pointer-events: none;
}

.saved-trips-modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent content from overflowing the modal */
}

.saved-trips-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.saved-trips-modal-title {
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.saved-trips-modal-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.saved-trips-modal-close:hover {
    color: #374151;
    background: #f3f4f6;
}

.saved-trips-modal-body {
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    max-height: calc(90vh - 80px); /* Account for header height */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    /* Ensure scrollbar is visible when content overflows */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Webkit scrollbar styling for better visibility */
.saved-trips-modal-body::-webkit-scrollbar {
    width: 8px;
}

.saved-trips-modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.saved-trips-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.saved-trips-modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.saved-trips-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.saved-trip-item {
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.saved-trip-item:hover {
    background: #f9fafb;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.saved-trip-item-content {
    flex: 1;
    cursor: pointer;
    min-width: 0; /* Allow content to shrink */
}

.saved-trip-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.saved-trip-item-name-text {
    min-width: 0;
}

/* PA badge sits beside reverse (↔) so it reads as trip-type, not part of the address */
.saved-trip-item-reverse-cluster {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.saved-trip-item-pa-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: #1e40af;
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 4px;
}

.saved-trip-item-route {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 4px;
}

.saved-trip-item-date {
    font-size: 12px;
    color: #9ca3af;
}

.saved-trip-item-delete {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    opacity: 0.6;
}

.saved-trip-item-delete:hover {
    background: #fee2e2;
    opacity: 1;
    transform: scale(1.1);
}

.saved-trip-item-delete:active {
    transform: scale(0.95);
}

.saved-trip-item-reverse {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #6b7280;
    opacity: 0.7;
}

.saved-trip-item-reverse:hover {
    background: #e0f2fe;
    color: #0284c7;
    opacity: 1;
    transform: scale(1.1);
}

.saved-trip-item-reverse:active {
    transform: scale(0.95);
}

.saved-trip-item-reverse svg {
    width: 20px;
    height: 20px;
}

.saved-trips-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.saved-trips-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

/* Home/depot Address Modal */
.home-depot-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    contain: layout paint;
}

.overlay-controls.home-depot-modal-open {
    opacity: 0;
    pointer-events: none;
}

.home-depot-modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 520px;
    width: 100%;
    overflow: visible;
}

.home-depot-modal-header,
.home-depot-modal-footer {
    display: flex;
    align-items: center;
    padding: 20px 24px;
}

.home-depot-modal-header {
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
}

.home-depot-modal-footer {
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #e5e7eb;
}

.home-depot-modal-title {
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.home-depot-modal-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-depot-modal-close:hover {
    color: #374151;
    background: #f3f4f6;
}

.home-depot-modal-body {
    padding: 24px;
}

.home-depot-modal-help {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.45;
    margin: 0 0 18px;
}

.home-depot-label {
    display: block;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.home-depot-input-wrap {
    position: relative;
}

.home-depot-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #111827;
    font-size: 16px;
}

.home-depot-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.home-depot-suggestions {
    width: 100%;
    max-height: 240px;
    z-index: 20010;
}

.home-depot-status {
    min-height: 20px;
    margin-top: 10px;
    color: #6b7280;
    font-size: 13px;
}

.home-depot-status.error {
    color: #dc2626;
}

.home-depot-status.success {
    color: #16a34a;
}

/* Mobile responsive styles for saved trips modal */
@media (max-width: 768px) {
    .saved-trips-modal {
        padding: 10px;
    }
    
    .saved-trips-modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .saved-trips-modal-header {
        padding: 16px 20px;
    }
    
    .saved-trips-modal-title {
        font-size: 16px;
    }
    
    .saved-trips-modal-body {
        padding: 20px;
        max-height: calc(95vh - 60px); /* Account for header height on mobile */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    .home-depot-modal {
        padding: 10px;
    }

    .home-depot-modal-content {
        max-width: 100%;
        border-radius: 12px;
    }

    .home-depot-modal-header,
    .home-depot-modal-footer,
    .home-depot-modal-body {
        padding: 16px 20px;
    }
    
    .saved-trip-item {
        padding: 12px;
    }
    
    .saved-trip-item-name {
        font-size: 14px;
    }
    
    .saved-trip-item-route {
        font-size: 13px;
    }
}

/* Professional color scheme */
:root {
    --nav-primary: #1e40af;
    --nav-secondary: #3b82f6;
    --nav-accent: #60a5fa;
    --nav-text: #ffffff;
    --nav-text-secondary: #a3a3a3;
    --nav-background: rgba(0, 0, 0, 0.9);
    --nav-border: rgba(255, 255, 255, 0.1);
}

/* GPS puck styling */
.gps-puck {
    width: 20px;
    height: 20px;
    background-color: #FF6600;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Speed HUD Styles */
#speed-hud {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 300ms ease-out, transform 300ms ease-out;
    /* Avoid parent #uiOverlay paint containment clipping on iOS WKWebView */
    contain: layout style;
}

#speed-hud:not(.speed-hud-hidden) {
    opacity: 1;
    transform: translateY(0);
}

#speed-hud.speed-hud-mobile-bottom.speed-hud-hidden {
    transform: translateY(10px);
}

#speed-hud.speed-hud-mobile-bottom:not(.speed-hud-hidden) {
    transform: translateY(0);
}

/* Active navigation: force visibility (mobile Safari / overlay stacking) */
#speed-hud.speed-hud-nav-visible {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: none;
    z-index: 2147483647 !important;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 480px) {
    #current-speed-container {
        font-size: 2.2rem !important;
        padding: 6px 12px !important;
    }
    
    #current-speed-container span:last-child {
        font-size: 1rem !important;
        margin-left: 4px !important;
    }
}

/* Turn Direction Indicator Styles - Similar to Speed HUD */
#turnDirectionIndicator {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 300ms ease-out, transform 300ms ease-out;
    /* OPTIMIZATION: CSS containment for isolated HUD component */
    contain: layout paint;
}

#turnDirectionIndicator:not(.turn-direction-indicator-hidden) {
    opacity: 1;
    transform: translateY(0);
}

/* Match turn direction container height to speed HUD container */
/* Speed HUD container height: 2.8rem font (44.8px) + line-height padding + 16px padding ≈ 72px */
#turn-direction-container {
    min-height: 72px;
    align-items: center;
    display: flex;
}

/* Arrow image - transparent background */
#turnDirectionArrowLeft,
#turnDirectionArrowRight,
#turnDirectionArrowExit {
    background: transparent;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 480px) {
    #turn-direction-container {
        padding: 6px 12px !important;
        gap: 10px !important;
        min-height: 60px !important; /* Match speed HUD mobile height (2.2rem font + padding) */
    }
    
    #turnDirectionArrowLeft,
    #turnDirectionArrowRight,
    #turnDirectionArrowExit {
        width: 42px !important;
        height: 42px !important;
        background: transparent !important;
    }
    
    #turnDirectionDistance {
        font-size: 1.8rem !important;
    }
}

/* Camera Pitch Slider Styles */
#pitchSlider {
    user-select: none;
    -webkit-user-select: none;
    touch-action: none; /* Allow all touch interactions for slider */
    -webkit-touch-callout: none; /* Prevent iOS callout menu */
    display: none !important; /* Hidden by default - only shown during navigation */
}

#pitchSliderHandle {
    -webkit-tap-highlight-color: transparent;
    touch-action: none; /* Allow dragging on handle */
    -webkit-touch-callout: none; /* Prevent iOS callout menu */
}

#pitchSliderHandle:active {
    cursor: grabbing;
    transform: translateX(-50%) scale(1.1);
}

#pitchSliderTrack {
    touch-action: none; /* Allow clicking/dragging on track */
    -webkit-touch-callout: none; /* Prevent iOS callout menu */
}

/* Audio Mute Button Styles */
#audioMuteButton {
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    -webkit-touch-callout: none; /* Prevent iOS callout menu */
    display: none !important; /* Hidden by default - only shown during navigation */
}

#audioMuteButton:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

#audioMuteButton:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.9);
}

#audioMuteButton svg {
    transition: opacity 0.2s ease;
}

/* ===== Navigation UI Elements - Unified for iOS and Android ===== */

/* Force hardware acceleration and proper rendering for all platforms */
#navBottomBar,
#navStopButton {
    /* Force hardware acceleration */
    -webkit-transform: translateZ(0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
    
    /* Ensure proper stacking context */
    -webkit-perspective: 1000;
    perspective: 1000;
    
    /* Fixed positioning - bottom position set by JavaScript */
    position: fixed !important;
    
    /* Ensure elements are clickable and visible */
    pointer-events: auto !important;
    -webkit-touch-callout: none;
    
    /* High z-index to ensure visibility above map */
    z-index: 99999 !important;
    /* OPTIMIZATION: CSS containment for isolated navigation components */
    contain: layout paint;
}

/* Desktop-only fix: Combine centering transform with hardware acceleration */
@media (min-width: 769px) {
    #navBottomBar {
        /* Combine translateX(-50%) for centering with translateZ(0) for hardware acceleration */
        transform: translateX(-50%) translateZ(0);
        -webkit-transform: translateX(-50%) translateZ(0);
    }
}

/* New Zealand Stop Sign Button Hover Effects */
#navExitBtn:hover svg {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

#navExitBtn:active svg {
    transform: scale(0.95);
}

/* Ensure button is tappable on iOS and all mobile devices */
#navExitBtn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation; /* Prevent double-tap zoom and improve touch responsiveness */
    cursor: pointer;
    user-select: none; /* Prevent text selection on touch */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

/* ===== Route Calculation Loading Spinner ===== */
/* Offline connectivity banner (Phase 1) */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    pointer-events: none;
    padding: env(safe-area-inset-top, 0) 12px 0;
}

.offline-indicator-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px auto 0;
    max-width: 520px;
    padding: 10px 14px;
    background: rgba(180, 83, 9, 0.95);
    color: #fff;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.offline-indicator-icon {
    flex-shrink: 0;
}

.route-loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.route-loading-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 32px 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    min-width: 200px;
}

.route-loading-spinner-icon {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #0b5bd3;
    border-radius: 50%;
    animation: route-loading-spin 0.8s linear infinite;
    /* Hardware acceleration */
    -webkit-transform: translateZ(0);
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.route-loading-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    text-align: center;
}

@keyframes route-loading-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .route-loading-content {
        padding: 24px 32px;
        min-width: 180px;
    }
    
    .route-loading-spinner-icon {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    .route-loading-text {
        font-size: 14px;
    }
}


/* ============================================
   Animated Navigation Instruction Box
   ============================================ */

/* Main container - positioned top-left with safe area support */
/* Navigation instruction box - constrained using right positioning to stop before speed HUD */
#navInstructionBox,
.nav-instruction-box {
    position: fixed !important;
    left: 12px !important;
    right: 240px !important; /* CRITICAL: Stop 240px from right edge (12px margin + ~220px speed HUD + 8px gap) */
    top: calc(env(safe-area-inset-top) + 12px) !important;
    z-index: 1300;
    pointer-events: none;
    /* Hidden by default - animated in via JavaScript */
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Visible state - slide in and fade in */
.nav-instruction-box.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    right: 240px !important; /* Maintain constraint to stop before speed HUD */
}

/* Fading out state */
.nav-instruction-box.fading-out {
    opacity: 0;
    transform: translateY(-15px) scale(0.97);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card container with beautiful styling - fills container */
.nav-instruction-card {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 100% !important; /* Fill container */
    max-width: 100% !important; /* Never exceed container */
    min-width: 0 !important; /* Prevent flex expansion */
    box-sizing: border-box !important;
    overflow: hidden !important;
    flex-shrink: 1 !important; /* Allow card to shrink if needed */
}

/* Arrow container - fixed width for consistent layout */
.nav-instruction-arrow-container {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animated arrow bounce on appear */
.nav-instruction-box.visible .nav-instruction-arrow-container {
    animation: arrowBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s;
}

@keyframes arrowBounce {
    0% {
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Bridge marker bounce animation for proximity alert */
@keyframes bridgeMarkerBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* SVG Arrow - animated rotation and color */
.nav-instruction-arrow {
    width: 28px;
    height: 28px;
    color: #ffffff;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.3s ease;
}

/* Arrow directions via CSS transforms */
.nav-instruction-arrow.direction-up {
    transform: rotate(-90deg);
}

.nav-instruction-arrow.direction-down {
    transform: rotate(90deg);
}

.nav-instruction-arrow.direction-left {
    transform: rotate(180deg);
    color: #FF6600; /* Match GPS puck orange */
}

.nav-instruction-arrow.direction-right {
    transform: rotate(0deg);
    color: #FF6600; /* Match GPS puck orange */
}

.nav-instruction-arrow.direction-slight-left {
    transform: rotate(-135deg);
}

.nav-instruction-arrow.direction-slight-right {
    transform: rotate(45deg);
}

.nav-instruction-arrow.direction-sharp-left {
    transform: rotate(-150deg);
}

.nav-instruction-arrow.direction-sharp-right {
    transform: rotate(30deg);
}

.nav-instruction-arrow.direction-uturn {
    transform: rotate(0deg);
    color: #f59e0b;
}

.nav-instruction-arrow.direction-roundabout {
    transform: rotate(0deg);
    color: #8b5cf6;
}

.nav-instruction-arrow.direction-straight {
    transform: rotate(-90deg);
    color: #10b981;
}

/* Text container */
.nav-instruction-text-container {
    flex: 1 1 0 !important; /* Allow flex growth but start from 0 */
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    word-break: break-word !important; /* Force text to wrap */
    position: relative !important; /* Ensure it respects parent bounds */
    box-sizing: border-box !important;
}

/* Instruction text styling */
.nav-instruction-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    color: #ffffff;
    word-wrap: break-word;
    white-space: normal;
    letter-spacing: -0.01em;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    #navInstructionBox,
    .nav-instruction-box {
        left: 8px !important;
        right: 200px !important; /* CRITICAL: Stop 200px from right edge on mobile (8px margin + ~180px speed HUD + 12px gap) */
        top: calc(env(safe-area-inset-top) + 8px) !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    .nav-instruction-card {
        width: 100% !important; /* Fill container */
        max-width: 100% !important; /* Never exceed container */
        box-sizing: border-box !important;
        overflow: hidden !important;
        padding: 14px 16px;
        gap: 12px;
    }
    
    .nav-instruction-arrow-container {
        width: 44px;
        height: 44px;
    }
    
    .nav-instruction-arrow {
        width: 24px;
        height: 24px;
    }
    
    .nav-instruction-text {
        font-size: 16px;
    }
}

/* Dark mode support (if system prefers dark) */
@media (prefers-color-scheme: dark) {
    .nav-instruction-card {
        background: rgba(17, 24, 39, 0.98);
        border-color: rgba(255, 255, 255, 0.12);
    }
}

/* ========== Fleet shell (in-app #/fleet/*) ========== */
.cn-fleet-shell {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    flex-direction: row;
    align-items: stretch;
    background: #0f1419;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    /* Align mobile menu button geometry with main content inset (max-width: 900px) */
    --cn-fleet-mobile-menu-edge-inset: 10px;
    --cn-fleet-mobile-menu-btn-size: 42px;
    --cn-fleet-mobile-menu-content-gap: 12px;
}
.cn-fleet-shell.cn-fleet-shell--visible {
    display: flex;
}
.cn-fleet-mobile-menu-btn {
    display: none;
    position: absolute;
    top: calc(env(safe-area-inset-top) + var(--cn-fleet-mobile-menu-edge-inset));
    left: calc(env(safe-area-inset-left) + var(--cn-fleet-mobile-menu-edge-inset));
    z-index: 72;
    width: var(--cn-fleet-mobile-menu-btn-size);
    height: var(--cn-fleet-mobile-menu-btn-size);
    border: 1px solid #2d3848;
    border-radius: 10px;
    background: #111820;
    color: #e8eef4;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}
.cn-fleet-mobile-menu-icon {
    display: inline-block;
    font-size: 1.2rem;
    line-height: 1;
}
.cn-fleet-mobile-menu-backdrop {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 69;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(5, 8, 12, 0.55);
}
.cn-fleet-sidebar {
    width: 256px;
    min-width: 256px;
    background: #1a222c;
    border-right: 1px solid #2d3848;
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0;
    box-shadow: 1px 0 0 rgba(0, 0, 0, 0.04);
}
.cn-fleet-sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0 0.9rem 0.95rem;
    margin: 0 0.45rem 0.6rem;
    border-bottom: 1px solid #2d3848;
}
.cn-fleet-sidebar-logo {
    height: 50px;
    width: auto;
    max-width: 140px;
    display: block;
    object-fit: contain;
}
.cn-fleet-sidebar-user {
    font-size: 0.82rem;
    color: #8b9aab;
    line-height: 1.35;
    word-break: break-word;
}
.cn-fleet-sidebar-account {
    padding: 0.65rem 1rem 1rem;
    border-bottom: 1px solid #e8e6e1;
    margin-bottom: 0.35rem;
}
.cn-fleet-sidebar-account-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #e8eef4;
}
.cn-fleet-sidebar-account-sub {
    font-size: 0.78rem;
    color: #8b9aab;
    margin-top: 0.2rem;
    word-break: break-word;
}
.cn-fleet-nav {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0 0.75rem;
}
.cn-fleet-nav-item {
    text-align: left;
    border: 0;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    font-size: 1.06rem;
    font-weight: 500;
    color: #e8eef4;
    background: transparent;
    cursor: pointer;
}
.cn-fleet-nav-item:hover {
    background: #263242;
}
.cn-fleet-nav-item.is-active {
    background: #3d8bfd;
    color: #ffffff;
    font-weight: 650;
}
.cn-fleet-sidebar-footer {
    margin-top: auto;
    padding: 0.65rem 0.75rem 0.35rem;
    border-top: 1px solid #2d3848;
}
.cn-fleet-sidebar-logout {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    border: 1px solid #3d4a5c;
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #e8eef4;
    background: #263242;
    cursor: pointer;
}
.cn-fleet-sidebar-logout:hover {
    background: #2f3d52;
    border-color: #4a5d78;
}
.cn-fleet-sidebar-logout:focus-visible {
    outline: 2px solid #3d8bfd;
    outline-offset: 2px;
}
.cn-fleet-triplog-panel {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 1rem 1.25rem 2rem;
    color: #e8eef4;
}
.cn-fleet-triplog-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
}
.cn-fleet-triplog-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.cn-fleet-triplog-btn {
    border: 1px solid #2d3848;
    border-radius: 12px;
    height: 40px;
    padding: 0 18px;
    font-size: 0.95rem;
    font-weight: 650;
    cursor: pointer;
    background: #263242;
    color: #e8eef4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cn-fleet-triplog-btn.is-active {
    background: #3d8bfd;
    border-color: #3d8bfd;
    color: #ffffff;
}
.cn-fleet-triplog-select-wrap {
    display: flex;
    flex-direction: column;
    min-width: 320px;
    max-width: 520px;
    flex: 1;
}
.cn-fleet-triplog-label {
    display: none;
}
.cn-fleet-triplog-select-wrap select {
    width: 100%;
    height: 40px;
    padding: 0 42px 0 14px;
    border: 1px solid #2d3848;
    border-radius: 12px;
    background: #111820;
    color: #e8eef4;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #8b9aab 50%),
        linear-gradient(135deg, #8b9aab 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 17px,
        calc(100% - 12px) 17px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}
.cn-fleet-triplog-results {
    margin-top: 12px;
    border: 1px solid #2d3848;
    border-radius: 12px;
    background: #111820;
    overflow: hidden;
}
.cn-fleet-triplog-message {
    margin: 0;
    padding: 14px 16px;
    color: #8b9aab;
    font-size: 0.9rem;
}
.cn-fleet-triplog-message.is-error {
    color: #ff8b8b;
}
.cn-fleet-triplog-table-wrap {
    overflow-x: auto;
}
.cn-fleet-triplog-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1020px;
}
.cn-fleet-triplog-table thead th {
    text-align: left;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    color: #8b9aab;
    background: #182230;
    border-bottom: 1px solid #2d3848;
    padding: 10px 12px;
    white-space: nowrap;
}
.cn-fleet-triplog-table tbody td {
    font-size: 0.87rem;
    color: #e8eef4;
    border-bottom: 1px solid #1f2a38;
    padding: 9px 12px;
    vertical-align: top;
}
.cn-fleet-triplog-table tbody tr:last-child td {
    border-bottom: 0;
}
.cn-fleet-triplog-cell-main {
    display: block;
    color: #e8eef4;
}
.cn-fleet-triplog-cell-sub {
    display: block;
    margin-top: 2px;
    color: #8b9aab;
    font-size: 0.78rem;
}
.cn-fleet-triplog-col-map {
    vertical-align: middle;
    white-space: nowrap;
}
.cn-fleet-triplog-view-btn {
    font: inherit;
    font-size: 0.8rem;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #3b82f6;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    cursor: pointer;
}
.cn-fleet-triplog-view-btn:hover {
    background: rgba(59, 130, 246, 0.28);
    color: #dbeafe;
}
.cn-fleet-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}
.cn-fleet-dashboard-panel {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 1rem 1.25rem 2rem;
    color: #e8eef4;
}
.cn-fleet-dashboard-panel.hidden {
    display: none !important;
}
.cn-fleet-dashboard-gate {
    max-width: 720px;
}
.cn-fleet-dashboard-inner {
    max-width: 960px;
}
.cn-fleet-dashboard-inner.hidden,
.cn-fleet-dashboard-gate.hidden {
    display: none !important;
}
.cn-fleet-h1 {
    font-size: 1.35rem;
    margin: 0 0 0.5rem;
    color: #e8eef4;
}
.cn-fleet-h2 {
    margin-top: 1rem;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}
.cn-fleet-sub {
    color: #8b9aab;
    font-size: 0.92rem;
    margin: 0 0 1rem;
    line-height: 1.45;
}
.cn-fleet-section {
    background: #1a222c;
    border: 1px solid #2d3848;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}
.cn-fleet-section h2 {
    font-size: 1rem;
    margin: 0 0 0.75rem;
    color: #e8eef4;
}
.cn-fleet-dashboard-panel label {
    display: block;
    font-size: 0.78rem;
    color: #8b9aab;
    margin-bottom: 0.2rem;
}
.cn-fleet-dashboard-panel input,
.cn-fleet-dashboard-panel select {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    border: 1px solid #2d3848;
    background: #111820;
    color: #e8eef4;
    margin-bottom: 0.65rem;
    font-size: 0.95rem;
    box-sizing: border-box;
}
.cn-fleet-dashboard-panel button[type="submit"],
.cn-fleet-dashboard-panel button:not(.cn-fleet-nav-item):not(.btn-trash):not(.cn-fleet-btn-secondary) {
    border: 0;
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    font-weight: 650;
    cursor: pointer;
    background: #3d8bfd;
    color: #fff;
    font-size: 0.9rem;
}
.cn-fleet-btn-secondary {
    border: 1px solid #2d3848 !important;
    border-radius: 10px;
    padding: 0.5rem 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background: #263242 !important;
    color: #e8eef4 !important;
    font-size: 0.88rem;
}
.cn-fleet-btn-secondary:hover {
    background: #324055 !important;
}
.cn-fleet-dashboard-panel .btn-trash {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    margin: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #8b9aab;
    cursor: pointer;
    line-height: 0;
}
.cn-fleet-dashboard-panel .btn-trash:hover {
    color: #c5d0dc;
}
.cn-fleet-dashboard-panel .btn-trash:focus-visible {
    outline: 2px solid #3d8bfd;
    outline-offset: 2px;
}
.cn-fleet-dashboard-panel .btn-trash svg {
    display: block;
}
.cn-fleet-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}
@media (max-width: 640px) {
    .cn-fleet-row2 {
        grid-template-columns: 1fr;
    }
}
.cn-fleet-dashboard-panel .row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}
.cn-fleet-msg {
    margin-top: 0.65rem;
    font-size: 0.9rem;
}
.cn-fleet-msg.err {
    color: #f87171;
}
.cn-fleet-msg.ok {
    color: #4ade80;
}
.cn-fleet-dashboard-panel table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}
.cn-fleet-dashboard-panel th,
.cn-fleet-dashboard-panel td {
    text-align: left;
    padding: 0.45rem 0.35rem;
    border-bottom: 1px solid #e8e6e1;
    vertical-align: top;
}
.cn-fleet-dashboard-panel th {
    color: #8b9aab;
    font-weight: 600;
}
.cn-fleet-plate {
    text-transform: uppercase;
}
.cn-fleet-map-pane {
    display: none;
    flex: 1;
    min-height: 0;
    min-width: 0;
    position: relative;
    transform: translateZ(0);
}
.cn-fleet-map-pane.cn-fleet-map-pane--visible {
    display: flex;
    flex-direction: column;
}
.cn-fleet-shell.cn-fleet-shell--visible .cn-fleet-map-pane.cn-fleet-map-pane--visible .app-view {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
}
.cn-fleet-shell.cn-fleet-shell--visible .cn-fleet-map-pane.cn-fleet-map-pane--visible #mapContainer {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
}
.cn-fleet-shell.cn-fleet-shell--visible .cn-fleet-map-pane.cn-fleet-map-pane--visible #uiOverlay {
    position: absolute !important;
    inset: 0 !important;
}

@media (max-width: 900px) {
    .cn-fleet-mobile-menu-btn {
        display: inline-flex;
    }
    .cn-fleet-main {
        min-width: 0;
    }
    /* Panels with headings only — fleet map pane stays full width under the menu btn */
    .cn-fleet-dashboard-panel,
    .cn-fleet-triplog-panel {
        padding-inline-start: calc(
            env(safe-area-inset-left, 0px) + var(--cn-fleet-mobile-menu-edge-inset) +
                var(--cn-fleet-mobile-menu-btn-size) + var(--cn-fleet-mobile-menu-content-gap)
        );
    }
    .cn-fleet-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(78vw, 280px);
        min-width: min(78vw, 280px);
        z-index: 71;
        transform: translateX(-104%);
        transition: transform 0.2s ease;
        box-shadow: 8px 0 22px rgba(0, 0, 0, 0.4);
    }
    .cn-fleet-shell.cn-fleet-shell--mobile-menu-open .cn-fleet-sidebar {
        transform: translateX(0);
    }
    .cn-fleet-shell.cn-fleet-shell--mobile-menu-open .cn-fleet-mobile-menu-backdrop {
        display: block;
    }
}

/* Keep pills anchored inside Fleet map pane, not viewport/sidebar. */
body.cn-fleet-layout-active .cn-fleet-map-pane.cn-fleet-map-pane--visible #planningRouteSummaryPill {
    position: absolute !important;
    left: 12px !important;
    bottom: 8px !important;
}
body.cn-fleet-layout-active .cn-fleet-map-pane.cn-fleet-map-pane--visible #navBottomBar {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    bottom: 8px !important;
}

/* Active turn-by-turn navigation: hide planning hamburger (JS also toggles inline) */
body.cn-navigating .planning-menu-container {
    display: none !important;
}

.hidden {
    display: none !important;
}

