        * { 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: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; height: 100vh; background: #f5f5f5; }
        .container { display: flex; height: 100vh; overflow: hidden; }
        #map { flex: 1; height: 100%; touch-action: none; }
        
        /* Sidebar */
        .sidebar { width: 350px; background: white; box-shadow: -2px 0 8px rgba(0,0,0,0.1); display: flex; flex-direction: column; overflow-y: auto; }
        .panel { padding: 1.5rem; border-bottom: 1px solid #e0e0e0; }
        .panel h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; color: #333; }
        
        /* Buttons */
        .button-group { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1rem; }
        button { padding: 0.625rem 1rem; border: none; border-radius: 6px; font-weight: 500; cursor: pointer; transition: all 0.2s; font-size: 0.875rem; }
        .btn-primary { background: #0066cc; color: white; }
        .btn-primary:hover { background: #0052a3; }
        .btn-secondary { background: #f0f0f0; color: #333; }
        .btn-secondary:hover { background: #e0e0e0; }
        .btn-danger { background: #dc3545; color: white; }
        .btn-danger:hover { background: #c82333; }
        .btn-success { background: #28a745; color: white; }
        .btn-success:hover { background: #218838; }
        
        /* Waypoints */
        .waypoints-list { max-height: 300px; overflow-y: auto; }
        .waypoint-item { padding: 0.75rem; background: #f8f9fa; border-radius: 6px; margin-bottom: 0.5rem; display: flex; justify-content: space-between; align-items: center; }
        .waypoint-info { flex: 1; }
        .waypoint-label { font-weight: 600; color: #0066cc; margin-bottom: 0.25rem; }
        .waypoint-coords { font-size: 0.75rem; color: #666; font-family: 'Courier New', monospace; }
        .waypoint-altitude { font-size: 0.75rem; color: #666; margin-top: 0.25rem; }
        .remove-btn { padding: 0.25rem 0.5rem; font-size: 0.75rem; background: #dc3545; color: white; border: none; border-radius: 4px; cursor: pointer; }
        .remove-btn:hover { background: #c82333; }
        
        /* Stats */
        .stats { display: grid; gap: 0.75rem; }
        .stat-card { background: #f8f9fa; padding: 0.875rem; border-radius: 6px; border-left: 3px solid #0066cc; }
        .stat-label { font-size: 0.75rem; color: #666; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.25rem; }
        .stat-value { font-size: 1.25rem; font-weight: 600; color: #333; }
        
        /* Toggle switches */
        .toggle-container { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
        .toggle-label { font-size: 0.875rem; color: #666; }
        .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: #0066cc; }
        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: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); font-size: 14px; font-weight: 600; color: #333; z-index: 1000; border: 2px solid #0066cc; }
        @media print { #mapWatermark { display: none !important; } }
        
        /* Info box */
        .info-box { background: #e3f2fd; padding: 0.625rem; border-radius: 4px; margin-bottom: 0.75rem; font-size: 0.813rem; color: #1565c0; border-left: 3px solid #0066cc; }
        
        /* Save panel */
        .save-panel input { width: 100%; padding: 0.625rem; border: 1px solid #ddd; border-radius: 6px; margin-bottom: 0.5rem; font-size: 0.875rem; }
        .saved-plans { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
        .saved-plan { padding: 0.75rem; background: #f8f9fa; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; }
        .saved-plan-name { font-weight: 600; color: #333; }
        .saved-plan-info { font-size: 0.75rem; color: #666; }
        
        /* 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; }

        /* Hide waypoint label boxes when toggled off */
        body.waypoint-labels-hidden .wl-div {
            visibility: hidden !important;
        }

        /* Drawing mode: prevent waypoint labels, leg info labels, and time labels from intercepting clicks */
        body.drawing-mode .wl-div,
        body.drawing-mode .leg-info-label,
        body.drawing-mode .time-label,
        body.drawing-mode .special-airspace-layer,
        body.drawing-mode .ctr-layer {
            pointer-events: none !important;
        }

        /* Previews should never intercept mouse events */
        .preview-leg-info-label,
        .preview-time-marker,
        .preview-line {
            pointer-events: none !important;
        }
