/* theme.css: Brand, light/dark appearance and late page overrides. Loaded last on every page. */

/* ---- brand ---- */
/* Mascot lockups: explicit dimensions prevent shifts while artwork loads. */
.brand.brand-identity {position: relative; gap: 0; min-height: 48px; width: max-content; max-width: 100%;}
.brand-lockup {display: block; width: 180px; height: 48px; max-width: 100%; flex: 0 1 auto;}
.brand-lockup img {display: block; width: 100%; height: 100%; object-fit: contain;}
.brand-lockup .brand-logo-dark {display: none;}
.brand-accessible-name {position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;}
html[data-theme="dark"] .brand-lockup .brand-logo-light {display: none;}
html[data-theme="dark"] .brand-lockup .brand-logo-dark {display: block;}
.auth-showcase .brand-lockup {width: 195px; height: 52px;}
.brand.brand-identity.auth-mobile-brand {display: none;}
.setup-body .brand-identity {display: flex; align-items: center;}
.setup-body .side > .brand {z-index: 1; padding: 8px 12px; border-radius: 12px; background: #f6f4fc;}
html[data-theme="dark"] .setup-body .side > .brand {background: transparent;}
@media (max-width: 900px) {
    .brand.brand-identity.auth-mobile-brand {display: flex; padding: 0; margin-bottom: 22px;}
}
@media (max-width: 560px) {
    .marketing-nav .brand-lockup {width: clamp(126px, 35vw, 180px); height: 48px;}
}
@media print {
    .setup-body .side {background: #fff; color: #132238;}
    .setup-body .side-copy p, .setup-body .side-copy small {color: #526176;}
    .setup-body .ring {display: none;}
    .setup-body .side > .brand, html[data-theme="dark"] .setup-body .side > .brand {background: #fff;}
    .brand-lockup .brand-logo-light, html[data-theme="dark"] .brand-lockup .brand-logo-light {display: block;}
    .brand-lockup .brand-logo-dark, html[data-theme="dark"] .brand-lockup .brand-logo-dark {display: none;}
}

/* ---- appearance ---- */
/* B19 appearance. Light keeps the existing white/pastel design; dark is opt-in.
   Keep this file last. Screen-only overrides never recolor photos or documents. */
:root {
    --chart-primary: #788bd1;
    --chart-secondary: #ca8fa8;
    --chart-secondary-readable: #b46e8c;
    --chart-tertiary: #dba57e;
    --chart-grid: #ece8ef;
    --chart-text: #6a6e80;
    --chart-point: #ffffff;
    --chart-fill-top: rgba(120,139,209,.17);
    --chart-fill-bottom: rgba(120,139,209,0);
}
.appearance-card .settings-form > p:first-child {margin: 0 0 17px; font-size: 14px; line-height: 1.65; color: var(--muted);}
.appearance-choices {display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0;}
.appearance-choices label {position: relative; min-width: 0; cursor: pointer;}
.appearance-choices input {position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0;}
.appearance-choices label > span {display: flex; min-height: 80px; align-items: center; justify-content: center; flex-direction: column; gap: 8px; padding: 12px 6px; border: 1px solid #cfc6df; border-radius: 12px; background: #fff; color: #625174;}
.appearance-choices svg {width: 21px; height: 21px;}
.appearance-choices strong {font-size: 13px; font-weight: 600;}
.appearance-choices input:checked + span {border-color: #8061a4; background: #f0e9f8; color: #563a76; box-shadow: inset 0 0 0 1px #8061a4;}
.appearance-choices input:focus-visible + span {outline: 3px solid #8061a4; outline-offset: 3px;}
.appearance-choices:disabled label {cursor: default; opacity: .65;}
.appearance-status {margin: 14px 0 0; font-size: 13px; line-height: 1.65; color: var(--muted);}

@media screen {
    /* Leave breathing room when native validation scrolls an auth field into view. */
    html:has(.auth-panel) {scroll-padding-top: 24px;}
    html[data-theme="dark"] {
        color-scheme: dark;
        --ink: #efedf6;
        --muted: #bdc0d0;
        --subtle: #afb4c8;
        --line: #41475b;
        --canvas: #171922;
        --card: #222632;
        --nav: #1d202b;
        --nav-soft: #302b43;
        --green: #c0a8e8;
        --green-dark: #d4bdf7;
        --green-soft: #363048;
        --purple: #dfa8c5;
        --purple-soft: #422e3f;
        --amber: #e6be88;
        --amber-soft: #3f3328;
        --coral: #f0b0a8;
        --coral-soft: #472e32;
        --mint: #273e36;
        --mint-ink: #a9d6bd;
        --lavender: #332d46;
        --peach: #3d302a;
        --shadow: 0 8px 30px #00000020;
        --night-surface: #222632;
        --night-soft: #2b3040;
        --night-control: #1c202c;
        --night-link: #d4bdf7;
        --night-focus: #ceb4f2;
        --night-success: #afdfbf;
        --night-warning: #f1cb98;
        --night-error: #ffbeb8;
        --chart-primary: #b0bdf4;
        --chart-secondary: #e4b0cc;
        --chart-secondary-readable: #e4b0cc;
        --chart-tertiary: #edc099;
        --chart-grid: #41475b;
        --chart-text: #c1c5d5;
        --chart-point: #222632;
        --chart-fill-top: rgba(176,189,244,.20);
        --chart-fill-bottom: rgba(176,189,244,0);
        background: var(--canvas);
    }
    html[data-theme="dark"] :is(body,.app-body,.marketing-body,.auth-body,.app-shell,.app-content,.main-content,.buyer-public) {background: var(--canvas); color: var(--ink);}
    html[data-theme="dark"] :is(.dashboard-overview,.equipment-page,.household-page,.home-landing,.milesby-demo,.buyer-page,.buyer-public,.documents-page,.garage-archive-page,.imports-page,.receipt-page,.handoff-page,.metric-evidence) {
        --overview-muted: var(--muted); --overview-line: var(--line);
        --eq-ink: var(--ink); --eq-muted: var(--muted); --eq-line: var(--line);
        --hh-ink: var(--ink); --hh-muted: var(--muted); --hh-line: var(--line);
        --home-ink: var(--ink); --home-muted: var(--muted); --home-purple: var(--night-link); --home-border: var(--line);
        --b04-ink: var(--ink); --b04-muted: var(--muted); --b04-line: var(--line);
        --b05-ink: var(--ink); --b05-muted: var(--muted); --b05-line: var(--line); --b05-soft: var(--night-soft);
        --imports-ink: var(--ink); --imports-muted: var(--muted); --imports-line: var(--line);
        color: var(--ink);
    }
    /* Existing page styles use local text colors. Restore consistent contrast
       without changing any layout, native control behavior, or content. */
    html[data-theme="dark"] :is(h1,h2,h3,h4,h5,h6,strong,b,dd) {color: var(--ink) !important;}
    html[data-theme="dark"] :is(p,small,dt,figcaption,time,label,legend) {color: var(--muted) !important;}
    html[data-theme="dark"] :is(.plain-page,.safety-panel,.plan-panel,.support-panel,.imports-page,.buyer-page,.buyer-public,.handoff-page,.receipt-page,.documents-page,.garage-archive-page,.dashboard-overview,.home-landing,.milesby-demo,.equipment-page,.household-page) li {color: var(--muted);}
    html[data-theme="dark"] :is(.card-kicker,.eyebrow,.nav-label,.marketing-eyebrow,.metric-label,.metric-foot,.block-muted,.unit,.field-hint,.field-help,.input-prefix i,.input-suffix i,.topbar-title small,.sidebar-user small,.card-subtitle,.legend,.cost-legend,.timeline-note,.type-label,.timeline-date,.comparison-note,.section-row > span,.privacy-chip,.guidance-chip,.public-profile-hero small,.ownership-stat > span,.ownership-cost-table span,.high-low-list span,.value-badge small,.report-summary span,.report-header small,.community-method-note,.community-sample,.community-computer,.community-vehicle-body > small,.community-vehicle-body h3 > span,.community-card-metrics > span,.leaderboard-card li > b,.hero-trust,.marketing-proof,.marketing-proof > span,.feature-number,.feature-tags span,.preview-chapters span,.preview-private,.preview-tools small,.vehicle-chapter-dates,.vehicle-facts small,.vehicle-quick-links a,.empty-icon,.journal-event-kind,.journal-event-date,.journal-event-notes summary,.journal-pagination,.history-pagination,.expense-category > span,.expense-category > small,.report-table small,.report-disclaimer) {color: var(--muted) !important;}
    html[data-theme="dark"] :is(div,section,article,header,footer,aside,nav,table,td,th,li,details,summary,form,fieldset,label,p,span) {border-color: var(--line);}
    html[data-theme="dark"] a:not(.button):not(.home-primary):not(.support-donate-button) {color: var(--night-link) !important;}
    html[data-theme="dark"] a:not(.button):not(.home-primary):not(.support-donate-button):hover {color: #e5d5ff !important;}
    html[data-theme="dark"] :is(a,button) :is(span,strong,b,small) {color: inherit !important;}
    html[data-theme="dark"] :is(a,button,summary,input,select,textarea):focus-visible {outline-color: var(--night-focus) !important;}
    html[data-theme="dark"] .modal-panel :is(h1,h2,h3)[tabindex]:focus {outline: 2px solid var(--night-focus); outline-offset: 4px;}
    html[data-theme="dark"] :is(.profile-photo-control,.upload-field):focus-within {outline-color: var(--night-focus) !important;}
    html[data-theme="dark"] .support-contact a:focus-visible {outline: none !important; color: #e5d5ff !important; text-decoration-color: currentColor;}
    html[data-theme="dark"] ::selection {background: #65557d; color: #fff;}

    /* Shells, primary surfaces, dialogs, and native input fields. */
    html[data-theme="dark"] :is(.sidebar,.topbar,.marketing-nav,.marketing-footer,.app-footer,.auth-panel,.modal-panel,.modal-header,.modal-actions,.shell-context) {background: var(--nav) !important; border-color: var(--line); color: var(--ink);}
    html[data-theme="dark"] .topbar {background: #1d202bf5 !important;}
    html[data-theme="dark"] :is(.brand,.brand-light,.marketing-brand,.topbar-title,.nav-item,.sidebar-user strong,.marketing-signin,.marketing-mobile-menu summary) {color: var(--ink) !important;}
    html[data-theme="dark"] .nav-item.active {background: #342e47; color: #e3d2ff !important; box-shadow: none;}
    html[data-theme="dark"] .nav-item:hover {background: #2a2d3e;}
    html[data-theme="dark"] .sidebar-card {background: #2a253b; border-color: #483d5d;}
    html[data-theme="dark"] .sidebar-card:after {border-color: #64507e;}
    html[data-theme="dark"] .sidebar-card strong {color: #e4d7f7 !important;}
    html[data-theme="dark"] .sidebar-card > span:not(.sidebar-card-icon) {color: #c5bdd6 !important;}
    html[data-theme="dark"] :is(.sidebar-card-icon,.avatar,.settings-avatar,.leader-avatar,.public-avatar,.owner-monogram) {background: #453853; color: #ebd6ff;}
    html[data-theme="dark"] .sidebar .icon-button:hover {background: #373142; color: #f4eaff;}
    html[data-theme="dark"] :is(.card,.metric-card,.vehicle-card,.empty-list-card,.empty-page,.empty-garage,.ownership-stat,.journal-toolbar,.journal-timeline,.expense-category,.report-sheet,.community-filters,.community-vehicle-grid > article,.leaderboard-card,.public-profile-stats article,.public-vehicle-grid > article,.home-community-grid > a,.overview-card,.overview-metric,.overview-details,.comparison-values > div,.plan-library-card,.plan-panel,.plan-filters,.plan-vehicle-picker,.support-panel,.support-history-item,.safety-panel,.membership-plan,.demo-garage-card,.demo-table-scroll,.demo-filters,.demo-empty,.buyer-report,.b05-public-card,.household-invite-chooser,.household-role-options label,.equipment-interval,.household-interval,.home-preview-window,.home-public-garage) {background: var(--card) !important; border-color: var(--line) !important; color: var(--ink); box-shadow: var(--shadow);}
    /* Dashboard sections stay flat in both themes; only attention/setup needs a panel. */
    html[data-theme="dark"] .dashboard-overview :is(.overview-card:not(.overview-attention):not(.overview-first-record),.overview-details) {background: transparent !important; box-shadow: none;}
    html[data-theme="dark"] .dashboard-overview .overview-metric {box-shadow: none;}
    html[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),select,textarea) {background: var(--night-control) !important; color: var(--ink) !important; border-color: #69728b !important; caret-color: var(--ink);}
    html[data-theme="dark"] :is(input,textarea)::placeholder {color: #aeb4c8 !important; opacity: 1;}
    html[data-theme="dark"] :is(input,select,textarea):focus {border-color: #c2a4e6 !important; box-shadow: 0 0 0 3px #b69ad633 !important;}
    html[data-theme="dark"] :is(input,select,textarea):disabled {color: #b3b8c9 !important; -webkit-text-fill-color: #b3b8c9 !important; background: #292e3c !important; opacity: 1;}
    html[data-theme="dark"] :is(input,select,textarea)[aria-invalid="true"] {border-color: var(--night-error) !important;}
    html[data-theme="dark"] input[type="file"]::file-selector-button {background: #3b3451 !important; color: #e4d5f7 !important; border-color: #67577e !important;}
    html[data-theme="dark"] :is(input[type="checkbox"],input[type="radio"],input[type="range"]) {accent-color: #b9a0dd;}
    html[data-theme="dark"] option {background: #222632; color: var(--ink);}
    html[data-theme="dark"] .field {color: var(--ink) !important;}
    html[data-theme="dark"] .field > span:first-child {color: var(--ink) !important;}
    html[data-theme="dark"] :is(.input-prefix i,.input-suffix i) {color: #c2b5d5 !important;}
    html[data-theme="dark"] .modal-backdrop {background: #080911b8;}
    html[data-theme="dark"] :is(.mobile-backdrop.active,.mobile-backdrop) {background-color: #080911b8;}
    html[data-theme="dark"] :is(.modal-close,.icon-button,.password-wrap button,.table-action) {color: #d9caed !important;}
    html[data-theme="dark"] .modal-close {background: #383047;}
    html[data-theme="dark"] .modal-actions {box-shadow: 0 -8px 24px #00000025;}
    html[data-theme="dark"] .check-card > span {background: var(--night-control); border-color: #727991; color: var(--ink);}
    html[data-theme="dark"] .check-card > span > i {border-color: #9ca7bf;}
    html[data-theme="dark"] .check-card input:checked + span {background: #363049; border-color: #bfa2e0;}
    html[data-theme="dark"] .check-card input:checked + span > i {background: #a98acd; border-color: #c9adeb;}
    html[data-theme="dark"] .check-card input:checked + span > i:after {border-color: #21152f;}
    html[data-theme="dark"] .privacy-toggle > span {background: #292634; border-color: #5f556f;}
    html[data-theme="dark"] .privacy-toggle input:checked + span {background: #342c47; border-color: #aa8cce;}
    html[data-theme="dark"] .privacy-toggle i {background: #6c738a;}
    html[data-theme="dark"] .privacy-toggle input:checked + span i {background: #bfa2e0;}
    html[data-theme="dark"] .privacy-toggle input:checked + span i:after {background: #282036;}
    html[data-theme="dark"] :is(.check-card input:focus-visible + span,.privacy-toggle input:focus-visible + span) {outline-color: var(--night-focus);}
    html[data-theme="dark"] :is(.upload-field,.csv-drop) {background: #262937; border-color: #817394;}
    html[data-theme="dark"] :is(.upload-field:hover,.csv-drop:hover) {background: #302b42; border-color: #bca1da;}

    /* Explicit semantic tones keep danger, guidance, and success distinguishable. */
    html[data-theme="dark"] :is(.alert,.alert-info,.record-save-state,.draft-banner,.draft-notice,.save-state,.receipt-notice,.b04-notice,.b05-notice,.h06-notice,.imports-notice,.household-notice,.support-notice,.service-context-note,.service-context-notice,.fuel-distance-review,.metric-evidence-notice) {background: #292b40 !important; border-color: #6b628b !important; color: #ddd4f3 !important;}
    html[data-theme="dark"] :is(.alert-error,.equipment-errors,.household-errors,.imports-errors,.receipt-errors,.receipt-extraction-errors,.b04-errors,.b05-errors,.h06-errors,.safety-errors,.support-errors,.b04-danger) {background: #422b32 !important; border-color: #a46773 !important; color: var(--night-error) !important;}
    html[data-theme="dark"] :is(.alert-error,.equipment-errors,.household-errors,.imports-errors,.receipt-errors,.receipt-extraction-errors,.b04-errors,.b05-errors,.h06-errors,.safety-errors,.support-errors,.b04-danger) :is(p,li,h2,strong,a) {color: #ffd0c9 !important;}
html[data-theme="dark"] .record-save-state.record-save-error {background: #422b32 !important; border-color: #a46773 !important; color: #ffd0c9 !important;}
    html[data-theme="dark"] :is(.button-danger,.danger-link,.equipment-remove,.household-danger,.b04-danger-link,.receipt-danger,.remove-rule,.service-context-rule-actions .remove-rule) {color: #ffc0b9 !important;}
    html[data-theme="dark"] .button-danger {background: #4a2e36 !important; border-color: #986675 !important;}
    html[data-theme="dark"] .button-danger:hover {background: #5a3540 !important;}
    html[data-theme="dark"] :is(.network-alert,.equipment-notice,.guidance-note,.plan-notice-warning,.service-candidates-guidance,.support-privacy,.import-tip,.overview-attention) {background: #393125 !important; border-color: #776344 !important; color: var(--night-warning) !important;}
    html[data-theme="dark"] :is(.network-alert,.equipment-notice,.guidance-note,.plan-notice-warning,.service-candidates-guidance,.support-privacy,.import-tip,.overview-attention) :is(p,small) {color: #e1caac !important;}
    html[data-theme="dark"] :is(.status-badge.overdue,.service-icon.overdue,.equipment-status.overdue,.household-status.overdue,.overview-status-overdue,.import-status.invalid,.imports-badge.is-error,.support-status-closed) {background: #4c2e36 !important; color: #ffc0b9 !important;}
    html[data-theme="dark"] :is(.status-badge.soon,.service-icon.soon,.equipment-status.soon,.household-status.soon,.overview-status-soon,.import-status.duplicate,.imports-badge.is-review) {background: #483a27 !important; color: #f6d099 !important;}
    html[data-theme="dark"] :is(.status-badge.later,.service-icon.later,.equipment-status.later,.household-status.later,.household-role.owner,.overview-kind-maintenance,.import-status.ready,.imports-badge.is-ready,.button-saved,.support-status-resolved,.b04-success,.receipt-success,.household-notice.success) {background: #2a4137 !important; color: #b6e7c6 !important;}
    html[data-theme="dark"] :is(.equipment-status,.household-status,.household-role,.overview-status-review,.trend-pill,.privacy-chip,.guidance-chip,.safety-badge,.plan-version,.plan-tag-owner,.plan-tag-neutral,.b04-status,.b05-status,.h06-status,.receipt-status,.imports-badge,.support-status,.demo-badge,.equipment-kind,.equipment-archived-tag,.vehicle-year,.vehicle-ownership-status,.community-photo > span,.vehicle-type-tag,.membership-badge,.membership-plan-state,.support-reference) {background: #393249; color: #e1d2f7 !important; border-color: #6a5984;}
    html[data-theme="dark"] :is(.field-error,.receipt-field-error,.b04-field-error,.imports-field-error,.imports-row-errors,.import-error,.vin-lookup[data-state="error"] .vin-lookup-status) {color: var(--night-error) !important;}
    html[data-theme="dark"] :is(.field-error,.receipt-field-error,.b04-field-error,.imports-field-error) * {color: inherit !important;}

    /* Buttons are styled last within their group to preserve action contrast. */
    html[data-theme="dark"] :is(.button,.home-primary,.support-donate-button) {background: #302e40 !important; border-color: #79688d !important; color: #e8def8 !important; box-shadow: none !important;}
    html[data-theme="dark"] :is(.button,.home-primary,.support-donate-button):hover {background: #3b354d !important; border-color: #b097cf !important; color: #fff !important;}
    html[data-theme="dark"] :is(.button-primary,.home-primary,.support-donate-button) {background: #c0a7e1 !important; border-color: #c0a7e1 !important; color: #251932 !important;}
    html[data-theme="dark"] :is(.button-primary,.home-primary,.support-donate-button):hover {background: #d4bef0 !important; border-color: #d4bef0 !important; color: #20112d !important;}
    html[data-theme="dark"] .button-ghost {background: #2c2939 !important; border-color: #595067 !important; color: #ded5ec !important;}
    html[data-theme="dark"] .button-danger {background: #4a2e36 !important; border-color: #986675 !important; color: #ffc0b9 !important;}
    html[data-theme="dark"] .button-saved {background: #2a4137 !important; border-color: #597b67 !important; color: #b6e7c6 !important;}
    html[data-theme="dark"] :is(.button,.home-primary,.support-donate-button) :is(span,strong,b,small) {color: inherit !important;}
    html[data-theme="dark"] :is(.rule-actions button,.rule-actions a,.vehicle-edit-link,.vin-lookup-option,.imports-decision,.receipt-suggestion,.service-context-rule-actions > a) {background: #353047; color: #dbc8f2 !important; border-color: #665777;}
    html[data-theme="dark"] :is(.rule-actions .remove-rule,.service-context-rule-actions .remove-rule) {background: #4a2e36; color: #ffc0b9 !important;}

    /* Records, metrics, tables, and SVG/canvas chart surroundings. */
    html[data-theme="dark"] :is(.table-wrap td,.table-wrap th,.report-table td,.report-table th,.import-preview-table th,.import-preview-table td,.demo-table-scroll th,.demo-table-scroll td) {color: var(--muted); border-color: var(--line);}
    html[data-theme="dark"] :is(.table-wrap th,.report-table th,.import-preview-table th,.demo-table-scroll th) {background: #282b3a; color: #d4c7e5 !important;}
    html[data-theme="dark"] :is(.table-wrap tbody tr:hover,.support-history-item summary:hover) {background: #2b2f3e;}
    html[data-theme="dark"] :is(.ownership-cost-table > div:first-child,.ownership-ledger-top > div,.ownership-stat-grid > div,.value-badge,.report-summary > div,.report-summary > article,.expense-category,.overview-comparison-values > div,.metric-interval-anchor,.comparison-values > .comparison-own,.demo-metrics > div,.demo-ownership,.home-preview-metrics > div,.home-preview-bottom,.feature-tags span) {background: #2d293e !important; border-color: #514762 !important; color: var(--ink);}
    html[data-theme="dark"] :is(.ownership-ledger-top > div.featured,.metric-featured,.overview-metric-mpg,.home-preview-metrics > .home-preview-economy,.demo-metrics > div:nth-child(2)) {background: #253a32 !important; border-color: #456552 !important;}
    html[data-theme="dark"] :is(.ownership-stat:nth-child(1),.insight-card,.demo-metrics > div:nth-child(3),.overview-first-record) {background: #302b40 !important; border-color: #50425f !important;}
    html[data-theme="dark"] :is(.ownership-stat:nth-child(2),.insight-card:nth-child(2)) {background: #283b33 !important; border-color: #42634f !important;}
    html[data-theme="dark"] :is(.insight-card:nth-child(3),.demo-metrics > div:nth-child(4)) {background: #3c3028 !important; border-color: #6c5240 !important;}
    html[data-theme="dark"] :is(.metric-icon,.metric-icon.purple,.large-icon,.service-icon,.guide-icon,.upload-icon,.vehicle-cell i,.vehicle-dot,.mpg-badge,.preview-chapters b,.feature-icon,.home-icon,.overview-note-symbol,.overview-welcome-icon,.setup-step-number,.household-mark,.equipment-empty-icon,.journal-event-icon,.vehicle-form-chapter > span) {background: #3d3250; color: #d8c2f1;}
    html[data-theme="dark"] .metric-icon.amber {background: #443628; color: #efc99b;}
    html[data-theme="dark"] .metric-icon.coral {background: #462f3a; color: #ebbad0;}
    html[data-theme="dark"] .mpg-value {color: #cbb5eb !important;}
    html[data-theme="dark"] :is(.benchmark-list > div > i,.driving-mix-bar) {background: #4a3850;}
    html[data-theme="dark"] .benchmark-list em {background: #ba9cde;}
    html[data-theme="dark"] .benchmark-list em.muted {background: #8994ac;}
    html[data-theme="dark"] .benchmark-list em.purple {background: #d797b9;}
    html[data-theme="dark"] .driving-mix-bar i {background: #9aaae5;}
    html[data-theme="dark"] .highway-dot {background: #9aaae5;}
    html[data-theme="dark"] .city-dot {background: #d797b9;}
    html[data-theme="dark"] :is(.legend-green,.overview-real-dot) {background: var(--chart-primary);}
    html[data-theme="dark"] :is(.legend-purple,.overview-computer-dot) {background: var(--chart-secondary);}
    html[data-theme="dark"] .legend-peach {background: var(--chart-tertiary);}
    html[data-theme="dark"] :is(.schedule-row,.timeline-row,.form-section,.journal-event,.metric-record,.metric-evidence-card > header,.metric-pagination,.metric-cost-breakdown,.comparison-method,.comparison-discovery,.overview-attention-list li + li,.overview-attention-footer,.overview-records li + li,.overview-assets-list li + li,.household-person,.equipment-record) {border-color: var(--line);}
    html[data-theme="dark"] .timeline-marker:before {background: var(--line);}
    html[data-theme="dark"] .timeline-marker {border-color: #8a839f;}
    html[data-theme="dark"] .timeline-marker.completed {border-color: #bb9edc;}
    html[data-theme="dark"] .timeline-marker.planned {border-color: #dcba89;}

    /* Optional details, notices, tools, Household, plans, and import/recovery. */
    html[data-theme="dark"] :is(.privacy-explainer,.import-tip,.import-help > .card,.logging-guide,.journal-note,.journal-export,.live-value-note,.onboarding-prompt,.overview-early-note,.overview-welcome,.health-list li,.household-intro-note,.household-interval,.household-invite-verification,.household-invite-chooser > summary,.household-role-options label:has(input:checked),.plan-notice,.plan-source-box,.plan-helper,.plan-summary,.plan-adopt-panel,.plan-public-facts,.plan-intervals,.plan-fit,.plan-category,.plan-empty,.schedule-first-interval,.recommendation-item .schedule-unknown,.equipment-unknown,.equipment-section-note,.equipment-existing-file,.b04-notice,.b05-progress,.h06-progress,.handoff-context,.h06-provenance,.imports-context,.imports-progress,.imports-source-metadata pre,.imports-source-metadata dl,.receipt-destination,.receipt-progress,.receipt-reuse,.receipt-extraction,.receipt-extraction-budget,.receipt-suggestion-used,.service-reuse,.service-candidates,.vehicle-optional,.vin-lookup,.vin-lookup-option:has(input:checked),.safety-note,.feedback-inbox-context,.support-history-message,.beta-thank-you,.membership-beta-note,.membership-unavailable,.support-side-note) {background: #2a293b !important; border-color: #514963 !important; color: var(--muted);}
    html[data-theme="dark"] :is(.equipment-interval,.household-interval,.recommendation-item,.plan-item,.household-home [data-household-invite-item]) {background: #252936 !important; border-color: var(--line) !important;}
    html[data-theme="dark"] .household-home [data-household-invite-item]:hover {background: #343047 !important;}
    html[data-theme="dark"] :is(.garage-tabs,.equipment-tabs,.household-tabs,.community-tabs,.import-steps li,.imports-steps li) {background: #282835; color: var(--muted);}
    html[data-theme="dark"] :is(.garage-tabs a[aria-current],.equipment-tabs a[aria-current],.household-tabs a[aria-current],.community-tabs a.active,.import-steps [aria-current],.imports-steps [aria-current]) {background: #443654; color: #efddff !important; border-color: #7b608f; box-shadow: none;}
    html[data-theme="dark"] :is(.detail-chips span,.detail-chips a,.community-hero-tags span,.plan-tag-neutral,.household-count,.overview-count,.feedback-inbox-count,.imports-namespace,.imports-totals > span,.import-summary > span) {background: #353045; color: #d4c7e5 !important;}
    html[data-theme="dark"] .community-hero-tags span:nth-child(2) {background: #2c4036; color: #b0d4bf !important;}
    html[data-theme="dark"] .community-hero-tags span:nth-child(3) {background: #423329; color: #edc6a0 !important;}
    html[data-theme="dark"] :is(.storage-meter,.b04-progress,.imports-progress progress) {accent-color: #b49ad6;}
    html[data-theme="dark"] meter::-webkit-meter-bar {background: #363447; border-color: #675e76;}
    html[data-theme="dark"] meter::-webkit-meter-optimum-value {background: #ad91d1;}
    html[data-theme="dark"] meter::-moz-meter-bar {background: #ad91d1;}
    html[data-theme="dark"] .valuation-actions > .refresh-limit {background: #43303d; color: #f1bfd9 !important;}

    /* Public profiles, demo garages, marketing, and authentication. */
    html[data-theme="dark"] :is(.community-photo,.vehicle-art,.equipment-art,.equipment-detail-art,.household-art,.household-overview-art,.public-vehicle-photo,.community-car-thumb,.demo-vehicle-art,.home-public-photo,.preview-car,.empty-garage-art) {background: #302d41; color: #c6b0db;}
    html[data-theme="dark"] :is(.vehicle-art-2,.discovery-color-2 .community-photo,.equipment-card:nth-child(3n+2) .equipment-art,.demo-tone-2) {background: #293e34; color: #b2d1bd;}
    html[data-theme="dark"] :is(.vehicle-art-3,.discovery-color-3 .community-photo,.equipment-card:nth-child(3n+3) .equipment-art,.demo-tone-3) {background: #3c3028; color: #d9bea3;}
    html[data-theme="dark"] :is(.vehicle-art,.community-photo,.public-vehicle-photo,.community-car-thumb,.empty-garage-art) > svg {fill: #29283a; stroke: #c4aadf;}
    html[data-theme="dark"] .vehicle-art:after {border-color: #ffffff09;}
    html[data-theme="dark"] .add-vehicle-card {background: #24212f; border-color: #756581; color: #cfbeda;}
    html[data-theme="dark"] .add-vehicle-card:hover {background: #302a40;}
    html[data-theme="dark"] .add-vehicle-card > span {background: #3c304d; color: #d5b9f0;}
    html[data-theme="dark"] :is(.community-invite,.home-feature.home-mint,.feature-card.mint,.home-preview-car,.home-preview-economy,.overview-equipment .overview-section-heading) {background: #273b32 !important; border-color: #496451 !important; color: #b4d8bf;}
    html[data-theme="dark"] :is(.leaderboard-card header,.home-community,.public-garage,.marketing-proof,.marketing-cta,.ownership-promise,.ownership-preview,.hero-window-bar,.hero-chart,.hero-metrics article,.hero-float-card,.home-sharing,.home-start,.home-preview,.home-feature.home-lavender,.feature-card.lavender,.overview-shared .overview-section-heading,.membership-plan-plus,.support-donate,.demo-disclosure,.demo-method,.demo-footer) {background: #2c263b !important; border-color: #554360 !important; color: var(--ink);}
    html[data-theme="dark"] :is(.home-feature.home-peach,.feature-card.peach) {background: #3c3028 !important; border-color: #6c5240 !important;}
    html[data-theme="dark"] :is(.home-icon,.feature-icon,.beta-thank-you-icon,.support-coffee-icon) {background: #ffffff0d; color: #d1b8e9;}
    html[data-theme="dark"] .home-peach .home-icon {color: #edc2a0;}
    html[data-theme="dark"] .home-mint .home-icon {color: #b3d9bc;}
    html[data-theme="dark"] :is(.home-preview-bottom,.home-preview-metrics > div,.hero-metrics article) {background: #292e3c !important;}
    /* The public introduction uses the same flat hierarchy as the signed-in app. */
    html[data-theme="dark"] .home-landing :is(.home-feature,.home-preview,.home-sharing,.home-start,.home-preview-metrics > div,.home-preview-bottom) {background: transparent !important; border-color: var(--line) !important; box-shadow: none;}
    html[data-theme="dark"] .home-landing .home-preview-window {box-shadow: none;}
    html[data-theme="dark"] .home-landing :is(.home-switch-pill,.home-switch-apps) {background: var(--card) !important; border-color: var(--line) !important;}
    html[data-theme="dark"] .home-landing .home-switch-apps li + li, html[data-theme="dark"] .home-landing .home-faq details {border-color: var(--line);}
    html[data-theme="dark"] .home-landing .home-switch-apps a:hover {background: #2b3040;}
    html[data-theme="dark"] .home-landing :is(.home-switch-pill,.home-switch-apps b,.home-inline-link,.home-faq details a) {color: #d4bdf7;}
    html[data-theme="dark"] .home-landing .home-faq summary::after {color: #d4bdf7;}
    html[data-theme="dark"] .home-landing .home-community-section {border-top-color: var(--line);}
    html[data-theme="dark"] .home-landing .home-switch-pill > span:first-child {color: var(--muted);}
    html[data-theme="dark"] .home-landing .home-promise-grid li {border-top-color: #5a4a70;}
    html[data-theme="dark"] .membership-page[aria-labelledby="membership-title"] .membership-beta-note {background: transparent !important;}
    html[data-theme="dark"] .home-landing .home-chart text {fill: var(--muted);}
    html[data-theme="dark"] .home-landing .home-chart-grid {stroke: var(--line);}
    html[data-theme="dark"] .home-landing .home-chart-area {fill: #2a3d34;}
    html[data-theme="dark"] .home-landing .home-chart-real {stroke: #b1d9bd;}
    html[data-theme="dark"] .home-landing .home-chart-computer {stroke: #d0b0eb;}
    html[data-theme="dark"] .home-landing .home-chart-points {fill: #222632; stroke: #b1d9bd;}
    html[data-theme="dark"] .home-landing .home-chart-legend i {background: #b1d9bd;}
    html[data-theme="dark"] .home-landing .home-chart-legend span + span i {background: transparent; border-color: #d0b0eb;}
    html[data-theme="dark"] .auth-showcase {background: radial-gradient(circle at 80% 30%, #433245 0, transparent 34%), linear-gradient(145deg,#2c283e,#22333a 70%,#35293e); color: var(--ink);}
    html[data-theme="dark"] :is(.showcase-copy :is(h1,h2) em,.hero-copy h1 em,.community-hero h1 em,.home-hero h1 span) {color: #d1b3e8;}
    html[data-theme="dark"] .showcase-orbit {border-color: #b994da20;}
    html[data-theme="dark"] .road-lines i {background: linear-gradient(transparent,#ac91c8);}
    html[data-theme="dark"] .car-body {fill: #363044;}
    html[data-theme="dark"] .car-window {fill: #65516f;}
    html[data-theme="dark"] .car-wheel {fill: #ad90c3; stroke: #363044;}
    html[data-theme="dark"] .car-hub {fill: #ddd0e8;}
    html[data-theme="dark"] .car-shadow {fill: #211c2d;}
    html[data-theme="dark"] .preview-orbit {border-color: #62506f;}
    html[data-theme="dark"] :is(.hero-grid,.home-chart-grid) {stroke: var(--line);}
    html[data-theme="dark"] .marketing-skip {background: #302840 !important; color: #f2e8ff !important; border-color: #c6a5e6 !important;}
    html[data-theme="dark"] :is(.beta-thank-you-label,.demo-disclosure,.demo-vehicle-art > span,.demo-card-body .demo-badge,.demo-ownership dt,.demo-section-heading > span,.home-chart-legend,.home-preview-kicker,.home-public-make,.home-preview figcaption,.home-preview-metrics span,.home-preview-bottom span,.home-asset-types > span,.home-sharing-note,.membership-plan-state,.membership-unavailable,.support-eyebrow,.support-history-meta,.support-submit-row span,.plan-card-meta,.plan-section-heading > span,.plan-card-owner,.plan-card-conditions,.plan-card-vehicle,.plan-version,.plan-category,.receipt-help,.receipt-meta,.receipt-kicker,.b05-row-meta,.b05-eyebrow,.h06-status,.h06-provenance,.imports-kicker,.imports-namespace,.import-hint,.import-summary,.imports-pagination > span,.safety-label,.safety-actions > span,.household-meta,.household-asset-footer,.household-record-date,.household-kicker,.shell-asset-context > span,.overview-eyebrow,.overview-metric > span,.overview-chart-legend,.overview-attention-body > span,.overview-due,.overview-record-kind,.overview-assets-list span,.equipment-private,.equipment-current > span,.equipment-card-reading span,.equipment-status,.metric-evidence-eyebrow,.metric-record-title span,.metric-formula span,.metric-cost-amount span,.metric-period-form label,.metric-pagination span,.fuel-distance-source,.fuel-calculation-status,.service-context-note > span,.service-context-list span,.vin-lookup > summary span) {color: var(--muted) !important;}
    html[data-theme="dark"] :is(.overview-text-link,.metric-inline-link,.metric-explanation-links a,.metric-explanation > summary,.comparison-method > summary,.service-reuse > summary,.log-details > summary,.vehicle-optional > summary,.vehicle-more-options > summary,.vin-lookup > summary,.b04-details summary,.b04-cancel summary,.receipt-preview summary,.receipt-options summary,.receipt-discard summary,.household-record-notes summary,.household-remove-details summary,.plan-card-link,.safety-preview summary,.safety-audit summary) {color: var(--night-link) !important;}
    html[data-theme="dark"] :is(.preview-tool-icon.mint,.journal-event-fuel .journal-event-icon) {background: #2d4539; color: #b4ddc1;}
    html[data-theme="dark"] :is(.preview-tool-icon.peach,.journal-event-maintenance .journal-event-icon) {background: #4b392d; color: #eac3a3;}
    html[data-theme="dark"] .receipt-preview img {background: #fff;}
    html[data-theme="dark"] .receipt-pdf {background: #252836; border-color: var(--line); color: var(--muted);}
    html[data-theme="dark"] .setup-body {background: var(--canvas); color: var(--ink);}
    html[data-theme="dark"] .setup-body .main {background: var(--canvas);}
    html[data-theme="dark"] .setup-body .panel {background: var(--card); border-color: var(--line); box-shadow: var(--shadow);}
    html[data-theme="dark"] .setup-body .side {background: linear-gradient(145deg,#252135,#203139);}
    html[data-theme="dark"] .setup-body .ring {border-color: #9b81bb24;}
    html[data-theme="dark"] .setup-body .step {background: #2b2d3b;}
    html[data-theme="dark"] .setup-body .step i {background: #3c3450; color: #dac5f3;}
    html[data-theme="dark"] .setup-body .alert:not(.success) {background: #422b32 !important; border-color: #a46773 !important; color: #ffd0c9 !important;}
    html[data-theme="dark"] .setup-body .alert.success {background: #2a4137 !important; border-color: #597b67 !important; color: #b6e7c6 !important;}
    html[data-theme="dark"] .setup-body .button {background: #c0a7e1 !important; border-color: #c0a7e1 !important; color: #251932 !important;}

    /* Scoped components found in the full-page contrast audit. */
    html[data-theme="dark"] .vehicle-year {background: #393249 !important; color: #e1d2f7 !important;}
    html[data-theme="dark"] :is(.care-metrics > article,.support-history-empty) {background: var(--card); border-color: var(--line);}
    html[data-theme="dark"] .plan-item .plan-condition {background: #302b40; color: var(--muted) !important;}
    html[data-theme="dark"] :is(.service-reuse > summary span,.support-history-header > span,.membership-price span,.community-filters label > span) {color: var(--muted) !important;}
    html[data-theme="dark"] .imports-field > span:not(.imports-field-error) {color: var(--ink) !important;}
    html[data-theme="dark"] :is(.equipment-record-notes > summary,.community-more-filters > summary,.community-more-filters > summary span) {color: var(--night-link) !important;}
    html[data-theme="dark"] .guide-steps i {color: #d4c7e5; border-color: #8f7da3;}
    html[data-theme="dark"] .empty-community {background: var(--card); border-color: var(--line);}
    html[data-theme="dark"] .empty-community-icon {background: #393249; color: #d9c5ef;}
    html[data-theme="dark"] .vehicle-setup-page :is(.vehicle-optional > summary,.vehicle-section-heading) {background: #302b40 !important; border-color: var(--line);}
    html[data-theme="dark"] .vehicle-setup-page .vehicle-optional > summary::before {color: var(--night-link);}
    html[data-theme="dark"] :is(.metric-interval-anchor > span,.demo-metrics span,.public-profile-missing > span,.feedback-inbox-meta) {color: var(--muted) !important;}
    html[data-theme="dark"] .modal-form[data-draft-form^="maintenance:"] .schedule-rule-picker .field-hint {color: var(--muted) !important;}
    html[data-theme="dark"] .imports-row-errors {background: #422b32; color: var(--night-error) !important;}
    html[data-theme="dark"] .imports-row-errors li {color: var(--night-error) !important;}
    html[data-theme="dark"] .imports-row-warnings {background: #393125; color: var(--night-warning);}
    html[data-theme="dark"] .imports-row-warnings li {color: var(--night-warning) !important;}

    /* Theme chooser uses native radio semantics and keeps focus visible. */
    html[data-theme="dark"] .appearance-choices label > span {background: #262a38; border-color: #747087; color: #d1c4e2;}
    html[data-theme="dark"] .appearance-choices input:checked + span {background: #413451; border-color: #d0acef; color: #f0dfff; box-shadow: inset 0 0 0 1px #d0acef;}
    html[data-theme="dark"] .appearance-choices input:focus-visible + span {outline-color: #d0acef;}
    html[data-theme="dark"] .appearance-choices label > span strong {color: inherit !important;}
}

/* Dialog titles receive focus for announcement, not as interactive controls. */
html .modal-panel .modal-header h2[tabindex="-1"]:focus {outline:none;}

/* Printed histories retain their existing light palette regardless of screen theme. */
@media print {
    html[data-theme] {
        color-scheme: light !important; background: #fff !important;
        --chart-primary: #788bd1; --chart-secondary: #ca8fa8; --chart-secondary-readable: #b46e8c;
        --chart-tertiary: #dba57e; --chart-grid: #ece8ef; --chart-text: #6a6e80; --chart-point: #ffffff;
        --chart-fill-top: rgba(120,139,209,.17); --chart-fill-bottom: rgba(120,139,209,0);
    }
    .appearance-card {display: none !important;}
}

/* ---- settings-page ---- */
/* B24: settings stay in ordinary document flow, with no hidden forms or tabs. */
.settings-page {max-width: 1140px; margin-inline: auto; --settings-line: #e4e1e9; --settings-muted: #655f70; --settings-link: #665081;}
.settings-page .page-intro {margin-bottom: 24px;}
.settings-jump-links {display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 0 0 16px; border-bottom: 1px solid var(--settings-line);}
.settings-jump-links a {display: inline-flex; align-items: center; min-height: 44px; padding: 8px 0; color: var(--settings-muted); font-size: 14px; font-weight: 600; text-decoration: none; text-underline-offset: 5px; scroll-margin-block: 110px;}
.settings-jump-links a:hover {color: var(--settings-link); text-decoration: underline;}
.settings-page :is(.settings-section,.settings-reminders > .settings-card) {display: grid; grid-template-columns: minmax(150px,.36fr) minmax(0,1fr); gap: 36px; margin: 0; padding: 36px 0; border: 0; border-bottom: 1px solid var(--settings-line); border-radius: 0; background: transparent; box-shadow: none; overflow: visible;}
.settings-page :is(.settings-section,.settings-reminders) {scroll-margin-top: 110px;}
.settings-page .settings-section:last-child {border-bottom: 0; padding-bottom: 8px;}
.settings-page :is(.settings-section-heading,.settings-reminders .card-header) {display: block; padding: 0; border: 0;}
.settings-page :is(.settings-section-heading h2,.settings-reminders h2) {margin: 0; font-family: var(--display); font-size: 20px; line-height: 1.35; letter-spacing: -.35px;}
.settings-page :is(.settings-section-heading > p,.settings-reminders .card-subtitle) {max-width: 26ch; margin: 9px 0 0; color: var(--settings-muted); font-size: 14px; line-height: 1.65;}
.settings-page :is(.settings-section-content,.settings-form) {min-width: 0;}
.settings-page .settings-form {padding: 0;}
.settings-page h3 {margin: 0 0 12px; font-family: var(--display); font-size: 16px; line-height: 1.45; letter-spacing: -.15px;}
.settings-page :is(.settings-section-content,.settings-reminders .settings-form) > p,
.settings-page :is(.settings-subsection,.settings-account-status,.settings-data-block) > p {margin: 0 0 16px; color: var(--settings-muted); font-size: 14px; line-height: 1.7;}
.settings-page .settings-form > .field {margin-top: 20px;}
.settings-page .field {font-size: 14px; line-height: 1.5;}
.settings-page .field :is(input,select,textarea) {font-size: 16px;}
.settings-page .field :is(input:not([type="checkbox"]):not([type="radio"]),select) {min-height: 46px;}
.settings-page :is(.field small,.field-help,.profile-photo-row > small) {color: var(--settings-muted); font-size: 13px; line-height: 1.65;}
.settings-page .field > span > small {font-weight: 400;}
.settings-page .form-grid {gap: 20px;}
.settings-page :is(.button,.membership-text-link,.danger-link) {min-height: 44px;}
.settings-page .button {white-space: normal; line-height: 1.45; text-align: center;}
.settings-page .settings-avatar {flex: 0 0 58px; width: 58px; height: 58px; border-radius: 16px;}
.settings-page .profile-photo-row {gap: 12px; margin-bottom: 24px;}
.settings-page .profile-photo-row > small {flex: 1 1 160px;}
.settings-page .privacy-toggle {margin-top: 24px;}
.settings-page .privacy-toggle > span {border-radius: 9px; background: #faf9fc;}
.settings-page .privacy-toggle strong {font-size: 14px; line-height: 1.5;}
.settings-page .privacy-toggle small {font-size: 13px; line-height: 1.6;}
.settings-page .settings-privacy-note {margin: 12px 0 0;}
.settings-page .settings-actions {justify-content: flex-start; margin-top: 20px;}
.settings-page .settings-subsection {margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--settings-line);}
.settings-page .settings-sharing {display: flex; align-items: flex-start; gap: 24px;}
.settings-page .settings-sharing > div {flex: 1; min-width: 0;}
.settings-page .settings-sharing p {margin: 0; color: var(--settings-muted); font-size: 14px; line-height: 1.7;}
.settings-page .settings-sharing .button {flex-shrink: 0;}
.settings-page .appearance-choices {max-width: 480px; gap: 12px;}
.settings-page .appearance-choices label > span {min-height: 92px; border-radius: 9px;}
.settings-page .appearance-status {margin-bottom: 0;}
.settings-page .sr-only {position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;}
.settings-page .compact-form {gap: 20px;}
.settings-page .compact-form > .button {align-self: flex-start;}
.settings-page .settings-password .compact-form {max-width: 480px;}
.settings-page .settings-password .field {margin-top: 0;}
.settings-page .membership-text-link {display: inline-flex; align-items: center; gap: 8px;}
.settings-page .settings-delete {padding-top: 12px;}
.settings-page .danger-link {display: inline-flex; align-items: center; color: #9e454b; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px;}
.settings-page .settings-export-links {display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 20px 0 16px;}
.settings-page .companion-actions {display: flex; flex-wrap: wrap; gap: 10px; margin: 0;}
.settings-page .companion-actions > a {justify-content: center; padding: 10px 16px; border-radius: 9px; font-size: 13px;}
.settings-page .reminder-preview {gap: 16px; margin-top: 28px; padding: 24px 0 0; border-top: 1px solid var(--settings-line);}
.settings-page .reminder-preview h3 {margin-bottom: 0;}
.settings-page .reminder-preview > .field-help {margin: 0;}
.settings-page .reminder-preview-item {gap: 16px; padding: 16px 0 0; border: 0; border-top: 1px solid var(--settings-line); border-radius: 0;}
.settings-page .storage-meter {max-width: 480px;}
.settings-page .safety-links {display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin: 0;}
.settings-page .safety-links a {display: inline-flex; align-items: center; min-height: 44px; color: var(--settings-link); font-size: 14px; text-decoration: underline; text-underline-offset: 4px;}
.settings-page :is(p,h2,h3,a,strong,small) {overflow-wrap: anywhere;}
.settings-page :is(a,button):focus-visible {outline: 3px solid #7663a6; outline-offset: 4px;}

@media (max-width: 1100px) {
    .settings-page :is(.settings-section,.settings-reminders > .settings-card) {grid-template-columns: minmax(130px,.32fr) minmax(0,1fr); gap: 24px;}
    .settings-page .settings-sharing {flex-direction: column; gap: 16px;}
}
@media (max-width: 760px) {
    .settings-page :is(.settings-section,.settings-reminders > .settings-card) {grid-template-columns: minmax(0,1fr); gap: 24px; padding-block: 28px;}
    .settings-page :is(.settings-section-heading > p,.settings-reminders .card-subtitle) {max-width: none; margin-top: 6px;}
    .settings-jump-links {gap: 0 22px; padding-bottom: 12px;}
    .settings-page .page-intro {gap: 16px; margin-bottom: 20px;}
}
@media (max-width: 420px) {
    .settings-page .profile-photo-row > small {flex-basis: 100%;}
    .settings-page .appearance-choices {gap: 7px;}
    .settings-page .settings-export-links {grid-template-columns: minmax(0,1fr);}
    .settings-page .companion-actions {align-items: stretch; flex-direction: column;}
    .settings-page .companion-actions .button {width: 100%;}
}
@media screen {
    html[data-theme="dark"] .settings-page {--settings-line: #41475b; --settings-muted: #bdc0d0; --settings-link: #d4bdf7;}
    html[data-theme="dark"] .settings-page .settings-reminders > .settings-card {background: transparent !important; box-shadow: none;}
}
@media print {
    .settings-jump-links {display: none;}
    .settings-page :is(.settings-section,.settings-reminders > .settings-card) {display: block; padding-block: 20px;}
    .settings-page :is(.settings-section-heading,.settings-reminders .card-header) {margin-bottom: 16px;}
}

/* ---- plus-membership ---- */
.plus-account,.membership-page{max-width:1080px;margin-inline:auto}
.plus-status-panel,.plus-benefits,.plus-billing-panel{padding:1.5rem 0;border-bottom:1px solid var(--border,#e4e5ed)}
.plus-status-panel h2,.plus-benefits h2,.plus-billing-panel h2{margin:0 0 .8rem;font-size:1.2rem}
.plus-status-panel p,.plus-billing-panel p,.plus-notice{max-width:70ch;line-height:1.65}
.plus-status-panel .button,.plus-billing-panel .button{margin-top:.5rem;min-height:44px;white-space:normal;text-align:center;overflow-wrap:anywhere}
.plus-actions{display:flex;flex-wrap:wrap;gap:.75rem}
.plus-actions form{min-width:0;max-width:100%}
.plus-cancel-details{margin-top:1.5rem;padding:1rem 0}
.plus-cancel-details summary{min-height:44px;cursor:pointer;display:list-item;padding:.6rem 0;font-weight:600}
.plus-cancel-form{display:grid;gap:.8rem;max-width:28rem}
.plus-cancel-form input{min-height:44px}
.plus-cancel-form button{justify-self:start}
.plus-notice{padding:1rem;background:var(--lavender-light,#f3f0fa);border-radius:.7rem}
.membership-plus-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2rem;margin-top:2rem}
.membership-plus-options>section{min-width:0;padding:1.25rem 0}
.membership-plus-options h2{margin:0 0 .6rem}
.membership-plus-options .button{min-height:44px;white-space:normal;overflow-wrap:anywhere;text-align:center}
.membership-plus-donation{margin-top:2rem;padding:1.5rem 0;border-top:1px solid var(--border,#e4e5ed)}
.membership-plus-options form{margin:0}
.plus-account a,.plus-account button,.plus-account input,.plus-account summary{scroll-margin-top:110px}
html[data-theme="dark"] .plus-notice{background:#282735;color:#e9e7f1}
.account-deletion-page,.privacy-policy-page{min-width:0;overflow-wrap:anywhere}.privacy-policy-page>.alert{overflow-wrap:normal}
.account-deletion-page .companion-actions{min-width:0;max-width:100%}
.account-deletion-page .companion-actions .button{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;height:auto;text-align:center}
@media(max-width:520px){.account-deletion-page .compact-form .companion-actions{grid-template-columns:minmax(0,1fr)}}
@media(max-width:700px){.membership-plus-options{grid-template-columns:1fr;gap:.5rem}.membership-plus-options>section+section{border-top:1px solid var(--border,#e4e5ed)}.plus-actions{flex-direction:column;align-items:stretch}.plus-actions .button{width:100%}.plus-cancel-form button{justify-self:stretch}}

/* ---- plus-insights ---- */
/* Owner-private Plus tools. Existing record pages and themes remain unchanged. */
.plus-insights {min-width:0; color:var(--ink);}
.plus-insights-label {display:block; margin-bottom:6px; color:var(--muted); font-size:.8rem; font-weight:700;}
.plus-insights-section {padding:28px 0; border-top:1px solid var(--line);}
.plus-insights-heading {display:flex; align-items:flex-start; justify-content:space-between; gap:20px; flex-wrap:wrap; margin-bottom:18px;}
.plus-insights-heading h2 {margin:0 0 6px; font-size:1.3rem; line-height:1.4;}
.plus-insights-heading p,.plus-insights-context,.plus-insights-footnote {margin:0; color:var(--muted); line-height:1.65;}
.plus-insights-context {max-width:82ch; margin-bottom:22px;}
.plus-insights-footnote {font-size:.875rem; margin-top:18px; max-width:95ch;}
.plus-insights-actions {display:flex; flex-wrap:wrap; gap:4px 18px;}
.plus-insights-actions a {display:inline-flex; align-items:center; min-height:44px; color:var(--green-dark); text-decoration:underline; text-underline-offset:3px; line-height:1.4;}
.plus-insights a:focus-visible,.plus-insights summary:focus-visible,.plus-insights button:focus-visible,.plus-insights input:focus-visible {outline:3px solid var(--green-dark); outline-offset:3px;}
.plus-insights-metrics {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border:1px solid var(--line); border-radius:14px; background:var(--card);}
.plus-insights-metrics>div {min-width:0; padding:22px;}
.plus-insights-metrics>div+div {border-left:1px solid var(--line);}
.plus-insights-metrics span,.plus-insights-metrics small {display:block; color:var(--muted); line-height:1.55;}
.plus-insights-metrics strong {display:block; margin:8px 0; font-size:1.6rem; line-height:1.3; overflow-wrap:anywhere;}
.plus-insights-metrics small {font-size:.85rem;}
.plus-insights-details {margin-top:18px;}
.plus-insights-details summary {width:fit-content; max-width:100%; min-height:44px; padding:10px 0; cursor:pointer; font-weight:600; line-height:1.5;}
.plus-insights-months {display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0 24px;}
.plus-insights-months>div {min-width:0; padding:16px 0; border-bottom:1px solid var(--line);}
.plus-insights-months h3 {margin:0 0 5px; font-size:1rem;}
.plus-insights-months strong {display:block; font-size:1.1rem; overflow-wrap:anywhere;}
.plus-insights-months span {display:block; margin-top:5px; color:var(--muted); font-size:.85rem; line-height:1.6;}
.plus-insights-empty {padding:18px 0 0; margin:0; color:var(--muted); line-height:1.65;}
.plus-insights-year {flex:0 1 240px; max-width:100%;}
.plus-insights-year label {display:block; margin-bottom:6px; font-size:.875rem; color:var(--muted);}
.plus-insights-year>div {display:flex; gap:8px; flex-wrap:wrap;}
.plus-insights-year input {flex:1 1 5em; width:6em; min-width:0; max-width:100%; min-height:44px; padding:9px 12px; border:1px solid var(--line); border-radius:9px; background:var(--card); color:var(--ink); font:inherit;}
.plus-insights-year button {min-height:44px;}
.plus-insights-comparison {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:28px;}
.plus-insights-comparison>section {min-width:0;}
.plus-insights-comparison h3 {font-size:1rem; font-weight:600; line-height:1.6; margin:0 0 10px;}
.plus-insights-comparison section>strong {font-size:1.9rem; line-height:1.4; overflow-wrap:anywhere;}
.plus-insights-comparison section>p {color:var(--muted); font-size:.875rem; line-height:1.6; margin:6px 0 18px;}
.plus-insights-comparison dl {margin:0;}
.plus-insights-comparison dl>div {display:flex; justify-content:space-between; gap:12px; border-top:1px solid var(--line); padding:12px 0; flex-wrap:wrap;}
.plus-insights-comparison dt {flex:1 1 11em; min-width:0; line-height:1.5;}
.plus-insights-comparison dd {margin:0; text-align:right; font-weight:600; line-height:1.5; overflow-wrap:anywhere;}
.plus-insights-comparison dd small {display:block; font-weight:400; color:var(--muted); font-size:.8rem;}
.plus-insights-difference {margin:20px 0 0; padding:14px 18px; border-radius:10px; background:var(--green-soft); line-height:1.65; overflow-wrap:anywhere;}
@media (max-width:760px) {.plus-insights-metrics {grid-template-columns:1fr;} .plus-insights-metrics>div+div {border-left:0; border-top:1px solid var(--line);} .plus-insights-metrics>div {padding:18px;} .plus-insights-months {grid-template-columns:repeat(2,minmax(0,1fr));} .plus-insights-comparison {grid-template-columns:1fr;} .plus-insights-section {padding:24px 0;}}
@media (max-width:390px) {.plus-insights-months {grid-template-columns:1fr;} .plus-insights-comparison dd {text-align:left;} .plus-insights-comparison dl>div {gap:5px 12px;}}
@media print {.plus-insights-year,.plus-insights-actions,.plus-insights .page-intro>a {display:none;} .plus-insights {color:#171923;} .plus-insights-section {break-inside:avoid;} .plus-insights-metrics {background:#fff;}}

/* ===== Everyday look (November 2026) =====
   One purple accent on a warm off-white, white cards with a thin warm border,
   plain sentence-case labels, Manrope headings. Loaded last so it wins over the
   older layered palettes above; light colours only, dark keeps its own palette. */
html:not([data-theme="dark"]){--ink:#1e2230;--muted:#5b6070;--subtle:#5f6474;--line:#e5dfd5;--canvas:#fcfaf7;--card:#fff;--nav:#fff;--nav-soft:#f3f0fa;--green:#5a48b5;--green-dark:#45379a;--green-soft:#eeebfa;--lavender:#f3f0fa;--purple:#5a48b5;--purple-soft:#eeebfa}
html:not([data-theme="dark"]) body,html:not([data-theme="dark"]) .app-body{background:var(--canvas)}
/* Shell */
html:not([data-theme="dark"]) .sidebar{background:#fff;border-right:1px solid var(--line);color:var(--ink)}
html:not([data-theme="dark"]) .nav-item{color:#4a4f5e}
html:not([data-theme="dark"]) .nav-item:hover{background:#f6f3ee;color:var(--ink)}
html:not([data-theme="dark"]) .nav-item.active,html:not([data-theme="dark"]) .experience-shell .nav-item.active{background:#eeebfa;color:#45379a;box-shadow:none}
html:not([data-theme="dark"]) .nav-label{color:var(--muted)}
html:not([data-theme="dark"]) .topbar{background:rgba(252,250,247,.94);border-color:var(--line)}
.shell-vehicle-view label{font-weight:600;font-size:13px;color:var(--muted)}
/* Labels: no small capitals; a quiet sentence-case line instead. */
.card-kicker,.eyebrow{text-transform:none!important;letter-spacing:0!important;font-size:13px!important;font-weight:600!important}
html:not([data-theme="dark"]) :is(.card-kicker,.eyebrow){color:var(--muted)!important}
/* Headings */
.main-content :is(h1,h2){font-family:var(--display);letter-spacing:-.3px}
.main-content h1{font-weight:800}
html:not([data-theme="dark"]) .main-content :is(h1,h2,h3){color:var(--ink)}
/* Surfaces */
html:not([data-theme="dark"]) :is(.card,.metric-card,.vehicle-card,.empty-list-card,.empty-page,.empty-garage,.ownership-stat,.journal-toolbar,.journal-timeline,.expense-category){background:#fff;border-color:var(--line);box-shadow:none}
.main-content :is(.card,.metric-card,.vehicle-card){border-radius:20px}
html:not([data-theme="dark"]) :is(.draft-banner,.draft-notice,.save-state,.record-save-state:not(.record-save-error),.receipt-notice,.b04-notice,.b05-notice,.h06-notice,.imports-notice,.household-notice,.support-notice,.service-context-note,.service-context-notice,.fuel-distance-review,.metric-evidence-notice){background:#f6f3ee!important;border-color:var(--line)!important;color:#3d4250!important}
html:not([data-theme="dark"]) :is(.metric-icon,.guide-icon){background:#f1eee8;color:#3d4250}
/* Buttons */
.main-content .button,.modal .button{border-radius:14px;font-size:14px;font-weight:700}
html:not([data-theme="dark"]) .button-primary,html:not([data-theme="dark"]) .dashboard-overview .button-primary,html:not([data-theme="dark"]) .dashboard-actions>.button-primary{background:#5a48b5!important;border-color:#5a48b5!important;color:#fff!important;box-shadow:none!important}
html:not([data-theme="dark"]) .button-primary:hover,html:not([data-theme="dark"]) .dashboard-overview .button-primary:hover,html:not([data-theme="dark"]) .dashboard-actions>.button-primary:hover{background:#45379a!important;border-color:#45379a!important;transform:none}
html:not([data-theme="dark"]) .button-secondary{background:#fff;border:1px solid #d9d2c6;color:var(--ink);box-shadow:none}
html:not([data-theme="dark"]) .button-secondary:hover{background:#f6f3ee;border-color:#c9c0b2;color:var(--ink)}
/* Form fields */
.main-content .field :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select),.modal .field :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select){min-height:46px;border-radius:12px;font-size:15px}
.main-content .field textarea,.modal .field textarea{border-radius:12px;font-size:15px}
html:not([data-theme="dark"]) .field :is(input:not([type=checkbox]):not([type=radio]),select,textarea){border-color:#d9d2c6;background:#fff;color:var(--ink)}
html:not([data-theme="dark"]) .field :is(input,select,textarea):focus{border-color:#5a48b5;box-shadow:0 0 0 3px #5a48b526}
html:not([data-theme="dark"]) .field>span{color:var(--ink)}
html:not([data-theme="dark"]) .field ::placeholder{color:#737885}
/* Links inside content */
html:not([data-theme="dark"]) .main-content :is(p,small,li,td) a:not(.button){color:#5a48b5}
[data-autosubmit-button][hidden]{display:none!important}
/* Remaining small-capital labels and table headers: plain sentence case. */
:is(.household-kicker,.support-eyebrow,.journal-event-kind,.vehicle-type-tag),.main-content th{text-transform:none!important;letter-spacing:0!important}
/* Older lavender tints become the warm neutral; #eeebfa stays the one accent tint. */
html:not([data-theme="dark"]) :is(.add-vehicle-card,.modal-close,.vehicle-edit-link,.button-ghost){background:#fff;border-color:var(--line)}
html:not([data-theme="dark"]) :is(.equipment-art,.equipment-detail-art,.garage-tabs,.equipment-tabs,.vehicle-type-tag,.household-count){background:#f1eee8}
html:not([data-theme="dark"]) :is(.overview-metric-mpg,.comparison-own,.vin-lookup,.journal-note,.live-value-note,.plan-vehicle-picker,.household-invite-verification,.support-privacy){background:#f6f3ee;border-color:var(--line)}
@media(max-width:640px){.main-content .page-intro{align-items:stretch;text-align:left}}
html:not([data-theme="dark"]) .household-intro-note{background:#f6f3ee;border-color:var(--line)}
html[data-theme="dark"] .car-overview a.co-action.co-action-primary:not(.co-x){color:#17142a!important}
html[data-theme="dark"] .car-overview a:is(.co-action,.co-row,,.co-track,.go-card):not(.co-action-primary):not(.co-x){color:var(--co-ink)!important}

/* Draft note shows only when it has something to say. */
.draft-notice:not(:has(button)):has(> [role="status"]:empty){display:none}

/* Settings and Household in the everyday style (November 2026) */
[data-email-password][hidden],[data-reminder-details][hidden]{display:none!important}
.settings-page{max-width:1000px}
.settings-page :is(.settings-section,.settings-reminders > .settings-card){margin:0 0 16px;padding:28px 30px;border:1px solid #e5dfd5;border-radius:18px;background:#fff;box-shadow:none}
.settings-page .settings-section:last-child{padding-bottom:28px;border-bottom:1px solid #e5dfd5}
.settings-page .settings-jump-links{gap:8px;margin:0 0 20px;padding:0;border:0}
.settings-page .settings-jump-links a{min-height:40px;padding:8px 15px;border:1px solid #e5dfd5;border-radius:999px;background:#fff;color:#3d4250}
.settings-page .settings-jump-links a:hover{border-color:#5a48b5;color:#5a48b5;text-decoration:none}
.settings-page .reminder-details{display:grid;gap:14px}
@media (max-width:640px){
  .settings-page .settings-jump-links{display:flex;flex-wrap:nowrap;overflow-x:auto;margin:0 -16px 16px;padding:0 16px 4px;scrollbar-width:none}
  .settings-page .settings-jump-links::-webkit-scrollbar{display:none}
  .settings-page .settings-jump-links a{flex:0 0 auto}
  .settings-page :is(.settings-section,.settings-reminders > .settings-card){padding:20px 18px;border-radius:16px}
}
html[data-theme="dark"] .settings-page :is(.settings-section,.settings-reminders > .settings-card){border-color:#3a3548;background:#1d1b26!important}
html[data-theme="dark"] .settings-page .settings-jump-links a{border-color:#3a3548;background:#1d1b26;color:#e6e2f0}

.hh{max-width:820px}
.hh .page-intro p{max-width:56ch}
.hh-invite{margin:0 0 22px}
.hh-invite > summary{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 18px;border-radius:12px;background:#5a48b5;color:#fff;font:600 15px var(--font);cursor:pointer;list-style:none}
.hh-invite > summary::-webkit-details-marker{display:none}
.hh-invite > summary::before{content:"+";font-size:19px;line-height:1}
.hh-invite[open] > summary{background:#4a3a9c}
.hh-invite .household-invite-options{margin-top:10px;padding:16px;border:1px solid #e5dfd5;border-radius:16px;background:#fff}
.hh-section{margin:0 0 24px}
.hh-head{display:flex;align-items:center;gap:10px;margin:0 0 8px}
.hh-head h2{margin:0;font:700 18px var(--display);letter-spacing:-.2px}
.hh-sub{margin:-2px 0 10px;color:#66707c;font-size:14px}
.hh-note{margin:0;padding:14px 16px;border:1px dashed #d9d2c6;border-radius:14px;color:#5d6270;font-size:14px;line-height:1.55}
.hh-list{padding:0;overflow:hidden;border:1px solid #e5dfd5;border-radius:16px;background:#fff;box-shadow:none}
.hh-empty{margin:0;padding:16px;color:#5d6270;font-size:14px}
.hh-row{display:flex;align-items:center;gap:12px;min-height:60px;padding:10px 16px;border-top:1px solid #efeae2;color:inherit;text-decoration:none}
.hh-row:first-child{border-top:0}
.hh-row:hover{background:#faf8f5}
.hh-row-main{flex:1;min-width:0}
.hh-row-main strong{display:block;font-size:15px}
.hh-row-main small{display:block;margin-top:2px;color:#66707c;font-size:13px}
.hh-chevron{color:#9a9fab;font-size:22px;line-height:1}
.hh-item{display:flex;align-items:flex-start;gap:14px;padding:14px 16px;border-top:1px solid #efeae2}
.hh-item:first-child{border-top:0}
.hh-thumb{display:grid;flex:0 0 56px;width:56px;height:56px;place-items:center;overflow:hidden;border-radius:12px;background:#f3efe9;color:#6d6880}
.hh-thumb img{width:100%;height:100%;object-fit:cover}
.hh-thumb svg{width:26px;height:26px}
.hh-item-main{flex:1;min-width:0}
.hh-item-main h3{margin:0;font:700 16px var(--display);overflow-wrap:anywhere}
.hh-item-main h3 a{color:inherit;text-decoration:none}
.hh-item-main > p{margin:3px 0 0;color:#66707c;font-size:14px}
.hh-item .household-owner-actions{display:flex;flex-wrap:wrap;gap:4px 18px;margin-top:6px}
.hh-item .household-owner-actions a{display:inline-flex;align-items:center;min-height:36px;font-size:14px;font-weight:600}
.hh-shared{margin-top:6px!important;color:#3d4250!important;font-weight:600}
html[data-theme="dark"] :is(.hh-list,.hh-invite .household-invite-options){border-color:#3a3548;background:#1d1b26}
html[data-theme="dark"] :is(.hh-row,.hh-item){border-color:#2e2a3b}
html[data-theme="dark"] .hh-row:hover{background:#25222f}
html[data-theme="dark"] .hh-thumb{background:#2a2636;color:#c9c2e0}
html[data-theme="dark"] :is(.hh-sub,.hh-row-main small,.hh-item-main > p,.hh-empty,.hh-note){color:#bdc0d0}
html[data-theme="dark"] .hh-shared{color:#e6e2f0!important}
html[data-theme="dark"] .hh-note{border-color:#3a3548}
html[data-theme="dark"] .hh-invite > summary{background:#a99bf0;color:#17142a}
.household-home.hh .hh-invite{overflow:visible;border:0;border-radius:0;background:none}
.household-home.hh .hh-invite > summary{display:inline-flex;min-height:44px;padding:0 18px;border:0;border-radius:12px;background:#5a48b5;color:#fff;font-size:15px;font-weight:600}
.household-home.hh .hh-invite > summary:hover{background:#4a3a9c}
.household-home.hh .hh-invite[open] > summary{border-bottom:0}
.household-home.hh .hh-invite .household-invite-options{padding:16px}
.household-home.hh .household-invite-options > p,.household-home.hh .household-invite-empty{font-size:15px}
.household-home.hh .hh-section{display:block}
html[data-theme="dark"] .household-home.hh .hh-invite > summary{background:#a99bf0;color:#17142a}
html[data-theme="dark"] .household-home.hh .hh-invite{background:none!important;border:0!important}
html[data-theme="dark"] .household-home.hh .hh-invite > summary{background:#a99bf0!important;color:#17142a!important}
html[data-theme="dark"] .household-home.hh a.hh-row{color:#f1eef8!important}
html[data-theme="dark"] .household-home.hh .hh-item-main h3 a{color:#f1eef8!important}

/* History and Print history actions (November 2026) */
.journal-actions,.page-intro.report-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.journal-actions .button,.page-intro.report-actions > .button{white-space:nowrap}
@media (max-width:640px){
  .journal-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .journal-actions .button-primary{grid-column:1 / -1}
  .page-intro.report-actions{display:grid;grid-template-columns:1fr 1fr;align-items:stretch}
  .page-intro.report-actions > div{grid-column:1 / -1}
  .page-intro.report-actions > .button-primary{grid-column:1 / -1}
}
html[data-theme="dark"] .imports-matches {border-color: #3b3752;}
html[data-theme="dark"] .co-status-soon {border-color: #6b5a2e; background: #2f2a1c;}
html[data-theme="dark"] .co-badge-snoozed {background: #2c2a3b; color: #b9b6cc;}
html[data-theme="dark"] :is(.snooze-rule,.service-icon.snoozed) {background: #2c2a3b; color: #c4c1d6;}
html[data-theme="dark"] .fuel-card-badge {background: #3b2c1d; color: #f0c493;}
html[data-theme="dark"] .maintenance-gaps {background: #1f1d2b; border-color: #3b3752;}

/* Phones: 16px text stops iPhones zooming into a field (at the pump, and everywhere else);
   form fields get firmer borders and placeholders that stay readable in sunlight. */
@media (max-width: 640px) {
    html .main-content .field :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea),
    html .modal .field :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea) {font-size: 16px;}
    html .modal .modal-panel .field :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select) {min-height: 50px;}
    html:not([data-theme="dark"]) .modal .field :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {border-color: #a9a1b8;}
    html[data-theme="dark"] .modal .field :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {border-color: #6d6684;}
    html .modal .field input::placeholder {color: #7d778b;}
}
html[data-theme="dark"] .trends-page {--tr-gas: #b8782c; --tr-service: #00a090; --tr-other: #8573dc; --tr-line: #a99bf0; --tr-grid: #343045; --tr-axis: #aba5ba; --tr-surface: #24212f;}
html[data-theme="dark"] .tr-tag {background: #2c2a3b; color: #b9b6cc;}

/* ---- data colours ---- */
/* One meaning per colour on every chart and bar, light and dark:
   purple = your measured MPG and the highway share (town is its light tint),
   pink = the dash reading, mustard = gas, teal = service, slate = other costs.
   Overdue and due-soon bars take the coral and amber status colours. */
:root {
    --data-mpg: #5a48b5;
    --data-mpg-tint: #ddd6f3;
    --data-dash: #b46e8c;
    --data-gas: #b06f24;
    --data-service: #00897b;
    --data-other: #737a8f;
    --chart-primary: var(--data-mpg);
    --chart-fill-top: rgba(90,72,181,.14);
    --chart-fill-bottom: rgba(90,72,181,0);
}
html[data-theme="dark"] {
    --data-mpg: #a99bf0;
    --data-mpg-tint: #463e66;
    --data-dash: #e4b0cc;
    --data-gas: #c98a3e;
    --data-service: #00a090;
    --data-other: #9aa0b4;
    --chart-primary: var(--data-mpg);
    --chart-secondary: var(--data-dash);
    --chart-secondary-readable: var(--data-dash);
    --chart-fill-top: rgba(169,155,240,.2);
    --chart-fill-bottom: rgba(169,155,240,0);
}
@media print {
    html[data-theme] {
        --data-mpg: #5a48b5; --data-mpg-tint: #ddd6f3; --data-dash: #b46e8c;
        --data-gas: #b06f24; --data-service: #00897b; --data-other: #737a8f;
        --chart-primary: #5a48b5; --chart-fill-top: rgba(90,72,181,.14); --chart-fill-bottom: rgba(90,72,181,0);
    }
}
.car-overview, html[data-theme="dark"] .car-overview {--co-gas: var(--data-gas); --co-service: var(--data-service);}
.co-cost-other {background: var(--data-other);}
.co-mix-bar {background: var(--data-mpg-tint);}
.co-mix-bar span {background: var(--data-mpg);}
.co-progress-overdue span {background: #d0604f;}
.co-progress-soon span {background: #d9913a;}
html[data-theme="dark"] .co-progress-overdue span {background: var(--co-over);}
html[data-theme="dark"] .co-progress-soon span {background: var(--co-soon);}
.trends-page, html[data-theme="dark"] .trends-page {--tr-gas: var(--data-gas); --tr-service: var(--data-service); --tr-other: var(--data-other); --tr-line: var(--data-mpg);}
html .driving-mix-bar {background: var(--data-mpg-tint);}
html .driving-mix-bar i {background: var(--data-mpg);}
html .highway-dot {background: var(--data-mpg);}
html .city-dot {background: var(--data-mpg-tint);}
html .fuel-evidence-trend .legend-green, html :is(.legend-green,.overview-real-dot) {background: var(--data-mpg);}
html .fuel-evidence-trend .legend-purple, html :is(.legend-purple,.overview-computer-dot) {background: var(--data-dash);}
html[data-theme="dark"] .service-context-rule-actions .remove-rule {background: transparent;}
html[data-theme="dark"] .dashboard-overview .overview-welcome {background: var(--card); border-color: var(--line);}
html[data-theme="dark"] .vehicle-art {background: #3d3250;}
html[data-theme="dark"] .vehicle-art-2 {background: #293e34;}
/* Sign-in panel: the homepage's purple, and readable stats. */
.showcase-copy :is(h1,h2) em {color: #70538c;}
.showcase-stats small {font-size: 12px;}
/* Cost per mile counts every cost, so its bar is ink, not one category's colour. */
.trends-page .tr-track i {background: var(--ink);}
.logging-guide {display: flex; flex-direction: column; justify-content: center;}
html[data-theme="dark"] .car-overview a.co-mile.co-card:not(.co-x) {color: var(--co-ink) !important;}
