/* ==========================================================================
   Sweet Lemon — "greasy garage poster" design system
   Bold, maximalist chrome (nav, cards, badges) with hard ink borders and
   punchy varied color; forms stay stripped-down and fast to fill on a
   phone at the roadside. Lemon yellow is a highlight surface, never a
   small-text color (kept off small text on light backgrounds for contrast).
   ========================================================================== */

:root {
    /* Paper & ink */
    --paper: #f6f0dd;
    --paper-deep: #efe6c9;
    --surface: #fffdf7;
    --surface-white: #ffffff;
    --ink: #201b10;
    --ink-soft: #5c5541;
    --line: #201b10;

    /* Lemon (brand accent — background/border/icon only, never small text) */
    --lemon: #f4d900;
    --lemon-soft: #fff2a8;
    --lemon-ink: #705f00; /* accessible on paper/white, for links & small accents */

    /* Status / varied accent palette (text-on-tint pairs tuned for AA contrast) */
    --ok: #15803d;
    --ok-bg: #eaf7ee;
    --warn: #9c4607;
    --warn-bg: #fdf1de;
    --danger: #b91c1c;
    --danger-bg: #fbe9e7;
    --info: #1d4ed8;
    --info-bg: #e8eefd;
    --rust: #9a3412;
    --rust-bg: #fbe9dd;
    --grease: #4d5b52;
    --grease-bg: #eaeee9;

    --radius: 7px;
    --radius-sm: 5px;
    --shadow-ink: 4px 4px 0 var(--line);
    --shadow-ink-sm: 3px 3px 0 var(--line);
    --font-display: 'Oswald', 'Arial Narrow', 'Segoe UI', sans-serif;
    --font-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #17140d;
        --paper-deep: #100e09;
        --surface: #211d13;
        --surface-white: #262117;
        --ink: #f5f0e0;
        --ink-soft: #beb298;
        --line: #f4d900;

        --lemon: #f4d900;
        --lemon-soft: #3a3410;
        --lemon-ink: #f4d900;

        --ok: #4ade80;
        --ok-bg: #143323;
        --warn: #fbbf24;
        --warn-bg: #3a2a0c;
        --danger: #f87171;
        --danger-bg: #3a1616;
        --info: #93b4ff;
        --info-bg: #16213d;
        --rust: #fb923c;
        --rust-bg: #3a220f;
        --grease: #9fb0a5;
        --grease-bg: #202822;

        --shadow-ink: 4px 4px 0 rgba(244, 217, 0, 0.35);
        --shadow-ink-sm: 3px 3px 0 rgba(244, 217, 0, 0.35);
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15.5px;
    line-height: 1.5;
}

body {
    background-color: var(--paper);
    /* subtle grease/grain texture — kept very low-opacity so it never fights legibility */
    background-image:
        radial-gradient(rgba(32, 27, 16, 0.05) 1px, transparent 1px),
        radial-gradient(rgba(32, 27, 16, 0.035) 1px, transparent 1px);
    background-size: 3px 3px, 5px 5px;
    background-position: 0 0, 2px 2px;
}

a { color: var(--lemon-ink); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Caution-tape strip along the very top of the page */
.hazard-strip {
    height: 7px;
    background: repeating-linear-gradient(-45deg, var(--lemon) 0 14px, var(--ink) 14px 28px);
}

/* Top navigation — bold ink bar, the loudest chrome on the page */
.topbar {
    background: var(--ink);
    border-bottom: 3px solid var(--lemon);
}
.topbar-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    height: 62px;
}
.brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: .02em;
    color: var(--paper);
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--lemon); }
.brand-mark { font-size: 24px; line-height: 1; filter: drop-shadow(0 0 0 var(--ink)); }
.nav-links { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav-links a {
    color: #cfc9b5;
    padding: 9px 13px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 13.5px;
    text-transform: uppercase;
    letter-spacing: .03em;
    text-decoration: none;
}
.nav-links a:hover { background: rgba(244, 217, 0, 0.12); color: var(--lemon); text-decoration: none; }
.nav-links a.active { background: var(--lemon); color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: 10px; }

.locale-switch { display: flex; gap: 2px; background: #2a2517; border-radius: var(--radius-sm); padding: 2px; }
.locale-switch a {
    font-size: 12.5px;
    font-weight: 700;
    padding: 5px 9px;
    color: #cfc9b5;
    border-radius: 4px;
    text-decoration: none;
}
.locale-switch a.active { background: var(--lemon); color: var(--ink); }

/* Right-side nav icons: notifications, reports, account, logout */
.nav-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 17px;
    text-decoration: none;
    color: #cfc9b5;
}
.nav-icon:hover { background: rgba(244, 217, 0, 0.12); text-decoration: none; }
.nav-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    padding: 3px 4px;
    border-radius: 999px;
    min-width: 15px;
    text-align: center;
    border: 1.5px solid var(--ink);
}
.nav-user {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: var(--radius-sm);
    color: var(--paper);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}
.nav-user:hover { background: rgba(244, 217, 0, 0.12); text-decoration: none; color: var(--lemon); }
.nav-user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .nav-user-name { display: none; } }

main { padding: 32px 0 60px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: .02em; }
h1 { font-size: 26px; margin: 0 0 4px; text-transform: uppercase; }
h2 { font-size: 17px; margin: 0 0 14px; text-transform: uppercase; }
h3 { font-size: 15px; margin: 0 0 8px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.subtitle { color: var(--ink-soft); margin: 0; font-size: 14px; font-weight: 500; }

/* Hero card (landing page) */
.hero-card {
    max-width: 620px;
    margin: 50px auto;
    text-align: center;
    padding: 44px 32px;
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 6px 6px 0 var(--lemon), 6px 6px 0 1px var(--line);
}
.hero-mark { font-size: 52px; margin-bottom: 6px; }

/* Grid */
.grid { display: grid; gap: 22px; align-items: stretch; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Cards — thick ink border + hard offset shadow, like a screen-printed poster panel */
.card {
    background: var(--surface);
    border: 2.5px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow-ink);
    display: flex;
    flex-direction: column;
}

/* Vertical rhythm between top-level page sections (grids, standalone cards,
   the hero...). Scoped to direct children of .container so it never leaks
   into cards nested INSIDE a .grid — those get even spacing from grid `gap`
   alone, keeping same-row cards aligned instead of drifting out of sync. */
.container > * + * { margin-top: 28px; }

.card-accent-lemon { box-shadow: var(--shadow-ink-sm), 0 0 0 0 transparent; border-color: var(--line); background: linear-gradient(180deg, var(--lemon-soft), var(--surface) 55%); }
.card-accent-sky { background: linear-gradient(180deg, var(--info-bg), var(--surface) 55%); }
.card-accent-moss { background: linear-gradient(180deg, var(--ok-bg), var(--surface) 55%); }

.stat-card .stat-label { color: var(--ink-soft); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 700; }
.stat-card .stat-sub { font-size: 12px; color: var(--ink-soft); margin-top: 4px; font-weight: 600; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 2.5px solid var(--line);
    background: var(--surface-white);
    color: var(--ink);
    padding: 10px 16px;
    min-height: 42px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: var(--shadow-ink-sm);
    transition: transform .05s ease, box-shadow .05s ease;
}
.btn:hover { text-decoration: none; transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--line); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--line); }
.btn-primary { background: var(--lemon); border-color: var(--line); color: var(--ink); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); box-shadow: 3px 3px 0 var(--danger); }
.btn-danger:hover { box-shadow: 2px 2px 0 var(--danger); }
.btn-danger:active { box-shadow: 0 0 0 var(--danger); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; min-height: 36px; }
.btn-block { width: 100%; justify-content: center; }
@media (max-width: 640px) { .btn-block-mobile { width: 100%; justify-content: center; } }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Forms — deliberately plain: no textures, no shadows, big touch targets.
   This is what you fill in standing next to the car with the clock running. */
form.stacked .field { margin-bottom: 16px; }
label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number],
select, textarea {
    width: 100%;
    padding: 11px 12px;
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 16px; /* >=16px prevents iOS auto-zoom on focus */
    background: var(--surface-white);
    color: var(--ink);
    font-family: var(--font-body);
    min-height: 44px;
}
textarea { resize: vertical; min-height: 76px; }
input:focus, select:focus, textarea:focus {
    outline: 3px solid var(--lemon);
    outline-offset: 1px;
    border-color: var(--line);
}
.field-hint { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; min-width: 0; }
@media (max-width: 560px) {
    .field-row { flex-direction: column; gap: 0; }
}
.checkbox-field { display: flex; align-items: center; gap: 8px; }
.checkbox-field input { width: 20px; height: 20px; }
.checkbox-field label { margin: 0; }

.form-card { max-width: 640px; }

.auth-page { max-width: 400px; margin: 40px auto; }
.auth-page .card { padding: 30px 28px 26px; }
.auth-page h1 { text-align: center; margin-bottom: 20px; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 2px solid var(--paper-deep); vertical-align: middle; }
th { color: var(--ink-soft); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* Badges — little stickers */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .02em;
    border: 1.5px solid transparent;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: currentColor; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: currentColor; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: currentColor; }
.badge-info { background: var(--info-bg); color: var(--info); border-color: currentColor; }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--ok); }
.dot-warn { background: var(--warn); }
.dot-danger { background: var(--danger); }
.dot-info { background: var(--info); }

/* ===================== Marketing homepage ===================== */
.home-section { padding: 64px 0; }
.home-section:first-child { padding-top: 0; }
.home-section-head { text-align: center; max-width: 640px; margin: 0 auto 34px; }
.home-section-head h2 { font-size: 26px; }
.home-section-head p { color: var(--ink-soft); font-size: 15px; margin: 0; }
.home-eyebrow {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--lemon-ink);
    background: var(--lemon-soft);
    border: 1.5px solid var(--lemon-ink);
    border-radius: 999px;
    padding: 4px 12px;
    margin-bottom: 10px;
}

.home-subnav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 26px auto 0; max-width: 700px; }
.home-subnav a {
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--ink);
    background: var(--surface-white);
    border: 2px solid var(--line);
    border-radius: 999px;
    padding: 7px 14px;
    text-decoration: none;
}
.home-subnav a:hover { background: var(--lemon); text-decoration: none; }

.home-split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
@media (max-width: 800px) { .home-split { grid-template-columns: 1fr; } }
.home-split p { font-size: 15px; line-height: 1.7; }
.home-split p + p { margin-top: 14px; }

.home-vehicle-card {
    background: var(--surface);
    border: 3px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 6px 6px 0 var(--lemon), 6px 6px 0 1px var(--line);
    padding: 22px;
    transform: rotate(-1.5deg);
}

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .feature-grid { grid-template-columns: 1fr; } }
.feature-card { text-align: left; }
.feature-card .feature-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.feature-card h3 { margin: 0 0 6px; }
.feature-card p { margin: 0; font-size: 13.5px; color: var(--ink-soft); }

.leaderboard-list { list-style: none; margin: 0; padding: 0; }
.leaderboard-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1.5px dashed var(--paper-deep);
    font-size: 14px;
}
.leaderboard-list li:last-child { border-bottom: none; }
.leaderboard-rank {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    background: var(--paper);
}
.leaderboard-list li:nth-child(1) .leaderboard-rank { background: var(--lemon); }
.leaderboard-name { flex: 1; font-weight: 700; }
.leaderboard-value { font-weight: 700; font-family: var(--font-display); }
.leaderboard-note { font-size: 12px; color: var(--ink-soft); text-align: center; margin-top: 16px; }

.brutal-block {
    background: var(--ink);
    color: var(--paper);
    border-radius: var(--radius);
    padding: 56px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 3px solid var(--line);
}
.brutal-block::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(-45deg, transparent 0 18px, rgba(244, 217, 0, 0.06) 18px 36px);
    pointer-events: none;
}
.brutal-block h2 { color: var(--lemon); font-size: 34px; margin-bottom: 14px; position: relative; }
.brutal-block p { max-width: 560px; margin: 0 auto; font-size: 16px; color: #d8d2bd; position: relative; }
.brutal-stats { display: flex; justify-content: center; gap: 40px; margin-top: 34px; flex-wrap: wrap; position: relative; }
.brutal-stat-value { font-family: var(--font-display); font-weight: 700; font-size: 32px; color: var(--lemon); }
.brutal-stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: #a89f81; margin-top: 2px; }

.mock-browser {
    border: 2.5px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-ink);
    overflow: hidden;
    background: var(--surface-white);
}
.mock-browser-bar { background: var(--ink); padding: 8px 12px; display: flex; gap: 6px; }
.mock-browser-bar span { width: 9px; height: 9px; border-radius: 50%; background: #57503c; }
.mock-browser-bar span:first-child { background: var(--danger); }
.mock-browser-bar span:nth-child(2) { background: var(--warn); }
.mock-browser-bar span:nth-child(3) { background: var(--ok); }
.mock-browser-body { padding: 16px; min-height: 180px; }
.mock-caption { text-align: center; font-size: 13px; font-weight: 700; margin-top: 10px; color: var(--ink-soft); }

.mock-tile { background: var(--paper); border: 1.5px solid var(--line); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; }
.mock-bar { height: 8px; border-radius: 4px; background: var(--paper-deep); overflow: hidden; }
.mock-bar-fill { height: 100%; }

.pricing-trial-banner {
    text-align: center;
    background: var(--lemon);
    border: 3px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 20px;
    font-weight: 800;
    max-width: 520px;
    margin: 0 auto 32px;
    box-shadow: var(--shadow-ink-sm);
}
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 860px) { .pricing-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; } }
.pricing-card { text-align: center; }
.pricing-card.featured { border-color: var(--lemon-ink); box-shadow: 6px 6px 0 var(--lemon), 6px 6px 0 1px var(--line); }
.pricing-card .plan-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; text-transform: uppercase; }
.pricing-card .plan-price { font-family: var(--font-display); font-weight: 700; font-size: 34px; margin: 10px 0 2px; }
.pricing-card .plan-price small { font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.pricing-card .plan-tagline { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 16px; min-height: 32px; }
.pricing-card ul { list-style: none; margin: 0 0 20px; padding: 0; text-align: left; font-size: 13.5px; }
.pricing-card ul li { padding: 6px 0; border-bottom: 1px solid var(--paper-deep); }
.pricing-card ul li:last-child { border-bottom: none; }
.pricing-card ul li::before { content: "\2713  "; color: var(--ok); font-weight: 800; }

.home-footer {
    background: var(--ink);
    color: #cfc9b5;
    padding: 40px 0 20px;
}
.home-footer .container { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 28px; }
@media (max-width: 700px) { .home-footer .container { grid-template-columns: 1fr 1fr; } }
.home-footer h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--lemon); margin: 0 0 12px; }
.home-footer a { color: #cfc9b5; font-weight: 500; }
.home-footer a:hover { color: var(--lemon); }
.home-footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.home-footer-bottom { text-align: center; font-size: 12px; color: #8a8371; margin-top: 32px; padding-top: 20px; border-top: 1px solid #3a3323; }

/* Obligations (inspection / insurance / tax) — one card each */
.obligation-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.obligation-card-head .obligation-icon { font-size: 22px; line-height: 1; }
.obligation-card-head h3 { margin: 0; }
.obligation-date { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin-bottom: 6px; }
.obligation-recur { font-size: 11.5px; color: var(--ink-soft); margin: 4px 0 12px; }
.obligation-list { list-style: none; margin: 0 0 12px; padding: 0; }
.obligation-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1.5px dashed var(--paper-deep);
    font-size: 13.5px;
}
.obligation-list li:last-child { border-bottom: none; }
.obligation-list .obligation-item-date { font-weight: 700; flex: 0 0 auto; }
.obligation-list .badge { flex: 0 0 auto; }
.obligation-item-actions { display: flex; gap: 4px; margin-left: auto; }

/* Small square icon-only buttons for discreet inline actions (edit/done/remove) */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1.5px solid var(--line);
    border-radius: 5px;
    background: var(--surface-white);
    color: var(--ink);
    font-size: 12px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.icon-btn:hover { background: var(--lemon-soft); }
.icon-btn-ok { color: var(--ok); border-color: var(--ok); }
.icon-btn-danger { color: var(--danger); border-color: var(--danger); }

/* Native <dialog> modal, styled to match the rest of the app */
dialog.modal {
    border: 3px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-ink);
    padding: 22px 24px;
    width: min(360px, 90vw);
    background: var(--surface);
    color: var(--ink);
}
dialog.modal::backdrop { background: rgba(32, 27, 16, 0.55); }
dialog.modal h3 { margin: 0 0 14px; }
dialog.modal .field { margin-bottom: 16px; }
dialog.modal .actions-row { justify-content: flex-end; }

/* Live trip tracking */
.trip-map { width: 100%; height: 320px; border: 2.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-ink); background: var(--paper-deep); }
.route-map { width: 100%; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--paper-deep); }
.trip-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.trip-stat { text-align: center; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 12px 8px; }
.trip-stat .trip-stat-value { font-family: var(--font-display); font-weight: 700; font-size: 22px; }
.trip-stat .trip-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); font-weight: 700; }
.trip-status { font-size: 13px; font-weight: 700; padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 14px; }
.trip-status-waiting { background: var(--warn-bg); color: var(--warn); }
.trip-status-live { background: var(--ok-bg); color: var(--ok); }
.trip-status-error { background: var(--danger-bg); color: var(--danger); }
.trip-stop-list { list-style: none; margin: 0; padding: 0; }
.trip-stop-list li { padding: 8px 0; border-bottom: 1px solid var(--paper-deep); font-size: 13.5px; }
.trip-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.trip-actions .btn { flex: 1; min-width: 140px; }

/* Fleets page: one card per fleet, its vehicles in a horizontal swipe strip */
.fleet-block + .fleet-block { margin-top: 30px; }
.fleet-block-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.fleet-block-header h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.vehicle-carousel {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 2px 2px 12px;
    -webkit-overflow-scrolling: touch;
    margin: 0 -2px;
}
.vehicle-carousel-card {
    flex: 0 0 auto;
    width: 210px;
    scroll-snap-align: start;
}
@media (max-width: 480px) { .vehicle-carousel-card { width: 78vw; } }

/* Wizard: big tappable type picker */
.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 700px) { .type-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 460px) { .type-grid { grid-template-columns: repeat(2, 1fr); } }
.type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--surface-white);
    border: 2.5px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-ink-sm);
    padding: 18px 8px;
    min-height: 92px;
    text-align: center;
    color: var(--ink);
    font-weight: 700;
    font-size: 12.5px;
    text-decoration: none;
    transition: transform .05s ease, box-shadow .05s ease;
}
.type-btn:hover { text-decoration: none; transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--line); background: var(--lemon-soft); }
.type-btn .type-icon { font-size: 28px; line-height: 1; }
.type-btn.type-btn-hero {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    padding: 16px 20px;
    background: var(--lemon);
    font-size: 15px;
    gap: 14px;
}
.type-btn.type-btn-hero .type-icon { font-size: 32px; }

.vehicle-card-photo { width: 100%; height: 120px; object-fit: cover; display: block; border-bottom: 2.5px solid var(--line); }
.vehicle-card-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    background: var(--lemon-soft);
    color: var(--lemon-ink);
}

/* License-plate chip — the unambiguous vehicle identifier used everywhere */
.plate {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 11.5px;
    letter-spacing: .06em;
    padding: 2px 7px;
    border: 1.5px solid var(--line);
    border-radius: 4px;
    background: var(--surface-white);
    color: var(--ink);
    white-space: nowrap;
}

/* Role badges — varied color per role for at-a-glance scanning */
.badge-role-owner { background: var(--lemon-soft); color: var(--lemon-ink); border-color: var(--lemon-ink); }
.badge-role-admin { background: var(--info-bg); color: var(--info); border-color: currentColor; }
.badge-role-editor { background: var(--ok-bg); color: var(--ok); border-color: currentColor; }
.badge-role-viewer { background: var(--grease-bg); color: var(--grease); border-color: currentColor; }

/* Health meter */
.health-meter { background: var(--paper-deep); border: 1.5px solid var(--line); border-radius: 999px; height: 10px; overflow: hidden; margin: 8px 0; }
.health-meter-fill { height: 100%; }

/* Alerts / flash */
.alert { padding: 13px 15px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; border: 2px solid currentColor; font-weight: 600; }
.alert-success { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert-warning { background: var(--warn-bg); color: var(--warn); }

/* Timeline — a small icon marker on the rail identifies each entry type at a
   glance. The marker's `left` anchors to the rail's exact center, then
   `translateX(-50%)` centers the marker on that point regardless of its own
   border/width — avoids the fiddly box-model math that made the old plain
   dot sit visibly off-center. */
.timeline { border-left: 3px solid var(--line); margin-left: 6px; padding-left: 28px; }
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-marker {
    position: absolute;
    left: -29.5px;
    top: 1px;
    transform: translateX(-50%);
    width: 23px;
    height: 23px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    border-radius: 50%;
    background: var(--paper);
    border: 2.5px solid var(--line);
}
.timeline-item[data-type="oil_change"] .timeline-marker, .timeline-item[data-type="filter"] .timeline-marker { border-color: var(--warn); }
.timeline-item[data-type="tyres"] .timeline-marker, .timeline-item[data-type="brakes"] .timeline-marker { border-color: var(--info); }
.timeline-item[data-type="refuel"] .timeline-marker { border-color: var(--rust); }
.timeline-item[data-type="tax"] .timeline-marker, .timeline-item[data-type="insurance"] .timeline-marker { border-color: var(--ok); }
.timeline-item[data-type="accident"] .timeline-marker, .timeline-item[data-type="repair"] .timeline-marker { border-color: var(--danger); }
.timeline-item[data-type="trip"] .timeline-marker { border-color: var(--lemon); }
.timeline-date { font-size: 12px; color: var(--ink-soft); font-weight: 700; text-transform: uppercase; }
.timeline-title { font-weight: 800; margin: 2px 0; }
.timeline-meta { font-size: 13px; color: var(--ink-soft); }

.entry-photo-strip { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.entry-photo-strip img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2px solid var(--line);
    display: block;
}
.photo-toggle { margin-top: 6px; }

.empty-state { text-align: center; padding: 44px 20px; color: var(--ink-soft); }

.text-muted { color: var(--ink-soft); }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

footer.app-footer { text-align: center; color: var(--ink-soft); font-size: 12.5px; padding: 24px; font-weight: 600; }

/* Print / "save as PDF" — hide chrome, keep the report content clean */
@media print {
    .hazard-strip, .topbar, footer.app-footer, .no-print, form { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ccc; }
    main { padding: 0; }
    a[href]::after { content: none !important; }
}
