.login-brand-bar {display:flex;justify-content:space-between;align-items:center;gap:12px}
#theme-toggle {margin:0;padding:7px 12px;border:1px solid #849dbb;border-radius:7px;background:#172e49;color:white;font:600 13px/1.4 system-ui;cursor:pointer;white-space:nowrap}
#theme-toggle[aria-pressed=true] {background:#e2edf8;color:#142c48}
#theme-toggle:focus-visible {outline:3px solid #f2be50;outline-offset:2px}
html[data-theme=light] {color-scheme:light;color:#182e47;background:#eff4f9}
html[data-theme=light] body {background:#eff4f9;color:#182e47}
html[data-theme=light] header,html[data-theme=light] .login-brand-bar {background:#101d31;color:#fff;color-scheme:dark}
html[data-theme=light] .login-brand-bar {padding:10px 16px;border-radius:10px}
html[data-theme=light] :is(aside,.panel,.card,dialog,.derivative-group,.unit-card,.sold-card,.funder-pop,.notification-panel,.otr-summary,.report-tile,.stat-button,#review,.metric,.group-body) {background:#fff;color:#192f46;border-color:#b7c8d8}
html[data-theme=light] :is(.group-heading,.unit-highlight,.unit-extras,.registration-box,.otr-summary>div,.option-chip,.age-drill,th,.notification-entry.unread,.banner,aside button.on,.otr-total,.otr-select-grid,.otr-calc-layout .card,.unit-card .unit-extras,.dashEmpty) {background:#e3edf6;color:#183853;border-color:#bdcfdf}
html[data-theme=light] :is(.group-heading:hover,.report-tile:hover,.age-drill:hover,tr:hover) {background:#dceaf5}
html[data-theme=light] :is(.group-title,.group-derivative,.vehicle-derivative,.unit-price,.unit-facts b,.sold-details b,.registration-box strong,.otr-summary strong,.num,.unit-card .unit-facts b:not(.logbook-retained),.field b,.otr-calc-layout h2) {color:#182e47}
html[data-theme=light] :is(main,.panel,aside,dialog) :is(p,small,.small,.muted,.field,.tag,label,.funder-details,.unit-facts small,.group-chevron,.unit-highlight small,.registration-box .muted,.report-tile .small,.sold-details small,.otr-summary small,.notification-entry small,th,footer) {color:#445c73}
html[data-theme=light] :is(.vehicle-make-model,.unit-link,td button,.notification-entry button,main a:not([class]),aside button,.group-heading .vehicle-make-model) {color:#145b93}
html[data-theme=light] :is(input,select,textarea,.otr-select-grid select,.otr-calc-layout input) {color:#192f46;background:#fff;border-color:#8198ae}
html[data-theme=light] :is(.error,#dashError,.danger:not(button),[role=alert]) {color:#922c36}
html[data-theme=light] :is(.success,.ok) {color:#14623f}
html[data-theme=light] :is(th,td,.field,.editor-section,.table-wrap,.notification-entry) {border-color:#c6d3df}
html[data-theme=light] .notification-panel {color-scheme:light}
html[data-theme=light] .notification-panel small {color:#42586d}
html[data-theme=light] .unit-card .unit-facts .logbook-badge {color:white}
html[data-theme=light] :is(main,.panel,dialog) :focus-visible {outline:3px solid #1766a1;outline-offset:2px}
@media(max-width:750px){header:has(#theme-toggle){height:auto;min-height:74px;flex-wrap:wrap;padding-block:10px}}

/* Keep the product name next to the logo at desktop and mobile widths. */
.portal-brand {display:flex;align-items:center;gap:14px;flex-shrink:0}
.portal-brand-label {display:inline-flex;align-items:center;border-left:1px solid #526a84;padding:5px 0 5px 14px;color:#edf5ff;font:600 15px/1.2 system-ui;white-space:nowrap}
@media(max-width:680px){.portal-brand{gap:9px}.portal-brand-label{font-size:13px;padding-left:9px}.portal-brand .brand-logo{width:126px;height:40px}}

/* Explicit surface/text pairs for controls and content that carry their own colours. */
html[data-theme=light] {
 --portal-text:#192f46; --portal-muted:#42586e; --portal-link:#12568b;
 --portal-panel:#fff; --portal-inset:#e6eff7; --portal-border:#899eb1;
}
html[data-theme=light] :is(.derivative-full,.otr-total h1,.funder-details summary,.stock-vehicle-open strong,.edit-section-title,.unit-extras strong,.otr-summary .otr-max) {color:var(--portal-text)}
html[data-theme=light] .unit-extras strong {color:var(--portal-text)!important}
html[data-theme=light] :is(.stock-vehicle-open span,.unit-highlight small,.unit-facts small) {color:var(--portal-muted)}
html[data-theme=light] .stock-vehicle-open:hover strong {color:var(--portal-link);text-decoration:underline}
html[data-theme=light] :is(.report-tile:focus-visible,.age-drill:hover) {color:var(--portal-text)}
html[data-theme=light] .external-stock-actions {background:var(--portal-inset);border-color:var(--portal-border)}
html[data-theme=light] .external-stock-actions :is(.cap-label,.cap-label strong) {color:var(--portal-text)}
html[data-theme=light] .unit-card .unit-extras .option-chip {background:#d8e6f3;color:var(--portal-text)}
html[data-theme=light] .external-stock-btn.order {background:#794800!important;color:white!important}
html[data-theme=light] :is(dialog:has(.mwvc-full-editor),.mwvc-full-editor .actions,.mwvc-full-editor .vehicle-edit-group) {background:var(--portal-panel);color:var(--portal-text);border-color:var(--portal-border)}
html[data-theme=light] .mwvc-full-editor .vehicle-edit-group>summary {background:var(--portal-inset);color:var(--portal-text)}
html[data-theme=light] .mwvc-full-editor .vehicle-edit-group>summary:hover {color:var(--portal-link)}
html[data-theme=light] :is(#stockSaveError,#vehicleEditor [role=alert]) {color:#902636!important}
html[data-theme=light] #recoveryList {background:var(--portal-inset)!important;color:var(--portal-text)}
html[data-theme=light] .panel a[href="?setup=1"] {color:var(--portal-link)!important}
html[data-theme=light] :is(input,textarea)::placeholder {color:#516477;opacity:1}
html[data-theme=light] :is(.table td,.notification-panel,.actions,.filters) button.btn,
html[data-theme=light] button.btn {color:#fff;background:#165e98;border-color:#124c7d}
html[data-theme=light] button.btn.secondary {color:#183b5b;background:#e1ebf4;border-color:#839bb1}
html[data-theme=light] :is(.table td,.notification-panel,.actions,.filters) button.btn.secondary {color:#183b5b;background:#e1ebf4;border-color:#839bb1}
html[data-theme=light] button.btn.danger,html[data-theme=light] .actions button.btn.danger {background:#842b40;color:white}
html[data-theme=light] #notice {background:#164665;color:white}
html[data-theme=light] .panel.danger {background:#fff0f1;color:#852836}
html[data-theme=light] .panel.success {background:#e1f3e9;color:#155134}
html[data-theme=light] .logbook-detail-banner.logbook-alert,html[data-theme=light] .logbook-detail-banner.logbook-warning {background:#fff1d9;color:#664014}
html[data-theme=light] .logbook-detail-banner.logbook-ok {background:#e1f3e9;color:#155134}
