        :root {
            --bg-deep: #06080f;
            --glass: rgba(255,255,255,0.05);
            --glass-border: rgba(255,255,255,0.08);
            --glass-hover: rgba(255,255,255,0.1);
            --text-primary: #f0f2f5;
            --text-secondary: rgba(255,255,255,0.5);
            --text-tertiary: rgba(255,255,255,0.45);
            --accent-blue: #4f8fff;
            --accent-cyan: #00d4ff;
            --accent-purple: #a855f7;
            --accent-pink: #ec4899;
            --orb-glow: rgba(79,143,255,0.4);
            --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
            --smooth: cubic-bezier(0.4, 0, 0.2, 1);
            --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
            --ease-spring: cubic-bezier(0.2, 0.8, 0.2, 1);
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }
        select, option, input[type="date"] {
            color-scheme: dark;
            background: #1a1d27;
            color: var(--text-primary);
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background: var(--bg-deep);
            color: var(--text-primary);
            height: 100vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        /* ========== ANIMATED BACKGROUND ========== */
        .bg-canvas {
            position: fixed;
            inset: 0;
            z-index: 0;
            overflow: hidden;
        }

        .bg-canvas::before, .bg-canvas::after {
            content: '';
            position: absolute;
            border-radius: 50%;
            opacity: 0.35;
            animation: drift 20s ease-in-out infinite alternate;
            will-change: transform;
        }

        .bg-canvas::before {
            width: 840px; height: 840px;
            background: radial-gradient(circle, var(--accent-blue), transparent 50%);
            top: -320px; left: -220px;
        }

        .bg-canvas::after {
            width: 740px; height: 740px;
            background: radial-gradient(circle, var(--accent-purple), transparent 50%);
            bottom: -270px; right: -220px;
            animation-delay: -10s;
            animation-duration: 25s;
        }

        .bg-orb-3 {
            position: absolute;
            width: 600px; height: 600px;
            border-radius: 50%;
            background: radial-gradient(circle, var(--accent-cyan), transparent 50%);
            opacity: 0.2;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            animation: drift2 18s ease-in-out infinite alternate;
            will-change: transform;
        }

        @keyframes drift {
            0% { transform: translate(0, 0) scale(1); }
            100% { transform: translate(80px, 40px) scale(1.15); }
        }

        @keyframes drift2 {
            0% { transform: translate(-50%, -50%) scale(1); }
            100% { transform: translate(-40%, -60%) scale(1.2); }
        }

        /* ========== TOP BAR ========== */
        .topbar {
            position: absolute;
            top: 0; left: 0; right: 0;
            z-index: 20;
            display: flex;
            align-items: center;
            padding: 14px 20px;
            gap: 12px;
            flex-shrink: 0;
            pointer-events: none;
            transition: background 0.3s var(--smooth), border-color 0.3s var(--smooth);
        }
        body.map-view .topbar {
            background: linear-gradient(180deg, rgba(6, 8, 15, 0.85) 0%, rgba(6, 8, 15, 0.4) 70%, transparent 100%);
            border-bottom: none;
        }
        .topbar-right {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-left: auto;
            flex-shrink: 0;
        }

        .topbar > * { pointer-events: auto; }

        .topbar-center {
            opacity: 0;
            transform: translateY(-6px);
            transition: opacity 0.4s var(--smooth), transform 0.4s var(--smooth);
            pointer-events: none;
        }

        body.chatting .topbar-center,
        body.chatting .topbar .btn-trips,
        body.chatting .topbar .btn-home,
        body.chatting .usage-badge,
        body.dashboard .topbar .btn-trips,
        body.dashboard .topbar .btn-home {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }

        .wordmark {
            cursor: pointer;
            text-decoration: none;
        }

        .wordmark-text {
            font-size: 32px;
            font-weight: 700;
            letter-spacing: -0.5px;
            color: var(--text-primary);
            line-height: 1;
            margin-bottom: 3px;
        }

        .wordmark-sub {
            font-size: 11px;
            font-weight: 400;
            color: var(--text-tertiary);
            letter-spacing: 0.3px;
        }

        .btn-ghost {
            padding: 6px 14px;
            border-radius: 8px;
            border: none;
            background: transparent;
            color: rgba(255,255,255,0.45);
            font-size: 12px;
            font-family: inherit;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s var(--smooth);
        }

        .btn-ghost:hover {
            background: rgba(255,255,255,0.06);
            color: var(--text-primary);
        }

        /* ========== USAGE BADGE ========== */
        .data-freshness {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px 4px 8px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.02em;
            cursor: default;
            transition: all 0.2s var(--smooth);
        }
        .data-freshness::before {
            content: '';
            display: inline-block;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: currentColor;
            flex-shrink: 0;
        }
        .data-freshness.warn {
            background: rgba(251, 191, 36, 0.08);
            color: #fbbf24;
            border: 1px solid rgba(251, 191, 36, 0.2);
        }
        .data-freshness.stale {
            background: rgba(239, 68, 68, 0.1);
            color: #ef4444;
            border: 1px solid rgba(239, 68, 68, 0.25);
            animation: dataFreshPulse 2.4s ease-in-out infinite;
        }
        @keyframes dataFreshPulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.0); }
            50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12); }
        }

        .usage-badge {
            padding: 4px 10px;
            border-radius: 12px;
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.06);
            color: var(--text-muted, rgba(255,255,255,0.35));
            font-size: 10px;
            font-family: 'SF Mono', 'Fira Code', monospace;
            font-weight: 400;
            letter-spacing: 0.02em;
            opacity: 0;
            transform: translateY(-6px);
            transition: opacity 0.4s var(--smooth), transform 0.4s var(--smooth), color 0.3s;
            pointer-events: none;
            white-space: nowrap;
        }
        .usage-badge:empty { display: none; }
        .usage-badge.warn { color: rgba(255, 180, 50, 0.6); }

        /* ========== MAIN CONTENT ========== */
        .main {
            position: relative;
            z-index: 10;
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .chat-scroll {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 0 24px 60px;
            scrollbar-width: thin;
            scrollbar-color: rgba(255,255,255,0.1) transparent;
        }

        body.chatting .chat-scroll {
            padding-top: 76px;
        }

        .chat-scroll::-webkit-scrollbar { width: 6px; }
        .chat-scroll::-webkit-scrollbar-track { background: transparent; }
        .chat-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

        /* ========== WELCOME STATE ========== */
        .welcome {
            display: flex;
            flex-direction: column;
            align-items: center;
            min-height: 100%;
            padding: 60px 20px 30px;
            padding-top: 120px;
            animation: fadeUp 0.8s var(--smooth);
        }

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

        /* ---- THE OTTO EYE ---- */
        .orb-hero {
            position: relative;
            width: 150px; height: 150px;
            margin: 20px 0 28px;
            animation: heroFloat 5s ease-in-out infinite;
            transition: filter 0.3s;
            cursor: default;
            /* ensure rings/aura aren't clipped */
            overflow: visible;
        }

        .orb-hero:hover {
            filter: brightness(1.15);
        }

        .orb-hero::before {
            content: '';
            position: absolute;
            inset: -60px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(79,143,255,0.18) 0%, rgba(79,143,255,0.06) 40%, transparent 70%);
            animation: auraBreath 4s ease-in-out infinite;
            pointer-events: none;
        }

        @keyframes auraBreath {
            0%, 100% { transform: scale(1); opacity: 0.7; }
            50% { transform: scale(1.12); opacity: 1; }
        }

        .orb-hero .otto-eye {
            width: 100%; height: 100%;
            position: relative;
            z-index: 1;
        }
        .eye-glow {
            position: absolute;
            inset: -80px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(79,143,255,0.45) 0%, rgba(79,143,255,0.2) 25%, rgba(168,85,247,0.08) 50%, transparent 70%);
            z-index: 0;
            pointer-events: none;
        }

        .orb-ring {
            position: absolute;
            inset: -22px;
            border-radius: 50%;
            border: 1.5px solid rgba(79,143,255,0.18);
            animation: orbRingPulse 4s ease-in-out infinite;
            box-shadow: 0 0 15px rgba(79,143,255,0.06);
        }

        .orb-ring:nth-child(2) { inset: -42px; border-color: rgba(168,85,247,0.12); animation-delay: -1.3s; box-shadow: 0 0 20px rgba(168,85,247,0.04); }
        .orb-ring:nth-child(3) { inset: -62px; border-color: rgba(0,212,255,0.08); animation-delay: -2.6s; box-shadow: 0 0 25px rgba(0,212,255,0.03); }

        @keyframes heroFloat {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-8px); }
        }
        @keyframes orbRingPulse { 0%, 100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.06); opacity: 1; } }

        /* Otto eye SVG animations — CSS transform only (GPU-composited) */
        .otto-eye circle { transform-origin: 30px 30px; }
        @keyframes irisRotate { to { transform: rotate(360deg); } }
        @keyframes irisShift { 0%, 100% { stop-color: #4f8fff; } 33% { stop-color: #00d4ff; } 66% { stop-color: #a855f7; } }

        .welcome-title {
            font-size: 36px;
            font-weight: 600;
            letter-spacing: -0.5px;
            color: var(--text-primary);
            margin-bottom: 10px;
            text-align: center;
        }

        .welcome-greet-text {
            margin-bottom: 32px;
            opacity: 1;
            animation: greetTextIn 0.8s cubic-bezier(0.16,1,0.3,1) 0.3s both;
        }

        .welcome-sub {
            font-size: 16px;
            color: rgba(255,255,255,0.45);
            margin-bottom: 32px;
            text-align: center;
            font-weight: 400;
            max-width: 440px;
            line-height: 1.6;
            letter-spacing: 0.2px;
        }

        /* ---- LANDING STATS ROW ---- */
        .welcome-stats {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 36px;
            flex-wrap: wrap;
            justify-content: center;
        }
        .welcome-stat {
            font-size: 12px;
            color: var(--text-secondary);
            font-variant-numeric: tabular-nums;
        }
        .welcome-stat strong {
            color: var(--text-primary);
            font-weight: 600;
        }
        .welcome-stat-sep {
            color: var(--text-tertiary);
            font-size: 10px;
        }

        /* ---- HERO CARDS (3 primary CTAs) ---- */
        .hero-cards {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 14px;
            max-width: 820px;
            width: 100%;
            margin-bottom: 24px;
        }
        .hero-card {
            padding: 28px 20px 24px;
            border-radius: 18px;
            border: 1px solid var(--glass-border);
            background: var(--glass);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            cursor: pointer;
            transition: all 0.3s var(--smooth);
            position: relative;
            overflow: hidden;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }
        .hero-card::after {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: 18px;
            opacity: 0;
            transition: opacity 0.3s;
            background: radial-gradient(300px circle at var(--spot-x, 50%) var(--spot-y, 50%), rgba(79,143,255,0.06), transparent 60%);
            pointer-events: none;
        }
        .hero-card:hover::after { opacity: 1; }
        .hero-card:hover {
            border-color: rgba(79,143,255,0.25);
            transform: translateY(-3px);
            box-shadow: 0 12px 40px rgba(79,143,255,0.08);
        }
        .hero-card:active { transform: translateY(0) scale(0.98); }
        .hero-card-icon {
            width: 52px; height: 52px;
            border-radius: 14px;
            background: rgba(79,143,255,0.08);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            margin-bottom: 4px;
        }
        .hero-card-icon svg {
            width: 24px; height: 24px;
            stroke: var(--accent-blue);
            fill: none;
            stroke-width: 1.5;
            stroke-linecap: round;
            stroke-linejoin: round;
        }
        .hero-card-title {
            font-size: 17px;
            font-weight: 700;
            color: var(--text-primary);
            letter-spacing: -0.3px;
        }
        .hero-card-desc {
            font-size: 13px;
            color: rgba(255,255,255,0.4);
            line-height: 1.5;
        }

        .nearby-list.collapsed { display: none; }

        /* ---- QUICK ACTIONS (chip row) ---- */
        .quick-actions {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            justify-content: center;
            max-width: 640px;
            margin-bottom: 16px;
        }
        .quick-chip {
            padding: 8px 18px;
            border-radius: 20px;
            border: 1px solid var(--glass-border);
            background: rgba(255,255,255,0.03);
            color: var(--text-secondary);
            font-size: 12px;
            font-family: inherit;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.25s var(--smooth);
        }
        .quick-chip:hover {
            background: rgba(79,143,255,0.08);
            border-color: rgba(79,143,255,0.25);
            color: var(--text-primary);
        }
        .quick-chip:active { transform: scale(0.96); }

        @media (max-width: 700px) {
            .hero-cards { grid-template-columns: 1fr; max-width: 320px; }
        }

        /* ---- ACTION CARDS (kept for quick-action expand forms) ---- */
        .action-cards {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
            max-width: 640px;
            width: 100%;
        }

        .action-card {
            padding: 20px;
            border-radius: 16px;
            border: 1px solid var(--glass-border);
            background: var(--glass);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            cursor: pointer;
            transition: all 0.3s var(--smooth);
            position: relative;
            overflow: hidden;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        .action-card:hover {
            background: var(--glass-hover);
            border-color: rgba(79,143,255,0.3);
            transform: translateY(-2px);
            box-shadow: 0 8px 32px rgba(79,143,255,0.1);
        }

        .action-card:active { transform: translateY(0) scale(0.98); }

        .action-card:last-child:nth-child(odd) {
            grid-column: 1 / -1;
            max-width: 314px;
            justify-self: center;
        }

        .action-card-icon {
            width: 36px; height: 36px;
            border-radius: 10px;
            background: rgba(79,143,255,0.08);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .action-card-icon svg {
            width: 18px; height: 18px;
            stroke: var(--accent-blue);
            fill: none;
            stroke-width: 1.5;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .action-card-title {
            font-size: 15px;
            font-weight: 700;
            color: var(--text-primary);
            line-height: 1.3;
        }

        .action-card-desc {
            font-size: 12.5px;
            color: var(--text-secondary);
            line-height: 1.4;
        }

        .action-card-form {
            display: none;
            flex-direction: column;
            gap: 10px;
            margin-top: 8px;
            padding-top: 12px;
            border-top: 1px solid var(--glass-border);
            width: 100%;
        }

        .action-card.expanded { cursor: default; }
        .action-card.expanded .action-card-form {
            display: flex;
            animation: formSlide 0.3s var(--smooth);
        }

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

        .action-form-row {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .action-form-label {
            font-size: 11px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            min-width: 48px;
            flex-shrink: 0;
            text-align: right;
        }

        .action-form-input, .action-form-select {
            flex: 1;
            background: rgba(255,255,255,0.04);
            border: 1px solid var(--glass-border);
            border-radius: 8px;
            color: var(--text-primary);
            font-family: inherit;
            font-size: 13px;
            padding: 8px 12px;
            outline: none;
            transition: border-color 0.2s;
        }

        .action-form-input:focus, .action-form-select:focus {
            border-color: rgba(79,143,255,0.4);
        }

        .action-form-select {
            -webkit-appearance: none;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 10px center;
            padding-right: 28px;
            cursor: pointer;
        }

        .action-form-select option {
            background: #1a1e2e;
            color: var(--text-primary);
        }

        .action-form-go {
            padding: 8px 20px;
            border: none;
            border-radius: 8px;
            background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
            color: white;
            font-family: inherit;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }

        .action-form-go:hover { opacity: 0.9; transform: scale(1.02); }

        .api-notice {
            display: none;
            align-items: center;
            gap: 12px;
            padding: 14px 20px;
            border-radius: 14px;
            border: 1px solid rgba(79,143,255,0.15);
            background: rgba(79,143,255,0.05);
            backdrop-filter: blur(20px);
            max-width: 640px;
            width: 100%;
            margin-top: 16px;
        }

        .api-notice.show { display: flex; animation: msgIn 0.4s var(--spring); }

        .api-notice-icon {
            width: 36px; height: 36px;
            border-radius: 10px;
            background: rgba(79,143,255,0.1);
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
        }

        .api-notice-icon svg {
            width: 20px; height: 20px;
            stroke: var(--accent-blue);
            fill: none;
            stroke-width: 1.5;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .api-notice-text {
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.5;
        }

        .api-notice-text strong { color: var(--text-primary); font-weight: 600; }

        /* ========== CHAT GREETING — CINEMATIC ========== */
        .chat-greeting {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 0 24px;
            max-width: 700px;
            margin: 0 auto;
            min-height: 100%;
            gap: 20px;
            box-sizing: border-box;
            padding-top: 20px;
            padding-bottom: 20px;
            overflow: visible;
        }

        /* ---- Liquid Aurora Blobs ---- */
        .greet-aurora {
            position: absolute;
            border-radius: 50%;
            pointer-events: none;
            will-change: transform;
        }
        .greet-aurora-1 {
            width: 660px; height: 660px;
            background: radial-gradient(circle, rgba(79,143,255,0.22), transparent 50%);
            top: -20%; left: -25%;
            animation: auroraDrift1 15s ease-in-out infinite alternate, auroraMorph1 12s ease-in-out infinite;
            opacity: 0;
            animation-fill-mode: forwards;
        }
        .greet-aurora-2 {
            width: 580px; height: 580px;
            background: radial-gradient(circle, rgba(168,85,247,0.18), transparent 50%);
            bottom: -15%; right: -20%;
            animation: auroraDrift2 20s ease-in-out infinite alternate, auroraMorph2 14s ease-in-out infinite;
            opacity: 0;
            animation-fill-mode: forwards;
        }
        .greet-aurora-3 {
            width: 520px; height: 520px;
            background: radial-gradient(circle, rgba(0,212,255,0.14), transparent 50%);
            top: 25%; left: 30%;
            animation: auroraDrift3 18s ease-in-out infinite alternate, auroraMorph3 16s ease-in-out infinite;
            opacity: 0;
            animation-fill-mode: forwards;
        }
        /* Staggered aurora fade-in — morph removed for perf (invisible through blur) */
        .greet-aurora-1 { animation: auroraFadeIn 2s ease 0.2s forwards, auroraDrift1 15s ease-in-out 2s infinite alternate; }
        .greet-aurora-2 { animation: auroraFadeIn 2s ease 0.6s forwards, auroraDrift2 20s ease-in-out 2s infinite alternate; }
        .greet-aurora-3 { animation: auroraFadeIn 2s ease 1.0s forwards, auroraDrift3 18s ease-in-out 2s infinite alternate; }

        @keyframes auroraFadeIn { from { opacity: 0; } to { opacity: 1; } }
        @keyframes auroraDrift1 { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(60px, 30px) scale(1.12); } }
        @keyframes auroraDrift2 { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(-50px, -40px) scale(1.08); } }
        @keyframes auroraDrift3 { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(30px, -25px) scale(1.15); } }
        @keyframes auroraMorph1 {
            0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
            25% { border-radius: 58% 42% 36% 64% / 43% 65% 35% 57%; }
            50% { border-radius: 45% 55% 62% 38% / 53% 38% 62% 47%; }
            75% { border-radius: 63% 37% 45% 55% / 38% 58% 42% 62%; }
        }
        @keyframes auroraMorph2 {
            0%, 100% { border-radius: 45% 55% 50% 50% / 55% 45% 55% 45%; }
            33% { border-radius: 60% 40% 35% 65% / 40% 60% 40% 60%; }
            66% { border-radius: 35% 65% 55% 45% / 60% 35% 65% 35%; }
        }
        @keyframes auroraMorph3 {
            0%, 100% { border-radius: 50% 50% 40% 60% / 60% 40% 50% 50%; }
            50% { border-radius: 40% 60% 65% 35% / 35% 65% 40% 60%; }
        }

        /* ---- Floating Particles ---- */
        .greet-particle {
            position: absolute;
            border-radius: 50%;
            pointer-events: none;
            opacity: 0;
            animation: particleFadeIn 1.5s ease forwards, particleFloat var(--dur) ease-in-out var(--delay) infinite;
            animation-delay: var(--delay);
        }
        @keyframes particleFadeIn { from { opacity: 0; } to { opacity: var(--opa); } }
        @keyframes particleFloat {
            0%, 100% { transform: translate(0, 0); }
            25% { transform: translate(var(--dx1), var(--dy1)); }
            50% { transform: translate(var(--dx2), var(--dy2)); }
            75% { transform: translate(var(--dx3), var(--dy3)); }
        }

        /* ---- Otto Eye — Cinematic Size ---- */
        .chat-greeting-eye {
            position: relative;
            width: 220px; height: 220px;
            animation: greetEyeEntrance 1s cubic-bezier(0.16,1,0.3,1) forwards, heroFloat 5s ease-in-out 1s infinite;
            overflow: visible;
            cursor: pointer;
            z-index: 2;
        }
        @keyframes greetEyeEntrance {
            from { opacity: 0; transform: translateY(40px) scale(0.8); }
            to   { opacity: 1; transform: translateY(0) scale(1); }
        }

        /* Aura halo — bigger, richer */
        .chat-greeting-eye::before {
            content: '';
            position: absolute;
            inset: -80px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(79,143,255,0.2) 0%, rgba(79,143,255,0.08) 35%, rgba(168,85,247,0.03) 60%, transparent 75%);
            animation: auraBreath 4s ease-in-out infinite;
            pointer-events: none;
        }

        /* Light rays emanating from Otto */
        .chat-greeting-eye::after {
            content: '';
            position: absolute;
            width: 450px; height: 450px;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            border-radius: 50%;
            background: conic-gradient(
                from 0deg,
                transparent 0deg, rgba(79,143,255,0.04) 8deg, transparent 16deg,
                transparent 40deg, rgba(168,85,247,0.03) 48deg, transparent 56deg,
                transparent 90deg, rgba(0,212,255,0.04) 98deg, transparent 106deg,
                transparent 140deg, rgba(79,143,255,0.03) 148deg, transparent 156deg,
                transparent 200deg, rgba(168,85,247,0.04) 208deg, transparent 216deg,
                transparent 260deg, rgba(0,212,255,0.03) 268deg, transparent 276deg,
                transparent 320deg, rgba(79,143,255,0.04) 328deg, transparent 336deg,
                transparent 360deg
            );
            animation: lightRaysRotate 90s linear infinite;
            pointer-events: none;
        }
        @keyframes lightRaysRotate { to { transform: translate(-50%, -50%) rotate(360deg); } }

        /* Reflected glow beneath Otto */
        .greet-reflection {
            position: absolute;
            width: 280px; height: 40px;
            bottom: -24px; left: 50%;
            transform: translateX(-50%);
            background: radial-gradient(ellipse 100% 100%, rgba(79,143,255,0.12), rgba(168,85,247,0.06), transparent 70%);
            border-radius: 50%;
            filter: blur(12px);
            animation: reflectionPulse 4s ease-in-out infinite;
            pointer-events: none;
        }
        @keyframes reflectionPulse {
            0%, 100% { opacity: 0.5; transform: translateX(-50%) scaleX(1); }
            50% { opacity: 0.8; transform: translateX(-50%) scaleX(1.1); }
        }

        /* (spline removed — SVG eye restored) */

        .chat-greeting-eye .otto-eye {
            width: 100%; height: 100%;
            transition: opacity 0.6s ease;
            position: relative;
            z-index: 1;
        }
        .chat-greeting-eye .eye-glow {
            position: absolute;
            inset: -100px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(79,143,255,0.5) 0%, rgba(79,143,255,0.22) 25%, rgba(168,85,247,0.1) 45%, transparent 70%);
            z-index: 0;
            pointer-events: none;
        }

        /* 5 orb rings — expanding outward */
        .chat-greeting-eye .orb-ring {
            position: absolute;
            border-radius: 50%;
            border: 1.5px solid rgba(79,143,255,0.2);
            animation: orbRingPulse 4s ease-in-out infinite;
            box-shadow: 0 0 15px rgba(79,143,255,0.06);
        }
        .chat-greeting-eye .orb-ring:nth-child(1) { inset: -20px; }
        .chat-greeting-eye .orb-ring:nth-child(2) { inset: -42px; border-color: rgba(168,85,247,0.15); animation-delay: -0.8s; box-shadow: 0 0 18px rgba(168,85,247,0.05); }
        .chat-greeting-eye .orb-ring:nth-child(3) { inset: -64px; border-color: rgba(0,212,255,0.1); animation-delay: -1.6s; box-shadow: 0 0 20px rgba(0,212,255,0.04); }
        .chat-greeting-eye .orb-ring:nth-child(4) { inset: -88px; border-color: rgba(79,143,255,0.06); animation-delay: -2.4s; animation-duration: 5s; }
        .chat-greeting-eye .orb-ring:nth-child(5) { inset: -114px; border-color: rgba(168,85,247,0.04); animation-delay: -3.2s; animation-duration: 6s; }

        /* Click shake — Otto gets "shaken up" */
        .chat-greeting-eye.otto-shaken {
            animation: ottoShake 0.6s ease-out forwards;
        }
        .chat-greeting-eye.otto-shaken .eye-glow {
            background: radial-gradient(circle, rgba(255,100,50,0.6) 0%, rgba(255,60,120,0.3) 30%, rgba(168,85,247,0.15) 50%, transparent 70%);
            transition: background 0.3s;
        }
        .chat-greeting-eye.otto-shaken .orb-ring {
            border-color: rgba(255,100,50,0.35) !important;
            box-shadow: 0 0 25px rgba(255,100,50,0.18) !important;
        }
        @keyframes ottoShake {
            0%   { transform: translateX(0) scale(1); }
            8%   { transform: translateX(-8px) rotate(-4deg) scale(1.04); }
            16%  { transform: translateX(7px) rotate(3deg) scale(1.02); }
            24%  { transform: translateX(-5px) rotate(-2deg); }
            32%  { transform: translateX(4px) rotate(1.5deg); }
            44%  { transform: translateX(-2px) rotate(-0.5deg); }
            56%  { transform: translateX(1px); }
            100% { transform: translateX(0) scale(1); }
        }
        .chat-greeting-eye.otto-recovering .otto-eye {
            transition: filter 0.8s ease;
        }
        .chat-greeting-eye.otto-recovering .orb-ring {
            transition: border-color 0.8s ease, box-shadow 0.8s ease;
        }

        /* ---- Gradient Text + Staggered Entrance ---- */
        .chat-greeting-text {
            font-size: 32px;
            font-weight: 500;
            line-height: 1.3;
            letter-spacing: -0.5px;
            max-width: 520px;
            text-align: center;
            background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(79,143,255,0.9) 50%, rgba(168,85,247,0.8) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            opacity: 0;
            animation: greetTextIn 0.8s cubic-bezier(0.16,1,0.3,1) 0.3s forwards;
            z-index: 2;
        }
        @keyframes greetTextIn {
            from { opacity: 0; transform: translateY(20px); filter: blur(4px); }
            to   { opacity: 1; transform: translateY(0); filter: blur(0); }
        }

        .chat-greeting-input {
            width: 100%;
            max-width: 520px;
            margin-top: 4px;
            opacity: 0;
            animation: greetElIn 0.7s cubic-bezier(0.16,1,0.3,1) 0.5s forwards;
            z-index: 2;
        }
        .chat-greeting-input .input-bar {
            max-width: 100%;
        }
        @keyframes greetElIn {
            from { opacity: 0; transform: translateY(16px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        /* ---- Glassmorphism Suggestion Chips ---- */
        .chat-suggestions {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: center;
            z-index: 2;
            opacity: 0;
            animation: greetElIn 0.7s cubic-bezier(0.16,1,0.3,1) 0.7s forwards;
        }
        .chat-suggestion {
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.1);
            color: rgba(255,255,255,0.6);
            padding: 10px 18px;
            border-radius: 24px;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.16,1,0.3,1);
            white-space: nowrap;
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), 0 2px 8px rgba(0,0,0,0.15);
        }
        .chat-suggestion:hover {
            background: rgba(255,255,255,0.1);
            color: rgba(255,255,255,0.9);
            border-color: rgba(79,143,255,0.3);
            transform: translateY(-1px) scale(1.03);
            box-shadow: inset 0 0 0 1px rgba(79,143,255,0.12), 0 4px 16px rgba(0,0,0,0.2), 0 0 20px rgba(79,143,255,0.06);
        }
        /* Stagger each chip */
        .chat-suggestion:nth-child(1) { animation: chipIn 0.5s cubic-bezier(0.16,1,0.3,1) 0.8s both; }
        .chat-suggestion:nth-child(2) { animation: chipIn 0.5s cubic-bezier(0.16,1,0.3,1) 0.9s both; }
        .chat-suggestion:nth-child(3) { animation: chipIn 0.5s cubic-bezier(0.16,1,0.3,1) 1.0s both; }
        @keyframes chipIn {
            from { opacity: 0; transform: translateY(12px) scale(0.92); }
            to   { opacity: 1; transform: translateY(0) scale(1); }
        }

        /* Hide bottom input bar when greeting is visible */
        body.greeting-mode .input-area { display: none; }

        /* ========== CHAT MESSAGES ========== */
        .messages {
            max-width: 720px;
            width: 100%;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            gap: 20px;
            padding: 20px 0;
        }

        .msg {
            display: flex;
            gap: 14px;
            animation: msgIn 0.4s var(--spring);
            max-width: 100%;
        }

        .msg.user { flex-direction: row-reverse; }

        @keyframes msgIn {
            from { opacity: 0; transform: translateY(12px) scale(0.97); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        .msg-orb {
            width: 36px; height: 36px;
            flex-shrink: 0;
        }

        .msg-orb .otto-eye {
            width: 100%; height: 100%;
        }

        .msg-bubble {
            padding: 14px 18px;
            border-radius: 18px;
            font-size: 14px;
            line-height: 1.7;
            max-width: 85%;
            overflow-wrap: break-word;
        }

        .msg.assistant .msg-bubble {
            background: var(--glass);
            border: 1px solid var(--glass-border);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            color: var(--text-primary);
            border-top-left-radius: 4px;
        }

        .msg.user .msg-bubble {
            background: linear-gradient(135deg, rgba(79,143,255,0.15), rgba(168,85,247,0.1));
            border: 1px solid rgba(79,143,255,0.2);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            color: var(--text-primary);
            border-top-right-radius: 4px;
        }

        .msg-bubble strong { color: #fff; font-weight: 600; }
        .msg-bubble p { margin-bottom: 8px; }
        .msg-bubble p:last-child { margin-bottom: 0; }

        /* ---- FEEDBACK (thumbs up/down on Otto answers) ---- */
        .msg-feedback {
            display: flex;
            gap: 4px;
            margin-top: 6px;
            opacity: 0;
            transition: opacity 0.2s ease;
        }
        .msg.assistant:hover .msg-feedback,
        .msg-feedback.rated { opacity: 0.7; }
        .msg-feedback.rated:hover { opacity: 1; }
        .msg-feedback button {
            background: transparent;
            border: 1px solid transparent;
            border-radius: 6px;
            padding: 3px 6px;
            cursor: pointer;
            color: var(--text-secondary);
            font-size: 13px;
            line-height: 1;
            transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
        }
        .msg-feedback button:hover {
            background: rgba(255,255,255,0.06);
            border-color: rgba(255,255,255,0.12);
            color: var(--text-primary);
        }
        .msg-feedback button:active { transform: scale(0.92); }
        .msg-feedback button.active.up {
            background: rgba(34,197,94,0.15);
            border-color: rgba(34,197,94,0.35);
            color: #4ade80;
        }
        .msg-feedback button.active.down {
            background: rgba(239,68,68,0.15);
            border-color: rgba(239,68,68,0.35);
            color: #f87171;
        }

        .msg-bubble pre {
            background: rgba(0,0,0,0.3);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 10px;
            padding: 12px 14px;
            overflow-x: auto;
            font-size: 12.5px;
            font-family: 'SF Mono', 'Fira Code', monospace;
            margin: 8px 0;
        }

        /* ---- THINKING ---- */
        .thinking {
            display: flex;
            gap: 14px;
            animation: msgIn 0.4s var(--spring);
        }

        .thinking .msg-orb {
            animation: thinkPulse 1.2s ease-in-out infinite;
        }

        .thinking .msg-orb .otto-eye {
            filter: drop-shadow(0 0 12px rgba(79,143,255,0.5));
        }

        .thinking .msg-orb .otto-pupil {
            animation: pupilThink 0.8s ease-in-out infinite;
        }

        @keyframes pupilThink {
            0%, 100% { r: 6; }
            50% { r: 9; }
        }

        @keyframes thinkPulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.08); }
        }

        .think-dots {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 14px 20px;
            background: var(--glass);
            border: 1px solid var(--glass-border);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-radius: 18px;
            border-top-left-radius: 4px;
        }

        .think-dots span {
            width: 7px; height: 7px;
            border-radius: 50%;
            background: var(--accent-blue);
            animation: thinkDot 1.4s ease-in-out infinite;
            opacity: 0.4;
        }

        .think-dots span:nth-child(2) { animation-delay: 0.15s; background: var(--accent-cyan); }
        .think-dots span:nth-child(3) { animation-delay: 0.3s; background: var(--accent-purple); }

        @keyframes thinkDot {
            0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
            30% { transform: translateY(-8px); opacity: 1; }
        }

        .think-status {
            font-size: 12px;
            color: rgba(255,255,255,0.45);
            font-style: italic;
            margin-left: 6px;
            white-space: nowrap;
            transition: opacity 0.3s ease;
        }

        /* ========== INPUT BAR ========== */
        .input-area {
            position: relative;
            z-index: 10;
            padding: 16px 20px 24px;
            flex-shrink: 0;
            background: linear-gradient(to top, var(--bg-deep) 0%, rgba(6,8,15,0.95) 40%, rgba(6,8,15,0.6) 70%, transparent 100%);
        }

        .input-bar {
            max-width: 720px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 6px 6px 6px 6px;
            border-radius: 28px;
            border: 1px solid rgba(255,255,255,0.06);
            background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
            backdrop-filter: blur(40px);
            -webkit-backdrop-filter: blur(40px);
            transition: all 0.4s var(--smooth);
            box-shadow:
                0 8px 40px rgba(0,0,0,0.4),
                0 2px 8px rgba(0,0,0,0.2),
                inset 0 1px 0 rgba(255,255,255,0.04);
        }

        .input-bar.focused {
            border-color: rgba(255,255,255,0.06);
            background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
            box-shadow:
                0 8px 40px rgba(0,0,0,0.4),
                0 2px 8px rgba(0,0,0,0.2),
                inset 0 1px 0 rgba(255,255,255,0.04);
        }

        .input-bar textarea {
            flex: 1;
            background: transparent;
            border: none;
            outline: none;
            color: var(--text-primary);
            /* 16px to prevent iOS Safari zoom-on-focus — this is the primary chat input. */
            font-size: 16px;
            font-family: inherit;
            font-weight: 400;
            resize: none;
            height: 44px;
            max-height: 120px;
            line-height: 44px;
            padding: 0 8px;
            letter-spacing: 0.01em;
            overflow: hidden;
            scrollbar-width: none;
            -ms-overflow-style: none;
        }

        .input-bar textarea::-webkit-scrollbar { display: none; }

        .input-bar textarea::placeholder {
            color: var(--text-tertiary);
            font-weight: 300;
            line-height: 44px;
        }

        .data-info-btn {
            width: 38px; height: 38px;
            border-radius: 50%;
            border: none;
            background: transparent;
            color: var(--text-tertiary);
            cursor: default;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            position: relative;
            transition: color 0.25s var(--smooth);
        }
        .data-info-btn:hover { color: var(--text-secondary); }
        .data-info-btn svg {
            width: 17px; height: 17px;
            fill: none;
            stroke: currentColor;
            stroke-width: 1.8;
            stroke-linecap: round;
            stroke-linejoin: round;
        }
        .data-info-tip {
            position: absolute;
            bottom: calc(100% + 10px);
            left: 0;
            background: rgba(15,18,30,0.95);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 12px;
            padding: 12px 16px;
            min-width: 220px;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s ease;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            box-shadow: 0 8px 32px rgba(0,0,0,0.5);
        }
        .data-info-btn:hover .data-info-tip { opacity: 1; }
        .data-info-tip-title {
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--accent-blue);
            margin-bottom: 8px;
        }
        .data-info-tip-row {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: var(--text-secondary);
            padding: 2px 0;
        }
        .data-info-tip-row span:last-child {
            color: var(--text-primary);
            font-weight: 500;
        }

        .send-btn {
            width: 44px; height: 44px;
            border-radius: 50%;
            border: none;
            background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
            color: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s var(--smooth);
            flex-shrink: 0;
            box-shadow: 0 2px 12px rgba(79,143,255,0.25);
        }

        .send-btn:hover {
            transform: scale(1.06);
            box-shadow: 0 4px 20px rgba(79,143,255,0.35);
            background: linear-gradient(135deg, #5a9aff, #1ae0ff);
        }
        .send-btn:active { transform: scale(0.94); }
        .send-btn:disabled { opacity: 0.25; cursor: not-allowed; transform: none; box-shadow: none; }

        .send-btn svg {
            width: 18px; height: 18px;
            fill: none;
            stroke: white;
            stroke-width: 2.5;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        /* ========== TREND INDICATORS ========== */
        .trend-up { color: #34d399; font-size: 11px; font-weight: 600; }
        .trend-down { color: #f87171; font-size: 11px; font-weight: 600; }
        .trend-flat { color: var(--text-tertiary); font-size: 11px; }

        /* ========== SHINY TEXT (React Bits style) ========== */
        .shiny-text {
            background: linear-gradient(
                120deg,
                rgba(255,255,255,0.7) 0%,
                rgba(255,255,255,0.7) 40%,
                rgba(79,143,255,1) 50%,
                rgba(255,255,255,0.7) 60%,
                rgba(255,255,255,0.7) 100%
            );
            background-size: 200% 100%;
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: shinySlide 3s ease-in-out infinite;
        }

        @keyframes shinySlide {
            0% { background-position: 100% 50%; }
            100% { background-position: -100% 50%; }
        }

        /* ========== SPLIT TEXT BLUR REVEAL (React Bits style) ========== */
        .split-text-char {
            display: inline-block;
            opacity: 0;
            filter: blur(12px);
            transform: translateY(8px);
            animation: charReveal 0.5s var(--smooth) forwards;
        }

        @keyframes charReveal {
            to { opacity: 1; filter: blur(0); transform: translateY(0); }
        }

        .welcome-sub-reveal {
            opacity: 0;
            filter: blur(6px);
            transform: translateY(6px);
            animation: subReveal 0.6s var(--smooth) 0.8s forwards;
        }

        @keyframes subReveal {
            to { opacity: 1; filter: blur(0); transform: translateY(0); }
        }

        /* ========== CUSTOM GLASS DROPDOWN (React Bits style) ========== */
        .topbar-center {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .topbar-clock {
            display: flex;
            align-items: center;
            gap: 6px;
            font-family: 'Inter', sans-serif;
            font-variant-numeric: tabular-nums;
            user-select: none;
            margin-right: 6px;
            padding-right: 14px;
            border-right: 1px solid rgba(255,255,255,0.08);
        }
        .clock-time {
            font-size: 12px;
            font-weight: 600;
            color: rgba(255,255,255,0.55);
            letter-spacing: -0.01em;
        }
        .clock-sep {
            font-size: 10px;
            color: rgba(255,255,255,0.12);
        }
        .clock-date {
            font-size: 11px;
            font-weight: 400;
            color: rgba(255,255,255,0.25);
            letter-spacing: 0.01em;
        }

        /* ========== SPOTLIGHT CARDS (React Bits style) ========== */
        .action-card::after {
            content: '';
            position: absolute;
            width: 180px; height: 180px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(79,143,255,0.15) 0%, transparent 70%);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.3s;
            transform: translate(-50%, -50%);
            left: var(--spot-x, 50%);
            top: var(--spot-y, 50%);
        }

        .action-card:hover::after { opacity: 1; }

        /* ========== DEALER MAP VIEW ========== */
        .btn-map, .btn-home {
            padding: 6px 14px;
            border-radius: 8px;
            border: none;
            background: transparent;
            color: rgba(255,255,255,0.45);
            font-size: 12px;
            font-family: inherit;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s var(--smooth);
        }
        .btn-map:hover, .btn-home:hover {
            background: rgba(255,255,255,0.06);
            color: var(--text-primary);
        }
        /* Active state for current view */
        body.chatting .topbar .btn-home {
            color: var(--text-primary);
            background: rgba(255,255,255,0.08);
        }
        body.map-view .topbar .btn-map {
            color: var(--text-primary);
            background: rgba(255,255,255,0.08);
        }
        body.chatting .topbar .btn-map,
        body.trip-manager .topbar .btn-map,
        body.map-view .topbar .btn-map,
        body.dashboard .topbar .btn-map {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }

        body.map-view .topbar-center,
        body.map-view .topbar .btn-ghost,
        body.map-view .topbar .btn-home,
        body.map-view .usage-badge,
        body.map-view .topbar .btn-trips,
        body.map-view .topbar .btn-map {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }
        body.map-view .main { display: none; }
        body.map-view .input-area { display: none; }

        #dealerMap {
            position: fixed;
            top: 68px;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 5;
            display: none;
        }
        body.map-view #dealerMap { display: block; }

        /* Dark map tiles */
        .leaflet-container { background: #0a0e1a; -webkit-font-smoothing: antialiased; }
        .leaflet-zoom-anim .leaflet-zoom-animated {
            will-change: transform;
            transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1) !important;
        }
        .leaflet-tile-pane { will-change: transform; }
        .leaflet-marker-pane { will-change: transform; }
        .leaflet-control-zoom {
            border: none !important;
            box-shadow: 0 2px 12px rgba(0,0,0,0.4) !important;
            border-radius: 10px !important;
            overflow: hidden;
            margin-left: 14px !important;
            margin-top: 10px !important;
        }
        .leaflet-control-zoom a {
            background: rgba(12, 14, 28, 0.85) !important;
            color: var(--text-primary) !important;
            border: none !important;
            border-bottom: 1px solid rgba(255,255,255,0.06) !important;
            width: 36px !important;
            height: 36px !important;
            line-height: 36px !important;
            font-size: 18px !important;
            font-weight: 300 !important;
            transition: background 0.15s !important;
        }
        .leaflet-control-zoom a:last-child { border-bottom: none !important; }
        .leaflet-control-zoom a:hover {
            background: rgba(79,143,255,0.12) !important;
            color: #fff !important;
        }
        .leaflet-control-zoom a.leaflet-disabled {
            opacity: 0.35 !important;
            cursor: default !important;
        }
        .leaflet-control-zoom a.leaflet-disabled:hover {
            background: rgba(12, 14, 28, 0.85) !important;
        }
        .leaflet-control-attribution {
            background: rgba(6,8,15,0.7) !important;
            color: var(--text-tertiary) !important;
            font-size: 10px !important;
        }
        .leaflet-control-attribution a { color: var(--text-secondary) !important; }

        /* ========== PREMIUM POPUPS ========== */
        .leaflet-popup-content-wrapper {
            background: rgba(12, 14, 28, 0.88) !important;
            border: 1px solid rgba(255,255,255,0.07) !important;
            border-top-color: rgba(255,255,255,0.11) !important;
            border-radius: 14px !important;
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            box-shadow: 0 1px 2px rgba(0,0,0,0.25), 0 4px 16px rgba(0,0,0,0.2), 0 12px 40px rgba(0,0,0,0.18) !important;
        }
        .leaflet-popup-tip { background: rgba(12, 14, 28, 0.88) !important; }
        .leaflet-popup-content { color: var(--text-primary) !important; font-family: 'Inter', sans-serif; margin: 14px 18px !important; }
        .leaflet-popup-content-wrapper { animation: popupEnter 200ms var(--ease-out-expo) forwards; }
        @keyframes popupEnter {
            from { opacity: 0; transform: translateY(4px) scale(0.97); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        .map-popup-name { font-weight: 600; font-size: 13px; margin-bottom: 2px; letter-spacing: -0.01em; color: rgba(255,255,255,0.95); }
        .map-popup-loc { color: rgba(255,255,255,0.45); font-size: 11px; margin-bottom: 6px; }
        .map-popup-row { display: flex; align-items: center; gap: 0; font-size: 11px; color: rgba(255,255,255,0.7); margin-bottom: 6px; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
        .map-popup-kv b { color: rgba(255,255,255,0.92); font-weight: 600; }
        .map-popup-sep { margin: 0 6px; color: rgba(255,255,255,0.2); }
        .map-popup-meta { font-size: 10px; color: rgba(255,255,255,0.35); margin-bottom: 4px; }
        .map-popup-bt { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,0.08); }
        .map-popup-bt-label { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255,255,255,0.3); margin-bottom: 4px; }
        .map-popup-bt-row { display: flex; justify-content: space-between; align-items: center; font-size: 10px; padding: 1px 0; }
        .map-popup-bt-name { color: rgba(255,255,255,0.6); }
        .map-popup-bt-count { color: rgba(255,255,255,0.85); font-weight: 600; font-variant-numeric: tabular-nums; }
        .map-popup-tier {
            display: inline-block;
            padding: 2px 7px;
            border-radius: 6px;
            font-size: 9px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            margin-top: 6px;
        }
        .map-popup-tier.hot { background: rgba(255,107,53,0.12); color: #ff6b35; box-shadow: 0 0 8px rgba(255,107,53,0.15); }
        .map-popup-tier.warm { background: rgba(34,197,94,0.12); color: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.12); }
        .map-popup-tier.cold { background: rgba(71,85,105,0.15); color: #94a3b8; }
        .map-popup-tier.restock { background: rgba(168,85,247,0.12); color: #a855f7; box-shadow: 0 0 8px rgba(168,85,247,0.15); }

        /* Map legend — compact horizontal strip */
        .map-legend {
            position: fixed;
            bottom: 20px;
            left: 20px;
            z-index: 10;
            background: rgba(12, 14, 28, 0.75);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 10px;
            padding: 7px 14px;
            backdrop-filter: blur(16px) saturate(180%);
            -webkit-backdrop-filter: blur(16px) saturate(180%);
            display: none;
            flex-direction: row;
            gap: 12px;
            align-items: center;
        }
        body.map-view .map-legend { display: flex; }
        .map-legend-title { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.06em; flex-shrink: 0; }
        .map-legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: rgba(255,255,255,0.6); white-space: nowrap; }
        .map-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

        /* Scoring key popup on legend hover */
        .map-legend { cursor: default; transition: border-color 200ms ease; }
        .map-legend:hover { border-color: rgba(79,143,255,0.15); }
        .scoring-key {
            position: absolute; bottom: calc(100% + 10px); left: 0;
            width: 340px;
            background: rgba(10, 12, 24, 0.94);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 12px;
            padding: 14px 16px;
            backdrop-filter: blur(24px) saturate(180%);
            -webkit-backdrop-filter: blur(24px) saturate(180%);
            box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(79,143,255,0.04);
            opacity: 0; pointer-events: none;
            transform: translateY(6px);
            transition: opacity 180ms var(--ease-out-expo), transform 180ms var(--ease-out-expo);
            z-index: 20;
        }
        .map-legend:hover .scoring-key { opacity: 1; pointer-events: auto; transform: translateY(0); }
        .scoring-key-title {
            font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.7);
            text-transform: uppercase; letter-spacing: 0.08em;
            margin-bottom: 6px; padding-bottom: 6px;
            border-bottom: 1px solid rgba(255,255,255,0.06);
        }
        .scoring-key-tiers {
            display: flex; gap: 6px; flex-wrap: wrap;
        }
        .scoring-key-tier {
            display: flex; align-items: center; gap: 5px;
            font-size: 12px; color: rgba(255,255,255,0.6);
        }
        .sk-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
        .sk-name { font-weight: 600; }
        .sk-range { font-variant-numeric: tabular-nums; color: rgba(255,255,255,0.5); font-size: 11px; }
        .sk-sep { color: rgba(255,255,255,0.12); font-size: 12px; }
        .scoring-key-section {
            margin-top: 10px; padding-top: 8px;
            border-top: 1px solid rgba(255,255,255,0.06);
        }
        .scoring-key-section-title {
            font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.55);
            text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px;
        }
        .sk-factor {
            padding: 6px 0;
        }
        .sk-factor + .sk-factor { border-top: 1px solid rgba(255,255,255,0.03); }
        .sk-factor-head {
            display: flex; justify-content: space-between; align-items: center;
            font-size: 13px; color: rgba(255,255,255,0.7); font-weight: 600;
        }
        .sk-factor-pts { color: rgba(79,143,255,0.7); font-variant-numeric: tabular-nums; font-size: 12px; }
        .sk-factor-desc {
            font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 2px; line-height: 1.4;
        }
        .sk-factor-desc em { font-style: normal; color: rgba(255,255,255,0.45); }
        .sk-opp-grid {
            display: flex; flex-direction: column; gap: 4px;
        }
        .sk-opp {
            display: flex; align-items: center; gap: 6px;
            font-size: 11px; color: rgba(255,255,255,0.5); line-height: 1.3;
        }
        .sk-opp-badge {
            display: inline-block; padding: 1px 6px; border-radius: 4px;
            font-size: 10px; font-weight: 700; text-transform: uppercase;
            letter-spacing: 0.04em; white-space: nowrap; flex-shrink: 0;
        }
        .sk-sweet-spot {
            margin-top: 10px; padding: 8px 10px;
            background: rgba(79,143,255,0.06);
            border: 1px solid rgba(79,143,255,0.1);
            border-radius: 8px;
            font-size: 11px; color: rgba(79,143,255,0.7); line-height: 1.4;
        }

        /* Map stats bar — slim floating pill */
        .map-stats {
            position: fixed;
            top: 82px;
            right: 420px;
            z-index: 10;
            display: none;
            align-items: center;
            gap: 10px;
            padding: 7px 14px;
            background: rgba(12, 14, 28, 0.78);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 12px;
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            font-size: 12px;
            white-space: nowrap;
        }
        body.map-view .map-stats { display: flex; }
        .map-stat { display: flex; align-items: center; gap: 4px; color: rgba(255,255,255,0.4); font-variant-numeric: tabular-nums; font-size: 11px; white-space: nowrap; }
        .map-stat-value { font-weight: 600; color: rgba(255,255,255,0.88); font-size: 12px; }
        .map-stat-sep { color: rgba(255,255,255,0.12); font-size: 9px; }

        /* ========== MAP FILTER BAR ========== */
        .map-filters {
            position: fixed;
            top: 82px;
            left: 64px;
            z-index: 10;
            display: none;
            align-items: center;
            gap: 7px;
            font-size: 13px;
        }
        body.map-view .map-filters { display: flex; }
        body.map-view.route-active .map-filters { display: none; }

        /* Filter pill buttons */
        .filter-pill-wrap { position: relative; }
        .filter-pill {
            display: flex; align-items: center; gap: 6px;
            padding: 6px 12px; border-radius: 9px;
            background: rgba(12, 14, 28, 0.72);
            border: 1px solid rgba(255,255,255,0.08);
            backdrop-filter: blur(16px) saturate(180%);
            -webkit-backdrop-filter: blur(16px) saturate(180%);
            color: rgba(255,255,255,0.55);
            font-size: 13px; font-family: inherit; font-weight: 500;
            cursor: pointer; user-select: none;
            transition: all 150ms var(--ease-out-expo);
            white-space: nowrap;
        }
        .filter-pill:hover { border-color: rgba(255,255,255,0.15); color: rgba(255,255,255,0.75); background: rgba(12, 14, 28, 0.85); }
        .filter-pill.open { border-color: rgba(79,143,255,0.3); color: rgba(255,255,255,0.9); background: rgba(12, 14, 28, 0.88); }
        .filter-pill.has-filter { border-color: rgba(79,143,255,0.25); color: rgba(255,255,255,0.88); }
        .filter-pill-count {
            display: inline-flex; align-items: center; justify-content: center;
            min-width: 18px; height: 18px; padding: 0 5px;
            border-radius: 9px; background: rgba(79,143,255,0.2);
            color: #4f8fff; font-size: 10px; font-weight: 700;
            font-variant-numeric: tabular-nums;
        }
        .filter-pill-chevron {
            width: 12px; height: 12px; opacity: 0.4;
            transition: transform 150ms var(--ease-out-expo);
        }
        .filter-pill.open .filter-pill-chevron { transform: rotate(180deg); opacity: 0.7; }

        /* Dropdown panels */
        .filter-dropdown {
            position: absolute; top: calc(100% + 7px); left: 0;
            min-width: 184px;
            background: rgba(12, 14, 28, 0.92);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 12px;
            padding: 7px;
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(79,143,255,0.04);
            display: none; flex-direction: column; gap: 1px;
            animation: dropIn 150ms var(--ease-out-expo) forwards;
            z-index: 20;
        }
        .filter-dropdown.open { display: flex; }
        .filter-dropdown.state-dd, .filter-dropdown.body-type-dd, .filter-dropdown.brand-dd { max-height: 280px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }
        .filter-dropdown.state-dd::-webkit-scrollbar, .filter-dropdown.body-type-dd::-webkit-scrollbar, .filter-dropdown.brand-dd::-webkit-scrollbar { width: 4px; }
        .filter-dropdown.state-dd::-webkit-scrollbar-thumb, .filter-dropdown.body-type-dd::-webkit-scrollbar-thumb, .filter-dropdown.brand-dd::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
        @keyframes dropIn {
            from { opacity: 0; transform: translateY(-4px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Checkbox rows */
        .filter-row {
            display: flex; align-items: center; gap: 9px;
            padding: 7px 9px; border-radius: 7px;
            cursor: pointer; transition: background 100ms ease;
            color: rgba(255,255,255,0.7); font-size: 13px; font-weight: 500;
            user-select: none;
        }
        .filter-row:hover, .filter-row:focus-visible { background: rgba(255,255,255,0.05); }
        .filter-row:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: -2px; border-radius: 7px; }
        .filter-row.unchecked { color: rgba(255,255,255,0.45); }
        .filter-check {
            width: 16px; height: 16px; border-radius: 5px; flex-shrink: 0;
            border: 1.5px solid rgba(255,255,255,0.2);
            display: flex; align-items: center; justify-content: center;
            transition: all 120ms var(--ease-out-expo);
        }
        .filter-row:not(.unchecked) .filter-check {
            background: rgba(79,143,255,0.25); border-color: rgba(79,143,255,0.5);
        }
        .filter-check-icon { width: 9px; height: 9px; opacity: 0; transition: opacity 100ms ease; }
        .filter-row:not(.unchecked) .filter-check-icon { opacity: 1; }
        .filter-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
        .filter-label { flex: 1; }
        .filter-sublabel { font-size: 10px; color: rgba(255,255,255,0.25); font-variant-numeric: tabular-nums; }

        /* All/None toggle row */
        .filter-toggle-row {
            display: flex; gap: 7px; padding: 5px 9px 7px; border-bottom: 1px solid rgba(255,255,255,0.06); margin-bottom: 2px;
        }
        .filter-toggle-btn {
            font-size: 10px; font-weight: 600; font-family: inherit;
            color: rgba(79,143,255,0.7); background: none; border: none;
            cursor: pointer; text-transform: uppercase; letter-spacing: 0.04em;
            padding: 2px 0; transition: color 100ms ease;
        }
        .filter-toggle-btn:hover { color: #4f8fff; }

        /* Reset pill */
        .filter-reset {
            display: none; align-items: center; gap: 3px;
            padding: 6px 12px; border-radius: 9px;
            background: rgba(12, 14, 28, 0.72);
            border: 1px solid rgba(239,68,68,0.15);
            backdrop-filter: blur(16px) saturate(180%);
            -webkit-backdrop-filter: blur(16px) saturate(180%);
            color: rgba(239,68,68,0.6); font-size: 13px; font-family: inherit; font-weight: 500;
            cursor: pointer; transition: all 150ms var(--ease-out-expo);
        }
        .filter-reset:hover { border-color: rgba(239,68,68,0.35); color: #ef4444; background: rgba(239,68,68,0.06); }

        /* Result count */
        .filter-result-count {
            font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.35);
            padding: 5px 0; white-space: nowrap;
            font-variant-numeric: tabular-nums;
            transition: opacity 200ms ease;
        }
        .filter-result-count.filtering { color: rgba(79,143,255,0.7); }

        /* ========== MAP SEARCH BAR ========== */
        .map-search {
            position: fixed;
            top: 82px;
            right: 20px;
            z-index: 16;
            display: none;
            flex-direction: column;
            width: 276px;
        }
        body.map-view .map-search { display: flex; }
        body.map-view.route-active .map-search { display: none; }

        .map-search-input-wrap {
            display: flex; align-items: center; gap: 9px;
            padding: 8px 14px;
            background: rgba(12, 14, 28, 0.78);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 12px;
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            transition: border-color 200ms var(--ease-out-expo), box-shadow 200ms var(--ease-out-expo);
        }
        .map-search-input-wrap:focus-within {
            border-color: rgba(79,143,255,0.3);
            box-shadow: 0 0 0 3px rgba(79,143,255,0.06), 0 8px 32px rgba(0,0,0,0.3);
        }
        .map-search-icon {
            width: 16px; height: 16px; flex-shrink: 0;
            color: rgba(255,255,255,0.45);
            transition: color 200ms ease;
        }
        .map-search-input-wrap:focus-within .map-search-icon { color: rgba(79,143,255,0.6); }
        .map-search-input {
            flex: 1; background: none; border: none; outline: none;
            color: var(--text-primary); font-family: inherit;
            font-size: 14px; font-weight: 400;
        }
        .map-search-input::placeholder { color: rgba(255,255,255,0.25); }
        .map-search-clear {
            width: 18px; height: 18px; flex-shrink: 0;
            background: rgba(255,255,255,0.08); border: none; border-radius: 50%;
            color: rgba(255,255,255,0.4); cursor: pointer;
            display: none; align-items: center; justify-content: center;
            transition: all 120ms ease;
            padding: 0;
        }
        .map-search-clear:hover { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.7); }
        .map-search.has-query .map-search-clear { display: flex; }

        /* Results dropdown */
        .map-search-results {
            margin-top: 5px;
            background: rgba(12, 14, 28, 0.92);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 12px;
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 0 0 1px rgba(79,143,255,0.04);
            display: none; flex-direction: column;
            max-height: 322px; overflow-y: auto;
            scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
            padding: 5px;
            animation: dropIn 150ms var(--ease-out-expo) forwards;
        }
        .map-search-results::-webkit-scrollbar { width: 4px; }
        .map-search-results::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
        .map-search-results.open { display: flex; }

        .map-search-result {
            display: flex; align-items: center; gap: 9px;
            padding: 9px 12px; border-radius: 8px;
            cursor: pointer; transition: background 80ms ease;
        }
        .map-search-result:hover, .map-search-result.active {
            background: rgba(79,143,255,0.08);
        }
        .map-search-result-dot {
            width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
            box-shadow: 0 0 6px currentColor;
        }
        .map-search-result-info { flex: 1; min-width: 0; }
        .map-search-result-name {
            font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.88);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .map-search-result-name mark {
            background: none; color: #4f8fff; font-weight: 700;
        }
        .map-search-result-meta {
            font-size: 12px; color: rgba(255,255,255,0.35);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .map-search-result-score {
            font-size: 12px; font-weight: 600; flex-shrink: 0;
            font-variant-numeric: tabular-nums;
        }
        .map-search-empty {
            padding: 18px 12px; text-align: center;
            font-size: 13px; color: rgba(255,255,255,0.25);
        }
        .map-search-hint {
            padding: 7px 12px; text-align: center;
            font-size: 12px; color: rgba(255,255,255,0.2);
        }

        /* ========== SIDE LIST PANEL ========== */
        .side-list {
            position: fixed;
            top: 68px;
            right: 0;
            bottom: 0;
            width: 340px;
            z-index: 12;
            display: none;
            flex-direction: column;
            background: rgba(8, 10, 20, 0.95);
            border-left: 1px solid rgba(255,255,255,0.06);
            transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
            overflow: hidden;
        }
        body.map-view.sl-open .side-list { display: flex; }
        body.map-view.sl-open .side-list.collapsed { width: 0; border-left: none; }

        /* Shift map & overlays when sidebar is open */
        body.map-view.sl-open #dealerMap { right: 340px; }
        body.map-view.sl-open .side-list.collapsed ~ #dealerMap,
        body.map-view.sl-open.sl-collapsed #dealerMap { right: 0; }
        body.map-view.sl-open .map-stats { right: 360px; }
        body.map-view.sl-open .map-search { display: none; }
        body.map-view.sl-open .otto-fab { right: 368px; }
        body.map-view.sl-open .otto-popup { right: 368px; }
        /* When collapsed, restore positions */
        body.map-view.sl-open.sl-collapsed .map-stats { right: 420px; }
        body.map-view.sl-open.sl-collapsed .map-search { display: flex; }
        body.map-view.sl-open.sl-collapsed .otto-fab { right: 28px; }
        body.map-view.sl-open.sl-collapsed .otto-popup { right: 28px; }
        body.map-view.sl-open.sl-collapsed #dealerMap { right: 0; }

        .sl-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 14px;
            border-bottom: 1px solid rgba(255,255,255,0.06);
            flex-shrink: 0;
        }
        .sl-header-title {
            font-size: 11px;
            font-weight: 600;
            color: rgba(255,255,255,0.4);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .sl-header-count {
            font-size: 11px;
            font-weight: 600;
            color: rgba(255,255,255,0.6);
        }
        .sl-collapse-btn {
            background: none;
            border: 1px solid rgba(255,255,255,0.08);
            color: rgba(255,255,255,0.4);
            width: 24px;
            height: 24px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            flex-shrink: 0;
            margin-left: 8px;
        }
        .sl-collapse-btn:hover { color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.2); }

        /* Drag handle — hidden everywhere by default; only the @media block below reveals it for mobile bottom-sheet mode */
        .sl-drag-handle { display: none; }

        /* Mobile hamburger menu — hidden everywhere by default. Shown only in
           the mobile @media block; styling for the dropdown is also there. */
        .topbar-hamburger { display: none; }
        .topbar-menu { display: none; }

        /* Sidebar search */
        .sl-search {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 14px;
            border-bottom: 1px solid rgba(255,255,255,0.06);
            flex-shrink: 0;
        }
        .sl-search-icon {
            width: 15px;
            height: 15px;
            flex-shrink: 0;
            color: rgba(255,255,255,0.35);
        }
        .sl-search input {
            flex: 1;
            background: none;
            border: none;
            outline: none;
            color: var(--text-primary);
            font-family: inherit;
            font-size: 13px;
            padding: 4px 0;
        }
        .sl-search input::placeholder { color: rgba(255,255,255,0.2); }
        .sl-search-clear {
            width: 18px;
            height: 18px;
            flex-shrink: 0;
            background: rgba(255,255,255,0.08);
            border: none;
            border-radius: 50%;
            color: rgba(255,255,255,0.4);
            cursor: pointer;
            display: none;
            align-items: center;
            justify-content: center;
            transition: all 120ms ease;
            padding: 0;
        }
        .sl-search-clear:hover { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.7); }
        .sl-search.has-query .sl-search-clear { display: flex; }

        /* Sidebar body / rows */
        .sl-body {
            flex: 1;
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: rgba(255,255,255,0.08) transparent;
        }
        .sl-body::-webkit-scrollbar { width: 4px; }
        .sl-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

        .sl-row {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 14px;
            border-bottom: 1px solid rgba(255,255,255,0.03);
            cursor: pointer;
            transition: background 0.12s;
            min-height: 44px;
        }
        .sl-row:hover { background: rgba(255,255,255,0.04); }
        .sl-row.sl-active { background: rgba(79,143,255,0.08); border-left: 2px solid #4f8fff; }

        .sl-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex-shrink: 0;
        }
        .sl-info {
            flex: 1;
            min-width: 0;
            overflow: hidden;
        }
        .sl-name {
            font-size: 12px;
            font-weight: 500;
            color: rgba(255,255,255,0.88);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .sl-meta {
            font-size: 10px;
            color: rgba(255,255,255,0.35);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-top: 1px;
        }
        .sl-vehicles {
            font-size: 11px;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
            flex-shrink: 0;
            text-align: right;
            min-width: 28px;
        }
        .sl-smyrna-badge {
            font-size: 8px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            padding: 1px 4px;
            border-radius: 3px;
            background: rgba(79,143,255,0.12);
            color: #4f8fff;
            flex-shrink: 0;
        }
        .sl-empty {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 40px 20px;
            color: rgba(255,255,255,0.25);
            font-size: 12px;
            gap: 6px;
        }

        /* Expand button (when sidebar collapsed) */
        .sl-expand-btn {
            position: fixed;
            top: 50%;
            right: 12px;
            transform: translateY(-50%);
            z-index: 12;
            display: none;
            width: 32px;
            height: 64px;
            background: rgba(8,10,20,0.9);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 8px;
            color: rgba(255,255,255,0.4);
            cursor: pointer;
            font-size: 14px;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            backdrop-filter: blur(12px);
        }
        .sl-expand-btn:hover { color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.2); }
        body.map-view.route-active .sl-expand-btn { display: none !important; }

        /* Pin highlight on hover from sidebar */
        .ember.pin-highlight svg {
            filter: brightness(2) drop-shadow(0 0 8px currentColor) !important;
            transform: scale(1.5);
            transition: all 0.2s ease;
        }

        @media (max-width: 900px) {
            /* ===== Mobile map: side-list becomes a 3-snap bottom sheet ===== */
            /* Reused: existing #sideList element + SideList render functions. */
            /* States are body classes: peek (default) | sheet-half | sheet-full. */

            .sl-expand-btn { display: none !important; }
            /* FAB rides above the peek state of the sheet */
            body.map-view .otto-fab { right: 16px; bottom: 104px; }
            body.map-view.sheet-half .otto-fab,
            body.map-view.sheet-full .otto-fab { display: none; }

            /* Side-list as bottom sheet. Heights use dvh (dynamic viewport
               height) so iOS Safari URL-bar collapse doesn't make the sheet
               jump; the fallback vh is for older browsers. */
            body.map-view .side-list {
                display: flex !important;
                top: auto !important;
                right: 0;
                left: 0;
                bottom: 0;
                width: 100%;
                height: 84px;
                max-height: 92vh;
                max-height: 92dvh;
                border-left: none;
                border-top: 1px solid rgba(255,255,255,0.08);
                border-radius: 18px 18px 0 0;
                box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
                z-index: 30;
                transition: height 0.32s cubic-bezier(0.32, 0.72, 0, 1);
                touch-action: pan-y;
                will-change: height;
            }
            body.map-view .side-list.dragging { transition: none; }
            body.map-view.sheet-half .side-list { height: 52vh; height: 52dvh; }
            body.map-view.sheet-full .side-list { height: 92vh; height: 92dvh; }

            /* Drag handle — visible top strip with a centered grabber */
            .sl-drag-handle {
                display: flex !important;
                align-items: center;
                justify-content: center;
                width: 100%;
                height: 22px;
                padding: 8px 0 6px;
                background: transparent;
                border: none;
                cursor: grab;
                flex-shrink: 0;
                -webkit-tap-highlight-color: transparent;
                touch-action: none;
            }
            .sl-drag-handle:active { cursor: grabbing; }
            .sl-drag-grabber {
                display: block;
                width: 40px;
                height: 4px;
                background: rgba(255,255,255,0.25);
                border-radius: 2px;
                transition: background 0.2s, width 0.2s;
            }
            .sl-drag-handle:hover .sl-drag-grabber,
            body.map-view.sheet-full .sl-drag-grabber { background: rgba(255,255,255,0.45); }

            /* Peek state hides search + trip routes + list body — only handle + header summary */
            body.map-view:not(.sheet-half):not(.sheet-full) .side-list .sl-search,
            body.map-view:not(.sheet-half):not(.sheet-full) .side-list .route-panel,
            body.map-view:not(.sheet-half):not(.sheet-full) .side-list .sl-body { display: none; }
            body.map-view:not(.sheet-half):not(.sheet-full) .sl-header {
                border-bottom: none;
                padding: 4px 16px 10px;
                justify-content: space-between;
            }
            body.map-view:not(.sheet-half):not(.sheet-full) .sl-collapse-btn { display: none; }

            /* Half state shows search + list; trip routes collapsed for space */
            body.map-view.sheet-half .route-panel .route-panel-body { display: none; }
            body.map-view.sheet-half .route-panel .route-panel-chevron { transform: rotate(0deg); }
            body.map-view.sheet-half .sl-collapse-btn { display: none; }

            /* Full state shows everything */
            body.map-view.sheet-full .sl-collapse-btn { display: none; }

            /* Bigger touch targets at mobile */
            body.map-view .side-list .sl-row { padding: 14px 14px; min-height: 56px; }
            body.map-view .side-list .sl-search input { font-size: 16px; }  /* Prevents iOS zoom on focus */

            /* When a route is active and the user is in full state, leave room for the exit-route floating button */
            body.map-view.route-active.sheet-full .side-list { height: 86vh; height: 86dvh; }

            /* ===== Mobile hamburger menu =====
               Hide the row of tab buttons; show a single hamburger that opens
               a right-aligned dropdown. Keeps the clock/freshness/usage badge
               (those are small status indicators, not navigation). */
            .topbar .btn-home,
            .topbar .btn-map,
            .topbar .btn-dash,
            .topbar .btn-sold,
            .topbar .btn-mydealers,
            .topbar .btn-trips,
            .topbar .btn-ghost { display: none !important; }

            .topbar-hamburger {
                display: flex !important;
                align-items: center;
                justify-content: center;
                /* 44x44 matches iOS HIG min tap target — this is the only mobile nav control. */
                width: 44px;
                height: 44px;
                padding: 0;
                background: rgba(20, 24, 40, 0.6);
                border: 1px solid rgba(255,255,255,0.08);
                border-radius: 8px;
                color: rgba(255,255,255,0.85);
                cursor: pointer;
                pointer-events: auto;
                -webkit-tap-highlight-color: transparent;
            }
            .topbar-hamburger:active { background: rgba(20, 24, 40, 0.9); }
            .topbar-hamburger svg { width: 20px; height: 20px; }

            .topbar-menu {
                position: fixed;
                top: 60px;
                right: 12px;
                z-index: 100;
                display: none;
                flex-direction: column;
                min-width: 180px;
                padding: 6px;
                background: rgba(12, 14, 28, 0.96);
                border: 1px solid rgba(255,255,255,0.1);
                border-radius: 10px;
                box-shadow: 0 12px 28px rgba(0,0,0,0.5), 0 0 0 1px rgba(79,143,255,0.08);
                pointer-events: auto;
            }
            .topbar-menu.open { display: flex; }
            .topbar-menu-item {
                display: block;
                width: 100%;
                text-align: left;
                padding: 11px 14px;
                background: transparent;
                border: none;
                border-radius: 6px;
                color: rgba(255,255,255,0.85);
                font-family: inherit;
                font-size: 14px;
                font-weight: 500;
                cursor: pointer;
                -webkit-tap-highlight-color: transparent;
            }
            .topbar-menu-item:active,
            .topbar-menu-item:hover { background: rgba(79,143,255,0.12); color: rgba(255,255,255,1); }
        }

        /* ========== OTTO FLOATING CHAT (Map View) ========== */
        .office-star-marker {
            filter: drop-shadow(0 0 3px rgba(255,255,255,0.3));
        }

        .otto-fab {
            position: fixed;
            bottom: 28px;
            right: 28px;
            z-index: 50;
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background: rgba(12, 14, 28, 0.88);
            border: 1px solid rgba(79,143,255,0.2);
            box-shadow: 0 4px 24px rgba(79,143,255,0.15), 0 0 0 1px rgba(79,143,255,0.08);
            cursor: pointer;
            display: none;
            align-items: center;
            justify-content: center;
            transition: all 0.3s var(--ease-out-expo);
            animation: fabBreathe 3s ease-in-out infinite;
        }
        body.map-view .otto-fab { display: flex; }
        .otto-fab:hover {
            transform: scale(1.08);
            box-shadow: 0 4px 32px rgba(79,143,255,0.3), 0 0 16px rgba(79,143,255,0.15);
        }
        .otto-fab:active { transform: scale(0.95); }
        .otto-fab svg { width: 36px; height: 36px; filter: drop-shadow(0 0 8px rgba(79,143,255,0.4)); }
        .otto-fab.popup-open { animation: none; box-shadow: 0 4px 24px rgba(79,143,255,0.25); border-color: rgba(79,143,255,0.35); }
        .otto-fab-label {
            position: absolute;
            bottom: 62px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(12, 14, 28, 0.92);
            border: 1px solid rgba(79,143,255,0.18);
            border-radius: 10px;
            padding: 5px 12px;
            font-size: 11px;
            font-weight: 500;
            color: rgba(255,255,255,0.8);
            white-space: nowrap;
            pointer-events: none;
            box-shadow: 0 4px 16px rgba(0,0,0,0.3);
        }
        .otto-fab-label::after {
            content: '';
            position: absolute;
            bottom: -5px;
            left: 50%;
            transform: translateX(-50%) rotate(45deg);
            width: 8px;
            height: 8px;
            background: rgba(12, 14, 28, 0.92);
            border-right: 1px solid rgba(79,143,255,0.18);
            border-bottom: 1px solid rgba(79,143,255,0.18);
        }
        .otto-fab.popup-open .otto-fab-label { display: none; }
        @keyframes fabBreathe {
            0%, 100% { box-shadow: 0 4px 24px rgba(79,143,255,0.15), 0 0 0 1px rgba(79,143,255,0.08); }
            50% { box-shadow: 0 4px 32px rgba(79,143,255,0.28), 0 0 12px rgba(79,143,255,0.1); }
        }

        .otto-popup {
            position: fixed;
            bottom: 96px;
            right: 28px;
            z-index: 51;
            width: 380px;
            height: 500px;
            border-radius: 16px;
            background: rgba(10, 12, 24, 0.95);
            border: 1px solid rgba(255,255,255,0.08);
            box-shadow: 0 16px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(79,143,255,0.06);
            display: none;
            flex-direction: column;
            overflow: hidden;
        }
        .otto-popup.open {
            display: flex;
            animation: popupOpen 300ms var(--ease-spring) forwards;
        }
        .otto-popup.closing {
            animation: popupClose 200ms var(--ease-out-expo) forwards;
        }
        @keyframes popupOpen {
            from { opacity: 0; transform: scale(0.92) translateY(12px); }
            to { opacity: 1; transform: scale(1) translateY(0); }
        }
        @keyframes popupClose {
            from { opacity: 1; transform: scale(1) translateY(0); }
            to { opacity: 0; transform: scale(0.92) translateY(12px); }
        }

        .otto-popup-header {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 14px 16px;
            border-bottom: 1px solid rgba(255,255,255,0.06);
            flex-shrink: 0;
        }
        .otto-popup-header-eye { width: 28px; height: 28px; flex-shrink: 0; }
        .otto-popup-header-eye svg { width: 100%; height: 100%; filter: drop-shadow(0 0 6px rgba(79,143,255,0.4)); }
        .otto-popup-header-title { font-size: 15px; font-weight: 700; color: var(--text-primary); flex: 1; }
        .otto-popup-close {
            width: 28px; height: 28px;
            border-radius: 8px;
            border: none;
            background: rgba(255,255,255,0.04);
            color: rgba(255,255,255,0.4);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.15s;
        }
        .otto-popup-close:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }

        .otto-popup-scroll {
            flex: 1;
            overflow-y: auto;
            padding: 14px;
            scrollbar-width: thin;
            scrollbar-color: rgba(255,255,255,0.1) transparent;
        }
        .otto-popup-scroll::-webkit-scrollbar { width: 4px; }
        .otto-popup-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
        .otto-popup-messages {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }
        .otto-popup-messages .msg { gap: 10px; }
        .otto-popup-messages .msg-bubble { font-size: 13px; padding: 10px 14px; border-radius: 14px; }
        .otto-popup-messages .msg-orb { width: 28px; height: 28px; min-width: 28px; }
        .otto-popup-messages .thinking { gap: 10px; }

        .otto-popup-quick {
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding: 12px 14px;
        }
        .otto-popup-quick.hidden { display: none; }
        .otto-quick-btn {
            background: rgba(79,143,255,0.08);
            border: 1px solid rgba(79,143,255,0.2);
            color: rgba(255,255,255,0.85);
            font-size: 12.5px;
            padding: 10px 14px;
            border-radius: 10px;
            cursor: pointer;
            text-align: left;
            transition: all 0.15s ease;
            line-height: 1.4;
        }
        .otto-quick-btn:hover {
            background: rgba(79,143,255,0.15);
            border-color: rgba(79,143,255,0.35);
            transform: translateY(-1px);
        }
        .otto-popup-input-bar {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 10px 12px;
            border-top: 1px solid rgba(255,255,255,0.06);
            flex-shrink: 0;
        }
        .otto-popup-input {
            flex: 1;
            background: rgba(255,255,255,0.04);
            border: 1px solid var(--glass-border);
            border-radius: 20px;
            padding: 9px 14px;
            color: var(--text-primary);
            font-size: 13px;
            font-family: inherit;
            outline: none;
            transition: border-color 0.2s;
        }
        .otto-popup-input:focus { border-color: rgba(79,143,255,0.3); }
        .otto-popup-input::placeholder { color: rgba(255,255,255,0.25); }
        .otto-popup-send {
            width: 34px; height: 34px;
            border-radius: 50%;
            border: none;
            background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
            color: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            flex-shrink: 0;
        }
        .otto-popup-send:hover { transform: scale(1.06); }
        .otto-popup-send:active { transform: scale(0.94); }
        .otto-popup-send:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }
        .otto-popup-send svg { width: 16px; height: 16px; fill: none; stroke: white; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

        @media (max-width: 500px) {
            .otto-fab { width: 48px; height: 48px; bottom: 16px; right: 16px; }
            .otto-fab svg { width: 30px; height: 30px; }
            .otto-popup { width: calc(100vw - 32px); right: 16px; bottom: 76px; height: 420px; }
        }

        /* ========== EMBER DOT SYSTEM ========== */
        .ember {
            position: relative; display: flex; align-items: center; justify-content: center;
            transform: scale(var(--ember-scale, 1));
            transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
        }
        .ember svg { width: 100%; height: 100%; }
        .ember.tier-hot svg { filter: drop-shadow(0 0 5px rgba(239,68,68,0.6)); }
        .ember.tier-warm svg { filter: drop-shadow(0 0 4px rgba(255,140,0,0.5)); }
        .ember.tier-cold svg { filter: drop-shadow(0 0 3px rgba(65,105,225,0.4)); }
        .ember.tier-unscored svg { filter: drop-shadow(0 0 2px rgba(139,149,165,0.3)); }
        /* Route proximity highlighting */
        .ember.route-nearby { transform: scale(2) !important; z-index: 10 !important; }
        .ember.route-nearby svg { filter: brightness(1.5) !important; }
        .route-dimmed { opacity: 0.15 !important; transition: opacity 0.4s var(--smooth); }

        /* Dim all base markers/clusters when route proximity is active */
        body.map-view.route-preview .leaflet-marker-pane > .leaflet-marker-icon:not(.route-marker) {
            opacity: 0.12 !important; transition: opacity 0.4s var(--smooth);
        }
        body.map-view.route-preview .marker-cluster {
            opacity: 0.1 !important; transition: opacity 0.4s var(--smooth);
        }

        /* ========== HOVER TOOLTIPS ========== */
        .map-hover-tooltip {
            background: rgba(15,18,30,0.95) !important;
            border: 1px solid var(--glass-border) !important;
            border-radius: 8px !important;
            padding: 5px 10px !important;
            color: var(--text-primary) !important;
            font-family: 'Inter', sans-serif !important;
            font-size: 11px !important;
            font-weight: 500 !important;
            box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
            white-space: nowrap;
        }
        .map-hover-tooltip::before { border-top-color: rgba(15,18,30,0.92) !important; }

        /* ========== ROUTE OVERLAY PANEL ========== */
        .route-panel {
            display: flex;
            flex-direction: column;
            flex-shrink: 0;
            border-bottom: 1px solid rgba(255,255,255,0.06);
        }

        .route-panel-toggle {
            display: flex; align-items: center; justify-content: center; gap: 6px;
            padding: 9px 14px; width: 100%;
            background: none;
            border: none;
            border-bottom: 1px solid rgba(255,255,255,0.04);
            cursor: pointer;
            transition: all 0.2s var(--ease-out-expo);
            user-select: none;
        }
        .route-panel-toggle:hover {
            background: rgba(255,255,255,0.04);
        }
        .route-panel-toggle.active {
            background: rgba(79,143,255,0.04);
        }
        .route-panel-icon { width: 14px; height: 14px; color: var(--accent-blue); flex-shrink: 0; opacity: 0.7; }
        .route-panel-title {
            font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.7);
        }
        .route-panel-chevron {
            width: 10px; height: 10px; color: rgba(255,255,255,0.45); flex-shrink: 0;
            transition: transform 0.25s var(--ease-out-expo);
        }
        .route-panel-toggle.active .route-panel-chevron { transform: rotate(180deg); }

        .route-panel-body {
            display: flex; flex-direction: column; gap: 8px;
            padding: 0 14px;
            width: 100%;
            opacity: 0; pointer-events: none;
            max-height: 0; overflow: hidden;
            transition: all 0.2s var(--ease-out-expo);
        }
        .route-panel.open .route-panel-body {
            opacity: 1; pointer-events: auto;
            max-height: 400px;
            padding: 10px 14px;
            overflow: visible;
        }

        @keyframes routePanelIn {
            from { opacity: 0; transform: translateY(-8px) scale(0.96); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }
        .route-select-wrap { display: flex; flex-direction: column; gap: 4px; }
        .route-select-label {
            font-size: 10px; font-weight: 500; color: var(--text-tertiary);
            text-transform: uppercase; letter-spacing: 0.5px;
        }

        /* Route dropdowns */
        .route-dropdown { position: relative; user-select: none; }
        .route-dropdown.disabled { opacity: 0.4; pointer-events: none; }
        .route-dropdown-trigger {
            display: flex; align-items: center; justify-content: space-between; gap: 6px;
            padding: 6px 10px; border-radius: 8px;
            border: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.03);
            color: rgba(255,255,255,0.5); font-size: 11px; font-family: inherit; font-weight: 400;
            cursor: pointer; transition: all 150ms var(--ease-out-expo);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .route-dropdown-trigger:hover {
            border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.06);
            color: var(--text-primary);
        }
        .route-dropdown.open .route-dropdown-trigger {
            border-color: rgba(79,143,255,0.3); color: var(--text-primary);
        }
        .route-dropdown-chevron {
            width: 12px; height: 12px; opacity: 0.4; flex-shrink: 0;
            transition: transform .25s var(--spring);
        }
        .route-dropdown.open .route-dropdown-chevron { transform: rotate(180deg); }
        .route-dropdown-menu {
            position: fixed;
            padding: 4px; border-radius: 12px;
            border: 1px solid var(--glass-border);
            background: rgba(14,17,30,0.95);
            backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
            box-shadow: 0 12px 48px rgba(0,0,0,0.5);
            opacity: 0; pointer-events: none;
            transform: translateY(-4px) scale(0.96);
            transition: all .2s var(--spring);
            z-index: 110; max-height: 220px; overflow-y: auto;
            width: 280px;
        }
        .route-dropdown.open .route-dropdown-menu {
            opacity: 1; pointer-events: auto; transform: translateY(0) scale(1);
        }
        .route-dropdown-item {
            padding: 8px 10px; border-radius: 8px;
            font-size: 12px; color: var(--text-secondary);
            cursor: pointer; transition: all .15s var(--smooth);
        }
        .route-dropdown-item:hover { background: rgba(79,143,255,0.1); color: var(--text-primary); }
        .route-dropdown-item.active { color: var(--accent-blue); font-weight: 500; }
        .route-dropdown-item-sub { font-size: 10px; color: var(--text-tertiary); margin-top: 2px; }

        /* Route dropdown scrollbar */
        .route-dropdown-menu::-webkit-scrollbar { width: 4px; }
        .route-dropdown-menu::-webkit-scrollbar-track { background: transparent; }
        .route-dropdown-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

        /* Show All Routes toggle */
        .route-show-all-btn {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 6px 10px; margin-top: 4px; border-radius: 8px;
            border: 1px solid rgba(79,143,255,0.25); background: rgba(79,143,255,0.07);
            color: rgba(79,143,255,0.85); font-size: 11px; font-family: inherit; font-weight: 500;
            cursor: pointer; transition: all .15s var(--smooth);
        }
        .route-show-all-btn:hover { background: rgba(79,143,255,0.14); color: var(--accent-blue); }
        .route-show-all-btn.active {
            background: var(--accent-blue); color: #fff;
            border-color: var(--accent-blue);
        }

        /* Overlay-mode dropdown items (with checkbox + color swatch) */
        .route-dropdown-item.overlay-item {
            display: flex; align-items: center; gap: 8px; padding: 7px 10px;
        }
        .route-overlay-checkbox {
            flex-shrink: 0; width: 12px; height: 12px; border-radius: 3px;
            border: 1.5px solid; transition: background .12s ease;
        }
        .route-overlay-swatch {
            flex-shrink: 0; width: 3px; height: 22px; border-radius: 2px;
        }

        /* Route list panel — overlay mode parent-trip toggles */
        .route-list-panel {
            margin-top: 8px;
            padding: 8px;
            border-radius: 10px;
            background: rgba(255,255,255,0.02);
            border: 1px solid rgba(255,255,255,0.06);
            max-height: 380px;
            overflow-y: auto;
        }
        .route-list-toolbar {
            display: flex; align-items: center; gap: 6px;
            padding: 0 4px 8px 4px;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            margin-bottom: 6px;
        }
        .route-list-summary {
            flex: 1;
            font-family: 'IBM Plex Mono', monospace;
            font-size: 9.5px;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: var(--text-tertiary);
        }
        .route-list-action {
            font-family: inherit;
            font-size: 10px; font-weight: 500;
            padding: 4px 8px; border-radius: 6px;
            border: 1px solid rgba(255,255,255,0.08);
            background: rgba(255,255,255,0.03);
            color: var(--text-secondary);
            cursor: pointer; transition: all .12s ease;
        }
        .route-list-action:hover {
            background: rgba(79,143,255,0.12);
            color: var(--accent-blue);
            border-color: rgba(79,143,255,0.3);
        }
        .route-list-body {
            display: flex; flex-direction: column; gap: 2px;
        }
        .route-list-row {
            display: flex; align-items: center; gap: 8px;
            padding: 7px 8px; border-radius: 8px;
            cursor: pointer; transition: background .12s ease;
            user-select: none;
        }
        .route-list-row:hover { background: rgba(255,255,255,0.04); }
        .route-list-row.active { background: rgba(79,143,255,0.06); }
        .route-list-check {
            flex-shrink: 0; width: 14px; height: 14px;
            border-radius: 4px; border: 1.5px solid;
            transition: background .12s ease;
            position: relative;
        }
        .route-list-check.on::after {
            content: ''; position: absolute;
            left: 3px; top: 0px; width: 4px; height: 8px;
            border: solid #fff; border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }
        .route-list-swatch {
            flex-shrink: 0; width: 3px; height: 28px; border-radius: 2px;
        }
        .route-list-info { flex: 1; min-width: 0; }
        .route-list-name {
            font-size: 12px; font-weight: 500;
            color: var(--text-primary);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .route-list-meta {
            font-size: 10px; color: var(--text-tertiary);
            margin-top: 1px;
        }

        /* Floating "Exit route view" button — pinned to the viewport corner whenever a route is active */
        .route-exit-floating {
            position: fixed; top: 16px; right: 16px; z-index: 9998;
            display: none; align-items: center; gap: 6px;
            padding: 9px 16px; border-radius: 10px;
            border: 2px solid rgba(239,68,68,0.5);
            background: rgba(20,20,28,0.95);
            color: #ef4444; font-size: 12px; font-family: inherit; font-weight: 700;
            cursor: pointer; backdrop-filter: blur(8px);
            box-shadow: 0 4px 20px rgba(0,0,0,0.5);
            transition: all .15s var(--smooth);
        }
        .route-exit-floating:hover { background: #ef4444; color: #fff; border-color: #ef4444; }
        body.route-active .route-exit-floating { display: flex; }

        /* X close button on trip preview modal */
        .tm-modal-close-x {
            position: fixed; top: 20px; right: 20px; z-index: 9999;
            display: flex; align-items: center; justify-content: center;
            width: 44px; height: 44px; border-radius: 50%;
            border: 2px solid rgba(239,68,68,0.6);
            background: rgba(20,20,28,0.95);
            color: #ef4444; cursor: pointer;
            box-shadow: 0 4px 16px rgba(0,0,0,0.5);
            transition: all .15s var(--smooth);
        }
        .tm-modal-close-x:hover {
            background: #ef4444; color: #fff;
            border-color: #ef4444; transform: scale(1.05);
        }
        .tm-modal-close-x svg { width: 18px; height: 18px; stroke-width: 2.5; }

        /* Clear route button */
        .route-clear-btn {
            display: flex; align-items: center; justify-content: center; gap: 6px;
            padding: 7px 12px; border-radius: 10px;
            border: 1px solid rgba(239,68,68,0.2); background: rgba(239,68,68,0.06);
            color: rgba(239,68,68,0.7); font-size: 11px; font-family: inherit; font-weight: 500;
            cursor: pointer; transition: all .2s var(--smooth);
        }
        .route-clear-btn:hover {
            background: rgba(239,68,68,0.12); color: #ef4444;
            border-color: rgba(239,68,68,0.35);
        }

        /* Route polyline glow + endpoints */
        .route-endpoint {
            display: flex; align-items: center; justify-content: center;
            width: 28px; height: 28px; border-radius: 50%;
            border: 2px solid #fff; font-size: 12px; font-weight: 700;
            font-family: 'Inter', sans-serif; color: #fff;
        }
        .route-endpoint.start { background: #22c55e; box-shadow: 0 0 16px rgba(34,197,94,0.4); }
        .route-endpoint.end { background: #ef4444; box-shadow: 0 0 16px rgba(239,68,68,0.4); }

        /* Animated dashes on route polyline */
        path.route-dash-animated { animation: routeDash 1.2s linear infinite; }
        @keyframes routeDash { to { stroke-dashoffset: -23; } }

        /* Pulsing route dealer markers */
        .route-dealer-marker { position: relative; width: 16px; height: 16px; }
        .route-dealer-marker .dot {
            width: 12px; height: 12px; border-radius: 50%;
            border: 2px solid rgba(255,255,255,0.5);
            position: absolute; top: 2px; left: 2px;
        }
        .route-dealer-marker .pulse-ring {
            position: absolute; inset: -4px; border-radius: 50%;
            border: 2px solid; opacity: 0;
            animation: routePulse 2s ease-out infinite;
        }
        @keyframes routePulse {
            0% { transform: scale(0.8); opacity: 0.8; }
            100% { transform: scale(2); opacity: 0; }
        }

        /* Dim background markers when route active */
        body.map-view.route-active .leaflet-marker-pane > .leaflet-marker-icon:not(.route-marker) {
            opacity: 0.15 !important; transition: opacity .4s var(--smooth);
        }
        body.map-view.route-active .marker-cluster {
            opacity: 0.12 !important; transition: opacity .4s var(--smooth);
        }

        /* Mobile responsive */
        @media (max-width: 600px) {
            /* Mobile map: stats bar — compact single row pinned below topbar */
            .map-stats {
                right: auto; left: 8px; right: 8px; transform: none;
                top: 54px; padding: 5px 10px; border-radius: 10px;
                font-size: 10px; gap: 3px 6px;
                white-space: normal; flex-wrap: wrap; justify-content: center;
            }
            .map-stat { font-size: 10px; }
            .map-stat-value { font-size: 11px; }

            /* Mobile map: search bar — full width below stats */
            .map-search { top: 86px; left: 8px; right: 8px; width: auto; }
            .map-search-input-wrap { padding: 6px 10px; border-radius: 10px; }
            .map-search-input { font-size: 13px; }

            /* Mobile map: filters — compact row below search */
            .map-filters { top: 122px; left: 8px; right: 8px; gap: 5px; flex-wrap: wrap; }
            .filter-pill { padding: 5px 10px; font-size: 11px; border-radius: 8px; }

            /* Mobile map: route panel — hidden (inside sidebar which is hidden) */
            .route-panel-toggle { padding: 6px 12px; font-size: 12px; }

            /* Mobile map: legend — compact, above Plan a Trip */
            .map-legend { bottom: 62px; left: 8px; padding: 5px 10px; border-radius: 8px; gap: 8px; }
            .map-legend-item { font-size: 10px; gap: 3px; }
            .map-legend-dot { width: 6px; height: 6px; }
            .map-legend-title { font-size: 10px; }
            .scoring-key { bottom: 36px; left: 0; }

            /* Mobile map: Plan a Trip button — smaller, centered bottom */
            .map-plan-trip-btn { bottom: 16px; padding: 8px 16px; font-size: 12px; border-radius: 10px; }

            /* Mobile map: route stats overlay */
            .route-stats { font-size: 10px; top: 54px; left: 8px; padding: 5px 10px; }
        }

        /* Plan Trip button on map */
        .map-plan-trip-btn {
            position: fixed;
            bottom: 28px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 16;
            display: none;
            align-items: center;
            gap: 8px;
            padding: 10px 20px;
            border-radius: 12px;
            border: 1px solid rgba(79,143,255,0.3);
            background: rgba(12, 14, 28, 0.85);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            color: var(--accent-blue);
            font-size: 14px;
            font-family: inherit;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.25s var(--ease-out-expo);
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
        }
        body.map-view .map-plan-trip-btn { display: flex; }
        body.map-view.route-active .map-plan-trip-btn { display: none; }
        .map-plan-trip-btn:hover {
            background: rgba(12, 14, 28, 0.95);
            border-color: rgba(79,143,255,0.5);
            box-shadow: 0 4px 24px rgba(79,143,255,0.15);
        }
        .map-plan-trip-btn svg { width: 16px; height: 16px; }

        /* ========== TRIP MANAGER VIEW ========== */
        body.trip-manager .topbar-center,
        body.trip-manager .topbar .btn-ghost,
        body.trip-manager .topbar .btn-home,
        body.trip-manager .usage-badge,
        body.trip-manager .topbar .btn-trips {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }

        body.trip-manager .chat-scroll {
            padding-top: 76px;
        }

        body.trip-manager .chat-input-wrap { display: none; }

        .btn-trips {
            padding: 6px 14px;
            border-radius: 8px;
            border: none;
            background: transparent;
            color: rgba(255,255,255,0.45);
            font-size: 12px;
            font-family: inherit;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s var(--smooth);
        }

        .btn-trips:hover {
            background: rgba(255,255,255,0.06);
            color: var(--text-primary);
        }
        body.trip-manager .topbar .btn-trips {
            color: var(--text-primary);
            background: rgba(255,255,255,0.08);
        }

        .tm-container {
            max-width: 960px;
            margin: 0 auto;
            padding: 20px 0;
            width: 100%;
        }

        .tm-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 24px;
        }

        .tm-title {
            font-size: 28px;
            font-weight: 700;
            background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(79,143,255,0.9), rgba(168,85,247,0.8));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .tm-subtitle {
            font-size: 15px;
            color: var(--text-tertiary);
            margin-top: 2px;
        }

        .tm-rep-select {
            background: var(--glass);
            border: 1px solid var(--glass-border);
            border-radius: 12px;
            color: var(--text-primary);
            color-scheme: dark;
            font-family: inherit;
            font-size: 14px;
            padding: 0 18px;
            height: 46px;
            outline: none;
            cursor: pointer;
            transition: border-color 0.2s;
        }

        .tm-rep-select:focus { border-color: var(--accent-blue); }

        /* TM compact hero */
        /* TM Header Row — title left, rep controls right */
        .tm-header-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 24px;
        }
        .tm-header-title {
            font-size: 24px;
            font-weight: 700;
            background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(79,143,255,0.9), rgba(168,85,247,0.8));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            white-space: nowrap;
        }
        .tm-header-controls {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        /* TM KPI Row */
        .tm-kpi-row {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
            margin-bottom: 24px;
        }
        .tm-kpi-card {
            background: var(--glass);
            border: 1px solid var(--glass-border);
            border-radius: 14px;
            padding: 16px 18px;
            text-align: center;
            transition: border-color 0.2s;
        }
        .tm-kpi-card:hover { border-color: rgba(79,143,255,0.2); }
        .tm-kpi-value {
            font-size: 24px;
            font-weight: 700;
            color: var(--text-primary);
            line-height: 1.2;
        }
        .tm-kpi-label {
            font-size: 12px;
            font-weight: 500;
            color: var(--text-tertiary);
            margin-top: 4px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* Trip management body */
        .tm-body {
            padding: 20px 28px 60px;
            max-width: 960px;
            margin: 0 auto;
        }

        .tm-controls {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 24px;
            flex-wrap: wrap;
        }

        .tm-rep-select {
            min-width: 160px;
        }

        .tm-icon-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 0 22px;
            height: 46px;
            border-radius: 12px;
            border: 1px solid var(--glass-border);
            background: var(--glass);
            color: var(--text-secondary);
            font-size: 13px;
            font-weight: 500;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .tm-icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); border-color: rgba(255,255,255,0.12); }
        .tm-icon-btn svg { flex-shrink: 0; }

        .tm-tab-bar {
            display: flex;
            background: var(--glass);
            border-radius: 10px;
            border: 1px solid var(--glass-border);
            overflow: hidden;
            height: 40px;
        }

        .tm-tab {
            padding: 0 20px;
            height: 40px;
            display: flex;
            align-items: center;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-tertiary);
            cursor: pointer;
            transition: all 0.2s;
            border: none;
            background: transparent;
            font-family: inherit;
        }

        .tm-tab.active {
            color: var(--text-primary);
            background: rgba(79,143,255,0.12);
        }

        .tm-controls-right {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-left: auto;
        }

        .tm-new-trip-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 0 20px;
            height: 36px;
            border-radius: 10px;
            border: 1px solid rgba(79,143,255,0.2);
            background: rgba(79,143,255,0.08);
            color: var(--accent-blue);
            font-size: 12px;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .tm-new-trip-btn:hover { background: rgba(79,143,255,0.18); border-color: rgba(79,143,255,0.35); }
        .tm-new-trip-btn svg { flex-shrink: 0; }

        .tm-trips-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .tm-trip-card {
            background: var(--glass);
            border: 1px solid var(--glass-border);
            border-left: 3px solid rgba(79,143,255,0.5);
            border-radius: 14px;
            padding: 16px 18px;
            position: relative;
            transition: all 0.25s var(--smooth);
            animation: tmFadeIn 0.3s ease;
        }
        .tm-trip-card.today-card { border-left-color: #22c55e; }
        .tm-trip-card.past-card { border-left-color: rgba(255,255,255,0.12); }
        .tm-trip-card:hover { border-color: rgba(79,143,255,0.25); border-left-color: rgba(79,143,255,0.6); background: rgba(255,255,255,0.04); transform: translateY(-1px); }
        .tm-trip-card.today-card:hover { border-left-color: #34d399; }
        .tm-trip-card.past-card:hover { border-left-color: rgba(255,255,255,0.2); }

        .tm-trip-top {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 8px;
        }

        .tm-card-badge {
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            padding: 3px 10px;
            border-radius: 100px;
            white-space: nowrap;
        }
        .tm-card-badge.today { background: rgba(34,197,94,0.15); color: #22c55e; }
        .tm-card-badge.upcoming { background: rgba(79,143,255,0.12); color: #4f8fff; }
        .tm-card-badge.past { background: rgba(255,255,255,0.06); color: var(--text-tertiary); }

        .tm-card-date {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .tm-card-route {
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 6px;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .tm-card-route svg { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.5; }

        .tm-card-notes {
            font-size: 12px;
            color: var(--text-tertiary);
            margin-bottom: 10px;
            font-style: italic;
            line-height: 1.5;
        }

        .tm-card-actions {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .tm-card-act {
            font-size: 11px;
            font-weight: 500;
            padding: 5px 12px;
            border-radius: 8px;
            border: none;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.2s;
            background: rgba(255,255,255,0.04);
            color: var(--text-tertiary);
        }
        .tm-card-act:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
        .tm-card-act.primary { background: rgba(79,143,255,0.1); color: var(--accent-blue); }
        .tm-card-act.primary:hover { background: rgba(79,143,255,0.2); }
        .tm-card-act.danger:hover { color: #f87171; background: rgba(248,113,113,0.1); }

        .tm-empty {
            text-align: center;
            padding: 60px 20px;
            color: var(--text-tertiary);
        }
        .tm-empty-icon { margin-bottom: 20px; opacity: 0.4; }
        .tm-empty-icon svg { width: 48px; height: 48px; }
        .tm-empty-title { font-size: 17px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
        .tm-empty-sub { font-size: 13px; color: var(--text-tertiary); line-height: 1.6; max-width: 280px; margin: 0 auto 20px; }
        .tm-empty-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 24px;
            border-radius: 12px;
            border: 1px solid rgba(79,143,255,0.25);
            background: rgba(79,143,255,0.1);
            color: var(--accent-blue);
            font-size: 14px;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
        }
        .tm-empty-btn:hover { background: rgba(79,143,255,0.2); border-color: rgba(79,143,255,0.4); }

        /* Dealer accordion */
        .tm-dealers {
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid var(--glass-border);
            animation: tmFadeIn 0.2s ease;
        }

        .tm-dealer-row {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 0;
            font-size: 12px;
            color: var(--text-secondary);
        }
        .tm-dealer-row + .tm-dealer-row { border-top: 1px solid rgba(255,255,255,0.03); }

        .tm-dealer-score {
            font-size: 10px;
            font-weight: 600;
            padding: 2px 6px;
            border-radius: 4px;
            min-width: 24px;
            text-align: center;
        }
        .tm-dealer-score.hot { background: rgba(249,115,22,0.15); color: #f97316; }
        .tm-dealer-score.warm { background: rgba(234,179,8,0.15); color: #eab308; }
        .tm-dealer-score.cold { background: rgba(255,255,255,0.06); color: var(--text-tertiary); }

        .tm-dealer-name { font-weight: 500; color: var(--text-primary); flex: 1; }
        .tm-dealer-dist { color: var(--text-tertiary); font-size: 11px; white-space: nowrap; }

        /* Trip card — new named trips */
        .tm-card-name { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
        .tm-card-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-tertiary); }
        .tm-meta-dot { opacity: 0.4; }
        .tm-card-rep { margin-left: auto; font-size: 11px; color: var(--text-tertiary); }
        .tm-card-rep-pill { margin-left: auto; width: 28px; height: 28px; border-radius: 50%; background: rgba(79,143,255,0.12); color: var(--accent-blue); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; letter-spacing: -0.5px; }
        .tm-status-badge { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding: 3px 10px; border-radius: 100px; }
        .tm-trip-card { cursor: pointer; }

        .tm-progress-bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,0.06); margin-top: 10px; overflow: hidden; }
        .tm-progress-bar.lg { height: 6px; border-radius: 6px; }
        .tm-progress-fill { height: 100%; border-radius: inherit; transition: width 0.4s ease; }

        .tm-kpi-row { grid-template-columns: repeat(4, 1fr); }

        /* Detail view */
        .tm-detail-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
        .tm-back-btn { display: flex; align-items: center; gap: 6px; background: none; border: none; color: var(--accent-blue); font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; padding: 6px 0; }
        .tm-back-btn:hover { opacity: 0.8; }
        .tm-detail-name { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; }
        .tm-detail-info { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
        .tm-detail-status { font-size: 11px; font-weight: 600; text-transform: uppercase; padding: 4px 12px; border-radius: 100px; cursor: pointer; font-family: inherit; appearance: none; -webkit-appearance: none; }
        .tm-detail-dates { font-size: 13px; color: var(--text-secondary); }
        .tm-detail-rep { font-size: 13px; color: var(--text-tertiary); }
        .tm-detail-notes { font-size: 13px; color: var(--text-tertiary); font-style: italic; margin-bottom: 16px; line-height: 1.5; }
        .tm-detail-progress { margin-bottom: 20px; }
        .tm-detail-progress-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
        .tm-detail-actions { display: flex; gap: 8px; }

        /* Day tabs */
        .tm-day-tabs { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 4px; }
        .tm-day-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--glass); cursor: pointer; font-family: inherit; transition: all 0.2s; min-width: 72px; }
        .tm-day-tab:hover { border-color: rgba(79,143,255,0.3); }
        .tm-day-tab.active { border-color: var(--accent-blue); background: rgba(79,143,255,0.08); }
        .tm-day-tab-num { font-size: 12px; font-weight: 600; color: var(--text-primary); }
        .tm-day-tab-date { font-size: 10px; color: var(--text-tertiary); }
        .tm-day-tab-count { font-size: 10px; color: var(--accent-blue); font-weight: 600; }

        /* Day route header */
        .tm-day-route { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; padding: 10px 14px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 10px; }

        /* Stop cards — checklist */
        .tm-stops-list { display: flex; flex-direction: column; gap: 4px; }
        .tm-stop-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 12px; transition: all 0.2s; }
        .tm-stop-card:hover { border-color: rgba(79,143,255,0.2); background: rgba(255,255,255,0.04); }
        .tm-stop-card.visited { border-left: 3px solid #22c55e; }
        .tm-stop-card.excluded { opacity: 0.35; }
        .tm-stop-check { flex-shrink: 0; }
        .tm-check { width: 18px; height: 18px; accent-color: #22c55e; cursor: pointer; }
        .tm-stop-order { width: 22px; height: 22px; border-radius: 50%; background: rgba(79,143,255,0.12); color: var(--accent-blue); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .tm-stop-info { flex: 1; min-width: 0; }
        .tm-stop-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .tm-stop-loc { font-size: 11px; color: var(--text-tertiary); }
        .tm-stop-stats { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
        .tm-stop-score { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
        .tm-stop-veh { font-size: 11px; color: var(--text-tertiary); }
        .tm-stop-smyrna { font-size: 11px; color: #22c55e; font-weight: 500; }
        .tm-stop-brand { font-size: 11px; color: var(--text-tertiary); font-style: italic; }
        .tm-stop-kpi { font-size: 10px; padding: 3px 7px; border-radius: 6px; background: rgba(255,255,255,0.04); color: var(--text-tertiary); white-space: nowrap; }
        .tm-stop-kpi.smyrna { background: rgba(34,197,94,0.1); color: #22c55e; }
        .tm-stop-kpi.aging { background: rgba(249,115,22,0.08); color: #fb923c; }
        .tm-stop-toggle { background: none; border: none; color: var(--text-tertiary); font-size: 14px; cursor: pointer; padding: 4px 6px; border-radius: 6px; transition: all 0.2s; }
        .tm-stop-toggle:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }

        .tm-add-dealers-btn { display: block; width: 100%; padding: 12px; margin-top: 8px; border: 1px dashed rgba(79,143,255,0.3); border-radius: 12px; background: none; color: var(--accent-blue); font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit; transition: all 0.2s; }
        .tm-add-dealers-btn:hover { background: rgba(79,143,255,0.06); border-color: rgba(79,143,255,0.5); }

        /* Suggestions modal */
        .tm-sug-row { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,0.04); cursor: pointer; transition: background 0.15s; }
        .tm-sug-row:hover { background: rgba(255,255,255,0.03); }
        .tm-sug-row.already { opacity: 0.4; }
        .tm-sug-score { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 6px; min-width: 28px; text-align: center; }
        .tm-sug-name { font-size: 13px; font-weight: 500; color: var(--text-primary); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .tm-sug-loc { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; }
        .tm-sug-dist { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; }

        /* Wizard steps */
        .tm-wiz-step { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent-blue); margin-bottom: 20px; }
        .tm-modal.tm-wiz-preview { max-width: 920px; max-height: 90vh; overflow-y: auto; padding: 32px 36px; }
        .tm-wiz-preview-header { }
        .tm-wiz-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 0; }
        .tm-spinner { width: 32px; height: 32px; border: 3px solid rgba(79,143,255,0.15); border-top-color: var(--accent-blue); border-radius: 50%; animation: tmSpin 0.8s linear infinite; }
        @keyframes tmSpin { to { transform: rotate(360deg); } }

        .tm-wiz-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 18px; background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border); border-radius: 12px; overflow: hidden; }
        .tm-wiz-stat { text-align: center; padding: 16px 8px; background: #1a1a2e; }
        .tm-wiz-stat-val { display: block; font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
        .tm-wiz-stat-lbl { display: block; font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.4px; margin-top: 4px; }

        .tm-wiz-days { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
        .tm-wiz-day-card { background: var(--glass); border: 1px solid var(--glass-border); border-radius: 12px; overflow: hidden; transition: border-color 0.2s; }
        .tm-wiz-day-card:hover { border-color: rgba(79,143,255,0.2); }
        .tm-wiz-day-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; cursor: pointer; gap: 16px; }
        .tm-wiz-day-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
        .tm-wiz-day-num { font-size: 14px; font-weight: 700; color: var(--accent-blue); white-space: nowrap; }
        .tm-wiz-day-route { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .tm-wiz-day-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
        .tm-wiz-day-meta { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }
        .tm-wiz-day-hot { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: rgba(249,115,22,0.15); color: #f97316; }
        .tm-wiz-day-warm { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: rgba(234,179,8,0.15); color: #eab308; }
        .tm-wiz-day-chevron { font-size: 12px; color: var(--text-tertiary); transition: transform 0.2s; }
        .tm-wiz-day-chevron.open { transform: rotate(180deg); }

        .tm-wiz-dealer-list { border-top: 1px solid rgba(255,255,255,0.04); padding: 6px 14px 14px; }
        .tm-wiz-day-card { contain: layout style; }
        .tm-wiz-dealer { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; transition: background 0.15s; }
        .tm-wiz-dealer:hover { background: rgba(255,255,255,0.03); }
        .tm-wiz-dealer-score-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; flex-shrink: 0; min-width: 40px; }
        .tm-wiz-dealer-score { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 8px; min-width: 36px; text-align: center; }
        .tm-wiz-dealer-info { flex: 1; min-width: 0; }
        .tm-wiz-dealer-name { font-size: 14px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .tm-wiz-dealer-loc { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .tm-wiz-dealer-tier { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
        .tm-wiz-dealer-tier.hot { color: #f97316; }
        .tm-wiz-dealer-tier.warm { color: #eab308; }
        .tm-wiz-dealer-tier.cold { color: var(--text-tertiary); }
        .tm-wiz-sold-tag { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: rgba(239,68,68,0.15); color: #ef4444; letter-spacing: 0.3px; vertical-align: middle; margin-left: 6px; }
        .tm-wiz-map-badge { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 10px; background: rgba(79,143,255,0.08); border: 1px solid rgba(79,143,255,0.2); border-radius: 10px; font-size: 12px; color: var(--accent-blue); }
        .tm-wiz-map-badge b { color: var(--text-primary); font-weight: 500; }
        .tm-wiz-map-badge-clear { background: none; border: none; color: rgba(255,255,255,0.4); font-size: 16px; cursor: pointer; padding: 0 2px; margin-left: auto; line-height: 1; transition: color 0.15s; }
        .tm-wiz-map-badge-clear:hover { color: #f87171; }
        .tm-wiz-filterbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; padding: 12px 14px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 12px; }
        .tm-wiz-filterbar-left { display: flex; gap: 4px; flex-wrap: wrap; }
        .tm-wiz-filterbar-right { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
        .tm-wiz-filter { font-size: 11px; font-weight: 600; padding: 6px 12px; border-radius: 8px; border: 1px solid transparent; background: rgba(255,255,255,0.04); color: var(--text-tertiary); cursor: pointer; transition: all 0.15s; }
        .tm-wiz-filter:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
        .tm-wiz-filter.active { background: rgba(79,143,255,0.15); border-color: rgba(79,143,255,0.3); color: var(--accent-blue); }
        .tm-wiz-filter.active.sold { background: rgba(249,115,22,0.15); border-color: rgba(249,115,22,0.3); color: #f97316; }
        .tm-wiz-select { background: #151824; border: 1px solid var(--glass-border); border-radius: 8px; color: var(--text-primary); font-family: inherit; font-size: 12px; padding: 6px 10px; outline: none; cursor: pointer; min-width: 130px; transition: border-color 0.2s; color-scheme: dark; }
        .tm-wiz-select:focus { border-color: var(--accent-blue); }
        .tm-wiz-dealer.excluded { opacity: 0.35; }
        .tm-wiz-dealer.excluded .tm-wiz-dealer-name { text-decoration: line-through; }
        .tm-wiz-day-card.expanded { border-color: rgba(79,143,255,0.15); }

        /* Inline chat at bottom */
        .tm-chat-wrap {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 50;
            background: linear-gradient(180deg, rgba(10,10,20,0) 0%, rgba(10,10,20,0.85) 30%, rgba(10,10,20,0.95) 100%);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            padding-top: 20px;
            display: none;
        }
        body.trip-manager .tm-chat-wrap { display: block; }

        .tm-chat-messages {
            max-height: 300px;
            overflow-y: auto;
            padding: 12px 20px 0;
            max-width: 600px;
            margin: 0 auto;
            display: none;
        }
        .tm-chat-messages.has-msgs { display: block; }

        .tm-chat-msg {
            margin-bottom: 10px;
            font-size: 13px;
            line-height: 1.5;
        }
        .tm-chat-msg.user { color: var(--text-primary); text-align: right; }
        .tm-chat-msg.user span { background: rgba(79,143,255,0.12); padding: 6px 12px; border-radius: 12px 12px 2px 12px; display: inline-block; }
        .tm-chat-msg.bot { color: var(--text-secondary); }
        .tm-chat-msg.bot .tm-chat-bubble { background: var(--glass); border: 1px solid var(--glass-border); padding: 10px 14px; border-radius: 2px 12px 12px 12px; }

        .tm-chat-input-row {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 20px 14px;
            max-width: 600px;
            margin: 0 auto;
        }

        .tm-chat-input {
            flex: 1;
            padding: 11px 16px;
            border-radius: 12px;
            border: 1px solid var(--glass-border);
            background: rgba(255,255,255,0.04);
            color: var(--text-primary);
            font-family: inherit;
            font-size: 13px;
            outline: none;
            transition: border-color 0.2s;
        }
        .tm-chat-input:focus { border-color: rgba(79,143,255,0.4); background: rgba(255,255,255,0.06); }
        .tm-chat-input::placeholder { color: var(--text-tertiary); }

        .tm-chat-send {
            width: 38px;
            height: 38px;
            border-radius: 10px;
            border: none;
            background: var(--accent-blue);
            color: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            flex-shrink: 0;
        }
        .tm-chat-send:hover { filter: brightness(1.15); }
        .tm-chat-send:disabled { opacity: 0.4; cursor: default; }

        .tm-chat-chips {
            display: flex;
            gap: 6px;
            padding: 8px 20px 6px;
            max-width: 600px;
            margin: 0 auto;
            flex-wrap: wrap;
            justify-content: center;
        }

        .tm-chat-chip {
            font-size: 11px;
            padding: 5px 12px;
            border-radius: 100px;
            border: 1px solid var(--glass-border);
            background: var(--glass);
            color: var(--text-tertiary);
            cursor: pointer;
            font-family: inherit;
            transition: all 0.2s;
        }
        .tm-chat-chip:hover { color: var(--text-primary); border-color: rgba(79,143,255,0.3); background: rgba(79,143,255,0.06); }

        /* Add rep modal */
        .tm-add-rep-fields { display: flex; flex-direction: column; gap: 12px; }
        .tm-add-rep-row { display: flex; gap: 10px; }
        .tm-add-rep-row > .tm-field { flex: 1; }
        .tm-tags-input { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 10px; min-height: 38px; align-items: center; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 10px; cursor: text; transition: border-color 0.2s; }
        .tm-tags-input:focus-within { border-color: var(--accent-blue); }
        .tm-tags-input input { background: none; border: none; outline: none; color: var(--text-primary); font-family: inherit; font-size: 13px; flex: 1; min-width: 60px; }
        .tm-tags-input input::placeholder { color: var(--text-tertiary); }
        .tm-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: rgba(79,143,255,0.12); color: var(--accent-blue); font-size: 12px; font-weight: 500; }
        .tm-tag-x { cursor: pointer; opacity: 0.6; font-size: 14px; line-height: 1; }
        .tm-tag-x:hover { opacity: 1; }

        /* Aurora blobs for TM */

        /* Suggestion cards grid */
        .tm-suggestions {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 24px;
            position: relative;
            z-index: 2;
            justify-content: center;
            max-width: 600px;
        }

        .tm-sug-card {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 18px 10px 14px;
            border-radius: 100px;
            background: rgba(255,255,255,0.05);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255,255,255,0.08);
            cursor: pointer;
            transition: all 0.3s var(--smooth);
            opacity: 0;
            animation: tmCardEntrance 0.5s cubic-bezier(0.16,1,0.3,1) forwards;
            white-space: nowrap;
        }

        .tm-sug-card:nth-child(1) { animation-delay: 0.5s; }
        .tm-sug-card:nth-child(2) { animation-delay: 0.6s; }
        .tm-sug-card:nth-child(3) { animation-delay: 0.7s; }
        .tm-sug-card:nth-child(4) { animation-delay: 0.8s; }

        @keyframes tmCardEntrance { 0% { opacity: 0; transform: translateY(12px); } 100% { opacity: 1; transform: translateY(0); } }

        .tm-sug-card:hover {
            background: rgba(79,143,255,0.12);
            border-color: rgba(79,143,255,0.3);
            transform: translateY(-2px) scale(1.02);
            box-shadow: 0 4px 20px rgba(79,143,255,0.15);
        }

        .tm-sug-icon {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .tm-sug-icon svg {
            width: 14px;
            height: 14px;
        }

        .sug-hot .tm-sug-icon { background: rgba(239,68,68,0.2); color: #ef4444; }
        .sug-surge .tm-sug-icon { background: rgba(34,197,94,0.2); color: #22c55e; }
        .sug-target .tm-sug-icon { background: rgba(79,143,255,0.2); color: #4f8fff; }
        .sug-territory .tm-sug-icon { background: rgba(0,212,255,0.2); color: #00d4ff; }

        .tm-sug-title {
            font-size: 13px;
            font-weight: 500;
            color: rgba(255,255,255,0.85);
            line-height: 1;
        }

        .tm-sug-text { display: contents; }
        .tm-sug-sub { display: none; }

        /* Trip form modal overlay */
        .tm-overlay {
            position: fixed;
            inset: 0;
            z-index: 100;
            background: rgba(0,0,0,0.6);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            animation: tmFadeIn 0.2s ease-out;
        }

        @keyframes tmFadeIn { from { opacity: 0; } to { opacity: 1; } }

        .tm-modal {
            background: #1a1a2e;
            border: 1px solid var(--glass-border);
            border-radius: 20px;
            padding: 28px;
            width: 100%;
            max-width: 420px;
            animation: tmSlideUp 0.25s var(--spring);
        }

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

        .tm-modal-title {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 20px;
            color: var(--text-primary);
        }

        .tm-field {
            margin-bottom: 16px;
        }

        .tm-field label {
            display: block;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-secondary);
            margin-bottom: 6px;
        }

        .tm-field input, .tm-field textarea {
            width: 100%;
            padding: 10px 14px;
            border-radius: 10px;
            border: 1px solid var(--glass-border);
            background: var(--glass);
            color: var(--text-primary);
            font-family: inherit;
            font-size: 14px;
            outline: none;
            transition: border-color 0.2s;
        }

        .tm-field input:focus, .tm-field textarea:focus {
            border-color: var(--accent-blue);
        }

        .tm-field textarea {
            height: 60px;
            resize: vertical;
        }

        .tm-modal-actions {
            display: flex;
            gap: 10px;
            margin-top: 20px;
        }
        .tm-wiz-preview .tm-modal-actions { position: sticky; bottom: -32px; padding: 16px 0; margin: 0 -36px -32px; padding: 16px 36px 32px; background: linear-gradient(to top, #1a1a2e 60%, transparent); z-index: 2; }

        /* --- Map-mode: wizard becomes right-side panel over the map --- */
        body.tm-map-mode .tm-overlay {
            background: none;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
            pointer-events: none;
            justify-content: flex-end;
            align-items: stretch;
            padding: 0;
        }
        body.tm-map-mode .tm-modal.tm-wiz-preview {
            pointer-events: auto;
            max-width: 400px;
            width: 400px;
            height: 100vh;
            max-height: 100vh;
            border-radius: 0;
            border-left: 1px solid var(--glass-border);
            margin: 0;
            padding: 24px 20px;
            animation: tmSlideRight 0.3s var(--spring);
            background: rgba(18,18,36,0.97);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
        }
        body.tm-map-mode .tm-wiz-preview .tm-modal-actions {
            margin: 0 -20px -24px;
            padding: 16px 20px 24px;
        }
        body.tm-map-mode .tm-wiz-preview .tm-wiz-summary {
            gap: 8px;
        }
        body.tm-map-mode .tm-wiz-preview .tm-wiz-filterbar {
            flex-direction: column;
            gap: 8px;
        }
        body.tm-map-mode .tm-wiz-preview .tm-wiz-filterbar-right {
            width: 100%;
        }
        body.tm-map-mode .tm-wiz-preview .tm-wiz-filterbar-right select {
            flex: 1;
        }
        @keyframes tmSlideRight { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: translateX(0); } }

        /* Wizard route markers — no extra styles needed, uses tactical icons */

        @media (max-width: 768px) {
            body.tm-map-mode .tm-overlay {
                background: rgba(0,0,0,0.6);
                backdrop-filter: blur(8px);
                pointer-events: auto;
                justify-content: center;
                align-items: center;
                padding: 20px;
            }
            body.tm-map-mode .tm-modal.tm-wiz-preview {
                max-width: 920px;
                width: 100%;
                height: auto;
                max-height: 90vh;
                border-radius: 20px;
                border-left: none;
                padding: 32px 36px;
                animation: tmSlideUp 0.25s var(--spring);
            }
        }

        .tm-modal-btn {
            flex: 1;
            padding: 10px;
            border-radius: 12px;
            border: none;
            font-family: inherit;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .tm-modal-btn.primary {
            background: var(--accent-blue);
            color: #fff;
        }

        .tm-modal-btn.primary:hover { filter: brightness(1.15); }
        .tm-modal-btn.primary:disabled { opacity: 0.5; cursor: not-allowed; }

        .tm-modal-btn.secondary {
            background: var(--glass);
            border: 1px solid var(--glass-border);
            color: var(--text-secondary);
        }

        .tm-modal-btn.secondary:hover { background: var(--glass-hover); }

        .manage-trips-link {
            display: block;
            text-align: center;
            font-size: 12px;
            color: var(--accent-blue);
            cursor: pointer;
            margin-top: 8px;
            opacity: 0.7;
            transition: opacity 0.2s;
        }

        .manage-trips-link:hover { opacity: 1; }

        /* ========== REDUCED MOTION ========== */
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
                scroll-behavior: auto !important;
            }
        }

        /* ========== FOCUS VISIBLE ========== */
        :focus-visible {
            outline: 2px solid var(--accent-blue);
            outline-offset: 2px;
        }
        button:focus-visible, .btn:focus-visible, .filter-pill:focus-visible,
        .action-card:focus-visible, .otto-fab:focus-visible {
            outline: 2px solid var(--accent-blue);
            outline-offset: 2px;
            box-shadow: 0 0 0 4px rgba(79,143,255,0.2);
        }
        input:focus-visible, textarea:focus-visible, select:focus-visible {
            outline: 2px solid var(--accent-blue);
            outline-offset: 0;
        }
        .input-bar textarea:focus-visible {
            outline: none;
        }
        :focus:not(:focus-visible) {
            outline: none;
        }

        /* ========== DASHBOARD VIEW ========== */
        .btn-dash, .btn-mydealers {
            padding: 6px 14px;
            border-radius: 8px;
            border: none;
            background: transparent;
            color: rgba(255,255,255,0.45);
            font-size: 12px;
            font-family: inherit;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s var(--smooth);
        }
        .btn-dash:hover, .btn-sold:hover, .btn-mydealers:hover {
            background: rgba(255,255,255,0.06);
            color: var(--text-primary);
        }
        .btn-sold {
            padding: 6px 14px;
            background: transparent;
            color: var(--text-secondary);
            border: 1px solid transparent;
            border-radius: 6px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.2s var(--smooth);
        }
        body.dashboard .topbar .btn-dash,
        body.sold-units .topbar .btn-sold {
            color: var(--text-primary);
            background: rgba(255,255,255,0.08);
        }
        body.chatting .topbar .btn-dash,
        body.map-view .topbar .btn-dash,
        body.trip-manager .topbar .btn-dash,
        body.dashboard .topbar .btn-dash {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }
        body.dashboard .topbar-center,
        body.dashboard .topbar .btn-ghost,
        body.dashboard .topbar .btn-home,
        body.dashboard .usage-badge,
        body.dashboard .topbar .btn-dash,
        body.dashboard .topbar .btn-mydealers,
        body.dashboard .topbar .btn-map,
        body.dashboard .topbar .btn-trips {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }
        body.dashboard .main { display: none; }
        body.dashboard .input-area { display: none; }
        body.dashboard #dealerMap { display: none; }
        body.dashboard #dashboardWrap { display: block; }

        body.sold-units .topbar-center,
        body.sold-units .topbar .btn-ghost,
        body.sold-units .topbar .btn-home,
        body.sold-units .usage-badge,
        body.sold-units .topbar .btn-dash,
        body.sold-units .topbar .btn-mydealers,
        body.sold-units .topbar .btn-sold,
        body.sold-units .topbar .btn-map,
        body.sold-units .topbar .btn-trips {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }
        body.sold-units .main { display: none; }
        body.sold-units .input-area { display: none; }
        body.sold-units #dealerMap { display: none; }
        body.sold-units #dashboardWrap { display: none; }
        body.sold-units #soldUnitsWrap { display: block; }

        /* ───────── My Dealers tab body-class rules (mirrors sold-units pattern) ───────── */
        body.my-dealers .topbar-center,
        body.my-dealers .topbar .btn-ghost,
        body.my-dealers .topbar .btn-home,
        body.my-dealers .usage-badge,
        body.my-dealers .topbar .btn-dash,
        body.my-dealers .topbar .btn-mydealers,
        body.my-dealers .topbar .btn-sold,
        body.my-dealers .topbar .btn-map,
        body.my-dealers .topbar .btn-trips {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }
        body.my-dealers .topbar .btn-mydealers {
            color: var(--text-primary);
            background: rgba(255,255,255,0.08);
        }
        body.my-dealers .main          { display: none; }
        body.my-dealers .input-area    { display: none; }
        body.my-dealers #dealerMap     { display: none; }
        body.my-dealers #dashboardWrap { display: none; }
        body.my-dealers #soldUnitsWrap { display: none; }
        body.my-dealers #myDealersWrap { display: block; }

        /* ============================================================
           My Dealers — editorial layout, not SaaS dashboard.
           Type-driven hierarchy, flat composition, single accent color.
           No card-everywhere look; rows + dividers carry structure.
           ============================================================ */
        .my-dealers-wrap {
            display: none;
            position: fixed;
            top: 56px;
            left: 0; right: 0; bottom: 0;
            z-index: 10;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 40px 24px 48px;
            scrollbar-width: thin;
            scrollbar-color: rgba(255,255,255,0.08) transparent;
            background:
                radial-gradient(1200px 600px at 75% -10%, rgba(94,234,212,0.05), transparent 60%);
        }
        .md-root {
            max-width: 1120px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            gap: 56px;
        }
        .md-loading, .md-empty {
            padding: 60px 0;
            color: var(--text-tertiary);
            font-size: 14px;
        }

        /* ── Header (used by both manager landing + rep view) ─────────────── */
        .md-h {
            padding-bottom: 4px;
            border-bottom: 1px solid rgba(255,255,255,0.07);
        }
        .md-eyebrow-q {
            font-size: 11px;
            color: var(--text-tertiary);
            letter-spacing: 0.18em;
            text-transform: uppercase;
            font-weight: 600;
            margin-bottom: 22px;
        }
        .md-h-title {
            font-size: 56px;
            font-weight: 800;
            color: var(--text-primary);
            letter-spacing: -2px;
            line-height: 1.02;
            margin: 0 0 12px 0;
            background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.78) 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        .md-h-lede {
            font-size: 16px;
            color: var(--text-secondary);
            line-height: 1.5;
            max-width: 640px;
            margin: 0 0 16px 0;
            font-weight: 400;
        }
        .md-h-lede strong {
            color: var(--text-primary);
            font-weight: 700;
            font-variant-numeric: tabular-nums;
        }
        .md-h-meta {
            font-size: 12px;
            color: var(--text-tertiary);
            letter-spacing: 0.04em;
            margin-bottom: 18px;
        }
        .md-h-meta strong {
            color: var(--text-secondary);
            font-weight: 600;
            font-variant-numeric: tabular-nums;
        }

        /* ── Manager landing: rep cards (match dealer card style) ────────── */
        .md-rep-cards {
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        }
        .md-rep-card-v2 {
            display: flex;
            flex-direction: column;
            gap: 16px;
            text-align: left;
        }
        .md-rep-card-v2.inactive {
            opacity: 0.55;
        }
        .md-rep-card-head {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .md-rep-card-avatar {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background: linear-gradient(135deg, rgba(94,234,212,0.28), rgba(79,143,255,0.20));
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-primary);
            font-weight: 700;
            font-size: 14px;
            letter-spacing: -0.2px;
            flex-shrink: 0;
        }
        .md-rep-card-ident {
            min-width: 0;
        }
        .md-rep-card-name {
            font-size: 15px;
            font-weight: 700;
            color: var(--text-primary);
            letter-spacing: -0.2px;
            line-height: 1.2;
        }
        .md-rep-card-role {
            font-size: 11px;
            color: var(--text-tertiary);
            margin-top: 2px;
        }
        .md-rep-card-role em { font-style: italic; }
        .md-rep-card-stat {
            padding-top: 12px;
            border-top: 1px solid rgba(255,255,255,0.05);
        }
        .md-rep-card-num {
            font-size: 28px;
            font-weight: 700;
            color: #5eead4;
            font-variant-numeric: tabular-nums;
            letter-spacing: -0.6px;
            line-height: 1;
        }
        .md-rep-card-v2.inactive .md-rep-card-num { color: var(--text-secondary); }
        .md-rep-card-cap {
            font-size: 10px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.1em;
            font-weight: 600;
            margin-top: 6px;
        }

        /* ── Loading skeleton (shown immediately on rep click) ───────────── */
        .md-h-title-loading {
            background: linear-gradient(90deg, #fff, rgba(255,255,255,0.4), #fff);
            background-size: 200% 100%;
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: mdShimmer 1.6s linear infinite;
        }
        @keyframes mdShimmer {
            0%   { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }
        .md-skel {
            background: linear-gradient(90deg,
                rgba(255,255,255,0.04) 0%,
                rgba(255,255,255,0.10) 50%,
                rgba(255,255,255,0.04) 100%);
            background-size: 200% 100%;
            animation: mdShimmer 1.6s linear infinite;
            border-radius: 4px;
        }
        .md-skel-num   { height: 24px; width: 64%; margin-bottom: 6px; }
        .md-skel-sub   { height: 11px; width: 50%; }
        .md-skel-title { height: 18px; width: 70%; }
        .md-skel-block { height: 56px; width: 100%; border-radius: 8px; }
        .md-card-skeleton {
            cursor: default;
            pointer-events: none;
        }
        .md-card-skeleton:hover {
            background: rgba(255,255,255,0.03);
            border-color: rgba(255,255,255,0.06);
            transform: none;
        }

        /* ── Manager strip on rep view ───────────────────────────────────── */
        .md-mgr-switcher {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 7px 12px;
            background: rgba(94,234,212,0.06);
            border: 1px solid rgba(94,234,212,0.16);
            border-radius: 999px;
            font-size: 11px;
            margin-bottom: 24px;
            align-self: flex-start;
        }
        .md-mgr-switcher-label {
            font-weight: 700;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: #5eead4;
        }
        .md-mgr-select {
            background: transparent;
            border: none;
            color: var(--text-primary);
            font-size: 12px;
            font-family: inherit;
            cursor: pointer;
            padding: 2px 4px;
        }
        .md-mgr-select:focus { outline: none; }
        .md-mgr-back {
            background: transparent;
            border: none;
            color: var(--text-tertiary);
            cursor: pointer;
            font-size: 11px;
            font-family: inherit;
            padding: 2px 6px;
            border-radius: 6px;
        }
        .md-mgr-back:hover { color: var(--text-primary); }

        /* ── Stats row: normal-sized inline metrics across the top ─────── */
        .md-stats {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 0;
            border-top: 1px solid rgba(255,255,255,0.06);
            border-bottom: 1px solid rgba(255,255,255,0.06);
            padding: 18px 0;
        }
        .md-stat {
            padding: 4px 24px;
            border-right: 1px solid rgba(255,255,255,0.05);
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .md-stat:first-child { padding-left: 0; }
        .md-stat:last-child  { border-right: none; padding-right: 0; }
        .md-stat-label {
            font-size: 10px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.12em;
            font-weight: 600;
        }
        .md-stat-value {
            font-size: 26px;
            font-weight: 700;
            color: var(--text-primary);
            font-variant-numeric: tabular-nums;
            letter-spacing: -0.6px;
            line-height: 1;
        }
        .md-stat.accent .md-stat-value { color: #5eead4; }
        .md-stat.warn .md-stat-value   { color: #fbbf24; }
        .md-stat-sub {
            font-size: 11px;
            color: var(--text-tertiary);
            font-style: italic;
            line-height: 1.3;
        }

        /* ── This Week — single-line items, full width ──────────────────── */
        .md-week-head {
            font-size: 10px;
            color: var(--text-tertiary);
            letter-spacing: 0.18em;
            text-transform: uppercase;
            font-weight: 700;
            margin-bottom: 12px;
        }
        .md-week-lede {
            font-size: 16px;
            color: var(--text-primary);
            line-height: 1.4;
            font-weight: 500;
            margin-bottom: 16px;
            letter-spacing: -0.2px;
        }
        .md-week-lede strong { font-weight: 800; }
        .md-week-note { color: #fbbf24; font-weight: 500; margin-left: 6px; }
        .md-week-list {
            list-style: none;
            padding: 0;
            margin: 0;
            display: flex;
            flex-direction: column;
        }
        .md-week-item {
            display: grid;
            grid-template-columns: 12px minmax(160px, auto) minmax(120px, auto) 1fr;
            gap: 14px;
            align-items: baseline;
            cursor: pointer;
            padding: 9px 6px 9px 0;
            border-bottom: 1px dashed rgba(255,255,255,0.05);
            transition: background 0.15s, transform 0.15s;
        }
        .md-week-item:hover {
            background: rgba(255,255,255,0.02);
            transform: translateX(2px);
        }
        .md-week-dot {
            width: 7px; height: 7px;
            border-radius: 50%;
            justify-self: center;
        }
        .md-dot-ghost    { background: #fbbf24; box-shadow: 0 0 6px rgba(251,191,36,0.6); }
        .md-dot-lapsed   { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.5); }
        .md-dot-missed   { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.5); }
        .md-dot-pipeline { background: #5eead4; box-shadow: 0 0 6px rgba(94,234,212,0.5); }
        .md-week-name {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
        }
        .md-week-loc {
            font-size: 12px;
            color: var(--text-tertiary);
            font-style: italic;
        }
        .md-week-detail {
            font-size: 12px;
            color: var(--text-secondary);
            text-align: right;
            font-variant-numeric: tabular-nums;
        }
        .md-week-detail strong {
            color: var(--text-primary);
            font-weight: 700;
        }
        .md-week-also {
            margin-top: 12px;
            padding-top: 10px;
            font-size: 12px;
            color: var(--text-tertiary);
            font-style: italic;
        }
        .md-week-also strong {
            color: var(--text-secondary);
            font-style: normal;
            font-weight: 700;
        }

        /* ── Account list: borderless typographic rows ───────────────────── */
        .md-list-head {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 24px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }
        .md-list-title {
            font-size: 22px;
            font-weight: 700;
            color: var(--text-primary);
            letter-spacing: -0.6px;
            margin: 0;
        }
        .md-list-controls {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }
        .md-filter-pill {
            background: transparent;
            border: none;
            color: var(--text-tertiary);
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            padding: 6px 10px;
            border-radius: 8px;
            cursor: pointer;
            font-family: inherit;
            transition: color 0.15s, background 0.15s;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        .md-filter-pill:hover { color: var(--text-secondary); }
        .md-filter-pill-count {
            font-size: 10px;
            color: var(--text-tertiary);
            font-variant-numeric: tabular-nums;
            padding: 1px 6px;
            border-radius: 999px;
            background: rgba(255,255,255,0.04);
        }
        .md-filter-pill.active {
            color: #5eead4;
            background: rgba(94,234,212,0.08);
        }
        .md-filter-pill.active .md-filter-pill-count {
            color: #5eead4;
            background: rgba(94,234,212,0.18);
        }
        .md-search {
            background: transparent;
            border: none;
            border-bottom: 1px solid rgba(255,255,255,0.08);
            color: var(--text-primary);
            padding: 5px 4px;
            font-size: 12px;
            font-family: inherit;
            width: 160px;
            transition: border-color 0.15s;
        }
        .md-search:focus {
            outline: none;
            border-bottom-color: #5eead4;
        }
        .md-search::placeholder { color: var(--text-tertiary); font-style: italic; }
        .md-sort {
            background: rgba(0,0,0,0.25);
            border: 1px solid rgba(255,255,255,0.08);
            color: var(--text-secondary);
            padding: 6px 26px 6px 11px;
            border-radius: 8px;
            font-size: 11px;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            letter-spacing: 0.02em;
            appearance: none;
            -webkit-appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23889' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 9px center;
            transition: border-color 0.15s, color 0.15s;
        }
        .md-sort:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.16); }
        .md-sort:focus { outline: none; border-color: rgba(94,234,212,0.4); }
        .md-sort option { background: #0f1420; color: var(--text-primary); }

        /* ── Dealer cards grid — dashboard cards, readable, roomy ───────── */
        .md-cards {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
            gap: 16px;
        }
        .md-card {
            display: flex;
            flex-direction: column;
            gap: 14px;
            padding: 20px 22px 18px;
            background: rgba(22,28,40,0.55);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 14px;
            cursor: pointer;
            text-align: left;
            font-family: inherit;
            position: relative;
            transition: background 0.15s, border-color 0.15s, transform 0.15s;
            /* PERF: skip off-screen cards entirely. A rep's 86-card grid was
               compositing every card every frame; with content-visibility:auto
               + contained painting, only on-screen cards do real work. */
            content-visibility: auto;
            contain-intrinsic-size: 0 280px;
            contain: layout paint style;
        }
        .md-card:hover {
            background: rgba(94,234,212,0.05);
            border-color: rgba(94,234,212,0.22);
            transform: translateY(-2px);
        }
        /* Top accent stripe for priority cards */
        .md-card.priority-ghost    { border-top: 2px solid #fbbf24; }
        .md-card.priority-lapsed   { border-top: 2px solid #ef4444; }
        .md-card.priority-missed   { border-top: 2px solid #f59e0b; }
        .md-card.priority-pipeline { border-top: 2px solid #5eead4; }

        .md-card-head {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 10px;
        }
        .md-card-title {
            display: flex;
            align-items: baseline;
            gap: 8px;
            min-width: 0;
            flex: 1;
        }
        .md-card-rank {
            font-size: 11px;
            color: var(--text-tertiary);
            font-weight: 600;
            font-variant-numeric: tabular-nums;
            flex-shrink: 0;
        }
        .md-card-name {
            font-size: 16px;
            font-weight: 700;
            color: var(--text-primary);
            letter-spacing: -0.2px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            min-width: 0;
            line-height: 1.25;
        }
        .md-card-pill {
            font-size: 9px;
            font-weight: 700;
            letter-spacing: 0.1em;
            padding: 4px 8px;
            border-radius: 6px;
            line-height: 1;
            white-space: nowrap;
            flex-shrink: 0;
        }
        .pill-active   { background: rgba(52,211,153,0.16); color: #34d399; }
        .pill-lapsed   { background: rgba(239,68,68,0.18);  color: #ef4444; }
        .pill-missed   { background: rgba(245,158,11,0.16); color: #f59e0b; }
        .pill-pipeline { background: rgba(79,143,255,0.16); color: #4f8fff; }
        .pill-ghost    { background: rgba(251,191,36,0.18); color: #fbbf24; }
        .pill-watching { background: rgba(255,255,255,0.06); color: var(--text-tertiary); }
        .pill-quiet    { background: rgba(255,255,255,0.04); color: var(--text-tertiary); }

        .md-card-loc {
            font-size: 12px;
            color: var(--text-tertiary);
            margin-top: -8px;
        }
        .md-card-tier { font-style: italic; }

        .md-card-stats {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 18px;
            width: 100%;
            padding: 14px 0;
            border-top: 1px solid rgba(255,255,255,0.05);
            border-bottom: 1px solid rgba(255,255,255,0.05);
        }
        .md-card-statgrp {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }
        .md-card-statgrp + .md-card-statgrp {
            border-left: 1px solid rgba(255,255,255,0.06);
            padding-left: 18px;
        }
        .md-card-statgrp-label {
            font-size: 9px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.14em;
            font-weight: 700;
            opacity: 0.7;
        }
        .md-card-statgrp-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 14px;
            justify-items: center;
        }
        .md-card-statgrp-label,
        .md-card-stat { text-align: center; }
        .md-card-stat-val {
            font-size: 22px;
            font-weight: 700;
            color: var(--text-primary);
            font-variant-numeric: tabular-nums;
            letter-spacing: -0.5px;
            line-height: 1;
        }
        .md-card-stat-ours .md-card-stat-val {
            color: #5eead4;
        }
        .md-card-stat-cap {
            font-size: 10px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            font-weight: 600;
            margin-top: 5px;
            line-height: 1.3;
        }
        @media (max-width: 780px) {
            .md-card-stats {
                grid-template-columns: 1fr;
                gap: 14px;
            }
            .md-card-statgrp + .md-card-statgrp {
                border-left: none;
                border-top: 1px solid rgba(255,255,255,0.05);
                padding-left: 0;
                padding-top: 14px;
            }
        }

        .md-card-meter-text {
            font-size: 12px;
            color: var(--text-secondary);
            font-variant-numeric: tabular-nums;
        }
        .md-card-meter-text strong {
            color: var(--text-primary);
            font-weight: 700;
        }
        .md-card-meter-pct {
            color: var(--text-tertiary);
            font-size: 11px;
            margin-left: 6px;
        }
        .md-card-meter-bar {
            height: 4px;
            background: rgba(255,255,255,0.06);
            border-radius: 2px;
            margin-top: 6px;
            overflow: hidden;
        }
        .md-card-meter-fill {
            height: 100%;
            border-radius: 2px;
            transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
        }
        .md-card-meter-fill.good { background: #34d399; }
        .md-card-meter-fill.mid  { background: #4f8fff; }
        .md-card-meter-fill.low  { background: rgba(255,255,255,0.22); }

        .md-card-foot {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }
        .md-card-foot-row {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            gap: 10px;
            font-size: 11px;
        }
        .md-card-foot-label {
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            font-weight: 600;
            font-size: 10px;
        }
        .md-card-foot-val {
            color: var(--text-secondary);
            font-variant-numeric: tabular-nums;
            text-align: right;
        }
        .md-card-foot-val.accent { color: #5eead4; font-weight: 600; }
        .md-card-foot-val.warn   { color: #fbbf24; font-weight: 600; }
        .md-card-foot-aside {
            color: var(--text-tertiary);
            font-style: italic;
            margin-left: 3px;
        }

        /* ── Responsive ──────────────────────────────────────────────────── */
        @media (max-width: 1100px) {
            .md-stats { grid-template-columns: repeat(5, 1fr); gap: 0; }
            .md-stat  { padding: 4px 14px; }
            .md-stat-value { font-size: 22px; }
        }
        @media (max-width: 900px) {
            .md-stats { grid-template-columns: repeat(3, 1fr); }
            .md-stat:nth-child(3) { border-right: none; }
            .md-stat:nth-child(n+4) { border-top: 1px solid rgba(255,255,255,0.05); padding-top: 14px; margin-top: 14px; }
        }
        @media (max-width: 780px) {
            .my-dealers-wrap   { padding: 28px 18px 40px; }
            .md-root           { gap: 36px; }
            .md-h-title        { font-size: 36px; letter-spacing: -1.2px; }
            .md-h-lede         { font-size: 14px; }
            .md-stats          { grid-template-columns: repeat(2, 1fr); padding: 14px 0; }
            .md-stat           { padding: 2px 12px; }
            .md-stat:nth-child(2n) { border-right: none; }
            .md-stat:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,0.05); padding-top: 12px; margin-top: 12px; }
            .md-stat-value     { font-size: 20px; }
            .md-week-item      { grid-template-columns: 10px 1fr; row-gap: 2px; }
            .md-week-loc, .md-week-detail { grid-column: 2; text-align: left; }
            .md-rep-row        { grid-template-columns: 1fr auto 18px; }
            .md-rep-row-role   { display: none; }
            .md-rep-row-name   { font-size: 20px; }
            .md-cards          { grid-template-columns: 1fr; gap: 12px; }
            .md-card           { padding: 16px 18px; }
            .md-card-name      { font-size: 15px; }
            .md-card-stat-val  { font-size: 20px; }
            .md-list-head      { gap: 12px; }
            .md-search         { flex: 1; min-width: 140px; }
        }

        /* ── Dealer detail modal ─────────────────────────────────────────── */
        .md-modal-overlay {
            position: fixed;
            inset: 0;
            z-index: 200;
            background: rgba(6,8,14,0.66);
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
            display: none;
            align-items: flex-start;
            justify-content: center;
            padding: 56px 20px 40px;
            overflow-y: auto;
        }
        .md-modal-overlay.open { display: flex; }
        .md-modal {
            position: relative;
            width: 100%;
            max-width: 680px;
            background: #0f1420;
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 18px;
            box-shadow: 0 24px 80px rgba(0,0,0,0.55);
            animation: mdModalIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
        }
        @keyframes mdModalIn {
            from { opacity: 0; transform: translateY(14px) scale(0.98); }
            to   { opacity: 1; transform: translateY(0) scale(1); }
        }
        .md-modal-close {
            position: absolute;
            top: 16px; right: 16px;
            width: 30px; height: 30px;
            border-radius: 8px;
            background: rgba(255,255,255,0.05);
            border: 1px solid rgba(255,255,255,0.08);
            color: var(--text-secondary);
            font-size: 20px;
            line-height: 1;
            cursor: pointer;
            transition: background 0.15s, color 0.15s;
        }
        .md-modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
        .md-modal-head {
            padding: 24px 26px 18px;
            border-bottom: 1px solid rgba(255,255,255,0.06);
        }
        .md-modal-title {
            font-size: 22px;
            font-weight: 700;
            color: var(--text-primary);
            letter-spacing: -0.4px;
        }
        .md-modal-sub {
            font-size: 13px;
            color: var(--text-tertiary);
            margin-top: 4px;
        }
        .md-modal-body { padding: 22px 26px 26px; }
        .md-modal-loading {
            padding: 40px 0;
            text-align: center;
            color: var(--text-tertiary);
            font-size: 13px;
        }
        .md-modal-lifetime {
            display: flex;
            flex-wrap: wrap;
            gap: 18px 28px;
            padding: 14px 16px;
            margin-bottom: 16px;
            background: rgba(94,234,212,0.04);
            border: 1px solid rgba(94,234,212,0.12);
            border-radius: 10px;
        }
        .md-modal-lifetime-item {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .md-modal-lifetime-val {
            font-size: 17px;
            font-weight: 700;
            color: var(--text-primary);
            font-variant-numeric: tabular-nums;
            letter-spacing: -0.3px;
            line-height: 1;
        }
        .md-modal-lifetime-val.accent { color: #5eead4; }
        .md-modal-lifetime-lab {
            font-size: 10px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.1em;
            font-weight: 600;
        }

        .md-modal-kpis {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 14px;
            margin-bottom: 20px;
        }
        .md-modal-kpi {
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.05);
            border-radius: 10px;
            padding: 14px 16px;
        }
        .md-modal-kpi-val {
            font-size: 26px;
            font-weight: 700;
            color: var(--text-primary);
            font-variant-numeric: tabular-nums;
            letter-spacing: -0.6px;
            line-height: 1;
        }
        .md-modal-kpi-val.accent { color: #5eead4; }
        .md-modal-kpi-val.warn { color: #fbbf24; }
        .md-modal-kpi-lab {
            font-size: 10px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.1em;
            font-weight: 600;
            margin-top: 6px;
        }

        /* Aging stacked bar */
        .md-modal-aging { margin-bottom: 24px; }
        .md-modal-aging-bar {
            display: flex;
            height: 10px;
            border-radius: 6px;
            overflow: hidden;
            background: rgba(255,255,255,0.05);
        }
        .md-modal-aging-bar .seg { height: 100%; }
        .seg-fresh { background: #34d399; }
        .seg-mid   { background: #5eead4; }
        .seg-aging { background: #f59e0b; }
        .seg-stale { background: #ef4444; }
        .md-modal-aging-legend {
            display: flex;
            flex-wrap: wrap;
            gap: 16px;
            margin-top: 12px;
            font-size: 11px;
            color: var(--text-tertiary);
        }
        .md-modal-aging-legend strong { color: var(--text-primary); font-weight: 700; margin-left: 2px; }
        .md-modal-aging-legend i {
            display: inline-block;
            width: 8px; height: 8px;
            border-radius: 2px;
            margin-right: 5px;
            vertical-align: baseline;
        }
        .dot-fresh { background: #34d399; }
        .dot-mid   { background: #5eead4; }
        .dot-aging { background: #f59e0b; }
        .dot-stale { background: #ef4444; }
        .dot-ours  { background: #5eead4; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

        .md-modal-section { margin-bottom: 22px; }
        .md-modal-section-head {
            font-size: 11px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.12em;
            font-weight: 700;
            margin-bottom: 12px;
            display: flex;
            justify-content: space-between;
            align-items: baseline;
        }
        .md-modal-section-aside {
            font-size: 10px;
            color: var(--text-tertiary);
            text-transform: none;
            letter-spacing: 0;
            font-weight: 500;
            font-style: italic;
        }

        /* Monthly sales — horizontal bars, most-recent first */
        .md-sales-summary {
            font-size: 11px;
            color: var(--text-tertiary);
            text-transform: none;
            letter-spacing: 0;
            font-weight: 500;
            font-variant-numeric: tabular-nums;
        }
        .md-sales-summary strong { color: var(--text-primary); font-weight: 700; }
        .md-sales-summary strong.accent { color: #5eead4; }
        .md-sales-rows {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .md-sales-row {
            display: grid;
            grid-template-columns: 38px 1fr 96px;
            gap: 14px;
            align-items: center;
        }
        .md-sales-mlabel {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }
        .md-sales-track {
            height: 18px;
            background: rgba(255,255,255,0.05);
            border-radius: 5px;
            overflow: hidden;
        }
        .md-sales-fill {
            height: 100%;
            background: rgba(255,255,255,0.14);
            border-radius: 5px;
            display: flex;
            min-width: 4px;
            transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
        }
        .md-sales-fill-ours {
            height: 100%;
            background: linear-gradient(90deg, #5eead4, #10b981);
            border-radius: 5px 0 0 5px;
            box-shadow: 0 0 10px rgba(94,234,212,0.3);
        }
        .md-sales-figs {
            font-size: 13px;
            color: var(--text-secondary);
            font-variant-numeric: tabular-nums;
            text-align: right;
            white-space: nowrap;
        }
        .md-sales-figs strong { color: var(--text-primary); font-weight: 700; font-size: 15px; }
        .md-sales-ours-fig { color: #5eead4; font-size: 11px; font-weight: 600; }
        .md-sales-legend {
            display: flex;
            gap: 20px;
            margin-top: 16px;
            font-size: 11px;
            color: var(--text-tertiary);
        }
        .md-sales-legend i {
            display: inline-block;
            width: 10px; height: 10px;
            border-radius: 3px;
            margin-right: 6px;
            vertical-align: -1px;
        }
        .md-sw-ours { background: linear-gradient(90deg, #5eead4, #10b981); }
        .md-sw-mkt  { background: rgba(255,255,255,0.14); }

        /* Inventory list */
        .md-inv-list {
            max-height: 280px;
            overflow-y: auto;
            border: 1px solid rgba(255,255,255,0.05);
            border-radius: 10px;
            scrollbar-width: thin;
            scrollbar-color: rgba(255,255,255,0.1) transparent;
        }
        .md-inv-row {
            display: grid;
            grid-template-columns: 48px 1fr auto;
            gap: 12px;
            align-items: center;
            padding: 9px 14px;
            border-bottom: 1px solid rgba(255,255,255,0.04);
            font-size: 13px;
        }
        .md-inv-row:last-child { border-bottom: none; }
        .md-inv-age {
            font-size: 11px;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
            text-align: center;
            padding: 3px 0;
            border-radius: 5px;
        }
        .age-fresh   { background: rgba(52,211,153,0.16); color: #34d399; }
        .age-mid     { background: rgba(94,234,212,0.14); color: #5eead4; }
        .age-aging   { background: rgba(245,158,11,0.16); color: #f59e0b; }
        .age-stale   { background: rgba(239,68,68,0.16);  color: #ef4444; }
        .age-unknown { background: rgba(255,255,255,0.06); color: var(--text-tertiary); }
        .md-inv-truck {
            color: var(--text-primary);
            font-weight: 500;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .md-inv-body { color: var(--text-primary); font-weight: 700; }
        .md-inv-chassis { color: var(--text-tertiary); font-weight: 400; font-size: 12px; }
        .md-inv-ours {
            font-size: 9px;
            font-weight: 700;
            letter-spacing: 0.08em;
            color: #5eead4;
            background: rgba(94,234,212,0.14);
            padding: 2px 5px;
            border-radius: 4px;
            margin-left: 6px;
        }
        .md-inv-price {
            color: var(--text-secondary);
            font-variant-numeric: tabular-nums;
            font-size: 12px;
        }
        .md-modal-ask {
            width: 100%;
            margin-top: 6px;
            padding: 12px;
            background: rgba(94,234,212,0.08);
            border: 1px solid rgba(94,234,212,0.2);
            border-radius: 10px;
            color: #5eead4;
            font-size: 13px;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            transition: background 0.15s;
        }
        .md-modal-ask:hover { background: rgba(94,234,212,0.14); }

        @media (max-width: 640px) {
            .md-modal-overlay { padding: 0; align-items: stretch; }
            .md-modal { max-width: none; border-radius: 0; min-height: 100%; }
            .md-modal-kpis { gap: 8px; }
            .md-modal-kpi { padding: 10px 12px; }
            .md-modal-kpi-val { font-size: 20px; }
        }

        /* ───────── Sold Units Tab — glass aesthetic matching dashboard ───────── */
        .sold-wrap {
            display: none;
            position: fixed;
            top: 56px;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 10;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 24px;
            scrollbar-width: thin;
            scrollbar-color: rgba(255,255,255,0.1) transparent;
            background:
                linear-gradient(rgba(52,211,153,0.02) 1px, transparent 1px),
                linear-gradient(90deg, rgba(52,211,153,0.02) 1px, transparent 1px);
            background-size: 24px 24px;
        }
        .sold-card {
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 16px;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            padding: 24px;
            max-width: 1400px;
            margin: 0 auto 20px;
            position: relative;
            overflow: hidden;
        }
        .sold-hero-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 24px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }
        .sold-hero-title {
            font-size: 11px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.1em;
            font-weight: 600;
            margin-bottom: 8px;
        }
        .sold-hero-value {
            font-size: 42px;
            font-weight: 700;
            letter-spacing: -1.2px;
            color: var(--text-primary);
            line-height: 1;
            font-variant-numeric: tabular-nums;
        }
        .sold-hero-delta {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-top: 10px;
            font-size: 12px;
            font-weight: 600;
        }
        .sold-hero-delta.up { color: #34d399; }
        .sold-hero-delta.down { color: #ef4444; }
        .sold-hero-delta.flat { color: var(--text-tertiary); }
        .sold-hero-sub {
            font-size: 12px;
            color: var(--text-tertiary);
            margin-top: 8px;
            line-height: 1.5;
            font-weight: 500;
        }
        .sold-hero-sub strong { color: var(--text-secondary); font-weight: 600; }
        .sold-methodology {
            margin-top: 10px;
            font-size: 11px;
        }
        .sold-methodology summary {
            cursor: pointer;
            color: var(--text-tertiary);
            user-select: none;
            padding: 4px 0;
            list-style: none;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: color 0.15s;
            letter-spacing: 0.02em;
            font-weight: 500;
        }
        .sold-methodology summary::-webkit-details-marker { display: none; }
        .sold-methodology summary::before {
            content: '›';
            font-size: 14px;
            color: var(--text-tertiary);
            transition: transform 0.2s var(--smooth);
            display: inline-block;
        }
        .sold-methodology[open] summary::before { transform: rotate(90deg); }
        .sold-methodology summary:hover { color: var(--text-secondary); }
        .sold-methodology-body {
            padding: 10px 0 4px 14px;
            color: var(--text-secondary);
            line-height: 1.6;
            font-size: 12px;
            max-width: 720px;
        }
        .sold-methodology-body strong { color: var(--text-primary); font-weight: 600; }
        .sold-methodology-body em { color: var(--text-primary); font-style: normal; font-weight: 500; }
        .sold-card-footer {
            margin-top: 14px;
            padding-top: 12px;
            border-top: 1px solid rgba(255,255,255,0.05);
            font-size: 11px;
            color: var(--text-tertiary);
            letter-spacing: 0.03em;
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
        }
        .sold-card-footer span strong { color: var(--text-secondary); font-weight: 600; }
        .sold-range-pills {
            display: inline-flex;
            gap: 2px;
            background: rgba(255,255,255,0.03);
            border: 1px solid var(--glass-border);
            border-radius: 20px;
            padding: 3px;
        }
        .sold-range-pills button {
            background: transparent;
            color: var(--text-tertiary);
            border: none;
            padding: 6px 14px;
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.05em;
            border-radius: 16px;
            cursor: pointer;
            transition: all 0.2s var(--smooth);
        }
        .sold-range-pills button:hover { color: var(--text-secondary); }
        .sold-range-pills button.active {
            background: rgba(255,255,255,0.08);
            color: var(--text-primary);
        }
        /* Legacy class kept for any consumer that still references it.
           The new segment selector is a 4-column equal-width tile bar
           defined further down — see .sold-segment-pills. */
        .sold-segment-bar {
            display: none;
        }
        .sold-vin-search {
            background: rgba(255,255,255,0.04);
            border: 1px solid var(--glass-border);
            color: var(--text-primary);
            padding: 7px 12px;
            border-radius: 8px;
            font-size: 12px;
            font-family: ui-monospace, monospace;
            width: 200px;
            font-variant-numeric: tabular-nums;
            transition: border-color 0.15s;
        }
        .sold-vin-search:focus { outline: none; border-color: rgba(52,211,153,0.5); }
        .sold-vin-search::placeholder { color: var(--text-tertiary); font-family: inherit; }
        .sold-csv-btn {
            background: transparent;
            border: 1px solid var(--glass-border);
            color: var(--text-secondary);
            padding: 7px 12px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.04em;
            font-family: inherit;
            transition: all 0.15s;
        }
        .sold-csv-btn:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.04); }
        .sold-csv-btn:disabled { opacity: 0.4; cursor: not-allowed; }
        .sold-leaderboard {
            margin: 18px 0 12px;
            background: rgba(255,255,255,0.02);
            border: 1px solid var(--glass-border);
            border-radius: 12px;
            padding: 16px 18px;
        }
        .sold-leaderboard-header {
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-tertiary);
            font-weight: 600;
            margin-bottom: 10px;
        }
        .sold-leaderboard-list { display: flex; flex-direction: column; gap: 6px; }
        .sold-leaderboard-row {
            display: grid;
            grid-template-columns: 28px 1fr auto auto;
            align-items: center;
            gap: 12px;
            padding: 6px 8px;
            border-radius: 6px;
            cursor: pointer;
            transition: background 0.15s;
        }
        .sold-leaderboard-row:hover { background: rgba(79,143,255,0.06); }
        .sold-leaderboard-rank { color: var(--text-tertiary); font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }
        .sold-leaderboard-name { color: var(--text-primary); font-size: 13px; font-weight: 500; }
        .sold-leaderboard-loc { color: var(--text-tertiary); font-size: 11px; }
        .sold-leaderboard-units { color: var(--text-primary); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }
        .sold-leaderboard-value { color: var(--text-tertiary); font-size: 11px; font-variant-numeric: tabular-nums; min-width: 70px; text-align: right; }
        .sold-table tbody tr { cursor: pointer; transition: background 0.12s; }
        .sold-table tbody tr:hover { background: rgba(79,143,255,0.06) !important; }
        .sold-segment-label { display: none; }
        /* New segmented selector: 4 equal-width tiles in a single rounded
           bar. Each tile stacks label over count so the numbers breathe
           and align across segments regardless of digit count. Acts as
           both filter switcher and per-segment count display. */
        .sold-ax-truth {
            max-width: 1400px;
            margin: 16px auto 12px;
            padding: 18px 22px;
            background: linear-gradient(135deg, rgba(94,234,212,0.10), rgba(94,234,212,0.03));
            border: 1px solid rgba(94,234,212,0.25);
            border-radius: 16px;
        }
        .sold-ax-truth-row {
            display: flex;
            align-items: center;
            gap: 18px;
        }
        .sold-ax-truth-num {
            font-size: 40px;
            font-weight: 800;
            color: #5eead4;
            line-height: 1;
            letter-spacing: -1.5px;
            font-variant-numeric: tabular-nums;
            flex-shrink: 0;
        }
        .sold-ax-truth-lab {
            font-size: 15px;
            font-weight: 700;
            color: var(--text-primary);
            letter-spacing: -0.2px;
        }
        .sold-ax-truth-sub {
            font-size: 12px;
            color: var(--text-tertiary);
            margin-top: 3px;
        }
        .sold-segment-head {
            max-width: 1400px;
            margin: 0 auto;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: var(--text-secondary);
        }
        .sold-segment-head-note {
            display: block;
            margin-top: 4px;
            font-size: 11px;
            font-weight: 400;
            text-transform: none;
            letter-spacing: 0;
            color: var(--text-tertiary);
            line-height: 1.45;
        }
        .sold-segment-pills {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 6px;
            max-width: 1400px;
            margin: 8px auto 20px;
            padding: 6px;
            background: rgba(0,0,0,0.22);
            border: 1px solid rgba(255,255,255,0.05);
            border-radius: 16px;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
        }
        .sold-segment-pills button {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 14px 12px;
            background: transparent;
            border: 1px solid transparent;
            border-radius: 12px;
            cursor: pointer;
            transition: background 0.18s var(--smooth), border-color 0.18s var(--smooth), transform 0.18s var(--smooth);
            font-family: inherit;
        }
        .sold-segment-pills button:hover {
            background: rgba(255,255,255,0.03);
        }
        .sold-segment-pills button .seg-label {
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: var(--text-tertiary);
            transition: color 0.18s;
        }
        .sold-segment-pills button .seg-count {
            font-size: 22px;
            font-weight: 700;
            color: var(--text-primary);
            font-variant-numeric: tabular-nums;
            letter-spacing: -0.4px;
            line-height: 1;
            transition: color 0.18s;
            /* override any inherited badge styling from earlier markup */
            background: none;
            padding: 0;
            border-radius: 0;
        }
        .sold-segment-pills button.active {
            background: rgba(79,143,255,0.14);
            border-color: rgba(79,143,255,0.28);
            box-shadow: 0 4px 18px rgba(79,143,255,0.08);
        }
        .sold-segment-pills button.active .seg-label { color: #93c5fd; }
        .sold-segment-pills button.active .seg-count { color: #4f8fff; }
        .sold-segment-pills button[data-f="all"].active {
            background: rgba(255,255,255,0.07);
            border-color: rgba(255,255,255,0.12);
            box-shadow: none;
        }
        .sold-segment-pills button[data-f="all"].active .seg-label { color: var(--text-secondary); }
        .sold-segment-pills button[data-f="all"].active .seg-count { color: var(--text-primary); }
        @media (max-width: 700px) {
            .sold-segment-pills { gap: 4px; padding: 4px; border-radius: 12px; }
            .sold-segment-pills button { padding: 10px 6px; gap: 4px; border-radius: 9px; }
            .sold-segment-pills button .seg-label { font-size: 9px; letter-spacing: 0.1em; }
            .sold-segment-pills button .seg-count { font-size: 17px; }
        }
        .sold-segment-pills button:disabled {
            opacity: 0.35;
            cursor: not-allowed;
        }
        .sold-chart-container {
            position: relative;
            margin: 0 -8px;
        }
        .sold-chart-svg { display: block; width: 100%; height: 280px; cursor: crosshair; }
        .sold-chart-axis { font-size: 10px; fill: var(--text-tertiary); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; font-weight: 500; }
        .sold-crosshair-line {
            stroke: rgba(255,255,255,0.2);
            stroke-width: 1;
            stroke-dasharray: 3 3;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.1s;
        }
        .sold-crosshair-dot {
            fill: var(--text-primary);
            stroke: #0a0e1a;
            stroke-width: 3;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.1s;
        }
        .sold-tooltip {
            position: absolute;
            background: rgba(15,20,35,0.92);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 10px;
            padding: 10px 14px;
            font-size: 12px;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.15s;
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            box-shadow: 0 12px 36px rgba(0,0,0,0.6);
            z-index: 5;
            min-width: 160px;
        }
        .sold-tooltip.visible { opacity: 1; }
        .sold-tooltip-date {
            font-size: 10px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.1em;
            margin-bottom: 6px;
            font-weight: 600;
        }
        .sold-tooltip-value {
            font-size: 16px;
            font-weight: 700;
            color: var(--text-primary);
            font-variant-numeric: tabular-nums;
            letter-spacing: -0.3px;
        }
        .sold-tooltip-units {
            font-size: 11px;
            color: var(--text-secondary);
            margin-top: 3px;
            font-weight: 500;
        }
        .sold-kpi-row {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 14px;
            max-width: 1400px;
            margin: 0 auto 20px;
        }
        .sold-kpi {
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 16px;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            padding: 18px 18px;
        }
        .sold-kpi-value { white-space: nowrap; }
        .sold-kpi-label {
            font-size: 10px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.1em;
            font-weight: 600;
            margin-bottom: 8px;
        }
        .sold-kpi-value {
            font-size: 26px;
            font-weight: 700;
            color: var(--text-primary);
            font-variant-numeric: tabular-nums;
            letter-spacing: -0.6px;
            line-height: 1;
        }
        .sold-kpi-sub {
            font-size: 10px;
            color: var(--text-tertiary);
            font-variant-numeric: tabular-nums;
            margin-top: 6px;
        }
        .sold-kpi-sellthrough .sold-kpi-value {
            color: #4f8fff;
        }
        .sold-kpi-days .sold-kpi-value {
            color: #34d399;
        }

        /* ============================================================
           SOLD TAB ZONES — Two distinct sections:
             Zone 1: OUR ACCOUNTS (S&T 500) — green-accented relationship
                     view with hero donut + movers + cold prospects
             Zone 2: WHOLE MARKET — blue-accented competitive view with
                     the existing total-sold chart + filters + table
           Each zone has its own visual identity (eyebrow tag, big title,
           ambient color tint, glassmorphic content cards) so a glance
           tells you which surface you're looking at.
           ============================================================ */
        .zone {
            max-width: 1400px;
            margin: 0 auto 32px;
            position: relative;
        }
        .zone-st500 {
            display: flex;
            flex-direction: column;
            gap: 16px;
            padding: 28px 28px 32px;
            background:
                radial-gradient(900px 280px at 12% 0%, rgba(52,211,153,0.10), transparent 60%),
                radial-gradient(700px 240px at 96% 100%, rgba(94,234,212,0.07), transparent 60%),
                rgba(255,255,255,0.015);
            border: 1px solid rgba(52,211,153,0.16);
            border-radius: 24px;
        }
        .zone-st500::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: 24px;
            pointer-events: none;
            background: linear-gradient(180deg, rgba(52,211,153,0.06) 0%, transparent 30%);
        }
        /* Whole Market zone: lighter-touch wrapper. The inner content
           (.sold-card, .sold-kpi-row, etc.) already enforces its own
           max-width: 1400px + horizontal margins, so wrapping it in a
           containerized .zone-market (with padding + border + max-width)
           was double-constraining the layout and squishing every card.
           Instead, keep .zone-market as a transparent flow container that
           just hosts the banner + an ambient backdrop, and let the inner
           cards keep their native widths and rhythm. */
        .zone-market {
            display: block;
            position: relative;
            margin: 0 auto 32px;
        }
        .zone-market::before {
            content: '';
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 0;
            background:
                radial-gradient(900px 280px at 80% 0%, rgba(79,143,255,0.05), transparent 60%);
        }
        .zone-market > * { position: relative; z-index: 1; }
        .zone-banner-market {
            max-width: 1400px;
            margin: 0 auto 24px;
            padding: 16px 24px 0;
        }
        .zone-banner {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
            gap: 24px;
            padding-bottom: 4px;
            position: relative;
            z-index: 1;
        }
        .zone-banner-left { flex: 1; min-width: 0; }
        .zone-tag {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 5px 12px;
            border-radius: 999px;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            margin-bottom: 14px;
        }
        .zone-tag-st500,
        .zone-tag-ours {
            background: rgba(52,211,153,0.12);
            color: #5eead4;
            border: 1px solid rgba(52,211,153,0.22);
        }
        .zone-tag-market {
            background: rgba(79,143,255,0.10);
            color: #93c5fd;
            border: 1px solid rgba(79,143,255,0.20);
        }
        .zone-tag-dot {
            width: 6px; height: 6px; border-radius: 50%;
            background: currentColor;
            box-shadow: 0 0 8px currentColor;
            animation: zonePulse 2.2s infinite ease-in-out;
        }
        @keyframes zonePulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50%      { opacity: 0.55; transform: scale(1.4); }
        }
        .zone-title {
            font-size: 36px;
            font-weight: 800;
            color: var(--text-primary);
            letter-spacing: -1.5px;
            margin: 0 0 8px 0;
            line-height: 1;
            background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.7) 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        /* Inherits the .zone-title gradient + weight + letter-spacing so
           "(Smyrna Truck index)" reads as part of the same bold title. */
        .zone-title-meaning {
            /* no overrides — match the parent .zone-title treatment */
        }
        .zone-sub {
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.55;
            max-width: 540px;
        }
        .zone-sub #st500CountInline {
            color: #5eead4;
            font-weight: 700;
        }

        /* ── Zone divider between S&T 500 and Whole Market ── */
        .zone-divider {
            max-width: 1400px;
            margin: 0 auto 32px;
            display: flex;
            align-items: center;
            gap: 18px;
            padding: 0 28px;
        }
        .zone-divider-line {
            flex: 1;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent);
        }
        .zone-divider-label {
            font-size: 10px;
            color: var(--text-tertiary);
            letter-spacing: 0.32em;
            font-weight: 700;
            text-transform: uppercase;
            white-space: nowrap;
        }

        /* ── S&T 500 / Our-deliveries range pills (match sold-range-pills look) ── */
        .st500-range-pills,
        .ours-range-pills {
            display: flex;
            gap: 4px;
            background: rgba(0,0,0,0.25);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 999px;
            padding: 4px;
            flex-shrink: 0;
        }
        .st500-range-pills button,
        .ours-range-pills button {
            background: transparent;
            border: none;
            color: var(--text-tertiary);
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.06em;
            padding: 6px 14px;
            border-radius: 999px;
            cursor: pointer;
            transition: background 0.15s, color 0.15s;
        }
        .st500-range-pills button:hover,
        .ours-range-pills button:hover { color: var(--text-secondary); }
        .st500-range-pills button.active,
        .ours-range-pills button.active {
            background: rgba(52,211,153,0.18);
            color: #5eead4;
        }

        /* ── OUR DELIVERIES section (Salesforce/AX hero) ── */
        .ours-hero-card {
            background: linear-gradient(135deg, rgba(52,211,153,0.06), rgba(255,255,255,0.02));
            border: 1px solid rgba(52,211,153,0.14);
            border-radius: 18px;
            padding: 24px 28px;
            margin-top: 18px;
        }
        .ours-kpis {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 18px;
        }
        .ours-kpi { text-align: center; }
        .ours-kpi-value {
            font-size: 38px;
            font-weight: 800;
            letter-spacing: -1.5px;
            line-height: 1;
            color: #5eead4;
            font-variant-numeric: tabular-nums;
        }
        .ours-kpi:nth-child(2) .ours-kpi-value,
        .ours-kpi:nth-child(3) .ours-kpi-value { color: var(--text-primary); }
        .ours-kpi-label {
            font-size: 11px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.06em;
            margin-top: 6px;
        }
        .ours-trend-head {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            margin: 24px 0 10px;
            padding-top: 18px;
            border-top: 1px solid rgba(255,255,255,0.06);
            font-size: 12px;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.06em;
            font-weight: 600;
        }
        .ours-window-label {
            font-size: 11px;
            color: var(--text-tertiary);
            text-transform: none;
            letter-spacing: 0;
            font-weight: 400;
        }
        .ours-trend {
            display: flex;
            align-items: flex-end;
            gap: 6px;
            height: 140px;
            padding-top: 8px;
            position: relative;
        }
        .ours-bar.active {
            filter: brightness(1.15);
            box-shadow: 0 0 12px rgba(94,234,212,0.5);
        }
        /* Custom hover tooltip for the monthly delivery bars */
        .ours-tip {
            position: absolute;
            bottom: calc(100% - 4px);
            transform: translateX(-50%) translateY(6px);
            min-width: 132px;
            background: rgba(8,12,18,0.96);
            border: 1px solid rgba(94,234,212,0.28);
            border-radius: 10px;
            padding: 9px 12px;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.14s ease, transform 0.14s ease;
            z-index: 5;
            box-shadow: 0 8px 24px rgba(0,0,0,0.45);
        }
        .ours-tip.visible {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
        .ours-tip-month {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-primary);
            text-transform: uppercase;
            letter-spacing: 0.06em;
            margin-bottom: 6px;
        }
        .ours-tip-row {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 13px;
            font-weight: 600;
            color: #5eead4;
            font-variant-numeric: tabular-nums;
        }
        .ours-tip-dot {
            width: 7px; height: 7px; border-radius: 2px;
            background: linear-gradient(180deg, #5eead4, #10b981);
            flex-shrink: 0;
        }
        .ours-tip-rev {
            font-size: 11px;
            color: var(--text-tertiary);
            font-variant-numeric: tabular-nums;
            margin-top: 3px;
        }
        .ours-bar-col {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            height: 100%;
            justify-content: flex-end;
            cursor: default;
        }
        .ours-bar-wrap {
            width: 100%;
            flex: 1;
            display: flex;
            align-items: flex-end;
            justify-content: center;
        }
        .ours-bar {
            width: 72%;
            max-width: 28px;
            border-radius: 4px 4px 0 0;
            background: linear-gradient(180deg, #5eead4, #10b981);
            transition: opacity 0.15s;
        }
        .ours-bar-col:hover .ours-bar { opacity: 0.8; }
        .ours-bar-val {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-secondary);
            font-variant-numeric: tabular-nums;
            margin-top: 4px;
        }
        .ours-bar-label {
            font-size: 9px;
            color: var(--text-tertiary);
            margin-top: 2px;
            white-space: nowrap;
        }
        .ours-accounts { margin-top: 18px; }
        .ours-accounts-header {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            margin-bottom: 10px;
        }
        .ours-accounts-header > span:first-child {
            font-size: 13px;
            font-weight: 700;
            color: var(--text-primary);
        }
        .ours-accounts-tag {
            display: inline-block;
            margin-left: 6px;
            padding: 2px 7px;
            border-radius: 999px;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.10);
            color: var(--text-tertiary);
            font-size: 9px;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            vertical-align: middle;
        }
        .ours-accounts-sub { font-size: 11px; color: var(--text-tertiary); max-width: 60%; text-align: right; }
        .ours-acct-row {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 14px;
            border-radius: 10px;
            background: rgba(255,255,255,0.02);
            border: 1px solid rgba(255,255,255,0.04);
            margin-bottom: 6px;
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s;
        }
        .ours-acct-row:hover {
            background: rgba(52,211,153,0.06);
            border-color: rgba(52,211,153,0.18);
        }
        .ours-acct-rank {
            width: 22px;
            font-size: 12px;
            font-weight: 700;
            color: var(--text-tertiary);
            text-align: center;
            flex-shrink: 0;
        }
        .ours-acct-main { flex: 1; min-width: 0; }
        .ours-acct-name {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .ours-acct-loc { font-size: 11px; color: var(--text-tertiary); }
        .ours-acct-delivered {
            font-size: 18px;
            font-weight: 700;
            color: #5eead4;
            font-variant-numeric: tabular-nums;
            text-align: right;
            flex-shrink: 0;
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            line-height: 1.1;
        }
        .ours-acct-unit {
            font-size: 9px;
            font-weight: 500;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }
        .ours-acct-rev {
            width: 78px;
            text-align: right;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary);
            font-variant-numeric: tabular-nums;
            flex-shrink: 0;
        }
        @media (max-width: 640px) {
            .ours-kpis { gap: 10px; }
            .ours-kpi-value { font-size: 28px; }
            .ours-bar-label { display: none; }
        }

        /* ── Hero card with donut chart ── */
        .st500-hero-card {
            position: relative;
            background: linear-gradient(135deg, rgba(52,211,153,0.06), rgba(255,255,255,0.02));
            border: 1px solid rgba(52,211,153,0.14);
            border-radius: 18px;
            padding: 24px 28px;
            display: grid;
            grid-template-columns: auto 1fr;
            gap: 28px;
            align-items: center;
            overflow: hidden;
        }
        .st500-hero-glow {
            position: absolute;
            top: -40%; left: -10%;
            width: 280px; height: 280px;
            background: radial-gradient(closest-side, rgba(52,211,153,0.22), transparent 70%);
            pointer-events: none;
            filter: blur(20px);
            z-index: 0;
        }
        .st500-hero-donut {
            position: relative;
            width: 140px; height: 140px;
            flex-shrink: 0;
            z-index: 1;
        }
        .st500-donut-svg {
            width: 100%; height: 100%;
            transform: rotate(-90deg);
        }
        .st500-donut-track {
            fill: none;
            stroke: rgba(255,255,255,0.06);
            stroke-width: 10;
        }
        .st500-donut-fill {
            fill: none;
            stroke: url(#st500DonutGrad);
            stroke-width: 10;
            stroke-linecap: round;
            transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 1, 0.36, 1);
            filter: drop-shadow(0 0 6px rgba(52,211,153,0.5));
        }
        .st500-donut-center {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
        }
        .st500-donut-value {
            font-size: 28px;
            font-weight: 800;
            color: #5eead4;
            letter-spacing: -1px;
            font-variant-numeric: tabular-nums;
            line-height: 1;
            text-shadow: 0 0 14px rgba(52,211,153,0.4);
        }
        .st500-donut-caption {
            font-size: 9px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.18em;
            margin-top: 6px;
            font-weight: 600;
        }
        .st500-hero-meta {
            z-index: 1;
            min-width: 0;
        }
        /* Two-block hero number layout: each value gets its own clear label
           so reps never have to guess what the numerator and denominator are. */
        .st500-hero-numbers {
            display: flex;
            align-items: stretch;
            gap: 24px;
        }
        .st500-hero-num-block {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .st500-hero-num {
            font-size: 32px;
            font-weight: 800;
            letter-spacing: -1px;
            font-variant-numeric: tabular-nums;
            line-height: 1;
            color: var(--text-primary);
        }
        .st500-hero-num-block.primary .st500-hero-num {
            color: #5eead4;
            text-shadow: 0 0 18px rgba(94,234,212,0.28);
        }
        .st500-hero-num.muted {
            color: rgba(255,255,255,0.55);
        }
        .st500-hero-num-label {
            font-size: 10px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.12em;
            font-weight: 600;
            line-height: 1.3;
            max-width: 180px;
        }
        .st500-hero-num-divider {
            width: 1px;
            background: rgba(255,255,255,0.08);
            align-self: stretch;
            margin: 0 4px;
        }
        .st500-hero-stats {
            display: flex;
            gap: 28px;
            margin-top: 18px;
            padding-top: 14px;
            border-top: 1px solid rgba(255,255,255,0.05);
        }
        .st500-hero-stat-value {
            font-size: 18px;
            font-weight: 700;
            color: var(--text-primary);
            font-variant-numeric: tabular-nums;
            letter-spacing: -0.3px;
            line-height: 1;
        }
        .st500-hero-stat-label {
            font-size: 10px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.1em;
            font-weight: 600;
            margin-top: 5px;
        }

        .st500-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
        }
        .st500-panel {
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 16px;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            padding: 18px 20px;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .st500-panel-header {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            padding-bottom: 8px;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
        }
        .st500-panel-sub {
            font-size: 11px;
            color: var(--text-tertiary);
            font-weight: 500;
        }
        .st500-list {
            display: flex;
            flex-direction: column;
            gap: 4px;
            min-height: 60px;
        }
        .st500-row {
            display: grid;
            grid-template-columns: 22px 1fr auto;
            gap: 10px;
            align-items: center;
            padding: 8px 10px;
            border-radius: 10px;
            cursor: pointer;
            transition: background 0.12s;
        }
        .st500-row:hover {
            background: rgba(79,143,255,0.06);
        }
        .st500-row-rank {
            color: var(--text-tertiary);
            font-weight: 600;
            font-size: 11px;
            font-variant-numeric: tabular-nums;
            text-align: right;
        }
        .st500-row-main { min-width: 0; }
        .st500-row-name {
            font-size: 13px;
            font-weight: 500;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 6px;
            min-width: 0;
        }
        .st500-row-name-text {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            min-width: 0;
            flex: 1;
        }
        .st500-row-loc {
            font-size: 11px;
            color: var(--text-tertiary);
            margin-top: 2px;
        }
        /* Two-tier right column: dominant "X sold" total (what ranked them)
           plus a smaller "Y ours · Z%" secondary line. Reps see total first,
           then immediately understand our share. */
        .st500-row-stats {
            min-width: 130px;
            text-align: right;
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 2px;
        }
        .st500-row-total {
            display: inline-flex;
            align-items: baseline;
            gap: 5px;
            font-variant-numeric: tabular-nums;
        }
        .st500-row-total-num {
            font-size: 16px;
            font-weight: 700;
            color: var(--text-primary);
            line-height: 1;
        }
        .st500-row-total-label {
            font-size: 10px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.1em;
            font-weight: 600;
        }
        .st500-row-ours {
            display: inline-flex;
            align-items: baseline;
            gap: 5px;
            font-variant-numeric: tabular-nums;
            margin-top: 1px;
        }
        .st500-row-ours-num {
            font-size: 12px;
            font-weight: 700;
            line-height: 1;
        }
        .st500-row-ours-label {
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.04em;
        }
        .st500-row-ours-yes .st500-row-ours-num { color: #5eead4; }
        .st500-row-ours-yes .st500-row-ours-label { color: rgba(94,234,212,0.7); }
        .st500-row-ours-zero .st500-row-ours-num,
        .st500-row-ours-zero .st500-row-ours-label { color: var(--text-tertiary); }
        .st500-share-bar {
            width: 110px;
            height: 4px;
            background: rgba(255,255,255,0.06);
            border-radius: 2px;
            margin-top: 6px;
            overflow: hidden;
        }
        .st500-share-bar-fill {
            height: 100%;
            border-radius: 2px;
            transition: width 0.3s;
        }
        .st500-share-bar-fill.good { background: #34d399; }
        .st500-share-bar-fill.mid  { background: #4f8fff; }
        .st500-share-bar-fill.low  { background: rgba(255,255,255,0.25); }

        .st500-row-cold-units {
            text-align: right;
            min-width: 60px;
        }
        .st500-row-cold-count {
            font-size: 16px;
            font-weight: 700;
            color: var(--text-primary);
            font-variant-numeric: tabular-nums;
        }
        .st500-row-cold-label {
            font-size: 10px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            font-weight: 600;
            margin-top: 1px;
        }

        .st500-badge {
            font-size: 9px;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            font-weight: 700;
            padding: 2px 6px;
            border-radius: 4px;
            line-height: 1;
            flex-shrink: 0;
        }
        .st500-badge-active { background: rgba(52,211,153,0.16); color: #34d399; }
        .st500-badge-lapsed { background: rgba(239,68,68,0.16);  color: #ef4444; }
        .st500-badge-new    { background: rgba(79,143,255,0.16); color: #4f8fff; }
        .st500-badge-cold   { background: rgba(255,255,255,0.06); color: var(--text-tertiary); }

        /* Relationship chips — Customer / Lapsed / Pipeline.
           Rendered inline next to dealer names across market views. */
        .rel-chip {
            display: inline-block;
            font-size: 9.5px;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            font-weight: 700;
            padding: 2px 6px;
            border-radius: 4px;
            line-height: 1;
            vertical-align: middle;
            margin-left: 6px;
            white-space: nowrap;
            cursor: help;
        }
        .rel-chip-customer { background: rgba(210,105,30,0.14); color: #D2691E; border: 1px solid rgba(210,105,30,0.25); }
        .rel-chip-lapsed   { background: rgba(239,68,68,0.14);  color: #ef4444; border: 1px solid rgba(239,68,68,0.25); }
        .rel-chip-pipeline { background: rgba(79,143,255,0.14); color: #4f8fff; border: 1px solid rgba(79,143,255,0.25); }

        .st500-lapsed-strip {
            background: rgba(239,68,68,0.06);
            border: 1px solid rgba(239,68,68,0.12);
            border-radius: 12px;
            padding: 12px 16px;
            display: flex;
            flex-wrap: wrap;
            gap: 14px;
            align-items: center;
        }
        .st500-lapsed-label {
            font-size: 10px;
            color: #ef4444;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            font-weight: 700;
            margin-right: 4px;
        }
        .st500-lapsed-item {
            font-size: 12px;
            color: var(--text-primary);
            cursor: pointer;
            padding: 4px 10px;
            border-radius: 8px;
            background: rgba(255,255,255,0.03);
            transition: background 0.12s;
        }
        .st500-lapsed-item:hover { background: rgba(79,143,255,0.08); }
        .st500-lapsed-meta {
            color: var(--text-tertiary);
            font-size: 11px;
            margin-left: 4px;
        }

        @media (max-width: 1100px) {
            .st500-grid          { grid-template-columns: 1fr; }
            .st500-hero-card     { grid-template-columns: 1fr; text-align: center; gap: 18px; padding: 22px; }
            .st500-hero-donut    { margin: 0 auto; }
            .st500-hero-stats    { justify-content: center; }
            .zone-banner         { flex-direction: column; align-items: flex-start; gap: 16px; }
            .zone-banner-right   { align-self: flex-end; }
            .zone-title          { font-size: 30px; }
            .zone-st500, .zone-divider { padding-left: 20px; padding-right: 20px; }
            .zone-banner-market  { padding-left: 20px; padding-right: 20px; }
        }
        @media (max-width: 700px) {
            .zone-st500, .zone-divider { padding-left: 16px; padding-right: 16px; margin-bottom: 22px; }
            .zone-st500          { padding-top: 22px; padding-bottom: 26px; }
            .zone-market         { margin-bottom: 22px; }
            .zone-banner-market  { padding-left: 16px; padding-right: 16px; }
            .zone-title          { font-size: 26px; }
            .st500-hero-stats    { gap: 18px; flex-wrap: wrap; justify-content: flex-start; }
            .st500-hero-headline { font-size: 26px; }
            .st500-panel         { padding: 14px 12px; }
            .st500-row           { grid-template-columns: 18px 1fr auto; gap: 8px; padding: 8px 4px; }
            .st500-row-stats     { min-width: 78px; }
            .st500-share-bar     { display: none; }
            .st500-row-total-num { font-size: 14px; }
            .st500-row-ours-num,
            .st500-row-ours-label { font-size: 10px; }
            .st500-row-cold-units { min-width: 46px; }
        }

        /* Filter bar — match dashboard pill selects */
        .sold-filters {
            max-width: 1400px;
            margin: 0 auto 20px;
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
        }
        .sold-filters select {
            padding: 6px 28px 6px 14px;
            border-radius: 20px;
            border: 1px solid var(--glass-border);
            background: rgba(255,255,255,0.03);
            color: var(--text-secondary);
            color-scheme: dark;
            font-size: 12px;
            font-family: inherit;
            font-weight: 500;
            cursor: pointer;
            appearance: none;
            -webkit-appearance: none;
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
            background-repeat: no-repeat;
            background-position: right 10px center;
            transition: all 0.2s var(--smooth);
        }
        .sold-filters select:hover { border-color: rgba(255,255,255,0.15); color: var(--text-primary); }
        .sold-filters select:focus { outline: none; border-color: rgba(52,211,153,0.4); }
        .sold-filters-label {
            font-size: 10px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.1em;
            font-weight: 600;
            margin-right: 4px;
        }
        .sold-clear-btn {
            background: transparent;
            color: var(--text-tertiary);
            border: 1px solid var(--glass-border);
            border-radius: 20px;
            padding: 6px 14px;
            font-size: 11px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s var(--smooth);
            margin-left: auto;
        }
        .sold-clear-btn:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.2); }

        /* Table — glass card */
        .sold-table-wrap {
            max-width: 1400px;
            margin: 0 auto;
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 16px;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            overflow: hidden;
        }
        .sold-table-header {
            padding: 16px 22px;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }
        .sold-table-count {
            font-size: 13px;
            color: var(--text-secondary);
            font-weight: 500;
        }
        .sold-table-count strong { color: var(--text-primary); font-weight: 700; }
        .sold-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 12px;
        }
        .sold-table thead th {
            text-align: left;
            padding: 10px 14px;
            font-size: 10px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            font-weight: 600;
            background: rgba(255,255,255,0.015);
            border-bottom: 1px solid rgba(255,255,255,0.05);
            cursor: pointer;
            user-select: none;
            white-space: nowrap;
        }
        .sold-table thead th:hover { color: var(--text-secondary); }
        .sold-table thead th.active { color: #34d399; }
        .sold-table thead th.active::after { content: ' ↓'; }
        .sold-table thead th.active.asc::after { content: ' ↑'; }
        .sold-table tbody td {
            padding: 10px 14px;
            border-bottom: 1px solid rgba(255,255,255,0.03);
            color: var(--text-secondary);
            white-space: nowrap;
        }
        .sold-table tbody td.price { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
        .sold-table tbody td.brand { color: var(--text-primary); font-weight: 500; }
        .sold-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
        .sold-table tbody tr:last-child td { border-bottom: none; }
        .sold-pager {
            padding: 12px 18px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-top: 1px solid rgba(255,255,255,0.05);
        }
        .sold-pager button {
            background: rgba(255,255,255,0.04);
            color: var(--text-secondary);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 6px;
            padding: 5px 12px;
            font-size: 11px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s;
        }
        .sold-pager button:hover:not(:disabled) { color: var(--text-primary); border-color: rgba(255,255,255,0.2); }
        .sold-pager button:disabled { opacity: 0.3; cursor: not-allowed; }
        .sold-pager-info { font-size: 11px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
        .sold-loading {
            text-align: center;
            padding: 60px 20px;
            color: var(--text-tertiary);
        }
        .sold-empty {
            text-align: center;
            padding: 40px 20px;
            color: var(--text-tertiary);
            font-size: 13px;
        }

        .dashboard-wrap {
            display: none;
            position: fixed;
            top: 56px;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 10;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 24px;
            scrollbar-width: thin;
            scrollbar-color: rgba(255,255,255,0.1) transparent;
            background:
                linear-gradient(rgba(79,143,255,0.02) 1px, transparent 1px),
                linear-gradient(90deg, rgba(79,143,255,0.02) 1px, transparent 1px);
            background-size: 24px 24px;
        }

        .dash-filters {
            display: flex;
            gap: 8px;
            margin-bottom: 20px;
            flex-wrap: wrap;
            align-items: center;
            max-width: 1400px;
            margin: 0 auto 20px;
        }
        .dash-filter-select {
            padding: 6px 28px 6px 12px;
            border-radius: 20px;
            border: 1px solid var(--glass-border);
            background: rgba(255,255,255,0.03);
            color: var(--text-secondary);
            color-scheme: dark;
            font-size: 12px;
            font-family: inherit;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s var(--smooth);
            -webkit-appearance: none;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 10px center;
        }
        .dash-filter-select:focus {
            border-color: rgba(79,143,255,0.3);
            background-color: rgba(79,143,255,0.06);
            color: var(--text-primary);
            outline: none;
        }
        .dash-filter-pill {
            padding: 5px 14px;
            border-radius: 20px;
            border: 1px solid var(--glass-border);
            background: rgba(255,255,255,0.03);
            color: var(--text-secondary);
            font-size: 11px;
            font-family: inherit;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s var(--smooth);
        }
        .dash-filter-pill:hover {
            background: rgba(79,143,255,0.06);
            border-color: rgba(79,143,255,0.2);
            color: var(--text-primary);
        }
        .dash-filter-pill.active {
            background: rgba(79,143,255,0.12);
            border-color: rgba(79,143,255,0.3);
            color: var(--accent-blue);
        }
        .dash-filter-label {
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-tertiary);
            font-weight: 600;
            margin-right: 4px;
        }
        .dash-filter-sep {
            width: 1px;
            height: 20px;
            background: rgba(255,255,255,0.06);
            margin: 0 8px;
        }

        .dash-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            max-width: 1400px;
            margin: 0 auto;
        }

        .dash-card {
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 16px;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            padding: 24px;
            position: relative;
            overflow: hidden;
            transition: border-color 0.3s var(--smooth), box-shadow 0.3s var(--smooth);
            animation: dashCardIn 0.5s var(--ease-out-expo) backwards;
        }
        .dash-card::before {
            content: '';
            position: absolute;
            inset: 0;
            background: repeating-linear-gradient(
                0deg,
                transparent,
                transparent 2px,
                rgba(79,143,255,0.012) 2px,
                rgba(79,143,255,0.012) 4px
            );
            pointer-events: none;
            border-radius: 16px;
        }
        .dash-card::after {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: 16px;
            opacity: 0;
            transition: opacity 0.3s;
            background: radial-gradient(400px circle at var(--spot-x, 50%) var(--spot-y, 50%),
                rgba(79,143,255,0.06), transparent 60%);
            pointer-events: none;
        }
        .dash-card:hover::after { opacity: 1; }
        .dash-card:hover {
            border-color: rgba(79,143,255,0.2);
            box-shadow: 0 8px 32px rgba(79,143,255,0.06);
        }
        .dash-card.span-2 { grid-column: span 2; }
        .dash-card.span-3 { grid-column: span 3; }
        .dash-card.span-4 { grid-column: span 4; }

        .dash-card-title {
            font-size: 13px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.8px;
            color: var(--text-secondary);
            margin-bottom: 18px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .dash-card-title::before {
            content: '';
            width: 3px;
            height: 10px;
            border-radius: 2px;
            background: var(--accent-blue);
        }

        @keyframes dashCardIn {
            from { opacity: 0; transform: translateY(20px) scale(0.97); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        .dash-kpi-row {
            display: flex;
            gap: 16px;
        }
        .dash-kpi-item {
            flex: 1;
            text-align: center;
        }
        .dash-kpi {
            font-size: 38px;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
            color: var(--text-primary);
            letter-spacing: -1px;
            line-height: 1;
        }
        .dash-kpi-label {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-top: 8px;
        }
        .dash-kpi-sub {
            font-size: 12px;
            color: var(--accent-cyan);
            margin-top: 4px;
            font-variant-numeric: tabular-nums;
        }
        @keyframes kpiGlow {
            0%, 100% { text-shadow: 0 0 0 transparent; }
            50% { text-shadow: 0 0 20px rgba(0,212,255,0.3); }
        }
        .dash-kpi.glow { animation: kpiGlow 3s ease-in-out infinite; }

        /* SVG chart transitions */
        .dash-bar { transition: width 0.7s var(--ease-out-expo); }
        .dash-bar-v { transition: height 0.7s var(--ease-out-expo), y 0.7s var(--ease-out-expo); }
        .dash-arc { transition: stroke-dashoffset 0.9s var(--ease-out-expo); }

        /* Horizontal bar chart rows */
        .dash-hbar-row {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 0;
            font-size: 13px;
        }
        .dash-hbar-label {
            width: 110px;
            color: var(--text-secondary);
            text-align: right;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex-shrink: 0;
        }
        .dash-hbar-track {
            flex: 1;
            height: 28px;
            background: rgba(255,255,255,0.03);
            border-radius: 6px;
            overflow: visible;
            position: relative;
        }
        /* Bar-chart card: stack title + list, let list grow to fill the card so the
           bars distribute uniformly however tall the grid makes the card. */
        .dash-hbar-card { display: flex; flex-direction: column; }
        .dash-hbar-list {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            gap: 6px;
            min-height: 0;
            padding-top: 4px;
        }
        .dash-hbar-fill {
            height: 100%;
            border-radius: 6px;
            transition: width 0.7s var(--ease-out-expo);
            position: relative;
            overflow: hidden;
        }
        .dash-hbar-fill.smyrna {
            background: linear-gradient(90deg, #8B4513, #D2691E) !important;
            box-shadow: 0 0 8px rgba(210,105,30,0.3);
        }
        .dash-hbar-row:hover .dash-hbar-fill { opacity: 1 !important; filter: brightness(1.3); }
        .dash-hbar-row:hover .dash-hbar-tooltip {
            opacity: 1; transform: translateY(-100%) scale(1);
        }
        .dash-hbar-tooltip {
            position: absolute; right: 4px; top: -2px;
            background: rgba(0,0,0,0.85); color: #fff; font-size: 10px;
            padding: 2px 6px; border-radius: 4px; white-space: nowrap;
            pointer-events: none; opacity: 0; transform: translateY(-100%) scale(0.8);
            transition: opacity 0.2s, transform 0.2s; z-index: 2;
            border: 1px solid rgba(79,143,255,0.3);
        }
        .dash-hbar-val {
            width: 56px;
            color: var(--text-tertiary);
            font-variant-numeric: tabular-nums;
            font-size: 12px;
            flex-shrink: 0;
        }

        /* Donut hover tooltip */
        .dash-donut-tooltip {
            position: absolute; pointer-events: none; opacity: 0;
            background: rgba(0,0,0,0.9); color: #fff; font-size: 11px;
            padding: 4px 10px; border-radius: 6px; white-space: nowrap;
            border: 1px solid rgba(79,143,255,0.3);
            transform: translate(-50%, -120%); transition: opacity 0.15s;
            z-index: 10;
        }
        .dash-donut-wrap { position: relative; }
        .dash-donut-legend {
            display: flex; flex-wrap: wrap; gap: 2px 0; margin-top: 6px;
        }
        .dash-donut-legend-item {
            display: inline-flex; align-items: center; gap: 4px;
            margin-right: 10px; font-size: 10px; color: var(--text-secondary);
            cursor: default; padding: 1px 4px; border-radius: 3px;
            transition: background 0.15s;
        }
        .dash-donut-legend-item:hover { background: rgba(255,255,255,0.06); }
        .dash-donut-legend-item .dot {
            width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0;
        }

        /* Pricing Intelligence panel */
        .dash-price-stats {
            display: flex; justify-content: space-between; gap: 12px; margin-bottom: 20px;
        }
        .dash-price-stat {
            text-align: center; flex: 1;
            padding: 8px 4px;
            background: rgba(255,255,255,0.02);
            border-radius: 10px;
            border: 1px solid rgba(255,255,255,0.04);
        }
        .dash-price-stat-val {
            font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums;
        }
        .dash-price-stat-label {
            font-size: 9px; color: var(--text-tertiary); text-transform: uppercase;
            letter-spacing: 0.5px; margin-top: 4px;
        }
        .dash-price-curve-wrap {
            position: relative;
            margin: 4px 0 0;
            cursor: crosshair;
        }
        .dash-price-crosshair {
            position: absolute;
            top: 0;
            width: 1px;
            background: rgba(255,255,255,0.5);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.1s;
            z-index: 5;
        }
        .dash-price-crosshair-tip {
            position: absolute;
            top: -4px;
            left: 50%;
            transform: translate(-50%, -100%);
            background: rgba(0,0,0,0.92);
            color: #fff;
            font-size: 11px;
            font-weight: 600;
            padding: 4px 10px;
            border-radius: 5px;
            white-space: nowrap;
            pointer-events: none;
            border: 1px solid rgba(0,212,255,0.4);
        }
        .dash-price-crosshair-dot {
            position: absolute;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #00d4ff;
            border: 2px solid #0d1117;
            transform: translate(-50%, -50%);
            pointer-events: none;
            box-shadow: 0 0 8px rgba(0,212,255,0.6);
        }

        /* Top dealers table */
        .dash-dealer-row {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            border-radius: 8px;
            transition: background 0.15s;
            font-size: 13px;
        }
        .dash-dealer-row:hover {
            background: rgba(255,255,255,0.03);
        }
        .dash-dealer-rank {
            width: 22px;
            font-weight: 700;
            color: var(--text-tertiary);
            font-variant-numeric: tabular-nums;
            text-align: center;
            font-size: 11px;
        }
        .dash-dealer-name {
            flex: 1;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-weight: 500;
        }
        .dash-dealer-loc {
            color: var(--text-tertiary);
            font-size: 10px;
            white-space: nowrap;
        }
        .dash-dealer-count {
            font-variant-numeric: tabular-nums;
            color: var(--text-secondary);
            font-weight: 600;
            min-width: 36px;
            text-align: right;
        }
        .dash-tier-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        /* Smyrna gauge */
        .dash-gauge-wrap {
            display: flex;
            align-items: center;
            gap: 20px;
            flex: 1;
        }
        .dash-smyrna-list {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }
        .dash-smyrna-item {
            display: flex;
            justify-content: space-between;
            padding: 7px 0;
            font-size: 13px;
            color: var(--text-secondary);
            border-bottom: 1px solid rgba(255,255,255,0.03);
        }
        .dash-smyrna-item:last-child { border-bottom: none; }

        /* Donut center text */
        .dash-donut-center {
            font-size: 28px;
            font-weight: 700;
            fill: var(--text-primary);
            font-variant-numeric: tabular-nums;
        }
        .dash-donut-sub {
            font-size: 10px;
            fill: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* Lead pipeline */
        .dash-lead-bar {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-bottom: 20px;
        }
        .dash-lead-bar:last-of-type {
            margin-bottom: 0;
        }
        .dash-lead-label {
            width: 54px;
            font-size: 13px;
            font-weight: 600;
            text-align: right;
            letter-spacing: 0.02em;
        }
        .dash-lead-track {
            flex: 1;
            height: 28px;
            background: rgba(255,255,255,0.03);
            border-radius: 6px;
            overflow: hidden;
        }
        .dash-lead-fill {
            height: 100%;
            border-radius: 6px;
            transition: width 0.7s var(--ease-out-expo);
        }
        .dash-lead-count {
            font-size: 13px;
            font-weight: 600;
            color: rgba(255,255,255,0.8);
            min-width: 36px;
            text-align: right;
        }

        /* Loading skeleton */
        .dash-skeleton {
            background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
            background-size: 200% 100%;
            animation: shimmer 1.5s ease-in-out infinite;
            border-radius: 8px;
        }
        @keyframes shimmer {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }

        /* Smyrna Price Position */
        .dash-price-pos-wrap {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            flex: 1;
        }
        .dash-price-pos-row {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 0;
            font-size: 13px;
        }
        .dash-price-pos-label {
            width: 120px;
            flex-shrink: 0;
            color: var(--text-secondary);
            text-align: right;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .dash-price-pos-track {
            flex: 1;
            height: 28px;
            position: relative;
            border-radius: 4px;
            background: rgba(255,255,255,0.03);
        }
        .dash-price-pos-center {
            position: absolute;
            left: 50%;
            top: 0;
            bottom: 0;
            width: 1px;
            background: rgba(255,255,255,0.15);
        }
        .dash-price-pos-bar {
            position: absolute;
            top: 2px;
            bottom: 2px;
            border-radius: 3px;
            transition: width 0.7s var(--smooth);
        }
        .dash-price-pos-delta {
            width: 56px;
            flex-shrink: 0;
            text-align: right;
            font-weight: 600;
            font-size: 12px;
        }
        .dash-price-pos-count {
            width: 32px;
            flex-shrink: 0;
            text-align: right;
            font-size: 11px;
            color: var(--text-tertiary);
        }
        .dash-price-pos-row { position: relative; }
        .dash-price-pos-tip {
            position: absolute;
            left: 50%;
            top: -4px;
            transform: translate(-50%, -100%) scale(0.8);
            background: rgba(0,0,0,0.92);
            color: #fff;
            font-size: 11px;
            padding: 6px 10px;
            border-radius: 6px;
            white-space: nowrap;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s, transform 0.2s;
            z-index: 10;
            border: 1px solid rgba(210,105,30,0.3);
            line-height: 1.5;
        }
        .dash-price-pos-row:hover .dash-price-pos-tip {
            opacity: 1;
            transform: translate(-50%, -100%) scale(1);
        }
        .dash-price-pos-row:hover .dash-price-pos-bar { opacity: 1 !important; filter: brightness(1.3); }

        /* ========== RESPONSIVE ========== */
        @media (max-width: 900px) {
            .dash-grid { grid-template-columns: repeat(2, 1fr); }
            .dash-card.span-3, .dash-card.span-4 { grid-column: span 2; }
            .dash-kpi-row { flex-wrap: wrap; }
            .dash-kpi-item { min-width: calc(50% - 8px); }
            .hero-cards { grid-template-columns: repeat(2, 1fr); }
        }
        @media (max-width: 600px) {
            .action-cards { grid-template-columns: 1fr; }
            .action-card:last-child:nth-child(odd) { max-width: none; }
            .orb-hero { width: 100px; height: 100px; }
            .welcome-title { font-size: 26px; font-weight: 600; }
            .msg-bubble { max-width: 90%; }
            .topbar-center { display: none; }
            .tm-header { flex-direction: column; gap: 12px; align-items: flex-start; }
            .tm-card-actions { flex-wrap: wrap; }
            .tm-rep-cards { flex-direction: column; gap: 10px; }
            .tm-rep-card { padding: 16px 24px; }
            .tm-header-row { flex-direction: column; align-items: flex-start; gap: 12px; }
            .tm-header-controls { width: 100%; }
            .tm-header-controls .tm-rep-select { flex: 1; }
            .tm-kpi-row { gap: 8px; grid-template-columns: repeat(2, 1fr); }
            .tm-kpi-card { padding: 12px 10px; }
            .tm-kpi-value { font-size: 20px; }
            .tm-wiz-summary { grid-template-columns: repeat(2, 1fr); }
            .tm-wiz-filterbar { flex-direction: column; align-items: stretch; }
            .tm-wiz-filterbar-left, .tm-wiz-filterbar-right { justify-content: flex-start; }
            .tm-stop-stats { flex-wrap: wrap; }
            .tm-wiz-preview { max-width: calc(100vw - 16px); }
            .dash-grid { grid-template-columns: 1fr; }
            .dash-card.span-2, .dash-card.span-3, .dash-card.span-4 { grid-column: span 1; }
            .hero-cards { grid-template-columns: 1fr; }
            .dashboard-wrap { padding: 12px; }
            /* Mobile topbar */
            .wordmark-text { font-size: 24px; }
            .wordmark-sub { display: none; }
            .usage-badge { display: none !important; }
            .topbar { padding: 10px 12px; gap: 6px; }
            .topbar-right { gap: 4px; }
            .btn-ghost, .btn-map, .btn-dash, .btn-mydealers, .btn-trips, .btn-home {
                font-size: 11px; padding: 10px 10px; min-height: 36px;
            }
            /* Mobile trip manager */
            .tm-modal { padding: 16px; margin: 8px; max-width: calc(100vw - 16px); border-radius: 16px; }
            .tm-body { padding: 24px 16px 40px; }
            .tm-controls { height: auto; flex-wrap: wrap; }
            .tm-tab { padding: 0 18px; }
            .tm-add-rep-row { flex-direction: column; }
            .tm-card-actions { flex-wrap: wrap; }
            /* Mobile dashboard KPIs */
            .dash-kpi-row { gap: 8px; }
            .dash-kpi-item { min-width: calc(50% - 4px); }
            .dash-kpi { font-size: 26px; letter-spacing: -0.5px; }
            .dash-kpi-label { font-size: 11px; font-weight: 600; }
            /* Mobile chat padding */
            .chat-scroll { padding: 0 12px 60px; }
            body.chatting .chat-scroll { padding-top: 60px; }
            /* Mobile greeting */
            .chat-greeting { padding: 0 16px; gap: 14px; }
            .chat-greeting-text { font-size: 26px; }
            .chat-greeting-eye { width: 150px; height: 150px; }
            .chat-greeting-eye::after { width: 300px; height: 300px; }
            .greet-reflection { width: 180px; }
            .greet-aurora-1 { width: 300px; height: 300px; }
            .greet-aurora-2 { width: 260px; height: 260px; }
            .greet-aurora-3 { width: 220px; height: 220px; }
            .greet-particle { display: none; }
            .chat-suggestion { font-size: 13px; padding: 8px 12px; }
            .chat-suggestions { flex-wrap: wrap; }
        }
        @media (max-width: 380px) {
            .btn-ghost, .btn-map, .btn-dash, .btn-mydealers, .btn-trips, .btn-home { font-size: 10px; padding: 10px 8px; }
            .wordmark-text { font-size: 20px; }
        }
        /* ═══ Auth Screen ═══ */
        .auth-overlay {
            position: fixed;
            inset: 0;
            z-index: 9999;
            background: var(--bg-deep);
            display: none;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.4s ease;
            overflow: hidden;
        }
        .auth-overlay.visible { display: flex; opacity: 1; }
        .auth-overlay.hidden { opacity: 0; pointer-events: none; }
        /* Ambient background orbs */
        .auth-bg-orb {
            position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none;
        }
        .auth-bg-orb-1 {
            width: 500px; height: 500px; top: -15%; left: -10%;
            background: radial-gradient(circle, rgba(79,143,255,0.12) 0%, transparent 70%);
            animation: authOrbFloat 14s ease-in-out infinite;
        }
        .auth-bg-orb-2 {
            width: 400px; height: 400px; bottom: -10%; right: -8%;
            background: radial-gradient(circle, rgba(168,85,247,0.1) 0%, transparent 70%);
            animation: authOrbFloat 18s ease-in-out infinite reverse;
        }
        .auth-bg-orb-3 {
            width: 300px; height: 300px; top: 40%; left: 60%;
            background: radial-gradient(circle, rgba(0,212,255,0.06) 0%, transparent 70%);
            animation: authOrbFloat 10s ease-in-out infinite 2s;
        }
        @keyframes authOrbFloat {
            0%, 100% { transform: translate(0, 0) scale(1); }
            33% { transform: translate(30px, -20px) scale(1.05); }
            66% { transform: translate(-20px, 15px) scale(0.95); }
        }
        .auth-card {
            width: 100%;
            max-width: 400px;
            padding: 44px 36px 36px;
            border-radius: 28px;
            border: 1px solid rgba(255,255,255,0.06);
            background: rgba(10,14,26,0.8);
            backdrop-filter: blur(60px);
            -webkit-backdrop-filter: blur(60px);
            box-shadow: 0 30px 100px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.04);
            text-align: center;
            position: relative;
            z-index: 1;
        }
        /* Eye container with orbital rings */
        .auth-eye-wrap {
            position: relative;
            width: 100px; height: 100px;
            margin: 0 auto 20px;
        }
        .auth-eye-ring {
            position: absolute; inset: -8px; border-radius: 50%;
            border: 1px solid rgba(79,143,255,0.15);
            animation: authRingSpin 20s linear infinite;
        }
        .auth-eye-ring::after {
            content: ''; position: absolute;
            width: 6px; height: 6px; border-radius: 50%;
            background: rgba(79,143,255,0.5);
            top: -3px; left: 50%; transform: translateX(-50%);
        }
        .auth-eye-ring-2 {
            position: absolute; inset: -18px; border-radius: 50%;
            border: 1px solid rgba(168,85,247,0.08);
            animation: authRingSpin 30s linear infinite reverse;
        }
        .auth-eye-ring-2::after {
            content: ''; position: absolute;
            width: 4px; height: 4px; border-radius: 50%;
            background: rgba(168,85,247,0.35);
            bottom: -2px; left: 50%; transform: translateX(-50%);
        }
        @keyframes authRingSpin { to { transform: rotate(360deg); } }
        .auth-eye-svg { width: 100px; height: 100px; position: relative; z-index: 1; }
        /* Subtle glow pulse behind eye */
        .auth-eye-glow {
            position: absolute; inset: -20px; border-radius: 50%;
            background: radial-gradient(circle, rgba(79,143,255,0.15) 0%, transparent 70%);
            animation: authGlowPulse 4s ease-in-out infinite;
        }
        @keyframes authGlowPulse {
            0%, 100% { opacity: 0.5; transform: scale(1); }
            50% { opacity: 1; transform: scale(1.08); }
        }
        .auth-title {
            font-size: 26px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 4px;
            letter-spacing: -0.3px;
        }
        .auth-subtitle {
            font-size: 13px;
            color: var(--text-muted);
            margin-bottom: 28px;
            letter-spacing: 0.5px;
            text-transform: uppercase;
        }
        .auth-form { display: flex; flex-direction: column; gap: 12px; }
        .auth-field {
            width: 100%;
            padding: 13px 16px;
            border-radius: 12px;
            border: 1px solid rgba(255,255,255,0.07);
            background: rgba(255,255,255,0.03);
            color: var(--text-primary);
            font-size: 14px;
            font-family: inherit;
            outline: none;
            transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
            box-sizing: border-box;
        }
        .auth-field:focus {
            border-color: rgba(79,143,255,0.4);
            background: rgba(79,143,255,0.04);
            box-shadow: 0 0 0 3px rgba(79,143,255,0.08);
        }
        .auth-field::placeholder { color: rgba(255,255,255,0.2); }
        .auth-btn {
            width: 100%;
            padding: 13px;
            border-radius: 12px;
            border: none;
            background: linear-gradient(135deg, #4f8fff 0%, #7c3aed 50%, #00d4ff 100%);
            background-size: 200% 200%;
            animation: authBtnShimmer 4s ease-in-out infinite;
            color: #fff;
            font-size: 14px;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            margin-top: 4px;
            letter-spacing: 0.3px;
        }
        @keyframes authBtnShimmer {
            0%, 100% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
        }
        .auth-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(79,143,255,0.3); }
        .auth-btn:active { transform: translateY(0); }
        .auth-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; animation: none; }
        .auth-toggle {
            margin-top: 20px;
            font-size: 12px;
            color: var(--text-muted);
        }
        .auth-toggle a {
            color: #4f8fff;
            cursor: pointer;
            text-decoration: none;
            font-weight: 500;
        }
        .auth-toggle a:hover { text-decoration: underline; }
        .auth-error {
            padding: 10px 14px;
            border-radius: 10px;
            background: rgba(239,68,68,0.08);
            border: 1px solid rgba(239,68,68,0.15);
            color: #f87171;
            font-size: 13px;
            text-align: left;
            display: none;
        }
        .auth-error.show { display: block; }
        .auth-success {
            padding: 10px 14px;
            border-radius: 10px;
            background: rgba(52,211,153,0.08);
            border: 1px solid rgba(52,211,153,0.15);
            color: #34d399;
            font-size: 13px;
            text-align: left;
            display: none;
        }
        .auth-success.show { display: block; }
        .auth-domain-note {
            font-size: 11px;
            color: var(--text-tertiary);
            margin-top: -4px;
            text-align: left;
            padding-left: 4px;
        }
        .auth-user-bar {
            position: relative;
            cursor: pointer;
            user-select: none;
            margin-left: 4px;
        }
        .auth-avatar {
            width: 32px; height: 32px; border-radius: 50%;
            background: linear-gradient(135deg, var(--accent), var(--accent-2));
            display: flex; align-items: center; justify-content: center;
            font-size: 12px; font-weight: 700; color: #fff; text-transform: uppercase;
            letter-spacing: 0.5px;
            transition: box-shadow 0.2s, transform 0.15s;
            border: 2px solid transparent;
        }
        .auth-avatar:hover { box-shadow: 0 0 0 3px rgba(100,149,237,0.25); transform: scale(1.05); }
        .auth-user-bar.active .auth-avatar { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(100,149,237,0.2); }
        .profile-dropdown {
            position: absolute; top: calc(100% + 8px); right: 0;
            width: 240px; border-radius: 12px;
            background: var(--bg-card); border: 1px solid var(--border);
            box-shadow: 0 12px 40px rgba(0,0,0,0.5);
            opacity: 0; visibility: hidden; transform: translateY(-4px);
            transition: all 0.2s ease; z-index: 100;
            overflow: hidden;
        }
        .profile-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
        .profile-header {
            padding: 16px; border-bottom: 1px solid var(--border);
            display: flex; align-items: center; gap: 12px;
        }
        .profile-header .profile-avatar {
            width: 40px; height: 40px; border-radius: 50%;
            background: linear-gradient(135deg, var(--accent), var(--accent-2));
            display: flex; align-items: center; justify-content: center;
            font-size: 16px; font-weight: 600; color: #fff; text-transform: uppercase;
            flex-shrink: 0;
        }
        .profile-header .profile-info { min-width: 0; }
        .profile-header .profile-name {
            font-size: 14px; font-weight: 600; color: var(--text-primary);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .profile-header .profile-email {
            font-size: 11px; color: var(--text-muted); margin-top: 2px;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .profile-meta {
            padding: 12px 16px; border-bottom: 1px solid var(--border);
            font-size: 11px; color: var(--text-muted);
            display: flex; align-items: center; gap: 6px;
        }
        .profile-meta svg { opacity: 0.4; flex-shrink: 0; }
        .profile-signout {
            padding: 10px 16px; font-size: 13px; color: var(--text-secondary);
            cursor: pointer; transition: all 0.15s;
            display: flex; align-items: center; gap: 8px;
        }
        .profile-signout:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

        /* ── Toast notifications ───────────────────────────────────────
           Replaces the ~26 silent console.error / blocking alert() sites.
           Stacks in the top-right; auto-dismisses; click to dismiss early. */
        #toastContainer {
            position: fixed;
            top: 70px;
            right: 20px;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
            max-width: 360px;
        }
        .toast {
            background: rgba(20, 22, 28, 0.95);
            border: 1px solid var(--glass-border);
            border-left: 3px solid var(--text-tertiary);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            color: var(--text-primary);
            padding: 12px 16px;
            border-radius: 10px;
            font-size: 13px;
            line-height: 1.4;
            box-shadow: 0 8px 24px rgba(0,0,0,0.4);
            pointer-events: auto;
            cursor: pointer;
            display: flex;
            align-items: flex-start;
            gap: 10px;
            opacity: 0;
            transform: translateX(20px);
            transition: opacity 0.25s ease, transform 0.25s var(--smooth);
        }
        .toast.show { opacity: 1; transform: translateX(0); }
        .toast.toast-error { border-left-color: #ef4444; }
        .toast.toast-warn  { border-left-color: #ff8c00; }
        .toast.toast-info  { border-left-color: #4f8fff; }
        .toast.toast-success { border-left-color: #34d399; }
        .toast-icon { flex-shrink: 0; font-size: 14px; line-height: 1.4; opacity: 0.85; }
        .toast-error .toast-icon { color: #ef4444; }
        .toast-warn  .toast-icon { color: #ff8c00; }
        .toast-info  .toast-icon { color: #4f8fff; }
        .toast-success .toast-icon { color: #34d399; }
        .toast-msg { flex: 1; word-break: break-word; }

        /* ── Mobile responsive pass ────────────────────────────────────
           Reps work in trucks on phones. These rules tighten the most
           overflow-prone components (topbar, Sold tab grid, filters,
           leaderboard) for narrow viewports without touching desktop. */
        @media (max-width: 768px) {
            /* Topbar: allow buttons to wrap onto a second row */
            .topbar {
                padding: 10px 12px;
                gap: 6px;
                flex-wrap: wrap;
            }
            .topbar-right { gap: 4px; }
            .btn-home, .btn-map, .btn-dash, .btn-mydealers, .btn-sold, .btn-trips, .btn-ghost {
                padding: 6px 10px;
                font-size: 11px;
            }

            /* Sold tab — tighter padding + auto-fit grid */
            .sold-card { padding: 18px 16px; margin: 0 12px 14px; max-width: none; }
            .sold-hero-header { gap: 12px; margin-bottom: 14px; }
            .sold-hero-value { font-size: 30px; letter-spacing: -0.6px; }
            .sold-hero-sub { font-size: 11px; }
            .sold-card-footer { flex-wrap: wrap; gap: 8px; }

            .sold-kpi-row {
                grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
                gap: 10px;
                padding: 0 12px;
            }
            .sold-kpi { padding: 14px 16px; }
            .sold-kpi-value { font-size: 22px; }

            .sold-segment-bar { padding: 0 12px; gap: 8px; }
            .sold-segment-pills { flex-wrap: wrap; }

            .sold-filters {
                padding: 0 12px;
                flex-wrap: wrap;
                gap: 8px;
            }
            /* 16px to prevent iOS zoom-on-focus when reps enter VINs on phones. */
            .sold-vin-search { flex: 1 1 100%; font-size: 16px; }
            .sold-csv-btn { margin-left: 0 !important; }

            .sold-leaderboard { margin: 12px; padding: 14px; }
            .sold-leaderboard-row {
                grid-template-columns: 24px 1fr auto;
                gap: 10px;
            }
            .sold-leaderboard-value { display: none; }  /* Reclaim width — units is the headline */

            .sold-table-wrap { padding: 0 12px; }

            /* Toasts: full-width banner along the top below topbar */
            #toastContainer {
                top: 60px;
                right: 8px;
                left: 8px;
                max-width: none;
            }

            /* Range pills should stay on one line via horizontal scroll if needed */
            .sold-range-pills, #soldRangePills {
                overflow-x: auto;
                max-width: 100%;
            }
        }

        @media (max-width: 480px) {
            /* Tightest: SE-class iPhones */
            .sold-hero-value { font-size: 26px; }
            .sold-kpi-value { font-size: 19px; }
            .sold-kpi-label { font-size: 9px; }
            .sold-kpi { padding: 11px 13px; }
            .btn-home, .btn-map, .btn-dash, .btn-mydealers, .btn-sold, .btn-trips {
                padding: 5px 8px;
                font-size: 10.5px;
            }
            /* Chat input — tighter padding so the keyboard doesn't eat half the screen */
            .input-area { padding: 10px 12px 14px; }
            .input-bar { padding: 4px; }
            /* Sold table cells — slimmer at SE width */
            .sold-table th, .sold-table td { padding: 8px 10px; font-size: 11px; }
        }

        /* ── This Week's Plays — collapsible chip in chat greeting ───── */
        .chat-plays {
            margin: 4px auto 6px;
            width: 100%;
            max-width: 640px;
            text-align: center;
        }
        .chat-plays:empty { display: none; }

        .plays-block { display: flex; flex-direction: column; align-items: center; gap: 8px; }

        .plays-toggle {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 7px 14px 7px 12px;
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.10);
            border-radius: 999px;
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 12.5px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.18s var(--spring);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
        }
        .plays-toggle:hover {
            background: rgba(0, 212, 255, 0.06);
            border-color: rgba(0, 212, 255, 0.30);
            color: var(--text-primary);
        }
        .plays-toggle:active { transform: scale(0.98); }
        .plays-toggle-icon { font-size: 13px; line-height: 1; }
        .plays-toggle-count {
            background: rgba(0, 212, 255, 0.18);
            color: #00d4ff;
            font-size: 10.5px;
            font-weight: 700;
            padding: 2px 7px;
            border-radius: 999px;
            line-height: 1.4;
            margin-left: 2px;
        }
        .plays-toggle-chev {
            font-size: 11px;
            color: var(--text-tertiary);
            margin-left: 2px;
            transition: transform 0.2s var(--spring);
        }
        .plays-toggle[aria-expanded="true"] .plays-toggle-chev {
            transform: rotate(180deg);
        }

        .plays-list {
            display: flex;
            flex-direction: column;
            gap: 4px;
            width: 100%;
            text-align: left;
            animation: playsListIn 0.25s var(--spring);
        }
        .plays-list[hidden] { display: none; }
        @keyframes playsListIn {
            from { opacity: 0; transform: translateY(-4px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        /* Compact one-line row. Title shows; detail truncates. Title + detail
           tooltip on hover. Click jumps to chat with the dealer briefing. */
        .chat-plays .brief-card {
            position: relative;
            display: grid;
            grid-template-columns: 28px 1fr 16px;
            align-items: center;
            gap: 10px;
            padding: 9px 12px 9px 14px;
            background: rgba(255,255,255,0.02);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 10px;
            cursor: pointer;
            text-align: left;
            color: var(--text-primary);
            transition: background 0.15s, border-color 0.15s, transform 0.15s;
            overflow: hidden;
            animation: briefIn 0.4s var(--spring) backwards;
            font-family: inherit;
            line-height: 1.3;
        }
        .chat-plays .brief-card::before {
            content: '';
            position: absolute;
            left: 0;
            top: 20%;
            bottom: 20%;
            width: 2px;
            border-radius: 0 2px 2px 0;
            background: rgba(79,143,255, 0.5);
        }
        .chat-plays .brief-card:nth-child(1) { animation-delay: 0.03s; }
        .chat-plays .brief-card:nth-child(2) { animation-delay: 0.07s; }
        .chat-plays .brief-card:nth-child(3) { animation-delay: 0.11s; }
        .chat-plays .brief-card:nth-child(4) { animation-delay: 0.15s; }

        .chat-plays .brief-card[data-detail*="Smyrna"]::before,
        .chat-plays .brief-card[data-detail*="velocity"]::before { background: #34d399; }
        .chat-plays .brief-card[data-detail*="dropped"]::before,
        .chat-plays .brief-card[data-detail*="cut"]::before { background: #fb923c; }
        .chat-plays .brief-card[data-detail*="Restock"]::before,
        .chat-plays .brief-card[data-detail*="restock"]::before { background: #c084fc; }

        .chat-plays .brief-card:hover {
            background: rgba(0, 212, 255, 0.04);
            border-color: rgba(0, 212, 255, 0.25);
        }
        .chat-plays .brief-card:active { transform: scale(0.99); }

        .chat-plays .brief-card-icon {
            font-size: 16px;
            line-height: 1;
            text-align: center;
            flex-shrink: 0;
        }
        .chat-plays .brief-card-body {
            min-width: 0;
            display: flex;
            align-items: baseline;
            gap: 8px;
            flex-wrap: nowrap;
            overflow: hidden;
        }
        .chat-plays .brief-card-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex-shrink: 1;
            min-width: 0;
        }
        .chat-plays .brief-card-detail {
            font-size: 11.5px;
            color: var(--text-tertiary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex-shrink: 2;
            min-width: 0;
        }
        .chat-plays .brief-card-arrow {
            color: var(--text-tertiary);
            font-size: 12px;
            opacity: 0.5;
            transition: opacity 0.15s, color 0.15s, transform 0.15s;
        }
        .chat-plays .brief-card:hover .brief-card-arrow {
            opacity: 1;
            color: #00d4ff;
            transform: translateX(2px);
        }

        /* Plays are collapsed by default into a small chip — the chat-greeting
           keeps its centered layout with the big Otto eye. When the rep
           expands the plays, the cards push down naturally. */

        /* ── Morning Brief ───────────────────────────────────────── */
        .morning-brief {
            display: flex;
            flex-direction: column;
            gap: 10px;
            max-width: 620px;
            margin: 18px auto 28px;
            width: 100%;
        }
        .morning-brief-header {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1.4px;
            color: var(--text-tertiary);
            opacity: 0.8;
            margin-bottom: 2px;
        }
        .morning-brief-header::after {
            content: '';
            flex: 1;
            height: 1px;
            background: linear-gradient(to right, rgba(255,255,255,0.08), transparent);
        }
        .brief-card {
            display: flex;
            align-items: flex-start;
            gap: 14px;
            padding: 14px 16px;
            background: var(--glass);
            border: 1px solid var(--glass-border);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-radius: 14px;
            cursor: pointer;
            transition: transform 0.18s var(--spring), border-color 0.18s, background 0.18s;
            text-align: left;
            animation: briefIn 0.5s var(--spring) backwards;
        }
        .brief-card:nth-child(2) { animation-delay: 0.05s; }
        .brief-card:nth-child(3) { animation-delay: 0.12s; }
        .brief-card:nth-child(4) { animation-delay: 0.19s; }
        .brief-card:nth-child(5) { animation-delay: 0.26s; }
        .brief-card:nth-child(6) { animation-delay: 0.33s; }
        .brief-card:hover {
            transform: translateX(2px);
            border-color: rgba(0, 212, 255, 0.35);
            background: rgba(0, 212, 255, 0.04);
        }
        .brief-card-icon {
            font-size: 22px;
            line-height: 1;
            flex-shrink: 0;
            margin-top: 1px;
            filter: saturate(1.1);
        }
        .brief-card-body { flex: 1; min-width: 0; }
        .brief-card-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 3px;
        }
        .brief-card-detail {
            font-size: 12.5px;
            color: var(--text-secondary);
            line-height: 1.4;
        }
        .brief-card-arrow {
            color: var(--text-tertiary);
            font-size: 16px;
            flex-shrink: 0;
            opacity: 0;
            transition: opacity 0.18s, transform 0.18s;
            align-self: center;
        }
        .brief-card:hover .brief-card-arrow {
            opacity: 0.7;
            transform: translateX(3px);
        }
        @keyframes briefIn {
            from { opacity: 0; transform: translateY(8px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        /* ── Network (Routes tab redesign) ─────────────────────────── */
        /* Topbar is ~70px tall (absolute positioned). Push content below it. */
        /* Match the Dashboard / Sold pattern: fixed wrapper below topbar so
           scrolled content can never bleed behind it. Lets the topbar keep
           its default transparent / blending look. */
        body.network-view .chat-scroll {
            position: fixed;
            top: 90px;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 8;
            padding: 24px max(28px, calc((100vw - 1200px) / 2)) 100px;
            overflow-y: auto;
            overflow-x: hidden;
        }
        .net-loading, .net-empty {
            padding: 40px 24px; color: var(--text-tertiary);
            text-align: center; font-size: 13px;
        }

        .net-header {
            padding-bottom: 18px;
            margin-bottom: 4px;
            border-bottom: 1px solid rgba(255,255,255,0.06);
        }
        .net-header-row { margin-bottom: 18px; }
        .net-header-row {
            display: flex; justify-content: space-between; align-items: flex-end;
            gap: 16px; margin-bottom: 14px;
        }
        .net-eyebrow {
            font-size: 10px; font-weight: 700; letter-spacing: 1.6px;
            color: var(--text-tertiary); margin-bottom: 4px;
        }
        .net-title { font-size: 26px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
        .net-sub { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

        .net-header-controls { display: flex; align-items: center; gap: 12px; }
        .net-rep-switch, .net-sort {
            display: flex; align-items: center; gap: 6px;
            font-size: 12px; color: var(--text-secondary);
        }
        .net-rep-switch select, .net-sort select {
            background: rgba(255,255,255,0.05);
            border: 1px solid rgba(255,255,255,0.10);
            color: var(--text-primary);
            border-radius: 8px; padding: 6px 10px; font-size: 13px;
        }

        .net-controls {
            display: flex; justify-content: space-between; align-items: center;
            gap: 16px; flex-wrap: wrap;
        }
        .net-chips { display: flex; gap: 6px; }
        .net-chip {
            background: transparent;
            border: 1px solid rgba(255,255,255,0.10);
            color: var(--text-secondary);
            border-radius: 999px;
            padding: 6px 14px;
            font-size: 12px; font-weight: 500;
            cursor: pointer; transition: all 0.15s;
        }
        .net-chip:hover { border-color: rgba(255,255,255,0.20); color: var(--text-primary); }
        .net-chip.active {
            background: rgba(0,212,255,0.10);
            border-color: rgba(0,212,255,0.35);
            color: #00d4ff;
        }

        .net-routes { display: flex; flex-direction: column; }
        .net-route {
            border: none;
            background: transparent;
        }
        .net-route + .net-route { margin-top: 8px; }

        .net-route-head {
            display: flex; justify-content: space-between; align-items: baseline;
            padding: 18px 4px 10px;
            border-bottom: 1px solid rgba(255,255,255,0.08);
            margin-bottom: 4px;
        }
        .net-route-title {
            font-size: 11px; font-weight: 700;
            color: var(--text-secondary);
            letter-spacing: 1.4px;
            text-transform: uppercase;
        }
        .net-route-meta {
            font-size: 11.5px; color: var(--text-tertiary);
            display: flex; align-items: center; gap: 10px;
        }
        .net-route-overdue {
            background: rgba(251,113,133,0.12);
            color: #fb7185;
            padding: 3px 10px;
            border-radius: 999px;
            font-size: 11px; font-weight: 600;
        }

        .net-rows { display: flex; flex-direction: column; }
        .net-row {
            display: grid;
            grid-template-columns: minmax(200px, 2.5fr) 70px 90px minmax(160px, 1.6fr) 100px 76px;
            align-items: center;
            gap: 16px;
            padding: 11px 8px;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            transition: background 0.12s;
            border-radius: 6px;
        }
        .net-row:last-child { border-bottom: none; }
        .net-row:hover {
            background: rgba(255,255,255,0.025);
        }
        .net-row-main { min-width: 0; }
        .net-row-name {
            font-size: 14px; font-weight: 600; color: var(--text-primary);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .net-row-loc { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }

        .net-tier-pill {
            font-size: 10px; font-weight: 700;
            padding: 3px 9px; border-radius: 999px; letter-spacing: 0.4px;
        }

        .net-row-stats { font-size: 13px; color: var(--text-primary); }
        .net-veh { font-weight: 600; }
        .net-unit { color: var(--text-tertiary); font-size: 11px; margin-left: 1px; }
        .net-smyrna { color: #4f8fff; font-size: 11.5px; }

        .net-row-velocity { font-size: 12.5px; color: var(--text-secondary); }
        .net-row-velocity strong { color: var(--text-primary); font-weight: 700; }
        .net-dim { color: var(--text-tertiary); }
        .net-row-visit { font-size: 12px; font-weight: 500; }

        .net-row-actions { display: flex; gap: 6px; justify-content: flex-end; }
        .net-btn {
            background: transparent;
            border: 1px solid rgba(255,255,255,0.10);
            color: var(--text-secondary);
            border-radius: 8px;
            width: 32px; height: 32px;
            font-size: 14px; cursor: pointer;
            transition: all 0.15s;
            display: inline-flex; align-items: center; justify-content: center;
        }
        .net-btn:hover {
            border-color: rgba(0,212,255,0.4);
            color: #00d4ff;
            background: rgba(0,212,255,0.05);
        }
        .net-btn:active { transform: scale(0.94); }

        .net-row-manual { background: rgba(255,255,255,0.012); }
        .net-row-manual .net-row-name { font-weight: 500; color: var(--text-secondary); }
        .net-off {
            font-size: 9.5px; font-weight: 600;
            letter-spacing: 0.6px; text-transform: uppercase;
            background: rgba(168,85,247,0.10);
            color: #c084fc;
            padding: 2px 7px; border-radius: 4px;
            margin-left: 6px; vertical-align: middle;
        }
        .net-manual-notes {
            cursor: pointer; border-radius: 6px;
            padding: 4px 8px; margin: -4px -8px;
            transition: background 0.12s;
        }
        .net-manual-notes:hover { background: rgba(255,255,255,0.04); }

        .net-notes-input {
            width: 100%;
            background: rgba(0,0,0,0.3);
            border: 1px solid rgba(0,212,255,0.3);
            color: var(--text-primary);
            border-radius: 6px; padding: 6px 8px;
            font-size: 12px; font-family: inherit; resize: vertical;
        }
        .net-notes-actions { display: flex; gap: 6px; margin-top: 6px; }
        .net-btn-save, .net-btn-cancel {
            font-size: 11px; padding: 4px 10px; border-radius: 6px;
            border: 1px solid rgba(255,255,255,0.12);
            background: transparent; color: var(--text-secondary); cursor: pointer;
        }
        .net-btn-save {
            background: rgba(0,212,255,0.15);
            border-color: rgba(0,212,255,0.4);
            color: #00d4ff;
        }

        @media (max-width: 800px) {
            body.network-view .chat-scroll { padding: 20px 12px 100px; }
            .net-row {
                grid-template-columns: 1fr 70px 80px;
                grid-template-areas:
                    "name tier veh"
                    "vel  vel  visit"
                    "actions actions actions";
                gap: 8px;
            }
            .net-row-main { grid-area: name; }
            .net-row-tier { grid-area: tier; text-align: right; }
            .net-row-stats { grid-area: veh; text-align: right; }
            .net-row-velocity { grid-area: vel; }
            .net-row-visit { grid-area: visit; text-align: right; }
            .net-row-actions { grid-area: actions; justify-content: flex-end; }
            .net-route-head { top: 60px; }
        }

        /* ====================================================================
           PERF: pause heavy background animations on non-home views.
           The three .bg-canvas orbs and .bg-orb-3 keep drifting forever (20-25s
           infinite loops, will-change: transform). They're hidden behind opaque
           content on Map/Dashboard/Sold/Trips/Table — pausing saves continuous
           GPU compositing work (notable on iPad battery).
           Using `paused` instead of `none` so animations resume in place
           when the user returns to home, rather than restarting from 0.
           ==================================================================== */
        body.map-view .bg-canvas::before,
        body.map-view .bg-canvas::after,
        body.map-view .bg-orb-3,
        body.dashboard .bg-canvas::before,
        body.dashboard .bg-canvas::after,
        body.dashboard .bg-orb-3,
        body.sold-units .bg-canvas::before,
        body.sold-units .bg-canvas::after,
        body.sold-units .bg-orb-3,
        body.trip-manager .bg-canvas::before,
        body.trip-manager .bg-canvas::after,
        body.trip-manager .bg-orb-3,
        body.my-dealers .bg-canvas::before,
        body.my-dealers .bg-canvas::after,
        body.my-dealers .bg-orb-3 {
            animation-play-state: paused;
        }

        /* ====================================================================
           PERF: content-visibility on long scrollable list rows.
           Lets the browser skip layout/paint for rows that are off-screen.
           contain-intrinsic-size reserves a placeholder height so scroll
           position stays stable as rows are virtualized in/out.
           Supported in Chrome/Edge 85+, Safari 18+. Older browsers ignore
           it gracefully — no behavior change there.
           ==================================================================== */
        .sl-row {
            content-visibility: auto;
            contain-intrinsic-size: 0 72px;
        }
        .route-list-row {
            content-visibility: auto;
            contain-intrinsic-size: 0 56px;
        }
