:root {
    --bg:         #14161a;
    --panel:      #1b1e25;
    --raised:     #242832;
    --raised-hi:  #2b303c;
    --hairline:   #2e333d;
    --text:       #e8eaed;
    --muted:      #8b919c;

    --accent:     #f5a524;
    --accent-dim: #5a4418;
    --accent-glow: rgba(245, 165, 36, .18);
    --signal:     #2dd4bf;
    --signal-glow: rgba(45, 212, 191, .16);
    --danger:     #e5484d;
    --danger-glow: rgba(229, 72, 77, .16);

    --display: 'Oswald', 'Segoe UI', system-ui, sans-serif;
    --body:    'Inter', 'Segoe UI', system-ui, sans-serif;
    --mono:    'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

    --sidebar-w: 250px;
    --radius: 10px;
    --radius-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%; height: 100%;
    background: transparent;
    font-family: var(--body);
    color: var(--text);
    overflow: hidden;
}

.hidden { display: none !important; }

#app-overlay {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(6, 7, 9, .55);
}

#app-container {
    position: relative;
    width: 1320px;
    height: 800px;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    background:
        radial-gradient(120% 70% at 15% -10%, rgba(245, 165, 36, .07), transparent 55%),
        radial-gradient(100% 60% at 100% 110%, rgba(45, 212, 191, .06), transparent 55%),
        repeating-linear-gradient(0deg, transparent 0 31px, rgba(255, 255, 255, .012) 31px 32px),
        repeating-linear-gradient(90deg, transparent 0 31px, rgba(255, 255, 255, .01) 31px 32px),
        var(--bg);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    box-shadow: 0 40px 120px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(255, 255, 255, .02), 0 0 70px rgba(245, 165, 36, .06);
    overflow: hidden;
    animation: containerIn .22s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes containerIn {
    from { opacity: 0; transform: scale(.96) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

#app-container::before {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0, 0, 0, .06) 2px 4px);
    pointer-events: none; z-index: 30;
}

.corner {
    position: absolute; width: 20px; height: 20px;
    border: 2px solid var(--accent); opacity: .4; z-index: 31;
}
.corner.tl { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.corner.tr { top: 8px; right: 8px; border-left: none; border-bottom: none; }
.corner.bl { bottom: 8px; left: 8px; border-right: none; border-top: none; }
.corner.br { bottom: 8px; right: 8px; border-left: none; border-top: none; }

/* ── Sidebar ─────────────────────────────────────────────── */
#sidebar {
    background: var(--panel);
    border-right: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    z-index: 5;
}

#sidebar-logo {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 6px 20px;
    border-bottom: 1px solid var(--hairline);
    margin-bottom: 16px;
}
.logo-mark {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent);
    color: var(--bg);
    font-family: var(--display);
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 0 16px var(--accent-glow);
}
.logo-text {
    font-family: var(--display);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .5px;
}
.logo-text span { color: var(--accent); margin-left: 4px; }
.logo-version {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 1px;
}

#nav-list { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--raised); color: var(--text); }
.nav-item.active {
    background: var(--raised);
    color: var(--accent);
    border-left-color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}
.nav-icon { font-size: 13px; width: 16px; text-align: center; }

#driver-card {
    margin-top: 16px;
    padding: 10px;
    background: var(--raised);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
}
.driver-card-inner { display: flex; align-items: center; gap: 10px; }
.driver-avatar { font-size: 22px; }
#driver-title { font-size: 12.5px; font-weight: 600; }
#driver-sub { font-size: 11px; color: var(--muted); font-family: var(--mono); }

#close-btn {
    margin-top: 12px;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--hairline);
    color: var(--muted);
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    cursor: pointer;
    transition: border-color .12s, color .12s, background .12s;
}
#close-btn:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-glow); }

/* ── Content ─────────────────────────────────────────────── */
#content {
    padding: 26px 32px;
    overflow-y: auto;
    z-index: 5;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: panelIn .16s cubic-bezier(.4, 0, .2, 1); }
@keyframes panelIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.panel-header { margin-bottom: 20px; }
.panel-title { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: .3px; }
.panel-subtitle { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    border: 1px dashed var(--hairline);
    border-radius: var(--radius-lg);
}

/* ── Cards / grids ───────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

.card {
    background: var(--raised);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.card.locked { opacity: .5; }
.card.locked:hover { transform: none; border-color: var(--hairline); }

.card-title { font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
.card-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 12px; }
.card-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.card-stat { font-family: var(--mono); font-size: 13px; }
.card-stat.money { color: var(--accent); }
.card-stat.xp { color: var(--signal); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 16px;
    border-radius: var(--radius);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .3px;
    cursor: pointer;
    border: 1px solid var(--hairline);
    background: var(--raised-hi);
    color: var(--text);
    transition: filter .12s, box-shadow .12s, transform .1s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 11px; }

.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--bg); box-shadow: 0 6px 18px var(--accent-glow); }
.btn-signal { background: var(--signal); border-color: var(--signal); color: var(--bg); box-shadow: 0 6px 18px var(--signal-glow); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-ghost { background: transparent; }

/* ── Progress bars ───────────────────────────────────────── */
.progress-track {
    width: 100%; height: 8px;
    background: var(--bg);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    overflow: hidden;
}
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.progress-fill.condition-high { background: var(--signal); }
.progress-fill.condition-mid { background: var(--accent); }
.progress-fill.condition-low { background: var(--danger); }

/* ── Career ──────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat-card {
    background: var(--raised);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    padding: 14px;
}
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-family: var(--mono); font-size: 20px; font-weight: 600; margin-top: 6px; }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.badge {
    display: flex; align-items: center; gap: 10px;
    padding: 12px;
    background: var(--raised);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    opacity: .4;
}
.badge.earned { opacity: 1; border-color: var(--accent-dim); box-shadow: 0 0 14px var(--accent-glow); }
.badge-icon { font-size: 20px; }
.badge-label { font-size: 12.5px; font-weight: 600; }
.badge-desc { font-size: 10.5px; color: var(--muted); }

/* ── Active delivery ─────────────────────────────────────── */
.status-card {
    background: var(--raised);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    padding: 22px;
}
.stage-track { display: flex; gap: 8px; margin: 16px 0; }
.stage-step {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .3px;
    border-radius: var(--radius);
    background: var(--bg);
    border: 1px solid var(--hairline);
    color: var(--muted);
}
.stage-step.done { background: var(--signal-glow); border-color: var(--signal); color: var(--signal); }
.stage-step.current { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }

/* ── Leaderboard ─────────────────────────────────────────── */
.leaderboard-row {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 14px;
    background: var(--raised);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    margin-bottom: 8px;
}
.leaderboard-rank {
    width: 28px; text-align: center;
    font-family: var(--mono); font-weight: 700; color: var(--accent);
}
.leaderboard-name { flex: 1; font-weight: 600; font-size: 13px; }
.leaderboard-meta { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

/* ── Garage ──────────────────────────────────────────────── */
.section-heading {
    font-size: 13px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
    color: var(--muted);
    margin: 24px 0 12px;
}
.section-heading:first-child { margin-top: 0; }

/* ── Toasts ──────────────────────────────────────────────── */
#toast-stack {
    position: fixed; top: 20px; right: 20px;
    display: flex; flex-direction: column; gap: 8px;
    z-index: 100;
}
.toast {
    min-width: 220px;
    padding: 12px 16px;
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    font-size: 12.5px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
    animation: toastIn .18s ease-out;
}
.toast.success { border-left-color: var(--signal); }
.toast.error { border-left-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
.toast.toast-out { opacity: 0; transform: translateX(16px); transition: opacity .2s, transform .2s; }

/* ── Contract badges/chips ───────────────────────────────── */
.card.hot { border-color: var(--danger); box-shadow: 0 0 16px var(--danger-glow); }
.card-badges { display: flex; gap: 6px; margin-bottom: 8px; }
.chip {
    display: inline-flex; align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    background: var(--raised-hi);
    border: 1px solid var(--hairline);
    color: var(--muted);
}
.chip.hot { background: var(--danger-glow); border-color: var(--danger); color: var(--danger); }
.chip.stops { background: var(--signal-glow); border-color: var(--signal); color: var(--signal); }

/* ── Forms ───────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; display: block; }
.input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--body);
    font-size: 13px;
}
.input:focus { outline: none; border-color: var(--accent); }
.form-row { display: flex; gap: 10px; align-items: flex-end; }
.form-row .field { flex: 1; margin-bottom: 0; }

/* ── Sub-tabs (Company tab's Overview/Roster/Treasury/Fleet) ─ */
.subtabs { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--hairline); padding-bottom: 12px; }
.subtab {
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border: 1px solid transparent;
}
.subtab:hover { background: var(--raised); color: var(--text); }
.subtab.active { background: var(--raised); color: var(--accent); border-color: var(--accent-dim); }

/* ── Roster / ledger rows ────────────────────────────────── */
.roster-row, .ledger-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: var(--raised);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    margin-bottom: 8px;
}
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.online-dot.online { background: var(--signal); box-shadow: 0 0 8px var(--signal); }
.roster-name { flex: 1; font-weight: 600; font-size: 13px; }
.roster-rank { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.ledger-kind { width: 90px; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.ledger-name { flex: 1; font-size: 12.5px; }
.ledger-amount { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.ledger-amount.positive { color: var(--signal); }
.ledger-amount.negative { color: var(--danger); }

/* ── Performance upgrades ────────────────────────────────── */
.upgrade-section { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--hairline); }
.upgrade-heading { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 8px; }
.upgrade-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.upgrade-label { font-size: 12px; }
.upgrade-level { font-family: var(--mono); color: var(--signal); }

/* ── Perk tree ───────────────────────────────────────────── */
.perk-tree { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.perk-branch { background: var(--raised); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 14px; }
.perk-branch-label { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--accent); margin-bottom: 12px; }
.perk-tier { padding: 10px 0; border-top: 1px solid var(--hairline); }
.perk-tier:first-of-type { border-top: none; padding-top: 0; }
.perk-tier.locked { opacity: .4; }
.perk-tier-label { font-weight: 600; font-size: 12.5px; margin-bottom: 3px; }
.perk-tier-desc { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.perk-tier-cost.owned { font-size: 11px; color: var(--signal); font-weight: 600; }

/* ── Paint ───────────────────────────────────────────────── */
.paint-section { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--hairline); }
.paint-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.paint-row label { font-size: 11px; color: var(--muted); width: 60px; flex-shrink: 0; }
.paint-row select { flex: 1; }

/* ── Danger zone (company disband) ──────────────────────────*/
.danger-zone { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--danger-glow); }

/* ── Driving HUD ─────────────────────────────────────────── */
/* Always mounted, independent of #app-overlay/SetNuiFocus — a peripheral
   widget visible while actually driving, never captures input. */
#hud-overlay {
    position: fixed;
    bottom: 28px; left: 28px;
    padding: 10px 16px;
    background: rgba(20, 22, 26, .78);
    border: 1px solid var(--hairline);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    pointer-events: none;
    z-index: 40;
    font-family: var(--body);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
#hud-label { font-size: 12.5px; font-weight: 600; color: var(--text); }
#hud-distance { font-family: var(--mono); font-size: 15px; color: var(--accent); margin-top: 2px; }
#hud-stops { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* ── Admin panel ─────────────────────────────────────────── */
#admin-overlay {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(6, 7, 9, .55);
    z-index: 50;
}
#admin-container {
    width: 1160px; height: 760px;
    display: flex; flex-direction: column;
    background: var(--ad-steel);
    border: 1px solid var(--ad-cyan);
    border-radius: var(--radius-lg);
    box-shadow: 0 40px 120px rgba(0, 0, 0, .75), 0 0 60px var(--ad-cyan-glow);
    overflow: hidden;
    animation: containerIn .22s cubic-bezier(.34, 1.56, .64, 1);
}
.admin-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 20px;
    background: var(--raised);
    border-bottom: 1px solid var(--hairline);
    flex-shrink: 0;
}
.admin-title {
    font-family: var(--display); font-size: 16px; font-weight: 700;
    letter-spacing: 1px; color: var(--ad-cyan);
}
#admin-close-btn {
    padding: 8px 14px; background: transparent; border: 1px solid var(--hairline);
    color: var(--muted); border-radius: var(--radius); font-size: 11.5px; font-weight: 600; cursor: pointer;
}
#admin-close-btn:hover { color: var(--danger); border-color: var(--danger); }

/* flex:1 + min-height:0 so the body scrolls internally instead of the whole
   container growing past its fixed height. */
#admin-body { padding: 18px 20px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
#admin-body::-webkit-scrollbar { width: 8px; }
#admin-body::-webkit-scrollbar-track { background: transparent; }
#admin-body::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 999px; }
.admin-row {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 14px;
    background: var(--raised);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    margin-bottom: 8px;
}
.admin-row-name { flex: 1; font-weight: 600; font-size: 13px; }
.admin-row-meta { font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* ── Scrollbar ───────────────────────────────────────────── */
#content::-webkit-scrollbar { width: 8px; }
#content::-webkit-scrollbar-track { background: transparent; }
#content::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 999px; }

/* ═══════════════════════════════════════════════════════════
   v2.0 — boot sequence, route map, analytics, receipts
   Every selector below is prefixed (boot-/map-/chart-/spark-/route-/
   receipt-/skeleton-) because this stylesheet shares one document with the
   admin overlay and the driving HUD. Bare class names have bitten this
   codebase's sibling resource before — see the .ghost collision noted in
   cipher-drugs.
   ═══════════════════════════════════════════════════════════ */

/* ── Boot sequence ───────────────────────────────────────── */
#boot-overlay {
    position: absolute; inset: 0; z-index: 40;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(90% 60% at 50% 40%, rgba(245, 165, 36, .06), transparent 70%),
        var(--bg);
    transition: opacity .3s ease, visibility .3s ease;
}
#boot-overlay.done { opacity: 0; visibility: hidden; pointer-events: none; }

#boot-inner { width: 460px; text-align: center; }

#boot-mark {
    width: 54px; height: 54px; margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent); color: var(--bg);
    font-family: var(--display); font-size: 28px; font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 0 34px var(--accent-glow);
    animation: bootPulse 1.4s ease-in-out infinite;
}
@keyframes bootPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 34px var(--accent-glow); }
    50%      { transform: scale(1.06); box-shadow: 0 0 52px var(--accent-glow); }
}

#boot-title {
    font-family: var(--display);
    font-size: 20px; font-weight: 600; letter-spacing: 2px;
    margin-bottom: 22px;
}
#boot-title span { color: var(--accent); margin-left: 6px; }

#boot-lines {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--muted);
    text-align: left;
    min-height: 118px;
    padding: 0 40px;
}
.boot-line {
    opacity: 0;
    animation: bootLineIn .18s ease forwards;
    white-space: nowrap;
    line-height: 1.72;
}
.boot-line:first-child { color: var(--accent); letter-spacing: 1px; }
@keyframes bootLineIn {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

#boot-bar {
    margin: 20px auto 0; width: 300px; height: 2px;
    background: var(--hairline); border-radius: 999px; overflow: hidden;
}
#boot-bar-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--signal));
    box-shadow: 0 0 12px var(--accent-glow);
    transition: width .16s ease;
}

/* ── Sidebar XP track ────────────────────────────────────── */
#driver-xp-track {
    margin-top: 9px; height: 3px;
    background: var(--bg); border-radius: 999px; overflow: hidden;
}
#driver-xp-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--signal));
    border-radius: 999px;
    transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

/* ── Skeleton loaders ────────────────────────────────────── */
.skeleton-wrap { display: flex; flex-direction: column; gap: 10px; }
.skeleton-row {
    height: 46px;
    border-radius: var(--radius);
    background: linear-gradient(90deg, var(--raised) 0%, var(--raised-hi) 50%, var(--raised) 100%);
    background-size: 220% 100%;
    animation: skeletonSweep 1.1s ease-in-out infinite;
}
@keyframes skeletonSweep {
    from { background-position: 140% 0; }
    to   { background-position: -40% 0; }
}

.empty-state.sm { padding: 18px 12px; font-size: 12px; }
.chip.sm { padding: 2px 6px; font-size: 9px; }

/* ── Route Map ───────────────────────────────────────────── */
#map-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 18px;
    height: 636px;
}

#map-root {
    position: relative;
    /* Matches .map-ocean. The SVG keeps its aspect ratio inside a wider
       panel, so without this the letterboxed margins would read as a
       different surface sitting either side of the sea. */
    background:
        radial-gradient(80% 60% at 50% 0%, rgba(45, 212, 191, .05), transparent 60%),
        #0e1116;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
#map-root::after {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, .07) 3px 6px);
    pointer-events: none;
}

#map-svg { width: 100%; height: 100%; display: block; }

/* The Leaflet container. The old SVG brought its own height through its
   aspect ratio; a tile map does not, so the root takes a concrete one. */
#map-root { min-height: 520px; }
#map-leaflet { position: absolute; inset: 0; }
/* Leaflet's default look fights the dashboard theme. */
#map-root .leaflet-container { background: #0a0e14; font: inherit; }
#map-root .leaflet-control-zoom a {
    background: #14181f; color: #cfd6e4; border-color: rgba(255,255,255,.08);
}
#map-root .leaflet-tooltip {
    background: #14181f; color: #e8ecf4; border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 4px 14px rgba(0,0,0,.4);
}

.map-ocean { fill: #0e1116; }
.map-grid-line { stroke: rgba(255, 255, 255, .028); stroke-width: .5; }
.map-land { fill: url(#map-land-grad); }
.map-coast {
    fill: none;
    stroke: var(--signal);
    stroke-width: .9;
    opacity: .55;
}
.map-highway {
    fill: none;
    stroke: rgba(245, 165, 36, .22);
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.map-district {
    fill: var(--muted);
    font-family: var(--mono);
    font-size: 6px;
    letter-spacing: 1.1px;
    text-anchor: middle;
    opacity: .5;
}

/* Routes */
.map-route-halo {
    fill: none; stroke: var(--accent); stroke-width: 4;
    opacity: .16; stroke-linecap: round; stroke-linejoin: round;
    filter: url(#map-route-glow);
}
.map-route {
    fill: none; stroke: var(--accent); stroke-width: 1.5;
    stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 5 4;
    animation: routeDash 1.4s linear infinite;
}
@keyframes routeDash { to { stroke-dashoffset: -18; } }

/* Pins */
.map-pin { cursor: pointer; }
.map-pin-hit { fill: transparent; }
.map-pin-ring {
    fill: rgba(45, 212, 191, .12);
    stroke: var(--signal);
    stroke-width: 1.1;
    transition: r .14s ease, fill .14s ease;
}
.map-pin-core { fill: var(--signal); }
.map-pin-index {
    fill: var(--bg); font-family: var(--mono); font-size: 4.4px;
    font-weight: 700; text-anchor: middle;
}
.map-pin:hover .map-pin-ring { fill: rgba(45, 212, 191, .3); }

.map-pin.hot .map-pin-ring { stroke: var(--danger); fill: rgba(229, 72, 77, .14); }
.map-pin.hot .map-pin-core { fill: var(--danger); }

.map-pin.locked { opacity: .35; }

.map-pin.selected .map-pin-ring {
    stroke: var(--accent);
    fill: rgba(245, 165, 36, .22);
    filter: url(#map-pin-glow);
}
.map-pin.selected .map-pin-core { fill: var(--accent); }

/* Depot + player */
.map-depot-box {
    fill: rgba(245, 165, 36, .18);
    stroke: var(--accent);
    stroke-width: 1.2;
}
.map-depot-core { fill: var(--accent); }
.map-depot-label {
    fill: var(--accent); font-family: var(--mono); font-size: 5px;
    letter-spacing: 1px; text-anchor: middle;
}

.map-player-arrow { fill: #ffffff; stroke: var(--bg); stroke-width: .6; }
.map-player-pulse {
    fill: rgba(255, 255, 255, .1);
    animation: playerPulse 2s ease-out infinite;
}
@keyframes playerPulse {
    0%   { r: 4; opacity: .55; }
    100% { r: 13; opacity: 0; }
}

/* Map sidebar */
#map-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.map-side-block {
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    padding: 14px;
}
.map-side-block.grow { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.map-side-heading {
    font-size: 11px; font-weight: 700; letter-spacing: .6px;
    text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}

.map-detail-title { font-family: var(--display); font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.map-detail-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-bottom: 12px;
}
.map-detail-grid > div { display: flex; flex-direction: column; gap: 2px; }
.mdl { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.mdv { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.mdv.money { color: var(--accent); }

.map-warn {
    font-size: 11px; color: var(--signal);
    background: var(--signal-glow);
    border: 1px solid var(--signal);
    border-radius: var(--radius);
    padding: 7px 9px; margin-bottom: 10px;
}
.map-lock {
    font-size: 11px; color: var(--danger);
    margin-bottom: 10px;
}

.map-list { overflow-y: auto; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.map-list::-webkit-scrollbar { width: 6px; }
.map-list::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 999px; }

.map-list-item {
    padding: 9px 11px;
    background: var(--raised);
    border: 1px solid transparent;
    border-left: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .12s, border-color .12s;
}
.map-list-item:hover { background: var(--raised-hi); }
.map-list-item.active { border-left-color: var(--accent); background: var(--raised-hi); }
.map-list-item.hot { border-left-color: var(--danger); }
.map-list-item.locked { opacity: .45; }
.map-list-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.map-list-label { font-size: 12.5px; font-weight: 600; }
.map-list-meta {
    display: flex; gap: 10px; margin-top: 4px;
    font-family: var(--mono); font-size: 10.5px; color: var(--muted);
}

/* ── Charts ──────────────────────────────────────────────── */
.chart-wrap {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    padding: 12px;
}
/* preserveAspectRatio="none" lets the 0-100 viewBox stretch to any panel
   width; strokes are given vector-effect so they don't distort with it. */
.chart-svg { width: 100%; height: 100%; display: block; overflow: visible; }

.chart-bar-track { fill: rgba(255, 255, 255, .022); }
.chart-bar {
    fill: var(--accent);
    opacity: .82;
    transition: opacity .12s;
}
.chart-bar-g:hover .chart-bar { opacity: 1; }

.chart-max {
    position: absolute; top: 8px; right: 12px;
    font-family: var(--mono); font-size: 10px; color: var(--muted);
}
.chart-x-axis { position: relative; height: 18px; margin-top: 4px; }
.chart-x-label {
    position: absolute; transform: translateX(-50%);
    font-family: var(--mono); font-size: 9.5px; color: var(--muted);
}

.spark-line {
    fill: none; stroke: var(--signal); stroke-width: 2;
    vector-effect: non-scaling-stroke;
    stroke-linejoin: round; stroke-linecap: round;
}
.spark-area { fill: var(--signal-glow); }

.route-list { display: flex; flex-direction: column; gap: 12px; }
.route-row {
    background: var(--raised);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 11px 13px;
}
.route-row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.route-label { font-size: 13px; font-weight: 600; }
.route-earned { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.route-bar-track {
    height: 4px; background: var(--bg); border-radius: 999px;
    overflow: hidden; margin: 8px 0 6px;
}
.route-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--signal));
    border-radius: 999px;
}
.route-meta { font-size: 11px; color: var(--muted); font-family: var(--mono); }

.analytics-note {
    margin-top: 20px; padding: 11px 14px;
    font-size: 12px; color: var(--signal);
    background: var(--signal-glow);
    border: 1px solid var(--signal);
    border-radius: var(--radius);
}

/* ── Receipts ────────────────────────────────────────────── */
.receipt {
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    overflow: hidden;
}
.receipt-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
    padding: 14px 16px;
    background: var(--raised);
    border-bottom: 1px solid var(--hairline);
}
.receipt-title { font-size: 14px; font-weight: 600; }
.receipt-sub { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.receipt-total { text-align: right; white-space: nowrap; }
.receipt-total-value { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--accent); }
.receipt-total-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.receipt-body { padding: 10px 16px; }
.receipt-line {
    display: flex; justify-content: space-between; gap: 12px;
    font-size: 12px; padding: 5px 0;
    font-family: var(--mono);
    color: var(--muted);
}
.receipt-line.base { color: var(--text); }
.receipt-line.pos { color: var(--signal); }
.receipt-line.neg { color: var(--danger); }
.receipt-line.subtotal {
    border-top: 1px solid var(--hairline);
    margin-top: 6px; padding-top: 9px;
    color: var(--text); font-weight: 700;
}
.receipt-line.split { color: var(--muted); font-style: italic; }

.receipt-foot {
    display: flex; gap: 8px; flex-wrap: wrap;
    padding: 10px 16px 14px;
}
.receipt-chip {
    font-family: var(--mono); font-size: 10px;
    padding: 3px 8px; border-radius: 999px;
    background: var(--raised); border: 1px solid var(--hairline);
    color: var(--muted);
}

/* ═══════════════════════════════════════════════════════════
   Ops console (admin)
   Deliberately a different surface from the driver dashboard: graphite and
   technical cyan instead of amber, mono type throughout, denser rows. Staff
   should never be a glance away from mistaking one for the other.

   Every selector is ad-* prefixed. This overlay shares a document with the
   dashboard and the HUD — an unprefixed class collided across stylesheets
   in cipher-drugs and made admin buttons float outside their cards and stop
   responding to clicks.
   ═══════════════════════════════════════════════════════════ */
:root {
    --ad-cyan: #22d3ee;
    --ad-cyan-glow: rgba(34, 211, 238, .16);
    --ad-steel: #171a20;
    --ad-steel-hi: #1e222a;
}

.admin-title { display: flex; align-items: center; gap: 12px; }
.ad-status {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
    color: var(--ad-cyan); font-weight: 400;
}
.ad-led {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--ad-cyan); box-shadow: 0 0 8px var(--ad-cyan);
    animation: adPulse 1.8s ease-in-out infinite;
}
@keyframes adPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

#ad-tabs {
    display: flex; gap: 2px;
    padding: 0 16px;
    background: var(--ad-steel);
    border-bottom: 1px solid var(--hairline);
}
.ad-tab {
    padding: 11px 16px;
    font-family: var(--mono); font-size: 11px;
    letter-spacing: .8px; text-transform: uppercase;
    color: var(--muted); cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .12s, border-color .12s;
}
.ad-tab:hover { color: var(--text); }
.ad-tab.active { color: var(--ad-cyan); border-bottom-color: var(--ad-cyan); }

.ad-heading {
    font-family: var(--mono); font-size: 10.5px;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--muted);
    margin: 20px 0 9px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--hairline);
}
.ad-muted { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.ad-warn { color: var(--danger); font-weight: 700; }

/* Stat grid */
.ad-stat-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.ad-stat {
    background: var(--ad-steel-hi);
    border: 1px solid var(--hairline);
    border-left: 2px solid var(--ad-cyan);
    border-radius: 6px;
    padding: 11px 13px;
}
.ad-stat-label {
    font-family: var(--mono); font-size: 9.5px; letter-spacing: .8px;
    text-transform: uppercase; color: var(--muted);
}
.ad-stat-value { font-family: var(--mono); font-size: 18px; font-weight: 700; margin-top: 5px; }

/* Dense rows */
.ad-row {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px;
    background: var(--ad-steel-hi);
    border: 1px solid var(--hairline);
    border-radius: 6px;
    margin-bottom: 5px;
}
.ad-row.ad-clickable { cursor: pointer; }
.ad-row.ad-clickable:hover { border-color: var(--ad-cyan); }
.ad-rank { font-family: var(--mono); font-size: 11px; color: var(--ad-cyan); width: 26px; }
.ad-row-main { font-size: 12.5px; font-weight: 600; min-width: 150px; }
.ad-row-meta { font-family: var(--mono); font-size: 10.5px; color: var(--muted); flex: 1; }
.ad-row-value { font-family: var(--mono); font-size: 12.5px; color: var(--ad-cyan); white-space: nowrap; }
.ad-row-actions { display: flex; align-items: center; gap: 6px; }

.ad-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hairline); flex-shrink: 0; }
.ad-dot.on { background: var(--signal); box-shadow: 0 0 7px var(--signal); }

/* Controls */
.ad-btn {
    padding: 7px 12px;
    background: var(--raised-hi);
    border: 1px solid var(--hairline);
    border-radius: 5px;
    color: var(--text);
    font-family: var(--mono); font-size: 10.5px;
    letter-spacing: .5px; text-transform: uppercase;
    cursor: pointer;
    /* Explicit resets. .ghost in cipher-drugs proved that a shared document
       can leak positioning onto buttons from an unrelated stylesheet. */
    position: static; transform: none; pointer-events: auto;
    transition: background .12s, border-color .12s, color .12s;
}
.ad-btn:hover:not(:disabled) { background: var(--raised); border-color: var(--ad-cyan); color: var(--ad-cyan); }
.ad-btn:disabled { opacity: .35; cursor: not-allowed; }
.ad-btn.sm { padding: 5px 9px; font-size: 10px; }
.ad-btn.ad-danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }
.ad-btn.ad-armed { border-color: var(--danger); color: var(--danger); background: var(--danger-glow); }

.ad-input {
    padding: 7px 10px;
    background: var(--bg);
    border: 1px solid var(--hairline);
    border-radius: 5px;
    color: var(--text);
    font-family: var(--mono); font-size: 11.5px;
    width: 100%;
}
.ad-input:focus { outline: none; border-color: var(--ad-cyan); }
.ad-input.sm { width: 110px; padding: 5px 8px; font-size: 10.5px; }

.ad-search-bar { margin-bottom: 6px; }
.ad-field-row { display: flex; gap: 7px; align-items: center; margin-bottom: 8px; }
.ad-note { font-family: var(--mono); font-size: 10px; color: var(--muted); line-height: 1.5; }
.ad-note-top {
    padding: 10px 12px; margin-bottom: 4px;
    background: var(--ad-steel-hi); border: 1px solid var(--hairline);
    border-left: 2px solid var(--ad-cyan); border-radius: 6px;
}
.ad-note-top code { color: var(--ad-cyan); }

.ad-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-chip-btn {
    padding: 5px 10px;
    background: var(--ad-steel-hi);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    font-size: 11px; cursor: pointer;
    transition: border-color .12s, color .12s;
}
.ad-chip-btn:hover { border-color: var(--ad-cyan); color: var(--ad-cyan); }

.ad-filters { display: flex; gap: 6px; margin-bottom: 12px; }
.ad-filter {
    padding: 5px 12px;
    font-family: var(--mono); font-size: 10px;
    letter-spacing: .6px; text-transform: uppercase;
    color: var(--muted); cursor: pointer;
    border: 1px solid var(--hairline); border-radius: 999px;
}
.ad-filter.active { color: var(--ad-cyan); border-color: var(--ad-cyan); background: var(--ad-cyan-glow); }

/* Player detail */
.ad-detail { margin-top: 14px; }
.ad-detail-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
    padding: 13px 15px;
    background: var(--ad-steel-hi);
    border: 1px solid var(--hairline);
    border-left: 2px solid var(--ad-cyan);
    border-radius: 6px;
}
.ad-detail-name { font-size: 15px; font-weight: 700; }
.ad-detail-sub { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.ad-detail-stats { display: flex; gap: 14px; font-family: var(--mono); font-size: 11px; color: var(--ad-cyan); }

.ad-card-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px; margin-top: 12px;
}
.ad-card {
    background: var(--ad-steel-hi);
    border: 1px solid var(--hairline);
    border-radius: 6px;
    padding: 12px;
}
.ad-card-title {
    font-family: var(--mono); font-size: 10px; letter-spacing: .9px;
    text-transform: uppercase; color: var(--ad-cyan); margin-bottom: 10px;
}

/* Control tab */
.ad-settings { display: flex; flex-direction: column; gap: 5px; }
.ad-setting {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 10px 13px;
    background: var(--ad-steel-hi);
    border: 1px solid var(--hairline);
    border-radius: 6px;
}
.ad-setting-info { flex: 1; min-width: 0; }
.ad-setting-label { font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.ad-setting-help { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 3px; }
.ad-setting-control { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ad-affix { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

.ad-badge {
    font-family: var(--mono); font-size: 8.5px;
    letter-spacing: .6px; text-transform: uppercase;
    padding: 2px 6px; border-radius: 3px;
    background: var(--raised); border: 1px solid var(--hairline);
    color: var(--muted);
}
.ad-badge.custom {
    background: var(--ad-cyan-glow);
    border-color: var(--ad-cyan);
    color: var(--ad-cyan);
}

.ad-toggle {
    width: 58px; padding: 6px 0;
    background: var(--raised); border: 1px solid var(--hairline);
    border-radius: 4px;
    font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
    color: var(--muted); cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
}
.ad-toggle.on {
    background: var(--ad-cyan-glow);
    border-color: var(--ad-cyan);
    color: var(--ad-cyan);
}

/* ═══════════════════════════════════════════════════════════
   Polish pass — map interaction, active run, preferences
   ═══════════════════════════════════════════════════════════ */

/* Map tooltip + zoom controls */
#map-tooltip {
    position: absolute; z-index: 6;
    padding: 8px 11px;
    max-width: 230px;
    background: rgba(20, 22, 26, .96);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
    font-size: 11.5px; line-height: 1.5;
    pointer-events: none;
}
#map-tooltip em { color: var(--danger); font-style: normal; font-size: 10.5px; }
#map-tooltip strong { font-size: 12px; }

#map-zoom {
    position: absolute; right: 10px; bottom: 10px; z-index: 5;
    display: flex; flex-direction: column; gap: 4px;
}
.map-zoom-btn {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(20, 22, 26, .9);
    border: 1px solid var(--hairline);
    border-radius: 5px;
    color: var(--muted);
    font-family: var(--mono); font-size: 13px; line-height: 1;
    cursor: pointer;
    transition: color .12s, border-color .12s;
}
.map-zoom-btn:hover { color: var(--accent); border-color: var(--accent); }

#map-svg { cursor: grab; }
#map-svg.dragging { cursor: grabbing; }

/* Active run overlay */
.map-active-seg {
    fill: none;
    stroke: var(--signal);
    stroke-width: 2;
    stroke-linecap: round;
    filter: url(#map-route-glow);
}
.map-active-seg.done { stroke: var(--muted); opacity: .35; filter: none; }

.map-active-ring { fill: var(--bg); stroke: var(--signal); stroke-width: 1.4; }
.map-active-index {
    fill: var(--signal); font-family: var(--mono); font-size: 5px;
    font-weight: 700; text-anchor: middle;
}
.map-active-stop.done .map-active-ring { stroke: var(--muted); }
.map-active-stop.done .map-active-index { fill: var(--muted); }
.map-active-stop.current .map-active-ring { stroke: var(--accent); stroke-width: 1.8; }
.map-active-stop.current .map-active-index { fill: var(--accent); }
.map-active-pulse {
    fill: none; stroke: var(--accent); stroke-width: 1;
    animation: activeStopPulse 1.8s ease-out infinite;
}
@keyframes activeStopPulse {
    0%   { r: 6; opacity: .8; }
    100% { r: 14; opacity: 0; }
}

.map-side-block.active-run { border-color: var(--signal); background: var(--signal-glow); }
.run-stage {
    font-family: var(--mono); font-size: 11px;
    color: var(--signal); margin-bottom: 10px;
}

/* Countdown chips */
.chip .expired { color: var(--muted); }

/* Sparkline legend + min label */
.chart-min {
    position: absolute; bottom: 8px; right: 12px;
    font-family: var(--mono); font-size: 10px; color: var(--muted);
}
.spark-legend {
    display: flex; gap: 18px; flex-wrap: wrap;
    margin-top: 8px;
    font-family: var(--mono); font-size: 10.5px; color: var(--muted);
}
.spark-legend strong { color: var(--text); }
.spark-legend .up { color: var(--signal); }
.spark-legend .down { color: var(--danger); }

/* Preferences */
.pref-row {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 14px 16px;
    background: var(--raised);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    margin-bottom: 8px;
}
.pref-info { flex: 1; min-width: 0; }
.pref-label { font-size: 13px; font-weight: 600; }
.pref-help { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.pref-toggle {
    width: 66px; padding: 8px 0; flex-shrink: 0;
    background: var(--bg);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    color: var(--muted);
    font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
}
.pref-toggle.on {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}
.pref-select { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   Fuel & maintenance
   ═══════════════════════════════════════════════════════════ */

/* HUD fuel gauge */
#hud-fuel { margin-top: 8px; }
.hud-fuel-label {
    font-family: var(--mono); font-size: 9px; letter-spacing: 1.5px;
    color: var(--muted); margin-bottom: 3px;
}
.hud-fuel-track {
    height: 5px; border-radius: 3px;
    background: rgba(255, 255, 255, .1);
    overflow: hidden;
}
#hud-fuel-fill {
    height: 100%; width: 100%;
    background: var(--signal);
    transition: width .4s linear, background .3s;
}
#hud-fuel-fill.low { background: var(--accent); }
#hud-fuel-fill.critical { background: var(--danger); }
#hud-fuel-pct {
    font-family: var(--mono); font-size: 11px;
    color: var(--text); margin-top: 3px;
}
#hud-fuel.warning .hud-fuel-label { color: var(--accent); }

/* Garage / fleet maintenance panel */
.maint-section {
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid var(--hairline);
}
.maint-row { margin-bottom: 10px; }
.maint-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 4px;
}
.maint-label { font-size: 12px; color: var(--muted); }
.maint-label.worn { color: var(--danger); font-weight: 600; }
.maint-val { font-family: var(--mono); font-size: 11px; }
.progress-track.sm { height: 5px; margin-bottom: 6px; }
.progress-fill.fuel-fill { background: var(--signal); }
.maint-note {
    font-size: 10.5px; color: var(--muted); font-style: italic;
}

/* Map fuel stations */
.map-station-ring {
    fill: rgba(20, 22, 26, .85);
    stroke: var(--muted);
    stroke-width: .8;
}
.map-station-icon {
    font-size: 4px; text-anchor: middle;
    opacity: .85;
}
.map-station:hover .map-station-ring { stroke: var(--signal); }

/* Reduced motion — one class on <body> switches the whole interface to
   near-instant transitions. Kept as a blanket override rather than unpicking
   each animation individually, so anything added later is covered by
   default instead of needing to remember this exists. */
body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
}
