@font-face {
    font-family: 'Switzer';
    src: url('https://cdn.fontshare.com/wf/BLNB4FAQFNK56DWWNF7PMGTCOTZHOEII/ST3WKSSDMBK2MIQQO3MAVYWLF4FTOLFV/6IN5WOLRCYP4G4MOCOHOMXNON6Q7MDAR.woff2') format('woff2'),
         url('https://cdn.fontshare.com/wf/BLNB4FAQFNK56DWWNF7PMGTCOTZHOEII/ST3WKSSDMBK2MIQQO3MAVYWLF4FTOLFV/6IN5WOLRCYP4G4MOCOHOMXNON6Q7MDAR.woff') format('woff'),
         url('https://cdn.fontshare.com/wf/BLNB4FAQFNK56DWWNF7PMGTCOTZHOEII/ST3WKSSDMBK2MIQQO3MAVYWLF4FTOLFV/6IN5WOLRCYP4G4MOCOHOMXNON6Q7MDAR.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
    font-style: normal;
}
@font-face {
    font-family: 'Switzer';
    src: url('https://cdn.fontshare.com/wf/OYB4CXKJQXKTNSLJMTDQOIVUL2V5EL7S/WYO2P7DQVV5RNXGMCUO2HL4RJP4VFUAS/6XPIMU23OJVRY676OG5YVJMWEHWICATX.woff2') format('woff2'),
         url('https://cdn.fontshare.com/wf/OYB4CXKJQXKTNSLJMTDQOIVUL2V5EL7S/WYO2P7DQVV5RNXGMCUO2HL4RJP4VFUAS/6XPIMU23OJVRY676OG5YVJMWEHWICATX.woff') format('woff'),
         url('https://cdn.fontshare.com/wf/OYB4CXKJQXKTNSLJMTDQOIVUL2V5EL7S/WYO2P7DQVV5RNXGMCUO2HL4RJP4VFUAS/6XPIMU23OJVRY676OG5YVJMWEHWICATX.ttf') format('truetype');
    font-weight: 500;
    font-display: swap;
    font-style: normal;
}
@font-face {
    font-family: 'Switzer';
    src: url('https://cdn.fontshare.com/wf/5SZVFDB7V52TI6ULVC6J3WQZQCIZVDV5/ODYPSTCUDMKSTYIPTV4CLQ7URIK7XYBJ/YS3VPNVO4B3TOJMEXDGFZQ4TLZGGSRZC.woff2') format('woff2'),
         url('https://cdn.fontshare.com/wf/5SZVFDB7V52TI6ULVC6J3WQZQCIZVDV5/ODYPSTCUDMKSTYIPTV4CLQ7URIK7XYBJ/YS3VPNVO4B3TOJMEXDGFZQ4TLZGGSRZC.woff') format('woff'),
         url('https://cdn.fontshare.com/wf/5SZVFDB7V52TI6ULVC6J3WQZQCIZVDV5/ODYPSTCUDMKSTYIPTV4CLQ7URIK7XYBJ/YS3VPNVO4B3TOJMEXDGFZQ4TLZGGSRZC.ttf') format('truetype');
    font-weight: 600;
    font-display: swap;
    font-style: normal;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font-body) !important; font-family: var(--font-body) !important; font-family: var(--font-body) !important; }

        :root {

            --ink: #0E1B33; --ink-soft: #5C6B8A; --ink-faint: #93A2C2;
            --primary: #2451C4; --primary-dark: #15306B; --primary-soft: #EAF0FC;
            --surface: #F3F6FC; --card: #FFFFFF; --border: #DCE6F5;
            --success: #15A567; --success-soft: #E5F7EE;
            --danger: #E0483B; --danger-soft: #FCEAE8; --accent: #F5A623; --accent-soft: #FEF3C7;
            --radius-sm: 8px; --radius-md: 14px; --radius-lg: 20px;
            --shadow-md: 0 10px 28px rgba(20, 40, 90, 0.12);
            --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        
            /* Liquid Glass Variables */
            --glass-bg: rgba(255, 255, 255, 0.75);
            --glass-blur: blur(24px) saturate(180%);
            --glass-border: 1px solid rgba(255, 255, 255, 0.6);

            --drawer-bg: rgba(255, 255, 255, 0.98);
            --bottom-nav-bg: rgba(255, 255, 255, 0.45);
            --bottom-nav-border: 1px solid rgba(255, 255, 255, 0.55);
            --icon-btn-bg: rgba(255, 255, 255, 0.5);
            --drawer-item-border: 1px solid rgba(14, 27, 51, 0.05);
        }

        :root.dark-theme {
            --ink: #FFFFFF; --ink-soft: #A1A1AA; --ink-faint: #71717A;
            --surface: #000000; --card: #0D0D11; --border: rgba(255, 255, 255, 0.12);
            --primary-soft: rgba(36, 81, 196, 0.2);
            --danger-soft: rgba(224, 72, 59, 0.15);
            --success-soft: rgba(21, 165, 103, 0.15);
            --accent-soft: rgba(245, 166, 35, 0.15);
            --glass-bg: rgba(0, 0, 0, 0.85); --glass-border: 1px solid rgba(255, 255, 255, 0.12);
            --drawer-bg: rgba(6, 6, 8, 0.96);
            --bottom-nav-bg: rgba(0, 0, 0, 0.65);
            --bottom-nav-border: 1px solid rgba(255, 255, 255, 0.15);
            --icon-btn-bg: rgba(255, 255, 255, 0.08);
            --drawer-item-border: 1px solid rgba(243, 246, 252, 0.05);
        }

        html, body { height: 100%; width: 100%; margin: 0; padding: 0; overflow: hidden; background: var(--surface); }
        body { font-family: var(--font-body); color: var(--ink); display: flex; flex-direction: column; }
        svg { display: block; }
        button, select, a, input, textarea { font-family: inherit !important; }

        /* HEADER */
        .dash-header {
            background: #FFFFFF !important;
            padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border) !important;
            box-shadow: var(--shadow-sm); z-index: 1200; flex-shrink: 0; height: 60px; position: relative;
        }
        .brand { display: flex; align-items: center; gap: 10px; }
        .brand-mark { display: flex; align-items: center; justify-content: center; border-radius: 10px; box-shadow: 0 4px 10px rgba(36, 81, 196, 0.35); }
        .menu-btn-top { display: none !important; }
        .icon-btn { background: var(--icon-btn-bg); color: var(--ink); width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 1px solid var(--border); transition: all 0.2s ease; position: relative; }
        .icon-btn:hover { background: var(--border); }
        .floating-header-menu {
            position: fixed; top: 0; right: -280px; width: 280px; height: 100%;
            background: var(--drawer-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
            border-left: 1px solid var(--border); box-shadow: -4px 0 24px rgba(0,0,0,0.15); 
            padding: 24px 16px 80px; z-index: 9999; display: flex; flex-direction: column; gap: 4px;
            transition: right 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); overflow-y: auto;
            -ms-overflow-style: none; scrollbar-width: none;
        }
        .floating-header-menu::-webkit-scrollbar { display: none; }
        .floating-header-menu.active { right: 0 !important; }
        .floating-header-menu .menu-item {
            display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 12px;
            cursor: pointer; transition: all 0.2s; text-decoration: none;
            border-bottom: var(--drawer-item-border);
            margin-bottom: 4px;
        }
        .floating-header-menu .menu-item:hover {
            background: var(--surface);
        }
        .floating-header-menu .menu-icon {
            width: 36px; height: 36px; background: var(--surface); border-radius: 10px;
            display: flex; align-items: center; justify-content: center; color: var(--ink-soft);
            transition: 0.2s; flex-shrink: 0;
        }
        .floating-header-menu .menu-item svg {
            transition: color 0.2s;
        }
        .floating-header-menu .menu-item:hover .menu-icon {
            background: var(--primary-soft); color: var(--theme-accent-text);
        }
        .floating-header-menu .menu-text {
            flex: 1; font-size: 14px; font-weight: 600; color: var(--ink);
        }
        .floating-header-menu .menu-item.active {
            background: var(--primary-soft);
            border-bottom-color: transparent;
        }
        .floating-header-menu .menu-item.active .menu-icon {
            background: var(--primary); color: white;
        }
        .floating-header-menu .menu-item.active .menu-text {
            color: var(--theme-accent-text); font-weight: 700;
        }
        
        .floating-header-menu .sub-item {
            padding: 10px 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
            background: transparent; border-radius: 8px;
        }
        .floating-header-menu .sub-item:hover {
            background: rgba(14, 27, 51, 0.04); color: var(--ink);
        }
        .floating-header-menu .sub-item.danger-item {
            color: var(--status-danger-text);
        }
        .floating-header-menu .sub-item.danger-item:hover {
            background: var(--danger-soft);
        }
        .menu-item.danger-item { color: var(--status-danger-text); background: var(--danger-soft); }
        .menu-item.danger-item:hover { background: #FCD9D6; }
        .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
        .brand-text .title { font-family: var(--font-display) !important; font-weight: 700; font-size: 15px; }
        .brand-text .live-badge {
    flex-shrink: 0 !important;
    white-space: nowrap !important; display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; color: var(--theme-accent-text); }
        
        .header-actions { display: flex; align-items: center; gap: 12px; }
        .desktop-nav { display: flex; gap: 6px; }
        .desktop-nav .nav-btn { text-decoration: none; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); padding: 10px 16px; border-radius: 10px; transition: 0.2s; cursor: pointer; display: flex; align-items: center; gap: 6px; font-family: var(--font-body) !important; }
        .desktop-nav .nav-btn:hover { background: var(--primary-soft); color: var(--theme-accent-text); }
        .desktop-nav .nav-btn.active { background: #FFFFFF; color: var(--theme-accent-text); box-shadow: 0 4px 12px rgba(36,81,196,0.08); border: 1px solid rgba(36, 81, 196, 0.1); }
        .desktop-nav svg { width: 18px; height: 18px; }
        
        /* CONTENT LAYOUT */
        .dash-content { flex: 1; display: flex; position: relative; overflow: hidden; }
        .map-container-wrapper { flex: 1; height: 100%; position: relative; z-index: 1; overflow: hidden; }
        .map-container-wrapper > #uuTopInstallBar {
            position: absolute !important;
            top: 12px !important;
            left: 12px !important;
            right: 12px !important;
            width: calc(100% - 24px) !important;
            max-width: 420px !important;
            margin: 0 auto !important;
            z-index: 1100 !important;
            pointer-events: auto !important;
        }
        #map { width: 100%; height: 100%; background: #e5eaf5; z-index: 1; filter: none !important; -webkit-filter: none !important; }
        #map .leaflet-tile, #map .leaflet-tile-pane, #map .leaflet-layer, #map .leaflet-container {
            filter: none !important;
            -webkit-filter: none !important;
        }

        /* SIDEBAR / CONTROLS (Responsive Drawer Style) */
        .history-sidebar { 
            width: 360px; background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
            border-left: var(--glass-border); display: flex; flex-direction: column; z-index: 999; flex-shrink: 0; 
            box-shadow: var(--shadow-md); position: absolute; right: 0; top: 0; bottom: 0; 
        }
        .history-sidebar::before { content: ''; position: absolute; inset: 0; background: linear-gradient(170deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 40%); pointer-events: none; z-index: 0; }
        
        .drag-handle-wrap { display: none; }
        .bus-list-wrapper { display: flex; flex-direction: column; overflow-y: auto; flex: 1; padding: 20px; z-index: 2; -ms-overflow-style: none; scrollbar-width: none; }
        .bus-list-wrapper::-webkit-scrollbar { display: none; }

        .control-group { margin-bottom: 18px; }
        .control-label { font-size: 11px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; display: block; }
        .glass-select { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 12px; font-size: 13px; font-weight: 600; background: rgba(255,255,255,0.9); color: var(--ink); outline: none; appearance: none; box-shadow: 0 2px 8px rgba(14,27,51,0.04); cursor: pointer; }
        .glass-select:focus { border-color: var(--primary); }
        
        .action-btn { width: 100%; padding: 14px; border-radius: 12px; font-size: 13px; font-weight: 700; color: #fff; background: var(--primary); border: none; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 4px 12px rgba(36, 81, 196, 0.25); display: flex; justify-content: center; align-items: center; gap: 8px; }
        .action-btn:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(36, 81, 196, 0.35); }
        .action-btn:disabled { background: var(--ink-faint); cursor: not-allowed; transform: none; box-shadow: none; }

        /* INSIGHTS CARDS */
        .insight-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-bottom: 16px; box-shadow: 0 4px 16px rgba(14,27,51,0.04); }
        .insight-header { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
        .insight-header svg { color: var(--theme-accent-text); }
        
        .insight-stat { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 12px; }
        .insight-stat:last-child { border-bottom: none; padding-bottom: 0; }
        .insight-stat span { color: var(--ink-soft); font-weight: 500; }
        .insight-stat b { color: var(--ink); font-weight: 700; }

        .stop-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
        .stop-item:last-child { border-bottom: none; }
        .stop-icon { width: 30px; height: 30px; border-radius: 11px; background: linear-gradient(135deg, #FFF7ED, #FEF3C7); color: #B45309; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 850; border: 1px solid rgba(245,166,35,0.28); box-shadow: 0 4px 10px rgba(245,166,35,0.14); }
        .stop-details { display: flex; flex-direction: column; gap: 2px; }
        .stop-title { font-size: 12px; font-weight: 700; color: var(--ink); }
        .stop-meta { font-size: 10px; font-weight: 600; color: var(--ink-soft); }

        .empty-state { text-align: center; padding: 30px 10px; color: var(--ink-soft); font-size: 13px; font-weight: 500; line-height: 1.5; background: var(--icon-btn-bg); border-radius: 16px; border: 1px dashed var(--border); }
        .empty-state svg { margin: 0 auto 12px; color: var(--ink-faint); }

        /* MARKERS */
        .stop-marker { width: 30px; height: 30px; background: linear-gradient(135deg, #FFF7ED, #FEF3C7); border: 2px solid #F59E0B; border-radius: 12px; box-shadow: 0 6px 16px rgba(245, 166, 35, 0.28); display: flex; align-items: center; justify-content: center; color: #92400E; font-weight: 900; font-size: 11px; position: relative; }
        .stop-marker::after { content: ''; position: absolute; inset: -5px; border: 1px solid rgba(245, 158, 11, 0.25); border-radius: 15px; }
        .stop-marker span { position: relative; z-index: 1; }

        /* Premium Bus Marker CSS */
        .leaflet-premium-direction-node {
            pointer-events: none !important;
        }
        .leaflet-premium-direction-node .bus-node-tag,
        .leaflet-premium-direction-node .bus-node-ring {
            pointer-events: auto !important;
        }
        .university-marker-wrapper {
            pointer-events: none !important;
        }
        .university-marker-wrapper .university-marker-node,
        .university-marker-wrapper .bus-node-tag {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
            pointer-events: auto !important;
        }
        .premium-bus-marker-node { display: flex; flex-direction: column; align-items: center; position: relative; pointer-events: none; transition: opacity 0.3s ease; }
        .bus-node-tag {
    flex-shrink: 0 !important; font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 600; padding: 4px 8px; border-radius: 6px; white-space: nowrap; margin-bottom: 4px; pointer-events: auto; backdrop-filter: blur(8px); text-align: center; border: 1px solid rgba(255,255,255,0.2); transition: all 0.3s ease; color: #fff; }
        
        .premium-bus-marker-node.moving .bus-node-tag {
    flex-shrink: 0 !important;
    white-space: nowrap !important; background: rgba(36, 81, 196, 0.9); box-shadow: 0 2px 8px rgba(36, 81, 196, 0.4); }
        .premium-bus-marker-node.idle .bus-node-tag {
    flex-shrink: 0 !important;
    white-space: nowrap !important; background: rgba(245, 166, 35, 0.95); box-shadow: 0 2px 8px rgba(245, 166, 35, 0.4); text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
        .premium-bus-marker-node.inactive .bus-node-tag {
    flex-shrink: 0 !important;
    white-space: nowrap !important; background: rgba(148, 163, 184, 0.9); box-shadow: 0 2px 8px rgba(148, 163, 184, 0.3); }
        .zoomed-out .bus-node-tag {
    flex-shrink: 0 !important;
    white-space: nowrap !important; opacity: 0 !important; transform: scale(0.5) translateY(10px) !important; pointer-events: none !important; }
        .zoomed-out .university-marker-wrapper { opacity: 0 !important; pointer-events: none !important; transition: opacity 0.3s ease; }

        .bus-node-ring { position: relative; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; pointer-events: auto; }
        .pulse-ring { position: absolute; width: 100%; height: 100%; border-radius: 50%; pointer-events: none; opacity: 0; transform: scale(0.5); transition: all 0.3s ease; }
        .moving .pulse-ring { border: 1px solid rgba(59, 130, 246, 0.6); box-shadow: 0 0 8px rgba(59, 130, 246, 0.4); animation: busLivePulse 2s cubic-bezier(0.25, 0, 0, 1) infinite; }
        .idle .pulse-ring, .inactive .pulse-ring { display: none; }
        .pulse-ring.delay { animation-delay: 1s; }
        @keyframes busLivePulse { 0% { transform: scale(0.4); opacity: 0.9; } 50% { opacity: 0.4; } 100% { transform: scale(1.6); opacity: 0; } }
        .bus-node-rotor { position: absolute; z-index: 2; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); }

        /* University Marker Styles */
        .university-marker-wrapper { background: transparent; border: none; }
        .university-marker-node { position: relative; display: flex; align-items: flex-end; justify-content: center; width: 46px; height: 58px; pointer-events: auto; transition: transform 0.2s ease; }
        .university-marker-node:hover { transform: translateY(-3px) scale(1.05); }
        .university-marker-pulse { position: absolute; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; background: rgba(21, 48, 107, 0.25); animation: uniPulse 2.2s ease-out infinite; z-index: -1; }
        @keyframes uniPulse { 0% { transform: scale(0.6); opacity: 0.7; } 100% { transform: scale(2.6); opacity: 0; } }

        /* LEGEND */
        .map-legend { background: var(--glass-bg); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-border); padding: 8px 12px; border-radius: 10px; box-shadow: var(--shadow-md); font-size: 11px; font-weight: 700; color: var(--ink); line-height: 1.6; z-index: 1000; }
        .legend-item { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
        .legend-item:last-child { margin-bottom: 0; }
        .legend-color { width: 16px; height: 4px; border-radius: 2px; }

        @media (max-width: 768px) {
            .map-legend {
                position: fixed !important;
                top: 70px !important;
                left: 10px !important;
                bottom: auto !important;
                right: auto !important;
                padding: 7px 9px !important;
                line-height: 1.3 !important;
                box-shadow: 0 4px 12px rgba(14, 27, 51, 0.15) !important;
                z-index: 1000 !important;
            }
            .map-legend .legend-item {
                gap: 6px;
                margin-bottom: 2px;
            }
            .desktop-nav { display: none; }
            .history-sidebar { 
                position: fixed; top: auto !important; 
                bottom: calc(60px + env(safe-area-inset-bottom, 12px) + 6px);
                left: 10px; right: 10px; width: auto; height: auto; border-right: none; border-radius: 20px; 
                background: var(--glass-bg); backdrop-filter: blur(26px) saturate(180%); -webkit-backdrop-filter: blur(26px) saturate(180%);
                border: var(--bottom-nav-border);
                box-shadow: inset 0 1px 1px rgba(255,255,255,0.1), 0 -10px 30px rgba(20,40,90,0.15); 
                z-index: 1100; overflow: hidden; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); display: flex; flex-direction: column;
            }
            .drag-handle-wrap { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 8px 0 4px; cursor: pointer; position: relative; z-index: 2; }
            .drag-handle { width: 40px; height: 4px; background: var(--border); border-radius: 10px; }
            .pull-indicator { display: flex !important; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; color: var(--theme-accent-text); background: var(--primary-soft); padding: 4px 12px; border-radius: 100px; animation: gentleBounce 2s infinite; }
            @keyframes gentleBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(2px); } }
            .history-sidebar.expanded .pull-indicator { animation: none; }
            .history-sidebar.expanded .pull-indicator svg { transform: rotate(180deg); }
            
            .bus-list-wrapper { max-height: 0px; padding: 0 !important; overflow: hidden; transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
            .history-sidebar.expanded .bus-list-wrapper { max-height: 55vh; padding: 0 16px 16px !important; overflow-y: auto !important; }
            .leaflet-bottom { bottom: calc(75px + env(safe-area-inset-bottom, 12px)) !important; }
            .bottom-nav { position: fixed; bottom: env(safe-area-inset-bottom, 12px); left: 12px; right: 12px; height: 60px; border-radius: 20px; background: var(--bottom-nav-bg); backdrop-filter: blur(28px) saturate(190%); -webkit-backdrop-filter: blur(28px) saturate(190%); border: var(--bottom-nav-border); box-shadow: 0 12px 36px rgba(20,40,90,0.20); z-index: 1200; display: flex; }
            .nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink-faint); font-size: 10.5px; font-weight: 600; gap: 4px; cursor: pointer; position: relative; z-index: 1; }
            .nav-item.active { color: var(--theme-accent-text); font-weight: 700; }
            .nav-item.active::before { content: ''; position: absolute; inset: 4px 16px; border-radius: 14px; background: rgba(36,81,196,0.12); z-index: -1; }
            .nav-item svg { width: 22px; height: 22px; }
            .dash-content { 
                position: absolute;
                top: 60px; left: 0; right: 0; bottom: 0;
                display: block !important;
                width: 100% !important;
                height: calc(100% - 60px) !important;
                overflow: hidden !important;
            }
            .map-container-wrapper {
                width: 100% !important;
                height: 100% !important;
                position: relative !important;
            }
            #map {
                width: 100% !important;
                height: 100% !important;
            }
            #uuTopInstallBar {
                position: absolute !important;
                top: 10px !important;
                left: 10px !important;
                right: 10px !important;
                width: auto !important;
                max-width: calc(100% - 20px) !important;
                z-index: 1001 !important;
                margin: 0 !important;
            }
            .menu-btn-top { display: flex !important; }
        }
        
        @media (min-width: 769px) {
            .bottom-nav { display: none !important; }
            .menu-btn-top { display: none !important; }
            .floating-header-menu { display: none !important; }
            /* Desktop: side-by-side — map fills left, sidebar fixed 360px right */
            .dash-content {
                flex-direction: row;
                position: absolute;
                top: 60px; left: 0; right: 0; bottom: 0;
            }
            .map-container-wrapper { flex: 1; height: 100%; }
            .history-sidebar {
                position: relative !important;
                top: auto !important; right: auto !important; bottom: auto !important; left: auto !important;
                width: 360px !important; min-width: 360px !important;
                height: 100% !important;
                flex-shrink: 0;
                transform: none !important;
                display: flex !important;
                flex-direction: column;
                overflow-y: auto !important;
                overflow-x: hidden !important;
            }
        }
        
        /* Prevent custom dropdowns from being clipped */
        .custom-dropdown-wrap { overflow: visible !important; }
        /* Custom Premium Dropdown styles */
        .custom-dropdown-wrap { position: relative; width: 100%; z-index: 100; margin-bottom: 2px; }
        .custom-dropdown-wrap.open { z-index: 9999; }
        
        .custom-dropdown-trigger {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: #FFF; padding: 12px 16px; border-radius: var(--radius-md); font-size: 13.5px; font-weight: 700;
            display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 12px rgba(36, 81, 196, 0.2); cursor: pointer; transition: transform 0.2s;
            font-family: var(--font-body);
        }
        .days-dropdown-trigger {
            background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%) !important;
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25) !important;
        }
        .custom-dropdown-trigger:active { transform: scale(0.98); }
        .custom-dropdown-trigger::after { content: '▾'; font-size: 16px; transition: transform 0.2s ease; }
        .custom-dropdown-wrap.open .custom-dropdown-trigger::after { transform: rotate(180deg); }

        .custom-dropdown-list {
            display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
            background: var(--drawer-bg); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
            border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); 
            max-height: 250px; overflow-y: auto; z-index: 10000;
            font-family: var(--font-body);
            scrollbar-width: none;
        }
        .custom-dropdown-list::-webkit-scrollbar {
            display: none;
        }
        .custom-dropdown-wrap.open .custom-dropdown-list { 
            display: grid !important; 
            grid-template-columns: repeat(4, 1fr); 
            gap: 8px; 
            padding: 12px; 
        }
        
        .custom-dropdown-option { 
            padding: 10px 8px; 
            font-size: 12.5px; 
            font-weight: 700; 
            color: var(--ink-soft); 
            background: var(--surface); 
            border: 1px solid var(--border); 
            border-radius: 8px; 
            cursor: pointer; 
            transition: all 0.2s ease; 
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: var(--font-body); 
        }
        .custom-dropdown-option:first-child {
            grid-column: span 4;
            font-size: 13.5px;
            padding: 12px;
        }
        .custom-dropdown-option:hover { 
            background: var(--primary-soft); 
            border-color: var(--primary) !important;
            color: var(--theme-accent-text); 
        }
        .custom-dropdown-option.active { 
            background: var(--primary) !important; 
            border-color: var(--primary) !important;
            color: #FFF !important; 
            box-shadow: 0 4px 10px rgba(36,81,196,0.25);
            font-weight: 700; 
        }

        @media (max-width: 768px) {
            .custom-dropdown-list {
                position: fixed !important;
                top: auto !important;
                bottom: 85px !important;
                left: 20px !important;
                right: 20px !important;
                width: auto !important;
                max-height: 220px !important;
                z-index: 999999 !important;
                box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
            }
        }
    
        /* Premium Dark mode bottom nav overrides */
        .dark-theme .bottom-nav .nav-item {
            color: rgba(255, 255, 255, 0.45) !important;
        }
        .dark-theme .bottom-nav .nav-item.active {
            color: #FFFFFF !important;
        }
        .dark-theme .bottom-nav .nav-item.active::before {
            background: rgba(255, 255, 255, 0.14) !important;
        }

    
        @media (max-width: 768px) {
            /* desktop-theme-btn removed */
        }

    
        /* Premium active/hover navigation button overrides for dark theme */
        .dark-theme .desktop-nav .nav-btn:hover {
            background: var(--primary-soft) !important;
            color: var(--theme-accent-text) !important;
        }
        .dark-theme .desktop-nav .nav-btn.active {
            background: var(--primary) !important;
            color: #FFFFFF !important;
            box-shadow: 0 4px 14px rgba(36, 81, 196, 0.4) !important;
            border: none !important;
        }

    


        /* Custom Premium Zoom Controls */
        .leaflet-bar {
            border: 1px solid var(--border) !important;
            box-shadow: var(--shadow-md) !important;
            border-radius: 12px !important;
            overflow: hidden;
            background: var(--glass-bg) !important;
            backdrop-filter: var(--glass-blur) !important;
            -webkit-backdrop-filter: var(--glass-blur) !important;
        }
        .leaflet-bar a {
            background: transparent !important;
            color: var(--ink) !important;
            border-bottom: 1px solid var(--border) !important;
            width: 36px !important;
            height: 36px !important;
            line-height: 36px !important;
            font-size: 18px !important;
            font-weight: 700 !important;
            transition: all 0.2s ease !important;
        }
        .leaflet-bar a:last-child {
            border-bottom: none !important;
        }
        .leaflet-bar a:hover {
            background: var(--primary-soft) !important;
            color: var(--theme-accent-text) !important;
        }

        .dark-theme .empty-state {
            background: #0E0E12 !important;
            border-color: rgba(255, 255, 255, 0.12) !important;
        }

        .dark-theme .history-sidebar {
            box-shadow: inset 0 1px 1px rgba(255,255,255,0.05), 0 -10px 30px rgba(0,0,0,0.45) !important;
        }

        /* Dark theme history sidebar overlay override */
        .dark-theme .history-sidebar::before {
            background: linear-gradient(170deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 40%) !important;
        }

        /* Dark theme glass select inputs */
        .dark-theme .glass-select {
            background: #141418 !important;
            border-color: rgba(255, 255, 255, 0.14) !important;
            color: #FFFFFF !important;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
        }
        .dark-theme input {
            color-scheme: dark;
        }

        /* Dark theme header glassmorphism override */
        .dark-theme .dash-header {
            background: var(--glass-bg) !important;
            border-bottom: var(--glass-border) !important;
            backdrop-filter: var(--glass-blur) !important;
            -webkit-backdrop-filter: var(--glass-blur) !important;
        }
        
        /* Force Brand Font Overrides */
        *, *::before, *::after {
            font-family: var(--font-body) !important;
        }
        button, select, a, input, textarea {
            font-family: inherit !important;
        }
        .brand-text .title {
            font-family: var(--font-display) !important;
        }
        .desktop-nav .nav-btn {
            font-family: var(--font-body) !important;
            font-size: 13px !important;
            font-weight: 600 !important;
        }
        
    
        /* Prevent transitions on page load */
        .preload * {
            -webkit-transition: none !important;
            -moz-transition: none !important;
            -ms-transition: none !important;
            -o-transition: none !important;
            transition: none !important;
        }

        /* Custom Premium Slider Styles */
        .premium-slider-wrap {
            background: rgba(255, 255, 255, 0.4);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 14px 16px 12px;
            box-shadow: inset 0 1px 2px rgba(0,0,0,0.01), 0 2px 6px rgba(14,27,51,0.02);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }
        .dark-theme .premium-slider-wrap {
            background: rgba(14, 27, 51, 0.3);
            border-color: var(--border);
        }
        
        .premium-slider {
            -webkit-appearance: none;
            width: 100%;
            height: 6px;
            border-radius: 3px;
            background: var(--border);
            outline: none;
            cursor: pointer;
            transition: background 0.3s;
        }
        .range-ticks {
            position: relative;
            height: 16px;
            margin-top: 8px;
            font-size: 10px;
            color: var(--ink-soft);
            font-weight: 700;
        }
        .range-ticks span {
            position: absolute;
            top: 0;
            transform: translateX(-50%);
            white-space: nowrap;
            line-height: 1.2;
            text-align: center;
        }
        
        .premium-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            border: 2px solid #FFFFFF;
            box-shadow: 0 3px 8px rgba(36, 81, 196, 0.3);
            cursor: pointer;
            transition: transform 0.1s ease, box-shadow 0.1s ease;
        }
        .premium-slider::-webkit-slider-thumb:hover {
            transform: scale(1.15);
            box-shadow: 0 4px 12px rgba(36, 81, 196, 0.45);
        }
        .premium-slider::-webkit-slider-thumb:active {
            transform: scale(1.05);
        }
        
        .premium-slider::-moz-range-thumb {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            border: 2px solid #FFFFFF;
            box-shadow: 0 3px 8px rgba(36, 81, 196, 0.3);
            cursor: pointer;
            transition: transform 0.1s ease, box-shadow 0.1s ease;
        }
        .premium-slider::-moz-range-thumb:hover {
            transform: scale(1.15);
            box-shadow: 0 4px 12px rgba(36, 81, 196, 0.45);
        }
        
        /* Dark theme thumb override */
        .dark-theme .premium-slider::-webkit-slider-thumb {
            border-color: var(--card);
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
        }
        .dark-theme .premium-slider::-moz-range-thumb {
            border-color: var(--card);
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
        }

        .clear-select-btn {
            position: absolute;
            top: 96px;
            right: 10px;
            left: auto;
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--card);
            border: 1px solid rgba(36, 81, 196, 0.24);
            color: var(--theme-accent-text);
            width: 38px;
            height: 38px;
            padding: 0;
            border-radius: 12px;
            font-family: var(--font-body);
            cursor: pointer;
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.72),
                0 8px 20px rgba(14, 27, 51, 0.18);
            transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
        }
        .clear-select-btn:hover {
            background: var(--primary);
            border-color: var(--primary);
            color: #FFFFFF;
            transform: translateY(-2px);
        }
        .clear-select-btn:active {
            transform: translateY(0) scale(0.94);
        }
        .clear-select-btn:focus-visible {
            outline: 3px solid rgba(36, 81, 196, 0.22);
            outline-offset: 3px;
        }
        .clear-select-btn svg {
            stroke: currentColor;
            pointer-events: none;
        }

        /* TRIP PLAYBACK & SCRUBBER BAR */
        .trip-playback-bar {
            position: absolute;
            top: 16px;
            left: 16px;
            z-index: 1002;
            width: 330px;
            max-width: calc(100% - 32px);
            background: var(--glass-bg);
            backdrop-filter: var(--glass-blur);
            -webkit-backdrop-filter: var(--glass-blur);
            border: var(--glass-border);
            border-radius: 16px;
            padding: 12px 14px;
            box-shadow: 0 10px 32px rgba(14, 27, 51, 0.16);
            display: flex;
            flex-direction: column;
            gap: 8px;
            transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease;
        }

        .playback-top-row {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .playback-btn {
            width: 34px;
            height: 34px;
            border-radius: 50%;
            background: var(--primary);
            color: #FFFFFF;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            flex-shrink: 0;
            box-shadow: 0 4px 12px rgba(36, 81, 196, 0.35);
            transition: transform 0.15s ease, background-color 0.15s ease;
        }
        .playback-btn:hover {
            transform: scale(1.06);
            background: var(--primary-dark);
        }
        .playback-btn:active {
            transform: scale(0.94);
        }

        .playback-info {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .playback-time {
            font-size: 13px;
            font-weight: 800;
            color: var(--ink);
            line-height: 1.2;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .playback-sub {
            font-size: 10.5px;
            font-weight: 600;
            color: var(--ink-soft);
            line-height: 1.2;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .playback-speed-pill {
            padding: 4px 8px;
            font-size: 10.5px;
            font-weight: 800;
            border-radius: 8px;
            background: var(--surface);
            color: var(--theme-accent-text);
            border: 1px solid var(--border);
            cursor: pointer;
            white-space: nowrap !important;
            flex-shrink: 0 !important;
            transition: all 0.15s ease;
        }
        .playback-speed-pill:hover {
            background: var(--primary-soft);
        }

        .playback-close-btn {
            width: 28px;
            height: 28px;
            border-radius: 8px;
            background: var(--surface);
            color: var(--ink-soft);
            border: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            flex-shrink: 0;
            transition: all 0.15s ease;
        }
        .playback-close-btn:hover {
            color: var(--ink);
            background: var(--border);
        }

        .playback-scrubber-wrap {
            width: 100%;
            display: flex;
            align-items: center;
        }

        .playback-scrubber {
            -webkit-appearance: none;
            appearance: none;
            width: 100%;
            height: 6px;
            border-radius: 4px;
            background: var(--border);
            outline: none;
            cursor: pointer;
            transition: background 0.2s;
        }
        .playback-scrubber::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: var(--primary);
            border: 2px solid #FFFFFF;
            box-shadow: 0 2px 6px rgba(36, 81, 196, 0.4);
            cursor: pointer;
            transition: transform 0.12s ease;
        }
        .playback-scrubber::-webkit-slider-thumb:hover {
            transform: scale(1.2);
        }
        .playback-scrubber::-moz-range-thumb {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: var(--primary);
            border: 2px solid #FFFFFF;
            box-shadow: 0 2px 6px rgba(36, 81, 196, 0.4);
            cursor: pointer;
        }

        /* TRAFFIC PERFORMANCE RATIO BAR */
        .traffic-ratio-bar-wrap {
            width: 100%;
        }
        .traffic-ratio-bar {
            height: 8px;
            border-radius: 6px;
            overflow: hidden;
            display: flex;
            background: var(--surface);
            border: 1px solid var(--border);
        }
        .traffic-moving-bar {
            background: #2451C4;
            height: 100%;
            transition: width 0.3s ease;
        }
        .traffic-jam-bar {
            background: #E0483B;
            height: 100%;
            transition: width 0.3s ease;
        }

        @media (max-width: 480px) {
            .dash-header { padding: 10px 12px; }
            .brand { min-width: 0; gap: 8px; }
            .brand-text { min-width: 0; }
            .brand-text .title { max-width: 176px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
            .brand-text .live-badge {
    flex-shrink: 0 !important;
    white-space: nowrap !important; font-size: 10px; }
            .header-actions { gap: 8px; }
            .map-legend { top: 68px !important; left: 8px !important; max-width: calc(100% - 58px); font-size: 10px; }
            .clear-select-btn { top: 96px; right: 10px; }
            .clear-select-btn svg { width: 18px; height: 18px; }
            .trip-playback-bar {
                top: 10px;
                left: 10px;
                right: 10px;
                width: auto;
                max-width: calc(100% - 20px);
                padding: 10px 12px;
                border-radius: 14px;
            }
            .playback-time { font-size: 12px; }
            .playback-sub { font-size: 10px; }
            .history-sidebar { left: 10px; right: 10px; bottom: calc(62px + env(safe-area-inset-bottom, 12px) + 8px); border-radius: 18px; }
            .history-sidebar.expanded .bus-list-wrapper { max-height: min(52vh, 390px); padding: 0 12px 14px !important; }
            .custom-dropdown-list { left: 10px !important; right: 10px !important; bottom: calc(72px + env(safe-area-inset-bottom, 12px)) !important; max-height: min(48vh, 260px) !important; }
            .custom-dropdown-wrap.open .custom-dropdown-list { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 6px !important; padding: 8px !important; }
            .custom-dropdown-option { min-height: 32px; padding: 8px 4px; font-size: 11px; border-radius: 7px; }
            .custom-dropdown-option:first-child { grid-column: span 3; }
            .bottom-nav { left: 10px !important; right: 10px !important; height: 62px !important; border-radius: 20px !important; }
            .nav-item { font-size: 10px !important; gap: 3px !important; }
            .nav-item.active::before { inset: 6px 8px !important; }
        }

        @media (max-height: 640px) and (max-width: 768px) {
            .history-sidebar.expanded .bus-list-wrapper {
                max-height: 44vh !important;
            }
        }

@media (max-width: 360px) {
    .history-sidebar { padding: 10px !important; }
    .custom-dropdown-option { font-size: 10px !important; }
    .trip-playback-bar { padding: 8px 10px; }
    .playback-btn { width: 30px; height: 30px; }
}

/* ==========================================================================
   Clean White + Blue UI v2 Theme — Route History
   Scoped strictly under body.ui-v2 to preserve existing behavior & other pages
   ========================================================================== */

body.ui-v2 {
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--ui-bg, #F4F7FB);
    color: var(--ui-ink, #0E1B33);
    -webkit-font-smoothing: antialiased;
}

/* Dashboard Header */
body.ui-v2 .dash-header {
    background: var(--ui-surface, #FFFFFF) !important;
    border-bottom: 1px solid var(--ui-border, #E5E7EB) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.ui-v2 .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

body.ui-v2 .brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(36, 81, 196, 0.2);
}

body.ui-v2 .brand-mark svg {
    display: block;
    width: 32px !important;
    height: 32px !important;
}

body.ui-v2 .brand-text .title {
    font-family: 'Switzer', sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ui-ink, #0E1B33);
}

body.ui-v2 .live-badge {
    background: #EEF4FF;
    color: var(--ui-primary, #0066FF);
    border: 1px solid rgba(0, 102, 255, 0.2);
    font-family: 'Switzer', sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

body.ui-v2 .desktop-nav .nav-btn {
    font-family: 'Switzer', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: var(--ui-ink-soft, #5C6B8A);
    border-radius: 10px;
    padding: 7px 12px;
    transition: all 0.15s ease;
}

body.ui-v2 .desktop-nav .nav-btn:hover {
    color: var(--ui-primary, #0066FF);
    background: rgba(0, 102, 255, 0.06);
}

body.ui-v2 .desktop-nav .nav-btn.active {
    background: #EEF4FF !important;
    color: var(--ui-primary, #0066FF) !important;
    font-weight: 600;
}

body.ui-v2 .icon-btn.menu-btn-top {
    background: var(--ui-surface, #FFFFFF);
    border: 1px solid var(--ui-border, #E5E7EB);
    border-radius: 10px;
    color: var(--ui-ink, #0E1B33);
    transition: all 0.15s ease;
}

body.ui-v2 .icon-btn.menu-btn-top:hover {
    background: var(--ui-bg, #F4F7FB);
    border-color: rgba(0, 102, 255, 0.3);
    color: var(--ui-primary, #0066FF);
}

/* History Floating Sidebar */
body.ui-v2 .history-sidebar {
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--ui-border, #E5E7EB) !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
}

body.ui-v2 .history-sidebar-header h3 {
    font-family: 'Switzer', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--ui-ink, #0E1B33);
}

body.ui-v2 .glass-select {
    background: var(--ui-surface, #FFFFFF) !important;
    border: 1px solid var(--ui-border, #E5E7EB) !important;
    border-radius: 10px !important;
    color: var(--ui-ink, #0E1B33) !important;
    font-family: 'Switzer', sans-serif;
    font-size: 13px;
    padding: 8px 12px;
}

body.ui-v2 .glass-select:focus {
    border-color: var(--ui-primary, #0066FF) !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}

body.ui-v2 .history-bus-card {
    background: var(--ui-surface, #FFFFFF) !important;
    border: 1px solid var(--ui-border, #E5E7EB) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    transition: all 0.15s ease;
}

body.ui-v2 .history-bus-card:hover {
    border-color: rgba(0, 102, 255, 0.3) !important;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.08);
}

body.ui-v2 .history-bus-card.active {
    border-color: var(--ui-primary, #0066FF) !important;
    background: #EEF4FF !important;
}

/* Trip Playback Bar */
body.ui-v2 .trip-playback-bar {
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--ui-border, #E5E7EB) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
}

body.ui-v2 .playback-btn {
    background: var(--ui-primary, #0066FF);
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    transition: background 0.15s ease;
}

body.ui-v2 .playback-btn:hover {
    background: #0052CC;
}

body.ui-v2 .playback-time {
    font-family: 'Switzer', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: var(--ui-ink, #0E1B33);
}

body.ui-v2 .playback-sub {
    font-size: 11px;
    color: var(--ui-ink-soft, #5C6B8A);
}

body.ui-v2 .clear-select-btn {
    background: var(--ui-surface, #FFFFFF);
    border: 1px solid var(--ui-border, #E5E7EB);
    color: var(--ui-ink, #0E1B33);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Floating Bottom Dock */
body.ui-v2 .dock-island-main {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(229, 231, 235, 0.85);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

body.ui-v2 .dock-tab {
    color: #6B7280;
    transition: color 0.15s ease, background 0.15s ease;
}

body.ui-v2 .dock-tab:hover {
    color: var(--primary, #2451C4);
}

body.ui-v2 .dock-tab.active {
    background: var(--primary, #2451C4) !important;
    color: #FFFFFF !important;
    border-radius: 100px;
    box-shadow: 0 4px 14px rgba(36, 81, 196, 0.35) !important;
}

body.ui-v2 .dock-tab.active svg {
    stroke: #FFFFFF !important;
    color: #FFFFFF !important;
}

body.ui-v2 .dock-island-action {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(229, 231, 235, 0.85);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

body.ui-v2 .dock-action-btn {
    color: #374151;
}

/* Full Dark Theme Pairing */
:root.dark-theme body.ui-v2,
html.dark-theme body.ui-v2,
body.ui-v2.dark-theme {
    background-color: var(--ui-bg, #0B0F19);
    color: var(--ui-ink, #F9FAFB);
}

:root.dark-theme body.ui-v2 .dash-header,
html.dark-theme body.ui-v2 .dash-header,
body.ui-v2.dark-theme .dash-header {
    background: var(--ui-surface, #111827) !important;
    border-bottom-color: var(--ui-border, #1F2937) !important;
}

:root.dark-theme body.ui-v2 .brand-text .title,
html.dark-theme body.ui-v2 .brand-text .title,
body.ui-v2.dark-theme .brand-text .title,
:root.dark-theme body.ui-v2 .history-sidebar-header h3,
html.dark-theme body.ui-v2 .history-sidebar-header h3,
body.ui-v2.dark-theme .history-sidebar-header h3,
:root.dark-theme body.ui-v2 .playback-time,
html.dark-theme body.ui-v2 .playback-time,
body.ui-v2.dark-theme .playback-time {
    color: var(--ui-ink, #F9FAFB) !important;
}

:root.dark-theme body.ui-v2 .desktop-nav .nav-btn,
html.dark-theme body.ui-v2 .desktop-nav .nav-btn,
body.ui-v2.dark-theme .desktop-nav .nav-btn {
    color: #9CA3AF;
}

:root.dark-theme body.ui-v2 .desktop-nav .nav-btn.active,
html.dark-theme body.ui-v2 .desktop-nav .nav-btn.active,
body.ui-v2.dark-theme .desktop-nav .nav-btn.active {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60A5FA !important;
}

:root.dark-theme body.ui-v2 .history-sidebar,
html.dark-theme body.ui-v2 .history-sidebar,
body.ui-v2.dark-theme .history-sidebar,
:root.dark-theme body.ui-v2 .trip-playback-bar,
html.dark-theme body.ui-v2 .trip-playback-bar,
body.ui-v2.dark-theme .trip-playback-bar {
    background: rgba(17, 24, 39, 0.94) !important;
    border-color: var(--ui-border, #1F2937) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

:root.dark-theme body.ui-v2 .glass-select,
html.dark-theme body.ui-v2 .glass-select,
body.ui-v2.dark-theme .glass-select,
:root.dark-theme body.ui-v2 .history-bus-card,
html.dark-theme body.ui-v2 .history-bus-card,
body.ui-v2.dark-theme .history-bus-card {
    background: #1F2937 !important;
    border-color: #374151 !important;
    color: #F9FAFB !important;
}

:root.dark-theme body.ui-v2 .history-bus-card.active,
html.dark-theme body.ui-v2 .history-bus-card.active,
body.ui-v2.dark-theme .history-bus-card.active {
    background: rgba(59, 130, 246, 0.18) !important;
    border-color: #3B82F6 !important;
}

:root.dark-theme body.ui-v2 .playback-sub,
html.dark-theme body.ui-v2 .playback-sub,
body.ui-v2.dark-theme .playback-sub {
    color: #9CA3AF !important;
}

:root.dark-theme body.ui-v2 .clear-select-btn,
html.dark-theme body.ui-v2 .clear-select-btn,
body.ui-v2.dark-theme .clear-select-btn {
    background: #1F2937;
    border-color: #374151;
    color: #F9FAFB;
}

:root.dark-theme body.ui-v2 .dock-island-main,
:root.dark-theme body.ui-v2 .dock-island-action,
html.dark-theme body.ui-v2 .dock-island-main,
html.dark-theme body.ui-v2 .dock-island-action,
body.ui-v2.dark-theme .dock-island-main,
body.ui-v2.dark-theme .dock-island-action {
    background: rgba(17, 24, 39, 0.94);
    border-color: rgba(31, 41, 55, 0.85);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

:root.dark-theme body.ui-v2 .dock-tab,
html.dark-theme body.ui-v2 .dock-tab,
body.ui-v2.dark-theme .dock-tab {
    color: #9CA3AF;
}

:root.dark-theme body.ui-v2 .dock-tab.active,
html.dark-theme body.ui-v2 .dock-tab.active,
body.ui-v2.dark-theme .dock-tab.active {
    background: #3B82F6 !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.45) !important;
}

:root.dark-theme body.ui-v2 .dock-tab.active svg,
html.dark-theme body.ui-v2 .dock-tab.active svg,
body.ui-v2.dark-theme .dock-tab.active svg {
    stroke: #FFFFFF !important;
    color: #FFFFFF !important;
}

:root.dark-theme body.ui-v2 .dock-action-btn,
html.dark-theme body.ui-v2 .dock-action-btn,
body.ui-v2.dark-theme .dock-action-btn {
    color: #D1D5DB;
}

/* Mobile Breakpoint Standards (Rule 1.1) */
@media (max-width: 480px) {
    body.ui-v2 .history-sidebar {
        border-radius: 16px !important;
    }
    body.ui-v2 .trip-playback-bar {
        padding: 10px 12px;
        border-radius: 14px;
    }
}

@media (max-width: 360px) {
    body.ui-v2 .history-sidebar {
        padding: 10px !important;
    }
    body.ui-v2 .trip-playback-bar {
        padding: 8px 10px;
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    body.ui-v2 .history-sidebar,
    body.ui-v2 .trip-playback-bar,
    body.ui-v2 .playback-btn,
    body.ui-v2 .history-bus-card {
        transition: none !important;
    }
}
