        .ol-attribution { display: none !important; }

        /* ========== Design Tokens (from TGM logo gradient) ========== */
        :root {
            --tgm-primary: #0077b6;
            --tgm-primary-light: #0084ca;
            --tgm-primary-lighter: #e0f4ff;
            --tgm-primary-dark: #005a8c;
            --tgm-green: #00652f;
            --tgm-cyan: #0084ca;
            --tgm-indigo: #5660a8;
            --tgm-pink: #e40052;
            --tgm-bg: #f8fafc;
            --tgm-surface: #ffffff;
            --tgm-border: #e2e8f0;
            --tgm-border-hover: #94a3b8;
            --tgm-text: #1e293b;
            --tgm-text-secondary: #64748b;
            --tgm-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
            --tgm-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
            --tgm-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
            --tgm-shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
            --tgm-radius-sm: 6px;
            --tgm-radius-md: 10px;
            --tgm-radius-lg: 14px;
            --tgm-radius-xl: 20px;
            --tgm-transition-fast: 150ms ease;
            --tgm-transition-normal: 250ms ease;
            --tgm-transition-smooth: 350ms cubic-bezier(0.4, 0, 0.2, 1);
            --tgm-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        }

        * { font-family: var(--tgm-font); }

        /* ========== Phase 1C: New CSS Classes ========== */

        /* Header gradient (matches logo) */
        .tgm-header {
            background: linear-gradient(135deg, var(--tgm-green) 0%, var(--tgm-cyan) 40%, var(--tgm-indigo) 75%, var(--tgm-pink) 100%);
            position: relative;
            overflow: hidden;
        }
        .tgm-header::after {
            content: '';
            position: absolute;
            top: -50%;
            right: -20%;
            width: 200px;
            height: 200px;
            background: rgba(255,255,255,0.06);
            border-radius: 50%;
            pointer-events: none;
        }

        /* Sidebar */
        .tgm-sidebar {
            box-shadow: var(--tgm-shadow-lg);
            border-right: 1px solid var(--tgm-border);
        }

        /* Tabs */
        .tgm-tab {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            flex: 1;
            padding: 10px 8px;
            font-size: 13px;
            font-weight: 500;
            color: var(--tgm-text-secondary);
            border-bottom: 2px solid transparent;
            transition: all var(--tgm-transition-fast);
            cursor: pointer;
            background: none;
        }
        .tgm-tab:hover {
            color: var(--tgm-primary-light);
            background: rgba(0,132,202,0.04);
        }
        .tgm-tab-active {
            color: var(--tgm-primary) !important;
            border-bottom-color: var(--tgm-primary) !important;
            background: var(--tgm-primary-lighter) !important;
            font-weight: 600;
        }
        .tgm-tab svg {
            width: 16px;
            height: 16px;
            flex-shrink: 0;
        }

        /* Filter buttons */
        .tgm-filter-btn {
            flex: 1;
            padding: 7px 12px;
            font-size: 12px;
            font-weight: 600;
            letter-spacing: 0.03em;
            border-radius: var(--tgm-radius-md);
            border: 2px solid var(--tgm-border);
            color: var(--tgm-text-secondary);
            background: var(--tgm-surface);
            transition: all var(--tgm-transition-fast);
            cursor: pointer;
        }
        .tgm-filter-btn:hover {
            border-color: var(--tgm-border-hover);
            background: var(--tgm-bg);
        }
        .tgm-filter-btn-active {
            border-color: var(--tgm-primary) !important;
            background: var(--tgm-primary) !important;
            color: white !important;
            box-shadow: 0 2px 8px rgba(0,119,182,0.3);
        }

        /* Map buttons */
        .tgm-map-btn {
            padding: 10px;
            background: rgba(255,255,255,0.92);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(255,255,255,0.6);
            border-radius: var(--tgm-radius-md);
            transition: all var(--tgm-transition-fast);
            cursor: pointer;
            color: #475569;
        }
        .tgm-map-btn:hover {
            background: rgba(255,255,255,1);
            box-shadow: var(--tgm-shadow-md);
            color: var(--tgm-primary);
        }

        /* Drag handle */
        .tgm-drag-handle {
            width: 48px;
            height: 5px;
            border-radius: 3px;
            background: #cbd5e1;
            transition: background var(--tgm-transition-fast);
        }

        /* ========== Existing classes (upgraded) ========== */
        #map {
            height: 100vh;
            width: 100%;
        }

        .ol-popup {
            position: absolute;
            background-color: white;
            box-shadow: var(--tgm-shadow-xl);
            padding: 16px;
            border-radius: var(--tgm-radius-lg);
            border: 1px solid var(--tgm-border);
            bottom: 12px;
            left: -50px;
            min-width: 280px;
            animation: popupFadeIn 0.25s ease;
        }
        .ol-popup:after, .ol-popup:before {
            top: 100%;
            border: solid transparent;
            content: " ";
            height: 0;
            width: 0;
            position: absolute;
            pointer-events: none;
        }
        .ol-popup:after {
            border-top-color: white;
            border-width: 10px;
            left: 48px;
            margin-left: -10px;
        }
        .ol-popup:before {
            border-top-color: var(--tgm-border);
            border-width: 11px;
            left: 48px;
            margin-left: -11px;
        }
        .ol-popup-closer {
            text-decoration: none;
            position: absolute;
            top: 2px;
            right: 8px;
        }
        .ol-popup-closer:after {
            content: "\2716";
        }

        .schedule-table {
            max-height: calc(100vh - 450px);
            min-height: 150px;
        }

        .line-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 32px;
            height: 28px;
            padding: 0 8px;
            border-radius: var(--tgm-radius-sm);
            font-weight: 700;
            font-size: 13px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.12);
            transition: transform var(--tgm-transition-fast);
        }
        .line-badge:hover {
            transform: scale(1.08);
        }

        .sidebar-scroll {
            height: calc(100vh - 180px);
            overflow-y: auto;
        }

        .line-item {
            border: 1px solid var(--tgm-border);
            border-radius: var(--tgm-radius-md);
            transition: all var(--tgm-transition-fast);
        }
        .line-item:hover {
            background-color: var(--tgm-bg);
            border-color: var(--tgm-primary-light);
            transform: translateX(3px);
            box-shadow: var(--tgm-shadow-sm);
        }

        .stop-item {
            border: 1px solid var(--tgm-border);
            border-radius: var(--tgm-radius-md);
            transition: all var(--tgm-transition-fast);
        }
        .stop-item:hover {
            background-color: var(--tgm-bg);
            border-color: var(--tgm-primary-light);
            transform: translateX(3px);
            box-shadow: var(--tgm-shadow-sm);
        }

        .itinerary-card {
            border: 1px solid var(--tgm-border);
            border-radius: var(--tgm-radius-md);
            transition: all var(--tgm-transition-fast);
        }
        .itinerary-card:hover {
            background-color: #f0f9ff;
            border-color: var(--tgm-primary-light);
            transform: translateY(-2px);
            box-shadow: var(--tgm-shadow-md);
        }

        /* Loading animations */
        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(160deg, #f0faf4 0%, #e0f4ff 40%, #eee8f8 70%, #fef0f4 100%);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 9999;
        }

        /* Logo "writing" reveal animation */
        .loading-logo {
            width: 220px;
            height: auto;
            filter: drop-shadow(0 8px 24px rgba(0,119,182,0.12));
            /* Mask: soft gradient edge that sweeps left-to-right */
            -webkit-mask-image: linear-gradient(to right, #000 30%, transparent 50%);
            mask-image: linear-gradient(to right, #000 30%, transparent 50%);
            -webkit-mask-size: 250% 100%;
            mask-size: 250% 100%;
            -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
            /* Phase 1: write-in (0-2s), Phase 2: gentle float (after 2.5s) */
            animation:
                logoWrite 2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards,
                logoFloat 3s ease-in-out 2.5s infinite;
        }

        @keyframes logoWrite {
            0% {
                -webkit-mask-position: 100% center;
                mask-position: 100% center;
                opacity: 0.6;
            }
            60% {
                opacity: 1;
            }
            100% {
                -webkit-mask-position: 0% center;
                mask-position: 0% center;
                opacity: 1;
            }
        }

        @keyframes logoFloat {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-8px); }
        }

        /* Glow pulse that follows the "pen" during write */
        .loading-logo-glow {
            position: absolute;
            width: 60px;
            height: 120px;
            border-radius: 50%;
            background: radial-gradient(ellipse, rgba(0,132,202,0.25) 0%, transparent 70%);
            pointer-events: none;
            animation: glowSweep 2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
        }

        @keyframes glowSweep {
            0% { left: -10%; opacity: 0; }
            10% { opacity: 1; }
            80% { opacity: 0.6; }
            100% { left: 100%; opacity: 0; }
        }

        /* Dots + status appear after the logo finishes writing */
        .loading-dots {
            display: flex;
            gap: 8px;
            margin-top: 24px;
            opacity: 0;
            animation: fadeIn 0.6s ease forwards 1.8s;
        }
        .loading-dots span {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            animation: dotPulse 1.4s ease-in-out 2s infinite;
        }
        .loading-dots span:nth-child(1) { background: var(--tgm-green); }
        .loading-dots span:nth-child(2) { background: var(--tgm-cyan); animation-delay: 2.15s; }
        .loading-dots span:nth-child(3) { background: var(--tgm-indigo); animation-delay: 2.3s; }
        .loading-dots span:nth-child(4) { background: var(--tgm-pink); animation-delay: 2.45s; }

        .loading-status {
            opacity: 0;
            animation: fadeIn 0.5s ease forwards 2s;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(6px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes dotPulse {
            0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
            40% { transform: scale(1); opacity: 1; }
        }

        .spinner {
            border: 4px solid #f3f3f3;
            border-top: 4px solid #3b82f6;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            animation: spin 1s linear infinite;
        }
        .animate-spin {
            animation: spin 1s linear infinite;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        @keyframes popupFadeIn {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes panelSlideIn {
            from { opacity: 0; transform: translateY(6px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Scrollbar */
        .sidebar-scroll::-webkit-scrollbar {
            width: 4px;
        }
        .sidebar-scroll::-webkit-scrollbar-track {
            background: transparent;
        }
        .sidebar-scroll::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 4px;
        }
        .sidebar-scroll::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

        /* ========== Mobile styles ========== */
        @media (max-width: 768px) {
            .sidebar-scroll {
                height: auto;
                max-height: calc(60vh - 140px);
            }
            .schedule-table {
                max-height: 30vh;
                min-height: 100px;
            }
            .ol-popup {
                min-width: 220px;
                left: -40px;
                padding: 12px;
                font-size: 14px;
            }
            #sidebar {
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
                z-index: 50;
                max-height: 70vh;
                border-radius: var(--tgm-radius-xl) var(--tgm-radius-xl) 0 0;
                box-shadow: 0 -8px 32px rgba(0,0,0,0.12);
                background: rgba(255,255,255,0.96);
                backdrop-filter: blur(20px);
                -webkit-backdrop-filter: blur(20px);
                transition: transform var(--tgm-transition-smooth);
            }
            #sidebar.collapsed {
                transform: translateY(calc(100% - 60px));
            }
            #sidebar-drag-handle {
                display: flex;
            }
            .mobile-header {
                display: flex !important;
            }
            .desktop-header {
                display: none !important;
            }
            #map-legend {
                bottom: 70px;
                left: 8px;
            }
            #map-controls {
                top: 8px;
                right: 8px;
            }
            /* Larger touch targets for mobile */
            .line-item, .stop-item {
                padding: 14px;
            }
            .itinerary-card {
                padding: 14px;
            }
            #itinerary-panel input[type="text"],
            #itinerary-panel input[type="time"],
            #itinerary-panel input[type="date"] {
                padding: 12px;
                font-size: 15px;
            }
            /* Drag handle color when open */
            #sidebar:not(.collapsed) .tgm-drag-handle {
                background: var(--tgm-primary-light);
            }
        }
        @media (min-width: 769px) {
            #sidebar-drag-handle {
                display: none;
            }
            .mobile-header {
                display: none !important;
            }
            .desktop-header {
                display: block !important;
            }
        }
