        :root {
            --bg: #f6f6f8;
            --surface: #ffffff;
            --surface-alt: #f2f2f6;
            --surface-alt-hover: #e7e8ee;
            --border: #e3e4ea;
            --text: #1c1e26;
            --text-secondary: #5c5f6b;
            --text-muted: #93959f;
            --accent: #4f46e5;
            --accent-hover: #4338ca;
            --accent-soft: #eeedfc;
            --danger: #dc3545;
            --danger-hover: #c82333;
            --success: #28a745;
            --success-hover: #218838;
            --radius-sm: 6px;
            --radius-md: 12px;
            --shadow-sm: 0 1px 2px rgba(20, 21, 26, 0.05);
            --shadow-md: 0 6px 20px rgba(20, 21, 26, 0.08);
            --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        }
        * { margin: 0; padding: 0; box-sizing: border-box; }
        #projectionWarning { display:none; position:fixed; top:0; left:0; right:0; z-index:10000; background:#c0392b; color:white; font-weight:600; font-size:13px; text-align:center; padding:8px 16px; box-shadow:0 2px 6px rgba(0,0,0,0.4); }
        .projection-warning-visible .leaflet-top { margin-top: 42px !important; }
        .azm-warning-visible .leaflet-top { margin-top: 42px !important; }
        .leaflet-top { transition: margin-top 0.2s; }
        body { font-family: var(--font); height: 100vh; background: var(--bg); color: var(--text); }
        .container { display: flex; height: 100vh; overflow: hidden; }
        #map { flex: 1; height: 100%; touch-action: none; }

        /* Sidebar */
        .sidebar { width: 360px; background: var(--bg); box-shadow: none; border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; padding: 0.875rem; gap: 0.875rem; }
        .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 1.25rem; }
        .panel h2 { font-size: 0.9375rem; font-weight: 600; margin-bottom: 1rem; color: var(--text); letter-spacing: -0.01em; }

        /* Dashboard tabs: only the active tab's panel(s) are shown at a time,
           replacing the old always-visible stacked-card scroll. */
        .dashboard-tabs { display: flex; flex-wrap: wrap; gap: 0.375rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 0.5rem; }
        .dashboard-tab-btn { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; gap: 0.125rem; font-family: var(--font); background: transparent; color: var(--text-secondary); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 0.5rem 0.375rem; font-size: 0.6875rem; font-weight: 500; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
        .dashboard-tab-icon { font-size: 1.0625rem; line-height: 1; }
        .dashboard-tab-btn:hover { background: var(--surface-alt); }
        .dashboard-tab-btn.active { background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }
        .panel[data-tab] { display: none; }
        .panel[data-tab].tab-active { display: block; }
        /* Folder status notice: only takes up space in the Plans tab when
           there's actually something to say (JS sets/clears its content). */
        #folderStatusNotice:empty { display: none !important; }

        /* Compact form fields (NOTAM Filters and similar dense sub-panels) */
        .notam-field-label { display: block; font-size: 10px; color: #666; margin-bottom: 2px; }
        .notam-field-input { width: 100%; padding: 3px 5px; border: 1px solid #ddd; border-radius: 4px; font-size: 11px; box-sizing: border-box; }

        /* Buttons */
        .button-group { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0.5rem; }
        button { font-family: var(--font); padding: 0.625rem 1rem; border: 1px solid transparent; border-radius: var(--radius-sm); font-weight: 500; cursor: pointer; transition: background-color 0.15s, border-color 0.15s; font-size: 0.875rem; }
        .btn-primary { background: var(--accent); color: white; }
        .btn-primary:hover { background: var(--accent-hover); }
        .btn-secondary { background: var(--surface-alt); color: var(--text); border-color: var(--border); }
        .btn-secondary:hover { background: var(--surface-alt-hover); }
        .btn-danger { background: var(--danger); color: white; }
        .btn-danger:hover { background: var(--danger-hover); }
        .btn-success { background: var(--success); color: white; }
        .btn-success:hover { background: var(--success-hover); }

        /* Form fields (shared by flight-parameter inputs and Display Settings sliders) */
        .field { margin-bottom: 1rem; }
        .field:last-child { margin-bottom: 0; }
        .field-label { display: block; font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
        .field-input { width: 100%; padding: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.875rem; font-family: var(--font); background: var(--surface); color: var(--text); }
        .range-input { width: 100%; cursor: pointer; accent-color: var(--accent); }
        .range-scale { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

        /* Waypoints */
        .waypoints-list { max-height: 300px; overflow-y: auto; }
        .waypoint-item { padding: 0.75rem; background: var(--surface-alt); border-radius: var(--radius-sm); margin-bottom: 0.5rem; display: flex; justify-content: space-between; align-items: center; }
        .waypoint-info { flex: 1; }
        .waypoint-label { font-weight: 600; color: var(--accent); margin-bottom: 0.25rem; }
        .waypoint-coords { font-size: 0.75rem; color: var(--text-secondary); font-family: 'Courier New', monospace; }
        .waypoint-altitude { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.25rem; }
        .remove-btn { padding: 0.25rem 0.5rem; font-size: 0.75rem; background: var(--danger); color: white; border: none; border-radius: 4px; cursor: pointer; }
        .remove-btn:hover { background: var(--danger-hover); }

        /* Stats */
        .stats { display: grid; gap: 0.75rem; }
        .stat-card { background: var(--surface-alt); padding: 0.875rem; border-radius: var(--radius-sm); border-left: 3px solid var(--accent); }
        .stat-label { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.25rem; }
        .stat-value { font-size: 1.25rem; font-weight: 600; color: var(--text); }

        /* Toggle switches */
        .toggle-container { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
        .toggle-label { font-size: 0.875rem; color: var(--text-secondary); }
        .toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
        .toggle-switch input { opacity: 0; width: 0; height: 0; }
        .toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .3s; border-radius: 24px; }
        .toggle-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
        input:checked + .toggle-slider { background-color: var(--accent); }
        input:checked + .toggle-slider:before { transform: translateX(20px); }

        /* Zoom indicator */
        .zoom-indicator { position: fixed; bottom: 20px; left: 20px; background: rgba(255,255,255,0.95); padding: 8px 12px; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); font-size: 14px; font-weight: 600; color: var(--text); z-index: 1000; border: 1px solid var(--border); }
        @media print { #mapWatermark { display: none !important; } }

        /* Info box */
        .info-box { background: var(--accent-soft); padding: 0.625rem; border-radius: 4px; margin-bottom: 0.75rem; font-size: 0.813rem; color: var(--accent-hover); border-left: 3px solid var(--accent); }

        /* Save panel */
        .save-panel input { width: 100%; padding: 0.625rem; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 0.5rem; font-size: 0.875rem; font-family: var(--font); }
        .saved-plans { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
        .saved-plan { padding: 0.75rem; background: var(--surface-alt); border-radius: var(--radius-sm); display: flex; justify-content: space-between; align-items: center; }
        .saved-plan-name { font-weight: 600; color: var(--text); }
        .saved-plan-info { font-size: 0.75rem; color: var(--text-secondary); }

        /* Print styles */
        @media print {
            @page {
                margin: 0;
            }

            /* Ensure Leaflet tiles print correctly */
            .leaflet-tile {
                image-rendering: -webkit-optimize-contrast !important;
            }
        }

        #print-info { display: none; }

        /* Mobile responsive */
        @media (max-width: 768px) {
            .sidebar { width: 100%; max-height: 40vh; position: absolute; bottom: 0; z-index: 1000; }
            .container { flex-direction: column; }
            #map { height: 60vh; }
            .button-group { grid-template-columns: 1fr; }
        }
            .coord-tooltip {
            background: rgba(0, 0, 0, 0.8) !important;
            color: white !important;
            border: none !important;
            border-radius: 4px !important;
            padding: 8px !important;
            font-size: 12px !important;
            box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
        }

        .coord-cursor-mode {
            cursor: crosshair !important;
        }

        .coord-mode-active {
            cursor: crosshair !important;
        }
        /* Ensure popups and sidebar are always above fixed-position labels */
        .leaflet-popup-pane { z-index: 700 !important; }
        .sidebar { z-index: 1000 !important; position: relative; }
        #sidebar { z-index: 1000 !important; }
