:root {
    color-scheme: light;
    --plate: #fbd649;
    --ink: #171714;
    --muted: #6d6b63;
    --canvas: #f5f3ee;
    --surface: #fff;
    --surface-2: #ece9e2;
    --border: #d8d4ca;
    --good: #197348;
    --good-soft: #e2f3e9;
    --warn: #a05200;
    --warn-soft: #fff0d7;
    --danger: #b42318;
    --shadow: 0 16px 40px rgba(23, 23, 20, .08);
    --radius: 22px;
    font-family: "DM Sans", system-ui, sans-serif;
}

.language-selector { display: grid; gap: 8px; min-width: 180px; }
.language-selector label { color: var(--muted); font-size: .82rem; font-weight: 700; }
.language-selector select { width: 100%; min-height: 49px; background: var(--canvas); border: 1px solid var(--border); border-radius: 11px; color: var(--ink); padding: 0 36px 0 14px; }
.settings-language-selector { width: min(210px, 100%); min-width: 0; }
.settings-form { margin-bottom: 14px; }
.login-language { margin-top: 18px; text-align: start; }
[dir="rtl"] body { font-family: "DM Sans", Tahoma, Arial, sans-serif; }
[dir="rtl"] .back-link, [dir="rtl"] .record-content, [dir="rtl"] .form-field, [dir="rtl"] .settings-card { text-align: right; }
[dir="rtl"] .chevron { transform: scaleX(-1); }
[dir="rtl"] input[type="email"], [dir="rtl"] .plate-input { direction: ltr; text-align: right; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --ink: #f5f3ee;
        --muted: #aaa79d;
        --canvas: #0c0c0b;
        --surface: #171715;
        --surface-2: #22221f;
        --border: #393934;
        --good: #69d19a;
        --good-soft: #153629;
        --warn: #ffbd69;
        --warn-soft: #3b2b17;
        --danger: #ff8b82;
        --shadow: 0 16px 40px rgba(0, 0, 0, .35);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #f5f3ee;
    --muted: #aaa79d;
    --canvas: #0c0c0b;
    --surface: #171715;
    --surface-2: #22221f;
    --border: #393934;
    --good: #69d19a;
    --good-soft: #153629;
    --warn: #ffbd69;
    --warn-soft: #3b2b17;
    --danger: #ff8b82;
    --shadow: 0 16px 40px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1[tabindex="-1"]:focus { outline: none; }

.app-shell { min-height: 100vh; }
.topbar {
    height: 76px;
    padding: 0 max(24px, calc((100vw - 1180px) / 2));
    display: flex;
    align-items: center;
    gap: 32px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--canvas) 90%, transparent);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; font-size: 18px; }
.brand-mark, .boot-mark {
    width: 42px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    border: 2px solid var(--ink);
    background: var(--plate);
    color: #141410;
    font: 700 15px/1 "Roboto Mono", monospace;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.45);
}
.desktop-nav { margin-left: auto; display: flex; gap: 4px; }
.desktop-nav a { padding: 10px 15px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; }
.desktop-nav a.active, .desktop-nav a:hover { color: var(--ink); background: var(--surface); }
.profile-dot { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--canvas); font-weight: 700; }
.profile-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    box-shadow: none;
    cursor: pointer;
}
.profile-button:hover { color: var(--ink); background: transparent; }
.main-content { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 110px; }
.bottom-nav { display: none; }

.page-heading { display: flex; justify-content: space-between; gap: 30px; align-items: end; margin-bottom: 44px; }
.page-heading.compact { margin-bottom: 30px; }
.page-heading h1 { margin: 4px 0 8px; font-size: clamp(34px, 5vw, 56px); line-height: 1.02; letter-spacing: -.045em; font-weight: 600; }
.page-heading p:last-child { color: var(--muted); max-width: 570px; margin: 0; font-size: 17px; }
.eyebrow { margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 700; }

.button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    border-radius: 12px;
    border: 1.5px solid var(--ink);
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 7px 16px rgba(0,0,0,.12); }
.button:focus-visible, input:focus-visible, select:focus-visible, .vehicle-card:focus-visible, a:focus-visible { outline: 3px solid #4b8eff; outline-offset: 3px; }
.button.primary { background: var(--plate); color: #151510; }
.button.secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
.button:disabled { opacity: .6; cursor: wait; transform: none; }
.full-width { width: 100%; }
.mobile-fab { display: none; }

.section-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 18px; }
.section-row h2 { margin: 0; font-size: 22px; }
.section-row > span { color: var(--muted); }
.vehicle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.vehicle-card {
    min-height: 270px;
    padding: 26px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(0,0,0,.02);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.vehicle-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--ink) 28%, var(--border)); }
.vehicle-card.past-vehicle { opacity: .58; filter: saturate(.55); }
.vehicle-card.past-vehicle:hover { opacity: .82; }
.vehicle-card-top { display: flex; justify-content: space-between; align-items: start; }
.chevron { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-size: 28px; color: var(--muted); }
.number-plate {
    display: inline-block;
    padding: 8px 13px 7px;
    border-radius: 6px;
    background: var(--plate);
    color: #10100d;
    border: 2px solid #181814;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.45);
    font: 700 21px/1 "Roboto Mono", monospace;
    letter-spacing: .04em;
    white-space: nowrap;
}
.number-plate.large { font-size: clamp(22px, 5vw, 30px); padding: 11px 17px 10px; }
.vehicle-card h2 { margin: 28px 0 5px; font-size: 26px; font-weight: 400; letter-spacing: -.025em; }
.vehicle-card h2 strong { font-weight: 700; }
.vehicle-meta { margin: 0; color: var(--muted); }
.status-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.status-row.large-gap { gap: 10px; margin-bottom: 0; }
.status-pill { min-height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; }
.status-pill.good { background: var(--good-soft); color: var(--good); }
.status-pill.warn { background: var(--warn-soft); color: var(--warn); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.card-footer { margin-top: auto; padding-top: 17px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 600; }
.card-footer span:last-child { color: var(--ink); }

.skeleton { border-radius: 9px; background: linear-gradient(100deg, var(--surface-2) 20%, color-mix(in srgb, var(--surface-2) 50%, var(--surface)) 45%, var(--surface-2) 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
.skeleton.wide { height: 38px; width: 45%; }
.skeleton.short { height: 24px; width: 60%; margin-top: 35px; }
.skeleton.body { height: 130px; width: 100%; margin-top: 20px; }
@keyframes shimmer { to { background-position-x: -300%; } }

.state-card { max-width: 620px; margin: 20px auto; padding: 48px 30px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-align: center; }
.state-card h1, .state-card h2, .state-card h3 { margin: 15px 0 8px; }
.state-card p { color: var(--muted); margin: 0 auto 24px; max-width: 420px; }
.compact-state { padding: 30px; }
.vehicle-count { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }
.state-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--plate); color: #151510; border: 1px solid #151510; margin: auto; font-size: 25px; font-weight: 700; }
.error-state .state-icon { background: #fee4e2; color: var(--danger); border-color: var(--danger); }
.narrow-page { width: min(720px, 100%); margin: 0 auto; }
.back-link { display: inline-flex; margin-bottom: 28px; color: var(--muted); text-decoration: none; font-weight: 600; }

.form-card, .panel, .settings-card, .search-box, .public-result {
    padding: 28px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
}
.form-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 21px; }
.form-field label, .search-box label { font-size: 13px; font-weight: 700; }
.form-field label span { color: var(--muted); font-weight: 400; }
.form-field input, .form-field select, .form-field textarea, .inline-form input, .search-box input {
    width: 100%;
    min-height: 49px;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 0 14px;
    background: var(--canvas);
    color: var(--ink);
}
.form-field textarea { min-height: 132px; padding: 13px 14px; line-height: 1.5; resize: vertical; }
.form-field input.invalid, .form-field select.invalid, .form-field textarea.invalid { border-color: var(--danger); }
.validation-errors {
    margin: 0 0 20px;
    padding: 14px 16px 14px 36px;
    border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
    border-radius: 11px;
    background: color-mix(in srgb, var(--danger) 10%, var(--surface));
    color: var(--danger);
}
.form-field small, .search-box small { color: var(--muted); }
.form-field .validation-message, .validation-message, .validation-errors { color: var(--danger); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.searchable-combobox { position: relative; }
.combobox-options {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    box-shadow: 0 16px 35px rgba(17, 17, 14, .14);
}
.combobox-options button {
    display: block;
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}
.combobox-options button:hover,
.combobox-options button:focus-visible,
.combobox-options button[aria-selected="true"] {
    outline: none;
    background: color-mix(in srgb, var(--plate) 28%, var(--surface));
}
.combobox-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.plate-input {
    background: var(--plate) !important;
    border: 2px solid #171714 !important;
    color: #111 !important;
    font: 700 22px/1 "Roboto Mono", monospace !important;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.privacy-note { display: flex; gap: 10px; background: var(--good-soft); color: var(--good); border-radius: 12px; padding: 15px; margin: 4px 0 22px; font-size: 13px; }
.privacy-note span { color: var(--ink); }
.historical-pack-option { margin-top: 0; }
.pack-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 22px; }
.pack-summary div { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.pack-summary strong { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--plate); color: #151510; }
.pack-summary span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.historical-pack-form .evidence-picker { padding: 18px; border: 1px dashed var(--border); border-radius: 14px; background: var(--surface-2); }
.pack-privacy-note { margin-top: 0; }
.historical-pack-link { text-decoration: none; }
.inline-error { padding: 13px 15px; margin: 0 0 18px; border-radius: 10px; background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); font-size: 13px; }
.lookup-success { color: var(--good) !important; font-weight: 600; }
.lookup-message { color: var(--warn) !important; }
.check-row { display: flex; align-items: center; gap: 10px; margin: -4px 0 20px; font-size: 14px; }
.check-row input { width: 20px; height: 20px; }

.vehicle-hero { padding: 12px 0 40px; border-bottom: 1px solid var(--border); }
.vehicle-title-row { display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.vehicle-title-row h1 { margin: 17px 0 5px; font-size: clamp(34px, 6vw, 58px); font-weight: 400; letter-spacing: -.05em; }
.vehicle-title-row h1 strong { font-weight: 700; }
.vehicle-title-row p { color: var(--muted); margin: 0; }
.trust-score { min-width: 155px; text-align: right; display: flex; flex-direction: column; color: var(--muted); font-size: 12px; }
.trust-score strong { color: var(--good); font-size: 36px; letter-spacing: -.04em; }
.detail-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; margin: 28px 0 58px; }
.panel h2 { font-size: 30px; margin: 4px 0; }
.text-button { min-height: 44px; border: 0; background: none; color: var(--ink); font-weight: 700; cursor: pointer; }
.logout-action { padding: 0; color: var(--muted); justify-self: end; }
.logout-action:hover { color: var(--ink); }
.mileage-chart { height: 130px; display: flex; align-items: end; gap: min(14px, 3vw); border-bottom: 1px solid var(--border); padding: 10px 10px 0; }
.chart-bar { flex: 1; min-width: 10px; max-width: 40px; border-radius: 7px 7px 0 0; background: linear-gradient(var(--plate), color-mix(in srgb, var(--plate) 55%, var(--ink))); transition: height .3s; }
.chart-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 8px; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 18px; }
.key-details dl { margin: 12px 0 0; }
.key-details dl div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.key-details dl div:last-child { border-bottom: 0; }
.key-details dt { color: var(--muted); }
.key-details dd { margin: 0; font-weight: 600; text-align: right; }
.timeline-heading { align-items: center; }
.timeline-heading h2 { font-size: 32px; margin-top: 4px; }
.record-form { margin-bottom: 28px; }
.timeline { position: relative; margin-left: 10px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 13px; bottom: 30px; width: 1px; background: var(--border); }
.timeline-card { display: grid; grid-template-columns: 18px 115px 1fr; gap: 18px; position: relative; margin-bottom: 16px; }
.timeline-marker { width: 17px; height: 17px; border: 4px solid var(--canvas); background: var(--muted); border-radius: 50%; margin-top: 21px; z-index: 1; box-shadow: 0 0 0 1px var(--border); }
.timeline-marker.verified { background: var(--good); }
.record-date { color: var(--muted); font-size: 12px; padding-top: 22px; }
.record-content { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.record-topline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.record-topline-actions { display: grid; justify-items: end; gap: 7px; }
.record-status-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.record-type { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.verified-badge, .timeline-tag { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; font-style: normal; }
.verified-badge, .timeline-tag.verified { background: var(--good-soft); color: var(--good); }
.timeline-tag.claimed { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.timeline-tag.evidenced { background: color-mix(in srgb, #2674d9 14%, var(--surface)); color: #4d93ef; }
.timeline-tag.main-dealer { background: var(--ink); color: var(--plate); }
.record-content h3 { margin: 10px 0 5px; font-size: 19px; }
.record-content p, .record-content small { color: var(--muted); margin: 0; }

.search-page { max-width: 780px; }
.search-box { margin-bottom: 24px; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 9px 0; }
.search-row input { min-height: 53px; }
.public-result-header { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.public-result-header h2 { margin: 14px 0 0; }
.public-result > p { color: var(--muted); }
.public-records { margin-top: 22px; border-top: 1px solid var(--border); }
.public-records article { display: grid; grid-template-columns: 130px 1fr; gap: 18px; padding: 17px 0; border-bottom: 1px solid var(--border); }
.public-records time { color: var(--muted); font-size: 12px; }
.public-records article div { display: flex; flex-direction: column; }
.public-records article span { color: var(--muted); font-size: 13px; }
.public-records em { color: var(--good); font-style: normal; font-weight: 700; }
.public-mot-button { margin-top: 14px; }
.public-mot-error { margin-top: 20px; }
.transient-mot-result { margin-top: 24px; }
.transient-data-note { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.transient-mot-mileage { margin: 22px 0 28px; }
.transient-mot-mileage .mileage-chart { overflow-x: auto; }
.transient-mot-mileage .chart-bar { flex-basis: 16px; flex-shrink: 0; }
.transient-timeline-heading { margin-bottom: 18px; }
.transient-timeline-heading h2 { margin: 4px 0 0; }
.transient-timeline-heading > span { color: var(--muted); }
.public-pack-documents { align-items: flex-start; gap: 7px; margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.public-pack-documents small { color: var(--muted); font-weight: 700; }
.public-pack-documents a { color: var(--ink); font-size: 12px; font-weight: 700; text-decoration: none; }
.public-pack-documents a:hover { text-decoration: underline; }

.settings-card { display: flex; justify-content: space-between; align-items: center; gap: 25px; margin-bottom: 14px; }
.settings-card h2 { margin: 0 0 4px; font-size: 17px; }
.settings-card p { color: var(--muted); margin: 0; font-size: 13px; }
.passkey-settings-card { display: block; }
.passkey-settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.passkey-management { display: grid; gap: 18px; width: 100%; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.passkey-add-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .85fr); align-items: end; gap: 24px; padding: 20px; border-radius: 16px; background: var(--surface-2); }
.passkey-add-panel h3 { margin: 0 0 6px; font-size: 17px; }
.passkey-device-link-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 18px; padding: 20px; border: 1px solid var(--border); border-radius: 16px; }
.passkey-device-link-panel h3 { margin: 0 0 6px; font-size: 17px; }
.passkey-device-link-panel p { margin-top: 0; }
.device-link-result { grid-column: 1 / -1; display: grid; gap: 10px; min-width: 0; }
.device-link-result > p { margin: 0; color: var(--muted); font-size: 13px; }
.device-link-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.passkey-add-controls { display: grid; gap: 10px; }
.passkey-list { display: grid; gap: 10px; }
.passkey-item { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 16px; }
.passkey-item-details { display: grid; gap: 5px; flex: 1; }
.passkey-item-details .form-field { max-width: 420px; margin-bottom: 3px; }
.passkey-item-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.passkey-safety-note { padding-left: 2px; }
.danger-text { color: var(--danger); }
.button.danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.segmented { display: flex; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.segmented button { min-height: 38px; padding: 0 11px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 7px rgba(0,0,0,.09); }
.garage-toolbar { align-items: center; }
.switch-row { display: flex; align-items: center; gap: 10px; font-size: 13px; position: relative; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; }
.switch { width: 44px; height: 25px; border-radius: 999px; background: var(--border); position: relative; order: 2; }
.switch::after { content: ""; width: 19px; height: 19px; border-radius: 50%; background: #fff; position: absolute; top: 3px; left: 3px; transition: left .2s; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.switch-row input:checked + .switch { background: var(--good); }
.switch-row input:checked + .switch::after { left: 22px; }

.boot-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); }
.boot-screen .boot-mark { width: 60px; height: 46px; font-size: 20px; margin-bottom: 6px; }
.boot-screen strong { color: var(--ink); font-size: 20px; }
#blazor-error-ui { display: none; position: fixed; left: 16px; right: 16px; bottom: 20px; z-index: 100; padding: 14px 18px; background: #fee4e2; color: #7a271a; border: 1px solid #f97066; border-radius: 12px; }
#blazor-error-ui .reload { margin-left: 10px; font-weight: 700; }
#blazor-error-ui .dismiss { float: right; background: none; border: 0; color: inherit; font-size: 20px; }

.vehicle-edit-button { margin-left: auto; }
.vehicle-edit-form { max-width: 720px; margin: -18px 0 28px; }
.vehicle-edit-form h2 { margin: 4px 0 20px; }
.danger-text { color: var(--danger); margin-left: 10px; }
.danger-button { background: var(--danger); border-color: var(--danger); color: #fff; }
.removal-form { max-width: 720px; margin: -18px 0 28px; border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.removal-form h2 { margin: 4px 0 20px; }
.removal-options {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-flow: row;
    width: 100%;
    gap: 10px;
    margin-bottom: 22px;
}
.removal-options label { display: flex; align-items: flex-start; gap: 12px; padding: 15px; border: 1px solid var(--border); border-radius: 13px; cursor: pointer; }
.removal-options input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--danger); }
.removal-options span { display: grid; gap: 4px; }
.removal-options small { color: var(--muted); line-height: 1.4; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-card { width: min(440px, 100%); padding: 36px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.login-mark { margin-bottom: 28px; }
.login-card h1 { margin: 7px 0 10px; font-size: 36px; letter-spacing: -.04em; }
.login-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 22px 0 16px; color: var(--muted); font-size: 12px; text-align: center; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.login-email { margin-bottom: 12px; }
.recovery-link { width: 100%; margin-top: 10px; text-align: center; }
.recovery-panel { margin-top: 12px; padding: 16px; background: var(--surface-2); border-radius: 12px; }
.recovery-panel p { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.login-message { padding: 12px; border-radius: 10px; background: var(--good-soft); color: var(--good) !important; font-size: 14px; }
.why-login-link { display: flex; justify-content: space-between; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); text-decoration: none; font-weight: 700; }

.public-page { min-height: 100vh; }
.public-topbar { min-height: 76px; padding: 14px max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--border); }
.public-topbar nav { display: flex; align-items: center; gap: 22px; }
.public-topbar nav > a:not(.button), .public-topbar > a:not(.brand) { color: var(--muted); text-decoration: none; font-weight: 650; }
.why-page main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.why-hero { min-height: 610px; padding: 90px 0 70px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(430px, .9fr); align-items: center; gap: 74px; }
.why-hero h1 { max-width: 650px; margin: 10px 0 20px; font-size: clamp(58px, 8vw, 104px); line-height: .88; letter-spacing: -.07em; font-weight: 600; }
.why-lede { max-width: 650px; color: var(--muted); font-size: clamp(18px, 2vw, 23px); line-height: 1.5; }
.why-actions { display: flex; gap: 12px; margin-top: 32px; }
.journey-visual { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: center; }
.journey-item { min-height: 150px; padding: 24px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); display: grid; align-content: center; }
.journey-item span { width: 38px; height: 32px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 6px; background: var(--surface-2); font: 700 13px "Roboto Mono", monospace; }
.journey-item strong { font-size: 22px; }
.journey-item small { color: var(--muted); margin-top: 5px; }
.journey-item.digital-log { background: #171714; color: #f5f3ee; }
.journey-item.digital-log span { background: var(--plate); color: #111; }
.journey-item.trusted-sale span { background: var(--good-soft); color: var(--good); }
.journey-arrow { justify-self: center; color: var(--muted); font-size: 26px; line-height: 1; transform: rotate(90deg); }
.proof-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; background: var(--surface); }
.proof-strip div { padding: 24px; border-right: 1px solid var(--border); }
.proof-strip div:last-child { border: 0; }
.proof-strip strong, .proof-strip span { display: block; }
.proof-strip strong { font-size: 19px; }
.proof-strip span { margin-top: 5px; color: var(--muted); font-size: 14px; }
.pack-feature { scroll-margin-top: 90px; margin: 96px 0 20px; padding: 56px; display: grid; grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr); align-items: center; gap: 64px; border: 1px solid var(--border); border-radius: 28px; background: var(--surface); overflow: hidden; }
.pack-feature-copy h2 { margin: 8px 0 18px; font-size: clamp(38px, 5vw, 64px); line-height: 1; letter-spacing: -.05em; }
.pack-feature-copy > p:not(.eyebrow) { color: var(--muted); font-size: 17px; line-height: 1.6; }
.pack-feature-copy ul { margin: 24px 0 30px; padding: 0; list-style: none; }
.pack-feature-copy li { position: relative; padding: 6px 0 6px 25px; }
.pack-feature-copy li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 800; }
.pack-feature-visual { min-height: 410px; display: grid; grid-template-columns: 1fr auto 1.15fr; align-items: center; gap: 20px; padding: 34px; border-radius: 24px; background: var(--canvas); }
.paper-pack { position: relative; height: 230px; }
.paper-sheet { position: absolute; inset: 18px 0; padding: 22px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 28px rgba(17,17,14,.1); color: var(--muted); font-size: 12px; }
.paper-sheet-back { transform: rotate(-8deg) translate(-5px, -5px); }
.paper-sheet-middle { transform: rotate(5deg) translate(5px, 2px); }
.paper-sheet-front { display: flex; flex-direction: column; justify-content: end; gap: 7px; transform: rotate(-1deg); color: var(--ink); }
.paper-sheet-front::before { content: ""; position: absolute; top: 22px; left: 22px; width: 54px; height: 7px; border-radius: 4px; background: var(--plate); box-shadow: 0 17px 0 var(--surface-2), 0 34px 0 var(--surface-2), 0 51px 0 var(--surface-2); }
.paper-sheet-front strong { font-size: 17px; }
.paper-sheet-front small { color: var(--muted); line-height: 1.4; }
.pack-feature-arrow { color: var(--muted); font-size: 28px; }
.digital-pack-card { min-height: 275px; padding: 24px; display: flex; flex-direction: column; border-radius: 20px; background: #171714; color: #f5f3ee; box-shadow: var(--shadow); }
.digital-pack-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 32px; }
.digital-pack-top > span { width: 38px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--plate); color: #111; font: 800 12px "Roboto Mono", monospace; }
.digital-pack-top em { padding: 5px 8px; border-radius: 999px; background: #173a2b; color: #82d5a8; font-size: 10px; font-style: normal; font-weight: 700; }
.digital-pack-card > small { color: #aaa89f; font-size: 9px; letter-spacing: .12em; }
.digital-pack-card > strong { margin-top: 8px; font-size: 22px; line-height: 1.15; }
.digital-pack-files { display: flex; align-items: center; gap: 6px; margin-top: 22px; }
.digital-pack-files span { padding: 6px; border: 1px solid #4a4a44; border-radius: 6px; font-size: 9px; }
.digital-pack-files b { color: #aaa89f; font-size: 10px; font-weight: 500; }
.digital-pack-card p { margin: auto 0 0; color: #aaa89f; font-size: 11px; line-height: 1.4; }
.audience-section { padding: 110px 0; }
.section-intro { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 38px; }
.section-intro h2, .balance-section h2, .why-cta h2 { margin: 8px 0 0; max-width: 760px; font-size: clamp(36px, 5vw, 62px); line-height: 1.03; letter-spacing: -.045em; }
.audience-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.audience-card { flex: 0 1 calc((100% - 32px) / 3); min-width: 0; min-height: 390px; padding: 28px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); display: flex; flex-direction: column; }
.audience-icon { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 34px; border-radius: 13px; background: var(--surface-2); font-size: 22px; }
.audience-card h3 { margin: 8px 0 12px; font-size: 26px; letter-spacing: -.025em; }
.audience-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.audience-card ul { margin: auto 0 0; padding: 18px 0 0; list-style: none; border-top: 1px solid var(--border); }
.audience-card li { padding: 4px 0; font-size: 14px; }
.audience-card li::before { content: "✓"; margin-right: 8px; color: var(--good); font-weight: 800; }
.buyer-card { background: #171714; color: #f5f3ee; }
.buyer-card > p:not(.eyebrow), .buyer-card .eyebrow { color: rgba(245, 243, 238, .72); }
.buyer-card .audience-icon { background: var(--plate); color: #111; }
.balance-section { display: grid; grid-template-columns: .85fr 1.15fr; gap: 74px; padding: 80px; border-radius: 28px; background: var(--surface-2); }
.balance-section > div:first-child > p:last-child { color: var(--muted); font-size: 17px; line-height: 1.6; }
.balance-list { display: grid; gap: 10px; }
.balance-list > div { display: grid; grid-template-columns: 38px 1fr; gap: 14px; padding: 18px; border-radius: 14px; background: var(--surface); }
.balance-list p { margin: 0; color: var(--muted); line-height: 1.5; }
.balance-list strong { color: var(--ink); }
.balance-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; }
.balance-mark.good { background: var(--good-soft); color: var(--good); }
.balance-mark.caution { background: var(--warn-soft); color: var(--warn); }
.why-cta { margin: 90px 0; padding: 55px; border-radius: 24px; background: #171714; color: #f5f3ee; display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.why-cta h2 { max-width: 700px; }
.public-footer { padding: 30px max(24px, calc((100vw - 1180px) / 2)); border-top: 1px solid var(--border); display: flex; justify-content: space-between; color: var(--muted); }
.recovery-page { display: grid; grid-template-rows: auto 1fr; }
.recovery-card { width: min(510px, calc(100% - 40px)); margin: 70px auto; align-self: start; padding: 38px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); }
.recovery-card h1 { margin: 8px 0 12px; font-size: 40px; letter-spacing: -.045em; }
.recovery-card > p:not(.eyebrow):not(.recovery-footnote) { color: var(--muted); line-height: 1.55; }
.security-symbol { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 14px; background: var(--plate); color: #111; font-size: 26px; }
.recovery-card .form-field { margin: 24px 0 14px; }
.recovery-footnote { margin: 18px 0 0; color: var(--muted); text-align: center; font-size: 13px; }
.success-panel { padding: 18px; margin: 22px 0; border-radius: 12px; background: var(--good-soft); color: var(--good); }
.success-panel p { margin: 4px 0 0; }

@media (max-width: 850px) {
    .why-hero { grid-template-columns: 1fr; padding-top: 60px; gap: 45px; }
    .journey-visual { max-width: 560px; }
    .pack-feature { grid-template-columns: 1fr; }
    .pack-feature-visual { max-width: 620px; }
    .proof-strip { grid-template-columns: 1fr 1fr; }
    .proof-strip div:nth-child(2) { border-right: 0; }
    .proof-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
    .audience-card { flex-basis: calc((100% - 16px) / 2); }
    .balance-section { grid-template-columns: 1fr; padding: 44px; gap: 36px; }
}

@media (max-width: 600px) {
    .public-topbar nav > a:not(.button) { display: none; }
    .public-topbar .button { min-height: 40px; padding: 0 14px; }
    .why-page main { width: min(100% - 28px, 1180px); }
    .why-hero h1 { font-size: 60px; }
    .why-actions { flex-direction: column; }
    .pack-feature { margin-top: 58px; padding: 30px 22px; gap: 34px; }
    .pack-feature-visual { min-height: auto; grid-template-columns: 1fr; padding: 24px; }
    .paper-pack { width: min(230px, 78%); height: 210px; justify-self: center; }
    .pack-feature-arrow { justify-self: center; transform: rotate(90deg); }
    .digital-pack-card { width: min(280px, 100%); justify-self: center; }
    .proof-strip { grid-template-columns: 1fr; }
    .proof-strip div { border-right: 0; border-bottom: 1px solid var(--border); }
    .audience-card { flex-basis: 100%; min-height: auto; }
    .balance-section { padding: 28px 20px; }
    .why-cta { padding: 32px 24px; flex-direction: column; align-items: start; }
    .public-footer { flex-direction: column; gap: 8px; }
}
.demo-account { display: flex; align-items: center; gap: 12px; margin: 25px 0; padding: 14px; border-radius: 13px; background: var(--surface-2); }
.demo-account > span:last-child { display: grid; }
.demo-account small, .development-note { color: var(--muted); }
.development-note { display: block; margin-top: 18px; line-height: 1.45; text-align: center; }
.share-setting { display: flex; align-items: flex-start; gap: 12px; margin: 18px 0 22px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.share-setting input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--good); }
.share-setting span { display: grid; gap: 4px; }
.share-setting strong { font-size: 14px; }
.share-setting small { color: var(--muted); line-height: 1.5; }

.evidence-picker { margin: 20px 0; padding: 0; border: 0; }
.evidence-picker legend { padding: 0; font-size: 13px; font-weight: 700; }
.evidence-picker legend span { color: var(--muted); font-weight: 400; }
.evidence-picker > p, .evidence-picker > small { color: var(--muted); }
.evidence-picker > p { margin: 5px 0 12px; font-size: 13px; }
.evidence-picker > small { display: block; margin-top: 9px; font-size: 11px; }
.evidence-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.evidence-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 43px; padding: 0 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.evidence-button:hover { border-color: var(--ink); }
.evidence-button input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.camera-button { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.evidence-selection { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.evidence-selection li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.evidence-selection li > span:nth-child(2) { display: grid; min-width: 0; }
.evidence-selection strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.evidence-selection small { color: var(--muted); font-size: 10px; }
.evidence-selection button { border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; }
.file-kind { padding: 5px 7px; border-radius: 7px; background: var(--ink); color: var(--surface); font-size: 9px; font-weight: 800; }
.evidence-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.evidence-links a,
.evidence-links button { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border: 0; border-radius: 9px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 11px; font-weight: 700; text-decoration: none; cursor: pointer; }
.evidence-links a:hover,
.evidence-links button:hover { text-decoration: underline; }
.pack-sharing-choice { border-color: color-mix(in srgb, var(--plate) 55%, var(--border)); }
.pack-visibility-badge { display: inline-flex; width: fit-content; margin-top: 12px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 750; }
.pack-visibility-badge.public { background: var(--good-soft); color: var(--good); }
.pack-visibility-badge.private { background: var(--surface-2); color: var(--muted); }

.record-edit-action { margin-left: 0; }
.record-edit-form { margin-top: 14px; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.existing-evidence { margin: 18px 0; padding: 14px; border: 1px solid var(--border); border-radius: 12px; }
.existing-evidence legend { padding: 0 6px; font-weight: 800; }
.existing-evidence > .muted { display: block; margin: 0 0 10px; font-size: 12px; }
.existing-evidence-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--border); }
.existing-evidence-name { min-width: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 700; }
.existing-evidence-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.existing-evidence-actions .text-button { font-size: 12px; }
@media (max-width: 640px) {
    .existing-evidence-row { align-items: flex-start; flex-direction: column; }
    .existing-evidence-actions { justify-content: flex-start; }
}

.settings-switches { display: grid; justify-items: end; gap: 12px; }
.notification-permission-status { grid-column: 1 / -1; max-width: 34rem; margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
.settings-loading-card { min-height: 112px; }
.settings-loading-indicator { width: 28px; height: 28px; flex: 0 0 28px; border: 3px solid var(--border); border-top-color: var(--plate); border-radius: 50%; animation: settings-spin .8s linear infinite; }
.install-settings-actions { display: grid; justify-items: end; gap: 8px; max-width: 390px; }
.install-settings-actions .button { min-width: 210px; white-space: nowrap; }
.install-settings-actions p { text-align: right; line-height: 1.45; }
@keyframes settings-spin { to { transform: rotate(360deg); } }
.admin-settings-card { margin-bottom: 14px; }
.admin-credential-card { margin-bottom: 14px; }
.admin-credential-card .credential-help { margin: -2px 0 16px; color: var(--muted); font-size: 13px; }
.admin-test-controls { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 10px; align-items: center; min-width: min(100%, 390px); }
.admin-test-controls input { min-height: 48px; }
.admin-section-heading { margin-top: 58px; }
.admin-section-heading h2 { margin: 0; font-family: var(--font-display); font-size: clamp(30px, 5vw, 44px); }
.admin-reports-heading { margin-top: 18px; }
.report-toolbar { display: grid; grid-template-columns: repeat(2, minmax(170px, 1fr)) minmax(264px, auto); align-items: end; gap: 12px; margin-bottom: 18px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.report-actions { display: grid; align-self: start; gap: 12px; padding-top: 29px; }
.report-actions > .button { width: 100%; }
.report-presets { display: inline-flex; gap: 5px; width: 100%; padding: 4px; border-radius: 11px; background: var(--surface-2); }
.report-presets button { min-height: 38px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; cursor: pointer; }
.report-presets button:hover { background: var(--surface); color: var(--ink); }
.report-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.report-metric { display: grid; gap: 7px; min-height: 150px; padding: 19px; border: 1px solid var(--border); border-radius: 17px; background: var(--surface); }
.report-metric > span { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .055em; }
.report-metric > strong { align-self: center; font-family: var(--font-display); font-size: clamp(34px, 4vw, 48px); line-height: 1; }
.report-metric small { align-self: end; color: var(--muted); line-height: 1.4; }
.report-metric .growth-positive { color: var(--good); }
.report-metric .growth-negative { color: var(--danger); }
.report-panels { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 14px; }
.report-panel { min-width: 0; margin: 0; }
.report-panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.report-panel-heading h3 { margin: 0 0 5px; font-size: 18px; }
.report-panel-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.report-legend { display: flex; flex-wrap: wrap; gap: 13px; color: var(--muted); font-size: 11px; font-weight: 700; }
.report-legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; }
.report-legend .registrations::before, .report-bar.registrations { background: var(--plate); }
.report-legend .active::before, .report-bar.active { background: var(--good); }
.report-chart-scroll { overflow-x: auto; padding: 4px 1px 2px; }
.report-chart { display: grid; grid-template-columns: repeat(var(--columns), minmax(28px, 1fr)); align-items: end; gap: 4px; min-width: max(100%, calc(var(--columns) * 31px)); height: 250px; border-bottom: 1px solid var(--border); }
.report-chart-day { display: grid; grid-template-rows: 210px 34px; align-items: end; min-width: 0; }
.report-bars { display: flex; align-items: end; justify-content: center; gap: 2px; height: 100%; }
.report-bar { display: block; width: min(10px, 42%); min-height: 0; border-radius: 4px 4px 1px 1px; transition: height .2s ease; }
.report-chart-day small { overflow: visible; color: var(--muted); font-size: 9px; line-height: 1.1; white-space: nowrap; transform: rotate(-35deg); transform-origin: top left; }
.activity-breakdown { display: grid; gap: 18px; }
.activity-breakdown-row { display: grid; gap: 8px; }
.activity-breakdown-row > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.activity-breakdown-row strong { font-size: 13px; }
.activity-breakdown-row span { color: var(--muted); font-size: 11px; }
.activity-breakdown-track { display: block; height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.activity-breakdown-track > span { display: block; height: 100%; border-radius: inherit; background: var(--plate); }
.report-empty { padding: 25px 12px; color: var(--muted); text-align: center; }
.report-definition { margin: 14px 3px 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.stripe-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 4px 0 18px; }
.stripe-summary > div { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.stripe-summary span { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.stripe-summary strong { overflow-wrap: anywhere; }
.stripe-live, .stripe-test { justify-self: start; padding: 3px 7px; border-radius: 999px; font-size: 11px; letter-spacing: .08em; }
.stripe-live { background: rgba(73, 194, 116, .16); color: var(--good); }
.stripe-test { background: rgba(244, 216, 93, .17); color: var(--accent); }
.payment-card { display: grid; gap: 18px; }
.payment-card h2 { margin: 0; }
.payment-total { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.payment-total span { color: var(--muted); }
.payment-total strong { font-family: var(--font-display); font-size: 30px; }

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, .78);
}

.image-lightbox-panel {
    display: grid;
    gap: 12px;
    width: min(100%, 1100px);
    max-height: calc(100vh - 48px);
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}

.image-lightbox-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.image-lightbox img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 130px);
    margin: auto;
    object-fit: contain;
    border-radius: 10px;
}
@media (max-width: 760px) {
    .topbar { height: 64px; padding: 0 20px; }
    .brand { font-size: 16px; }
    .brand-mark { width: 38px; height: 30px; }
    .desktop-nav, .profile-button { display: none; }
    .main-content { width: min(100% - 32px, 620px); padding: 34px 0 132px; }
    .bottom-nav {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 30;
        height: calc(72px + env(safe-area-inset-bottom));
        padding: 7px 10px env(safe-area-inset-bottom);
        background: color-mix(in srgb, var(--surface) 94%, transparent);
        border-top: 1px solid var(--border);
        backdrop-filter: blur(18px);
    }
    .bottom-nav a { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 12px; text-decoration: none; color: var(--muted); }
    .bottom-nav a span { font-size: 23px; line-height: 1; }
    .bottom-nav a small { font-size: 10px; font-weight: 700; }
    .bottom-nav a.active { color: var(--ink); background: var(--surface-2); }
    .bottom-nav .add-tab span { width: 35px; height: 32px; display: grid; place-items: center; background: var(--plate); border: 1px solid #151510; border-radius: 9px; color: #151510; }
    .page-heading { margin-bottom: 28px; align-items: start; }
    .page-heading h1 { font-size: 38px; }
    .page-heading p:last-child { font-size: 15px; }
    .desktop-action { display: none; }
    .vehicle-grid { grid-template-columns: 1fr; }
    .vehicle-card { min-height: 252px; padding: 22px; }
    .vehicle-card h2 { margin-top: 24px; }
    .mobile-fab { display: inline-flex; position: fixed; z-index: 25; right: 18px; bottom: calc(88px + env(safe-area-inset-bottom)); box-shadow: 0 10px 25px rgba(0,0,0,.17); }
    .form-card, .panel, .settings-card, .search-box, .public-result { padding: 21px; border-radius: 18px; }
    .form-grid { grid-template-columns: 1fr; gap: 0; }
    .pack-summary { grid-template-columns: 1fr; }
    .vehicle-title-row { align-items: start; }
    .vehicle-title-row h1 { font-size: 38px; }
    .trust-score { min-width: 102px; }
    .trust-score strong { font-size: 28px; }
    .detail-grid { grid-template-columns: 1fr; margin-bottom: 44px; }
    .timeline-heading { align-items: end; }
    .timeline-heading h2 { font-size: 27px; }
    .timeline-heading .button { padding: 0 13px; font-size: 13px; }
    .timeline-card { grid-template-columns: 17px 1fr; gap: 13px; }
    .record-date { grid-column: 2; padding: 0; margin-bottom: -8px; font-size: 11px; }
    .record-content { grid-column: 2; padding: 17px; }
    .timeline-marker { grid-row: 1 / span 2; }
    .inline-form { grid-template-columns: 1fr 1fr; }
    .inline-form .button { grid-column: 1 / -1; }
    .search-row { grid-template-columns: 1fr; }
    .search-row .button { width: 100%; }
    .public-result-header { align-items: start; flex-direction: column; }
    .public-records article { grid-template-columns: 1fr; gap: 5px; }
    .settings-card { flex-direction: column; align-items: stretch; }
    .passkey-settings-heading, .passkey-item { align-items: stretch; flex-direction: column; }
    .passkey-add-panel { grid-template-columns: 1fr; }
    .passkey-device-link-panel { grid-template-columns: 1fr; }
    .passkey-item-actions { justify-content: flex-start; }
    .stripe-summary { grid-template-columns: 1fr; }
    .report-metric-grid, .report-panels { grid-template-columns: 1fr; }
    .report-toolbar { grid-template-columns: 1fr 1fr; align-items: stretch; }
    .report-actions { grid-column: 1 / -1; padding-top: 0; }
    .report-presets button { flex: 1; }
    .garage-toolbar { align-items: stretch; flex-direction: column; }
    .segmented { align-self: start; }
    .switch-row { justify-content: space-between; }
}

@media (max-width: 390px) {
    .main-content { width: calc(100% - 24px); }
    .vehicle-title-row { flex-direction: column; }
    .trust-score { text-align: left; }
    .privacy-note { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
.record-description {
    margin-top: .75rem;
    white-space: pre-line;
    line-height: 1.55;
    color: var(--text-muted);
}

.official-badge {
    display: inline-flex;
    padding: .2rem .5rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .75rem;
    color: var(--text-muted);
}

.suggestion-row {
    display: flex;
    gap: .75rem;
    margin-top: .45rem;
    flex-wrap: wrap;
}

.mileage-readings {
    display: grid;
    gap: .55rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.mileage-reading-row {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) minmax(8rem, auto) auto;
    align-items: center;
    gap: 1rem;
}

.mileage-remove-actions {
    display: inline-flex;
    gap: .65rem;
    align-items: center;
}

.reminder-badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: rgba(246, 211, 69, .14);
    border: 1px solid rgba(246, 211, 69, .42);
    color: var(--accent);
    font-size: .75rem;
    font-weight: 700;
}

@media (max-width: 620px) {
    .mileage-reading-row {
        grid-template-columns: 1fr auto;
    }

    .mileage-reading-row .text-button {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

.public-record-tag { margin-left: .45rem; color: var(--good); font-style: normal; font-weight: 750; }
.private-history-state .button { margin-top: .5rem; }

.terms-backdrop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.78); backdrop-filter: blur(5px); }
.terms-dialog { width: min(720px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; gap: 18px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 24px 80px rgba(0,0,0,.45); }
.terms-heading { display: flex; align-items: center; gap: 14px; }
.terms-heading h1, .terms-heading p { margin: 0; }
.terms-copy { overflow-y: auto; padding: 4px 16px 4px 2px; color: var(--muted); line-height: 1.55; }
.terms-copy h2 { margin: 20px 0 5px; color: var(--ink); font-size: 1.05rem; }
.terms-copy p { margin: 6px 0; }
.terms-agreement { display: flex; gap: 12px; align-items: flex-start; color: var(--ink); font-weight: 650; }
.terms-agreement input { margin-top: 4px; flex: 0 0 auto; }
@media (max-width: 620px) { .terms-backdrop { padding: 8px; } .terms-dialog { max-height: calc(100vh - 16px); padding: 18px; border-radius: 15px; } }
