/* UI paint only. Existing page geometry, media, brand artwork, safe areas,
   scrolling and text direction remain owned by their feature stylesheets.
   Explicit theme selectors also cover dialogs whose CSS is loaded on demand. */
:root {
  /* Semantic paint contract. Light keeps its existing feature CSS; every
     appearance exposes the same roles to shared/lazy and native consumers. */
  --app-theme-bg:#e8edf4;--app-theme-surface:#ffffff;
  --app-theme-raised:#f1f5f9;--app-theme-subtle:#f6f8fb;
  --app-theme-ink:#10223f;--app-theme-muted:#596a80;
  --app-theme-line:#e9edf3;--app-theme-control-line:#8392a6;
  --app-theme-primary:#1764ba;--app-theme-primary-ink:#ffffff;
  --app-theme-accent:#1764ba;--app-theme-selected:#e8f4ff;
  --app-theme-danger:#a12c3b;--app-theme-danger-bg:#fff6f6;
  --app-theme-warning:#80570b;--app-theme-warning-bg:#fff3d9;
  --app-theme-success:#166647;--app-theme-success-bg:#e4f4ec;
  --app-theme-secondary:var(--app-theme-muted);
  --app-theme-background:var(--app-theme-bg);
  --app-theme-card-bg:var(--app-theme-surface);
  --app-theme-border:var(--app-theme-line);
  --app-theme-divider:var(--app-theme-line);
  --app-theme-text-primary:var(--app-theme-ink);
  --app-theme-text-secondary:var(--app-theme-muted);
  --app-theme-icon-default:var(--app-theme-muted);
  --app-theme-icon-active:var(--app-theme-accent);
  --app-theme-button-primary:var(--app-theme-primary);
  --app-theme-button-primary-text:var(--app-theme-primary-ink);
  --app-theme-button-secondary:var(--app-theme-raised);
  --app-theme-button-secondary-text:var(--app-theme-ink);
  --app-theme-button-outline:var(--app-theme-surface);
  --app-theme-button-outline-text:var(--app-theme-accent);
  --app-theme-input-bg:var(--app-theme-bg);
  --app-theme-input-border:var(--app-theme-control-line);
  --app-theme-focus-border:var(--app-theme-accent);
  --app-theme-chip-bg:var(--app-theme-selected);
  --app-theme-chip-text:var(--app-theme-accent);
  --app-theme-status-success:var(--app-theme-success);
  --app-theme-status-warning:var(--app-theme-warning);
  --app-theme-status-danger:var(--app-theme-danger);
  --app-theme-shadow-color:#10233b1a;
  --app-theme-shadow-sm:0 2px 8px var(--app-theme-shadow-color);
  --app-theme-shadow-md:0 8px 24px var(--app-theme-shadow-color);
  --app-theme-shadow-lg:0 18px 54px var(--app-theme-shadow-color);
  --app-theme-surface-fill:var(--app-theme-surface);
  --app-theme-header-bg:var(--app-theme-surface);
  --app-theme-nav-bg:var(--app-theme-surface);
  --app-theme-sheet-bg:var(--app-theme-surface);
  --app-theme-focus-ring:#1764ba33;
  --app-theme-scrim:#030811b8;
  /* Swatches preview the actual palettes, regardless of the selected theme. */
  --app-theme-preview-light:linear-gradient(110deg,#fff 0 68%,#1764ba 68%);
  --app-theme-preview-dark:linear-gradient(110deg,#172232 0 68%,#94c4ff 68%);
  --app-theme-preview-dark-gold:linear-gradient(110deg,#171e28 0 68%,#c4a366 68%);
  --app-theme-preview-diamond-light:linear-gradient(110deg,#edf3fa 0 68%,#265b91 68%);
  --app-theme-switch-bg:#f1f4f8;
  --app-theme-switch-ink:#30445d;
  --app-theme-switch-line:#cbd6e3;
  --app-theme-switch-selected:#fff;
  --app-theme-switch-accent:#1764ba;
}
.app-theme-switch {
  display:inline-grid;grid-template-columns:minmax(44px,.7fr) minmax(44px,.7fr) minmax(44px,1fr) minmax(44px,1.35fr);align-items:stretch;gap:2px;min-width:188px;max-width:100%;
  margin:0;padding:2px;border:1px solid var(--app-theme-switch-line);border-radius:10px;
  background:var(--app-theme-switch-bg);color:var(--app-theme-switch-ink);
  vertical-align:middle;box-sizing:border-box;
}
.side-drawer-header:has(>.app-theme-switch) { flex-wrap:wrap;gap:4px;padding-inline:0; }
.side-drawer-header>.app-theme-switch,.side-drawer-header>div.app-theme-switch { display:inline-grid;gap:2px;flex:1; }
.side-drawer-header:has(>.app-theme-switch)>.side-drawer-close { margin-inline-start:auto; }
.app-theme-switch[hidden] { display:none!important; }
.app-theme-switch>button {
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  min-width:44px;min-height:44px;max-width:100%;margin:0;padding:6px 3px;
  border:1px solid transparent;border-radius:7px;box-sizing:border-box;
  color:var(--app-theme-switch-ink);background:transparent;
  font-family:inherit;font-size:.8125rem;font-weight:600;line-height:1.35;
  white-space:normal;overflow-wrap:anywhere;cursor:pointer;touch-action:manipulation;
}
.app-theme-switch>button[aria-pressed=true] {
  color:var(--app-theme-switch-accent);background:var(--app-theme-switch-selected);
  border-color:var(--app-theme-switch-line);box-shadow:0 1px 3px #10243b12;
}
.app-theme-switch>button:focus-visible { outline:2px solid var(--app-theme-switch-accent);outline-offset:2px; }
.app-theme-switch>button::before {
  content:'';display:block;flex:none;width:24px;height:7px;border-radius:4px;
  background:var(--app-theme-preview);box-shadow:0 0 0 1px var(--app-theme-switch-line);
}
.app-theme-switch>button[data-app-theme=light] { --app-theme-preview:var(--app-theme-preview-light); }
.app-theme-switch>button[data-app-theme=dark] { --app-theme-preview:var(--app-theme-preview-dark); }
.app-theme-switch>button[data-app-theme=dark-gold] { --app-theme-preview:var(--app-theme-preview-dark-gold); }
.app-theme-switch>button[data-app-theme=diamond-light] { --app-theme-preview:var(--app-theme-preview-diamond-light); }
.app-theme-switch>button[aria-pressed=true] { border-color:var(--app-theme-switch-accent); }
/* One atomic palette paint; existing interaction transitions resume afterward. */
html[data-theme-changing=true] *,html[data-theme-changing=true] *::before,html[data-theme-changing=true] *::after {
  transition:none!important;
}
@media(max-width:360px) {
  .side-drawer-header>.app-theme-switch,.side-drawer-header>div.app-theme-switch { flex-basis:100%; }
}

html[data-theme="dark"] {
  color-scheme:dark;
  --zagros-color-scheme:dark;
  --zagros-welcome-ink:#edf3fc;
  --zagros-welcome-bg:#111c2b;
  --zagros-welcome-gradient:linear-gradient(145deg,#16273b,#0d1724);
  --zagros-welcome-gold:#e8c878;
  --app-theme-bg:#0d1521;
  --app-theme-surface:#172232;
  --app-theme-raised:#1e2d40;
  --app-theme-subtle:#202f43;
  --app-theme-ink:#edf3fc;
  --app-theme-muted:#b5c2d4;
  --app-theme-line:#43536a;
  --app-theme-control-line:#43536a;
  --app-theme-shadow-color:#03081166;
  --app-theme-accent:#94c4ff;
  --app-theme-primary:#1764ba;
  --app-theme-selected:#243f60;
  --app-theme-danger:#ffb3bb;
  --app-theme-danger-bg:#492b36;
  --app-theme-warning:#f5d184;
  --app-theme-warning-bg:#443923;
  --app-theme-success:#97e1bb;
  --app-theme-success-bg:#203f35;
  --app-theme-switch-bg:var(--app-theme-surface);
  --app-theme-switch-ink:var(--app-theme-muted);
  --app-theme-switch-line:var(--app-theme-line);
  --app-theme-switch-selected:var(--app-theme-selected);
  --app-theme-switch-accent:var(--app-theme-accent);
  --ink:var(--app-theme-ink);--muted:var(--app-theme-muted);
  --line:var(--app-theme-line);--soft:var(--app-theme-subtle);
  /* Keep the existing filled brand colors, and use a separate readable link color. */
  --blue:#0b71ed;--brand:#183d30;--gold:#e8c878;
  background:var(--app-theme-bg);color:var(--app-theme-ink);
}
/* Premium appearances add paint tokens, not new page layouts. Shared aliases
   keep lazy dialogs and future shared controls on the same palette. */
html[data-theme="dark-gold"] {
  color-scheme:dark;
  --zagros-color-scheme:dark;
  --zagros-welcome-ink:var(--app-theme-ink);
  --zagros-welcome-bg:var(--app-theme-bg);
  --zagros-welcome-gradient:radial-gradient(ellipse at 50% 38%,#302b23,#171e28 48%,#0d1219);
  --zagros-welcome-gold:var(--app-theme-accent);
  --zagros-welcome-accent:linear-gradient(90deg,#775523,#e0c38a,#775523);
  --app-theme-bg:#0d1219;
  --app-theme-surface:#171e28;
  --app-theme-raised:#242b35;
  --app-theme-subtle:#20262f;
  --app-theme-ink:#f5f1e8;
  --app-theme-muted:#bfc3cb;
  --app-theme-line:#45423b;
  --app-theme-control-line:#807565;
  --app-theme-accent:#e0c38a;
  --app-theme-primary:#c4a366;
  --app-theme-primary-ink:#101722;
  --app-theme-primary-strong:#775523;
  --app-theme-selected:#332d23;
  --app-theme-secondary:#d3bd93;
  --app-theme-card-bg:linear-gradient(145deg,#202832,#171e28);
  --app-theme-surface-fill:linear-gradient(160deg,#1d2530,#171e28 65%);
  --app-theme-header-bg:linear-gradient(110deg,#242932,#181f29);
  --app-theme-nav-bg:linear-gradient(180deg,#232a33,#171e28);
  --app-theme-sheet-bg:linear-gradient(150deg,#212832,#171e28 60%);
  --app-theme-media-control-bg:#171e28f5;
  --app-theme-media-control-ink:#e0c38a;
  --app-theme-media-label-bg:#171e28ed;
  --app-theme-media-label-ink:#f5f1e8;
  --app-theme-focus-ring:#e0c38a40;
  --app-theme-shadow-color:#00000055;
  --app-theme-scrim:#060b13b8;
  --app-theme-danger:#ffb3bb;
  --app-theme-danger-bg:#492b36;
  --app-theme-warning:#f5d184;
  --app-theme-warning-bg:#443923;
  --app-theme-success:#97e1bb;
  --app-theme-success-bg:#203f35;
  --app-theme-diamond-ink:#94c4ff;
  --app-theme-diamond-bg:#243f60;
}
html[data-theme="diamond-light"] {
  color-scheme:light;
  --zagros-color-scheme:light;
  --zagros-welcome-ink:var(--app-theme-ink);
  --zagros-welcome-bg:var(--app-theme-bg);
  --zagros-welcome-gradient:radial-gradient(ellipse at 50% 38%,#ffffff,#edf4fc 60%,#dce8f5);
  --zagros-welcome-gold:var(--app-theme-accent);
  --zagros-welcome-accent:linear-gradient(90deg,#a8c2dc,#265b91,#a8c2dc);
  --app-theme-bg:#eef3fa;
  --app-theme-surface:#fbfdff;
  --app-theme-raised:#e8f0f9;
  --app-theme-subtle:#edf3fa;
  --app-theme-ink:#182e4b;
  --app-theme-muted:#50647d;
  --app-theme-line:#d1deee;
  --app-theme-control-line:#71859e;
  --app-theme-accent:#24568b;
  --app-theme-primary:#265b91;
  --app-theme-primary-ink:#ffffff;
  --app-theme-primary-strong:#24568b;
  --app-theme-selected:#dceafb;
  --app-theme-secondary:#4b6688;
  --app-theme-card-bg:linear-gradient(145deg,#ffffff,#f2f7fe);
  --app-theme-surface-fill:linear-gradient(155deg,#ffffff,#edf3fa);
  --app-theme-header-bg:linear-gradient(110deg,#ffffff,#e6eff9);
  --app-theme-nav-bg:linear-gradient(180deg,#ffffff,#e7eff9);
  --app-theme-sheet-bg:linear-gradient(150deg,#ffffff,#f2f7fe 65%);
  --app-theme-media-control-bg:#f5f9fff5;
  --app-theme-media-control-ink:#24568b;
  --app-theme-media-label-bg:#f5f9fff2;
  --app-theme-media-label-ink:#182e4b;
  --app-theme-focus-ring:#265b9133;
  --app-theme-shadow-color:#294b751a;
  --app-theme-scrim:#182e4b66;
  --app-theme-danger:#9e2636;
  --app-theme-danger-bg:#fbe9ec;
  --app-theme-warning:#80570b;
  --app-theme-warning-bg:#fff3d9;
  --app-theme-success:#166647;
  --app-theme-success-bg:#e4f4ec;
  --app-theme-diamond-ink:#1e5f98;
  --app-theme-diamond-bg:#e1effc;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) {
  --app-theme-switch-bg:var(--app-theme-surface);
  --app-theme-switch-ink:var(--app-theme-muted);
  --app-theme-switch-line:var(--app-theme-control-line);
  --app-theme-switch-selected:var(--app-theme-selected);
  --app-theme-switch-accent:var(--app-theme-accent);
  --ink:var(--app-theme-ink);--muted:var(--app-theme-muted);
  --line:var(--app-theme-line);--soft:var(--app-theme-subtle);
  /* Legacy feature accents share the palette. The strong alias remains safe
     behind legacy white button text; promotion artwork keeps its meaning. */
  --blue:var(--app-theme-primary-strong);--brand:var(--app-theme-primary-strong);--gold:#e8c878;
  --app-theme-directory-ink:var(--app-theme-ink);
  --app-theme-directory-muted:var(--app-theme-muted);
  --app-theme-directory-paper:var(--app-theme-surface);
  --app-theme-directory-soft:var(--app-theme-subtle);
  --app-theme-directory-line:var(--app-theme-line);
  --app-theme-directory-blue:var(--app-theme-accent);
  --app-theme-directory-primary:var(--app-theme-primary);
  --app-theme-directory-primary-ink:var(--app-theme-primary-ink);
  --app-theme-directory-accent:var(--app-theme-accent);
  background:var(--app-theme-background);color:var(--app-theme-text-primary);
}
/* Preserve the existing Dark directory palette exactly while sharing its
   component paint rules with premium appearances. */
html[data-theme="dark"] {
  --app-theme-directory-ink:#edf3fb;
  --app-theme-directory-muted:#b0bfd1;
  --app-theme-directory-paper:#111e2e;
  --app-theme-directory-soft:#1b2b40;
  --app-theme-directory-line:#31445c;
  --app-theme-directory-blue:#2474cf;
  --app-theme-directory-primary:#1764ba;
  --app-theme-directory-primary-ink:#ffffff;
  --app-theme-directory-accent:#83bbff;
}

html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body {
  background:var(--app-theme-bg)!important;color:var(--app-theme-ink)!important;
}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) :is(.admin-account-control,.ac-dialog) {
  --ac-ink:var(--app-theme-ink);--ac-muted:var(--app-theme-muted);
  --ac-line:var(--app-theme-line);--ac-accent:var(--app-theme-accent);
}

/* Primary surfaces include body-appended dialogs and lazy-loaded modules. */
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(
  .app-shell,.admin-shell,.surface,.sidebar,.panel,.stat-card,.car-card,.showroom-card,
  .section-advertisements,.section-ad-frame,
  .my-account-summary,.account-listing-card,.account-empty-state,.account-summary-grid>div,
  .public-car-card,.my-showroom-card,.owner-section,.owner-car-item,.map-picker,
  .lorry-card,.parts-listing-card,.parts-shop-card,.parts-choice,
  .auth-session-panel,.post-ad-menu,.post-ad-option,.vehicle-wizard-card,.vehicle-wizard-step,
  .wizard-finance-fields,.vehicle-review-grid>div,.vehicle-promotion-option,
  .public-section-view,.public-provider-card,.section-listing-card,.section-provider-card,
  .public-showroom-profile,.public-info-card,.public-post-page,.post-info-card,.post-inventory-card,
  .post-inventory-item,.office-inventory-header,.office-inventory-about,.office-directory-card,
  .rental-card,.inventory-card,.empty-panel,.welcome-card,.recovery-driver-dashboard,
  .recovery-card,.recovery-driver-row,.recovery-results-panel,.recovery-location-copy,
  .recovery-confirm-location,.recovery-map-notices>p,.recovery-map-notices>.recovery-results-error,
  .sell-form-card,.auth-card,.my-account-card,.account-card,.business-menu-panel,
  .admin-hub-card,.admin-section-card,.admin-management-card,.admin-record-detail,
  .section-record-card,.showroom-admin-card,.showroom-admin-profile,.showroom-admin-inventory,
  .approval-card,.am-summary-card,.am-owner,.am-more-actions,.as-row,.hq-row,.hq-service,.hq-rule,
  .at-item,.lo-row,.ops-stat,.ops-chart,.ops-row,.security-account-row,.gov-card,.pm-card,
  .ad-editor-panel,.ad-menu-items,.ad-selected-listing,.admin-role-editor,.admin-permission-grid label,
  .vehicle-catalog-form-grid form,.vehicle-catalog-model,.global-record-full-details,
  .payment-metrics article,.payment-metrics article:first-child,.subscription-panel,
  .listing-promotion-card,.customer-promotion-tier,.customer-promotion-package,.credit-wallet,
  .credit-choice,.credit-admin-tier,.credit-shared-balance,.home-control-card,.vehicle-brand-panel,.commercial-selector-options,
  .global-thread,.global-notification,.favorite-record,.saved-search-row,.saved-search-plan,.app-governance-update,
  .business-picker button,.inventory-counts>div,.review-grid>div,.as-summary>div,.hq-summary>div,
  .ah-summary>div,.at-summary>div,.lo-summary>div,.ad-stat,.ad-list,.ad-record,
  dialog,.am-login>main,.global-language-menu,.side-drawer-panel,.side-drawer-admin
) {
  background:var(--app-theme-surface)!important;color:var(--app-theme-ink)!important;
  border-color:var(--app-theme-line)!important;
}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(#publicSectionScreen,#myAccountScreen,#showroomOwnerScreen) {
  background:var(--app-theme-bg)!important;color:var(--app-theme-ink)!important;
}
/* Headers/footers keep their existing sticky/fixed behavior and safe-area padding. */
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(
  .bottom-nav,.shortcut-bar,.post-toolbar,.post-contact-footer,.business-header,
  .editor-footer,.painted-footer,.rental-editor-actions,.global-message-compose,.vehicle-wizard-actions,
  .account-security-dialog>header,.saved-search-dialog>header,.app-governance-header,
  .approval-review>header,.approval-review-bar,.approval-review-content,.approval-actions,
  .home-ad-detail>header,.home-ad-detail-body,.home-ad-detail-actions,
  .home-control-header,.home-control-editor-footer,.ad-manager-header,.ad-management-table th,
  .am-admin-table th,.payments-panel th,.admin-help-management th,.table-head,
  .ac-dialog-header,.as-dialog-header,.hq-dialog-head,.lo-dialog header,
  .security-admin-dialog>header,.recovery-results-panel>summary
) {
  background:var(--app-theme-surface)!important;color:var(--app-theme-ink)!important;
  border-color:var(--app-theme-line)!important;
}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(.admin-shell.is-hub,.public-favorites,.payments-panel,.pm-admin,.admin-account-safety,.admin-health-qa,.admin-management,.admin-trash,.admin-governance,.admin-security-operations,.admin-help-management) {
  color:var(--app-theme-ink)!important;
}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(.admin-shell,dialog) :is(h1,h2,h3,h4),
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body .approval-dashboard-heading h2 {
  color:var(--app-theme-ink)!important;
}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) .app-shell:not(:has(#homeScreen:not([hidden])))>.top-header,
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) .app-shell:not(:has(#homeScreen:not([hidden])))>.top-header::before {
  background:var(--app-theme-surface)!important;border-color:var(--app-theme-line)!important;
}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(
  .search-field,.filter-button,.buy-toolbar-filter,.ac-search,.ac-header>.ac-tabs,.auth-mode-tabs,.language-switcher,
  .car-image-wrap,.lorry-media,.rental-card-media,.rental-photo-link,.office-photo,
  .editor-steps,.am-audit-filters,.approval-tab strong,.ac-count,.as-badge,.hq-badge,.lo-badge,
  .badge,.payment-test,.checkout-test,.checkout-method,.commercial-selector-manual,
  .customer-promotion-select,.credit-inline-help,.credit-admin-field,.credit-mini,
  .record-image-error,.empty-cars,.at-empty,.as-empty,.hq-empty,.lo-empty,.am-empty,.ah-empty,
  .ops-empty,.customer-promotion-empty,.saved-search-empty,.saved-search-note,
  .report-target,.zt-confirm-record,.as-notice,.hq-notice,.security-notice,.lo-note,.ops-note,
  .wizard-upload,.owner-lock-note,.owner-reference-note,.owner-moderation-note,.ad-enabled,
  .gov-note,.gov-count,.gov-empty,.pm-system,.pm-account-summary,.payment-metrics article,
  .public-description,.post-rental-prices>div,.post-detail-field,.post-seller-type,
  .post-inventory-media-fallback,.office-inventory-empty,.lorry-ids>span,.rental-source>span,.global-message,
  .recovery-message,.recovery-location-hint,.recovery-form-note,.section-gold-empty,
  .painted-status,.painted-choice,.favorite-record-media
) {
  background:var(--app-theme-subtle)!important;color:var(--app-theme-ink)!important;
  border-color:var(--app-theme-line)!important;
}
/* Only the gallery backing changes; image pixels and contain sizing do not. */
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(.public-post-page .vehicle-gallery,.rental-gallery-stage) {
  background:var(--app-theme-bg)!important;
}

/* Native controls: no changes to dimensions, input types, validity or keyboard flow. */
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]),
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(.commercial-selector-trigger,.vehicle-brand-toggle) {
  background:var(--app-theme-bg)!important;color:var(--app-theme-ink)!important;
  border-color:var(--app-theme-control-line,var(--app-theme-line))!important;caret-color:var(--app-theme-ink);
}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(.search-field,.filter-button,.buy-toolbar-filter,.ac-search,.language-switcher,.auth-mode-tabs) {
  border-color:var(--app-theme-control-line,var(--app-theme-line))!important;
}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(input,textarea)::placeholder {
  color:var(--app-theme-muted)!important;opacity:1;
}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(input,select,textarea)[readonly] { background:var(--app-theme-subtle)!important; }
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(form label,form legend,.vehicle-wizard-step legend,.vehicle-wizard-card h2,.vehicle-review-section h3,.vehicle-review-grid b,.account-summary-grid dd,.public-info-card b,.public-car-body h3,.account-listing-title,.my-account-header h1,.my-listings-heading h2,.my-account-summary-heading h2,.post-ad-menu-header h2,.account-empty-state h3,.am-summary-card>strong,.vehicle-catalog-form-grid b,.vehicle-catalog-block h3,.vehicle-catalog-row b,.global-record-overview>b,.admin-account-heading b,.ad-editor-panel h3,.ad-editor-panel legend) { color:var(--app-theme-ink)!important; }
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(input[type=checkbox],input[type=radio],input[type=range]) { accent-color:var(--app-theme-primary); }
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(button,a,input,select,textarea,summary):focus-visible {
  outline-color:var(--app-theme-accent)!important;
}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(input,select,textarea)[aria-invalid=true],
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(.wizard-invalid,.commercial-selector-trigger[aria-invalid=true],.vehicle-brand-toggle[aria-invalid=true]) {
  border-color:var(--app-theme-danger)!important;
}

/* Neutral controls are explicit so photograph controls and overlaid copy keep
   their original appearance. This list includes on-demand form/dialog actions. */
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(
  dialog button,.panel button,.admin-shell button,.business-menu-panel button,.business-menu-panel a,
  .business-header button,.business-menu>summary,.business-account-centers button,
  .side-drawer-links button,.side-drawer-account,.side-drawer-close,.side-drawer-admin button,
  .surface button:where(:not(.rental-choice)),.auth-options button,.editor-steps button,.card-actions button,
  .vehicle-wizard-card button,.my-account-add-button,.outline-account-button,.account-listing-actions button,
  .account-quick-action,.account-photo-item button,.owner-car-actions button,.owner-location-controls button,
  .public-car-view,.parts-view-shop,.parts-view-listing,.parts-item-main,.lorry-view,.showroom-city-chip,
  .post-ad-menu-close,.post-ad-option,.car-photo-action,.owner-manage-button,
  .inventory-toolbar button,.inventory-filters button,.welcome-actions button,.entry-back,
  .dashboard-heading button,.additional-business button,.business-summary button,.business-contact-verification button,
  .recovery-driver-dashboard button,.recovery-location-tools button,.recovery-expand-toggle,
  .recovery-map-home,.recovery-pager button,.recovery-more button,.recovery-location-copy button,
  .recovery-confirm-location button,.recovery-results-error button,.recovery-contact-actions a,
  .marketplace-back,.showroom-nav-button,.showroom-home-button,.listing-card-view,
  .section-listing-card-view,.public-section-view button:where(:not(.rental-choice)),.rental-surface button:where(:not(.rental-choice)),
  .rental-market-toolbar>button,.lorry-toolbar>button,.post-back,.post-inventory-view,
  .post-related-action,.post-location-link,.post-contact-footer>button[data-contact-channel=messaging],
  .global-contact-bar>a,.global-contact-bar>button,
  .record-customer-actions button,.record-customer-actions a,.global-message>button,
  .favorite-record-view,.global-notification-confirm button,.global-language-menu>button,.app-governance-update button
) {
  background:var(--app-theme-raised)!important;color:var(--app-theme-ink)!important;
  border-color:var(--app-theme-control-line,var(--app-theme-line))!important;
}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :where(#verifyAdminContact,#refresh) {
  background:var(--app-theme-raised)!important;color:var(--app-theme-ink)!important;border-color:var(--app-theme-line)!important;
}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(
  .bottom-nav>button,.bottom-nav>button>i,.shortcut-bar button,.shortcut-bar button>i,
  .icon-button,.global-language-trigger,.side-nav button,.settings,.home-button,.view-all,
  .admin-access-gate,.breadcrumb b,.status-bar,.admin-brand,.business-brand,
  .section-listing-card-copy h2,.section-listing-card-copy>strong,.car-card-body h2,
  .showroom-card-body h2,.section-record-copy h3,.approval-card h3,.at-item h3,
  .public-showroom-heading h1,.marketplace-heading h1,.sell-form-heading h2,.showroom-page-header h1,
  .showroom-intro h2,.post-detail-fields dd,.office-card-copy>strong,.am-header h2,.am-header h3,.am-admin-name,
  .am-summary-card>strong,.inventory-counts strong,.recovery-driver-row strong,.recovery-action-card strong,
  .favorite-record-copy strong,.checkout-summary dd,.checkout-result-icon
) { color:var(--app-theme-ink)!important; }
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(
  .marketplace-heading p,.marketplace-subtitle,.sell-form-heading p,.form-intro,.car-specs,.car-city,
  .showroom-page-header p,.showroom-intro p,.showroom-list-subtitle,.public-showroom-heading p,
  .section-listing-card-copy p,.section-listing-card-copy small,.section-record-copy p,.section-record-copy small,
  .post-city,.post-ka,.post-owner-ka,.post-detail-fields dt,.post-detail-fields dt i,.post-inventory-item small,
  .post-rental-prices span,.post-contact-footer .contact-fallback,.vehicle-detail-extra dt,
  .office-inventory-summary p,.office-card-copy>span,.office-card-copy>small,
  .rental-card-body>p,.rental-price-row span,.rental-source,.rental-card-footer small,
  .inventory-card p,.business-picker small,.business-summary #businessPolicy,.welcome-card-caption>span,
  .welcome-credits,.login-types,.recovery-driver-kind,.recovery-driver-summary bdi,.recovery-driver-row small,
  .recovery-location-hint,.recovery-form-note,.record-secondary,.record-fields dt,.record-analytics dt,
  .approval-card p,.approval-message,.approval-filter,.approval-actions>label,.approval-review-meta dt,
  .approval-fields dt,.approval-hint,.approval-provider-type,.section-record-meta,.section-record-reference,
  .ac-feedback,.ac-row-contact,.ac-row-meta,.ac-ka,.ac-pagination,.ac-fields dt,
  .as-meta,.as-reason,.as-meta-pair>span:first-child,.as-row-state time,.as-row-state small,
  .hq-meta,.hq-meta-pair>span:first-child,.hq-row-main>small,.hq-row-main>p,.hq-service p,
  .ah-message,.ah-result-count,.lo-meta,.lo-message,.ops-stat small,.ops-row p,.ops-note,
  .am-owner-email,.am-admin-email,.am-admin-last-active,.am-audit-identity time,.am-audit-action strong,
  .at-item-meta,.at-ka-id,.at-deletion-details,.at-message,.at-result-count,.at-explanation,
  .gov-copy small,.gov-history small,.gov-info dt,.gov-grid .gov-card>small,.security-account-row small,
  .pm-muted,.pm-feedback,.payment-muted,.payment-details dt,.checkout-summary dt,.checkout-method small,
  .listing-promotion-card small,.customer-promotion-tier-message,.promotion-setting-hint,
  .credit-wallet small,.credit-choice small,.credit-admin-hint,.credit-duration,
  .home-control-header p,.home-control-hint,.home-control-image-row p,.home-control-message,
  .ad-manager-intro,.ad-list-meta,.ad-eyebrow,.ad-stat span,.ad-identity-wrap small,
  .global-thread p,.global-thread time,.global-messages time,.global-notification-copy small,
  .global-notification .notification-read-status,.favorite-record-copy small,.security-session small,
  .global-chat-safety small,.app-governance-policy small,.saved-search-row p,.saved-search-message,.saved-search-plan span,
  .painted-heading p,.painted-status,.painted-selection-summary small,.painted-readonly-summary p,.painted-legend-item,.painted-requirement,
  .zt-confirm-message,.zt-confirm-record span,.zagros-content-report small,
  .auth-step-message,.auth-session-panel small,.post-ad-menu-header p,.my-account-header p,.my-listings-heading p,
  .my-account-summary-heading p,.account-summary-grid dt,.account-listing-meta,.account-photo-input small,
  .vehicle-wizard-step label small,.wizard-optional-grid small,.wizard-help,.vehicle-review-grid small,
  .vehicle-review-section dt,.vehicle-review-media figcaption,.vehicle-promotion-option small,.vehicle-promotion-option em,
  .vehicle-wizard-progress span,.vehicle-wizard-progress small,.vehicle-wizard-success p,.lorry-specs,.lorry-meta,.lorry-ids,
  .parts-reference,.parts-results-count,.parts-choice small,.public-info-card small,.public-inventory-heading p,
  .public-car-body p,.showroom-form-intro,.owner-account-method>p,.owner-verification-note,
  .map-picker-heading small,.car-photo-upload>p,.owner-car-item p,.showroom-vehicle-specs,.showroom-vehicle-description,
  .showroom-source-card p,.showroom-source-card small,.my-showroom-card small,.showroom-card-city,.showroom-meta,
  .stat-card p,.stat-card small,.panel-heading p,.activity-list small,.listing-name small,.admin-section-card p,
  .global-record-overview small,.global-record-item dt,.admin-account-heading small,.vehicle-catalog-row small,
  .ad-field-hint,.ad-upload small,.home-advertisement-text-control p,.home-advertisement-text-control small,
  .ad-listing-choice small,.ad-selected-listing small,.ad-table-dates span+span,
  .breadcrumb,.admin-profile small,.page-heading>div>p:last-child,.admin-workspace-empty,
  .admin-hub-card p,.admin-hub-card small,.business-brand small,.side-drawer-admin>span
) { color:var(--app-theme-muted)!important; }
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(
  a:where(:not(.brand):not(.business-brand):not(.admin-brand)),.car-price,.section-listing-card-price,
  .account-listing-price,.public-car-body strong,.showroom-vehicle-price,.lorry-price,.parts-price,
  .post-price,.post-rental-prices strong,.post-seller-link,.zagros-report-actions button,
  .office-card-copy .office-view-action,.rental-price-row strong,.public-favorites .favorite-record-copy b,
  .recovery-row-distance,.record-reference,.record-title-link,.hub-open,.ac-view,
  .bottom-nav>.active-nav,.bottom-nav>.active-nav>i,.view-all,.car-specs i,.car-city i
) { color:var(--app-theme-accent)!important; }

/* Selected controls and primary actions remain distinct from neutral controls. */
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(
  .side-nav button.active,.language-switcher button.active,.global-language-menu>button[aria-checked=true],
  .auth-options button[aria-pressed=true],.auth-mode-tabs button.active,
  .approval-tab[aria-selected=true],.ac-tabs button.active,.ac-types button.active,
  .as-tabs button.active,.hq-tabs button.active,.lo-tabs button.active,.gov-tabs button.active,
  .pm-tabs button[aria-current=page],.payment-tabs a[aria-current],.section-manager-tabs>button[aria-pressed=true],
  .section-manager-tabs>button[aria-selected=true],.section-manager-tabs>button.active,
  .admin-quick-views button[aria-pressed=true],.business-picker button[aria-pressed=true],
  .listing-promotion-card.is-selected,.customer-promotion-package.is-selected,
  .credit-choice:has(input:checked),.saved-search-plan:has(input:checked),
  .commercial-selector-option[aria-pressed=true],.painted-state-option[aria-pressed=true],
  .wizard-make-option.selected,.vehicle-promotion-option.selected,.vehicle-wizard-progress span.active,
  .owner-method-option input:checked+span,.showroom-city-chip[aria-pressed=true],.account-photo-item button.is-main,
  .ad-target-options label:has(input:checked),
  .home-control-tabs button[aria-selected=true],.home-control-position-grid button[aria-pressed=true]
) {
  background:var(--app-theme-selected)!important;color:var(--app-theme-accent)!important;
  border-color:var(--app-theme-accent)!important;
}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(
  .primary,.primary-button,.home-button,.publish-button,.sell-car-button,.register-showroom-button,
  .showroom-submit-button,.owner-verification-button,.account-listing-actions .primary-action,
  .recovery-primary,.checkout-primary,.buy-filter-apply,.painted-save,.saved-search-primary,
  .report-submit,.app-governance-primary,.credit-primary,.commercial-listing-actions button[type=submit],
  .listing-promotion-actions button[type=submit],.subscription-panel button[type=submit],
  .ac-primary,.as-primary,.hq-primary,.ah-primary,.am-primary,.pm-primary,.gov-primary,
  .ad-primary,.home-control-primary,.promotion-save,.promotion-dialog-actions button[type=submit],
  .global-message-compose button,.admin-access-gate a,.am-login button[type=submit],
  .post-contact-footer>a[data-contact-channel=call]
) {
  background:var(--app-theme-primary)!important;color:var(--app-theme-primary-ink,#fff)!important;border-color:var(--app-theme-primary)!important;
}

/* Semantic states are paint-only; status values and moderation rules do not change. */
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(
  .warning,.badge.warn,.badge.gold,.ac-status-held,.ac-status-suspended,.ac-status-pending,
  .ac-additional-status .active,.ac-additional-status .active>.ac-count,.approval-status,
  .approval-badge.GOLD,.section-record-badge.GOLD,.section-record-badge.held,.section-record-badge.pending,
  .as-status-under_review,.as-status-suspend,.as-status-suspended,.as-status-held,
  .hq-state-warning,.hq-state-investigating,.hq-state-rate_limited,.hq-state-new,
  .lo-status-pending_payment,.lo-status-review_required,.payment-status-pending,
  .record-management .hold,.record-management .gold,.showroom-admin-action.gold,
  .account-status-pill.is-held,.listing-status-pill.is-held,.listing-status-pill.is-hidden,.record-status.held,
  .recovery-hold-notice,.recovery-target-banner,.am-status.held,.at-expiring .at-recovery
) { color:var(--app-theme-warning)!important;background:var(--app-theme-warning-bg)!important;border-color:var(--app-theme-warning)!important; }
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(
  .badge.live,.ac-status-active,.ac-badge:not([class*=ac-status-]),.approval-status.approved,
  .account-status-pill:not(.is-held),.listing-status-pill:not(.is-held):not(.is-hidden):not(.is-sold),
  .ad-status-active,.showroom-car-status:not(.sold),
  .section-record-badge.active,.section-record-badge.approved,.as-status-resolved,.as-status-active,.as-status-reactivate,
  .hq-state-healthy,.hq-state-passed,.hq-state-delivered,.hq-state-resolved,.hq-state-reviewed,
  .payment-status-paid,.am-status.active,.ah-status.active,.gov-verified,.app-verified-badge,
  .record-management .activate,.approval-card-actions>.approve,.approval-action.approve,
  .global-contact-bar>[data-contact-channel=whatsapp],.post-contact-footer>[data-contact-channel=whatsapp],
  .recovery-contact-actions .recovery-whatsapp,.global-message.mine,.recovery-message.mine,
  .saved-search-success,.home-control-saved,.at-restore
) { color:var(--app-theme-success)!important;background:var(--app-theme-success-bg)!important;border-color:var(--app-theme-success)!important; }
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(.global-contact-bar,.post-contact-footer,.recovery-contact-actions) :is(a[data-contact-channel=whatsapp],a.recovery-whatsapp) {
  color:var(--app-theme-success)!important;background:var(--app-theme-success-bg)!important;border-color:var(--app-theme-success)!important;
}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(
  .ac-status-blocked,.ac-status-deleted,.approval-status.rejected,.section-record-badge.deleted,.section-record-badge.rejected,
  .as-status-block,.as-status-blocked,.hq-state-down,.hq-state-failed,.hq-state-review_required,
  .payment-status-failed,.payment-status-cancelled,.lo-status-expired,.pm-badge.off,.ops-status.failed,
  .ac-danger,.as-danger,.as-danger-solid,.ah-danger,.am-danger,.pm-danger,.saved-search-danger,
  .record-management .delete,.showroom-admin-action.delete,.approval-card-actions>.decline,
  .account-listing-actions .danger-action,.owner-car-actions .danger,.car-photo-action.danger,.account-photo-item .photo-remove,
  .approval-action.decline,.approval-action.delete,.approval-confirm-actions .decline,.at-purge,
  .zt-confirm-submit,#myAccountLogout,#drawerLogout
) { color:var(--app-theme-danger)!important;background:var(--app-theme-danger-bg)!important;border-color:var(--app-theme-danger)!important; }
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(
  [role=alert],.am-error,.payment-error,.checkout-error,.commercial-listing-error,
  .media-upload-error,.zt-confirm-error,.app-governance-error,.home-control-error,.ad-error,
  .hq-inline-issue,.ops-error,.recovery-results-error,#recoveryError
) { color:var(--app-theme-danger)!important; }
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(.approval-badge.DIAMOND_PLUS,.section-record-badge.DIAMOND_PLUS,.section-record-badge.DIAMOND,.record-management .vip,.showroom-admin-action.vip) {
  background:var(--app-theme-diamond-bg,var(--app-theme-selected))!important;color:var(--app-theme-diamond-ink,var(--app-theme-accent))!important;
}

/* Map tiles, truck symbols, media overlays and logos are deliberately untouched. */
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(.leaflet-popup-content-wrapper,.leaflet-popup-tip,.leaflet-tooltip,.leaflet-control-attribution,.leaflet-control-zoom a) {
  background:var(--app-theme-surface)!important;color:var(--app-theme-ink)!important;border-color:var(--app-theme-line)!important;
}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(dialog,.modal-backdrop)::backdrop { background:#030811c9!important; }
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) .modal-backdrop { background:#030811b8!important; }
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(.toast,.zagros-trash-toast) { background:var(--app-theme-raised)!important;color:var(--app-theme-ink)!important; }
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) .app-theme-switch>button {
  background:transparent!important;color:var(--app-theme-switch-ink)!important;border-color:transparent!important;
}
html:is([data-theme="dark"],[data-theme="dark-gold"],[data-theme="diamond-light"]) .app-theme-switch>button[aria-pressed=true] {
  background:var(--app-theme-switch-selected)!important;color:var(--app-theme-switch-accent)!important;border-color:var(--app-theme-switch-line)!important;
}
/* Premium navigation paint is paired; semantic count dots and promotion
   artwork are not part of these icon selectors. */
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body :is(.side-drawer-links i,.side-drawer-account i,.side-drawer-admin i,.menu-button,.notification-button) {
  color:var(--app-theme-accent)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body .bottom-nav>.post-button>i {
  background:var(--app-theme-primary)!important;color:var(--app-theme-primary-ink)!important;
  border-color:var(--app-theme-surface)!important;box-shadow:var(--app-theme-shadow-sm)!important;
}

/* Premium role consumers. One mapping serves both palettes, including UI
   mounted after startup. These are paint overrides, never layout or state.
   The customer scope also reaches dialogs appended alongside .app-shell. */
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) {
  background:var(--app-theme-background)!important;color:var(--app-theme-text-primary)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .app-shell,#homeScreen,#publicSectionScreen,#myAccountScreen,#showroomOwnerScreen
) { background:var(--app-theme-background)!important;color:var(--app-theme-text-primary)!important; }
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .top-header,.post-toolbar,.marketplace-heading,.showroom-page-header,.account-security-dialog>header,
  .saved-search-dialog>header,.app-governance-header,.home-ad-detail>header,.global-modal>header
) {
  background:var(--app-theme-header-bg)!important;color:var(--app-theme-text-primary)!important;
  border-color:var(--app-theme-divider)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .app-shell>.top-header::before,.app-shell>.top-header::after
) { background:var(--app-theme-header-bg)!important; }
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body .app-shell:not(:has(#homeScreen:not([hidden])))>.top-header,
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body .app-shell:not(:has(#homeScreen:not([hidden])))>.top-header::before,
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body .app-shell.single-control-row:has(>#publicSectionScreen.marketplace-directory:not([hidden]))>.top-header {
  background:var(--app-theme-header-bg)!important;border-color:var(--app-theme-divider)!important;
}
/* Placement height/eligibility remains owned by the ad service. An unpainted
   container must not become a bright empty panel merely by changing theme. */
html:root:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) .section-advertisements {
  background:transparent!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .bottom-nav,.shortcut-bar,.post-contact-footer,.global-message-compose,.painted-footer,
  .vehicle-wizard-actions,.buy-filter-sheet footer,.rental-editor-actions
) {
  background:var(--app-theme-nav-bg)!important;color:var(--app-theme-text-primary)!important;
  border-color:var(--app-theme-divider)!important;box-shadow:var(--app-theme-shadow-sm)!important;
}
html:root:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  dialog,.side-drawer-panel,.global-language-menu,.commercial-selector-options,.vehicle-brand-panel,
  .recovery-results-panel,.auth-session-panel,.post-ad-menu
) {
  background:var(--app-theme-sheet-bg)!important;color:var(--app-theme-text-primary)!important;
  border-color:var(--app-theme-border)!important;box-shadow:var(--app-theme-shadow-lg)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .car-card,.public-car-card,.showroom-card,.section-listing-card,.section-provider-card,.public-provider-card,
  .home-gold-card,.parts-listing-card,.parts-shop-card,.lorry-card,.rental-card,.office-directory-card,.inventory-card,
  .public-info-card,.post-info-card,.post-inventory-item,.public-showroom-profile,.showroom-source-card,
  .my-account-summary,.account-listing-card,.my-showroom-card,.favorite-record,.global-thread,.global-notification,
  .saved-search-row,.saved-search-plan,.recovery-driver-row,.vehicle-wizard-card,.vehicle-wizard-step,
  .vehicle-promotion-option,.customer-promotion-tier,.customer-promotion-package,.credit-wallet,.credit-choice,
  .account-empty-state,.empty-panel,.empty-showroom-cars,.directory-empty,.recovery-map-notices>p
) {
  background:var(--app-theme-card-bg)!important;color:var(--app-theme-text-primary)!important;
  border-color:var(--app-theme-border)!important;box-shadow:var(--app-theme-shadow-sm)!important;
}
/* Card navigation targets must not become a second opaque panel. In particular
   .showroom-open is an invisible full-card hit target, not a painted button. */
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .parts-item-main,.section-listing-card-main,.home-gold-body,.office-card-copy,.public-car-body
) { background:transparent!important;color:var(--app-theme-text-primary)!important; }
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) .showroom-open {
  background:transparent!important;color:transparent!important;box-shadow:none!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .home-gold-body h3,.auth-session-panel b,.account-profile-editor summary,.account-listing-group h3,
  .post-brand,.showroom-source-card b,.recovery-provider-profile h2,.public-inventory-heading h2,
  .global-notification-copy strong,.saved-search-row strong,.global-thread strong
) { color:var(--app-theme-text-primary)!important; }
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .home-gold-meta,.home-gold-meta small,.home-gold-reference,.recovery-status,.recovery-row-number,
  .recovery-provider-meta,.auth-session-panel p,.global-chat-safety,.directory-status,.empty-showroom-cars
) { color:var(--app-theme-text-secondary)!important; }
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .home-gold-body>strong,.home-gold-view,.rental-source button,.rental-view,.office-view-action,
  .showroom-source-label,.public-info-card>i,.post-listing-meta i,.home-gold-meta i,.account-profile-editor summary,
  .side-drawer-admin i,.side-drawer-links i,.side-drawer-account i,.toast i,
  .auth-link-button,.account-quick-action i,.account-empty-state>i,.account-listing-group h3 i
) { color:var(--app-theme-icon-active)!important; }
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .bottom-nav>button,.bottom-nav>button>i,.shortcut-bar button,.shortcut-bar button>i,
  .search-field>i,.directory-search>i,.post-detail-fields dt i
) { color:var(--app-theme-icon-default)!important; }
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .bottom-nav>.active-nav,.bottom-nav>.active-nav>i,.shortcut-bar>.active-shortcut,.shortcut-bar>.active-shortcut>i
) { color:var(--app-theme-icon-active)!important; }

/* Fields and outline controls share a paired fill, boundary and focus ring. */
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  input,select,textarea
):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]),
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .search-field,.showroom-search,.directory-search,.commercial-selector-trigger,.vehicle-brand-toggle
) {
  background:var(--app-theme-input-bg)!important;color:var(--app-theme-text-primary)!important;
  border-color:var(--app-theme-input-border)!important;box-shadow:none!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .search-field,.showroom-search,.directory-search
) input { background:transparent!important;box-shadow:none!important; }
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .location-action.secondary,.outline-account-button,.buy-toolbar-filter,.filter-button,.marketplace-back,
  .showroom-city-chip,.post-back,.post-location-link,.rental-list-action,.recovery-pager button,.pagination button,
  .global-contact-bar>button,.global-contact-bar>a:not([data-contact-channel=whatsapp]),
  .post-contact-footer>button[data-contact-channel=messaging]
) {
  background:var(--app-theme-button-outline)!important;color:var(--app-theme-button-outline-text)!important;
  border-color:var(--app-theme-input-border)!important;box-shadow:var(--app-theme-shadow-sm)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .side-drawer-links button,.side-drawer-account,.side-drawer-close,.side-drawer-admin button,
  .account-quick-action,.global-notification-actions button,.global-language-menu>button,
  .rental-surface>nav button,.recovery-location-tools button,
  .sell-form-card .close-modal,.sell-form-card .cancel-button,
  .auth-mode-tabs button:not(.active),.owner-method-option input:not(:checked)+span
) {
  background:var(--app-theme-button-secondary)!important;color:var(--app-theme-button-secondary-text)!important;
  border-color:var(--app-theme-border)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .primary,.primary-button,.publish-button,.sell-car-button,.register-showroom-button,.showroom-submit-button,
  .owner-verification-button,.account-listing-actions .primary-action,.recovery-primary,.checkout-primary,
  .buy-filter-apply,.painted-save,.saved-search-primary,.report-submit,.app-governance-primary,.credit-primary,
  .commercial-listing-actions button[type=submit],.listing-promotion-actions button[type=submit],
  .subscription-panel button[type=submit],.global-message-compose button,.location-action.primary,
  .home-ad-detail-actions>.home-ad-call,.post-contact-footer>a[data-contact-channel=call],
  .bottom-nav>.post-button>i,.admin-access-gate a
) {
  background:var(--app-theme-button-primary)!important;color:var(--app-theme-button-primary-text)!important;
  border-color:var(--app-theme-button-primary)!important;box-shadow:var(--app-theme-shadow-sm)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) .bottom-nav>.post-button>i {
  border-color:var(--app-theme-surface)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  input,select,textarea,.commercial-selector-trigger,.vehicle-brand-toggle
):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):focus,
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .search-field,.directory-search,.showroom-search
):focus-within {
  border-color:var(--app-theme-focus-border)!important;
  box-shadow:0 0 0 3px var(--app-theme-focus-ring)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(button,a,summary):focus-visible {
  outline:2px solid var(--app-theme-focus-border)!important;outline-offset:2px;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(input,select,textarea,.commercial-selector-trigger,.vehicle-brand-toggle):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden])[aria-invalid=true] {
  border-color:var(--app-theme-status-danger)!important;
}
html:root:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .city-count,.public-inventory-heading>span,.buy-filter-count,.post-seller-type,.rental-source>span,
  .recovery-status,.recovery-row-number,.recovery-cluster-marker span,.showroom-p-badge,
  .global-message.mine,.recovery-message.mine
) {
  background:var(--app-theme-chip-bg)!important;color:var(--app-theme-chip-text)!important;
  border-color:var(--app-theme-border)!important;box-shadow:none!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .rental-surface>nav [aria-current=page],.global-language-menu>button[aria-checked=true],
  .showroom-city-chip[aria-pressed=true],.filter-button.has-filters,.kurdish-language-menu button[aria-pressed=true],
  .pagination [aria-current=page],.recovery-pager [aria-current=page],
  .customer-promotion-package.is-selected,.listing-promotion-card.is-selected,
  .vehicle-promotion-option.selected,.credit-choice:has(input:checked),.saved-search-plan:has(input:checked),
  .commercial-selector-option[aria-pressed=true],.painted-state-option[aria-pressed=true]
) {
  background:var(--app-theme-selected)!important;color:var(--app-theme-icon-active)!important;
  border-color:var(--app-theme-focus-border)!important;box-shadow:inset 0 0 0 1px var(--app-theme-focus-border)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .side-drawer-links button,.side-drawer-admin button,.global-language-menu>button
):hover {
  background:var(--app-theme-selected)!important;color:var(--app-theme-icon-active)!important;
}
/* Operational states remain distinguishable; a gold appearance never implies
   GOLD promotion, paid status, verification or administrative approval. */
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(.verified-chip,.public-verified) {
  background:var(--app-theme-success-bg)!important;color:var(--app-theme-status-success)!important;
  border-color:var(--app-theme-status-success)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(#drawerLogout,#myAccountLogout) {
  background:var(--app-theme-danger-bg)!important;color:var(--app-theme-status-danger)!important;
  border-color:var(--app-theme-status-danger)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .car-card-summary,.rental-card-footer,.rental-price-row,.account-profile-editor,.public-section-owner,
  .security-session,.app-governance-policy,.side-drawer-header,.record-customer-actions,.post-detail-field,
  .account-summary-grid>div,.global-chat-safety,hr
) { border-color:var(--app-theme-divider)!important; }
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .recovery-row-media,.recovery-provider-media,.favorite-record-media,.post-inventory-media-fallback,
  .showroom-card-image,.public-map-wrap,.public-car-media,.home-gold-media
) { background:var(--app-theme-subtle)!important;color:var(--app-theme-text-secondary)!important; }
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(dialog)::backdrop,
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(.modal-backdrop,.side-drawer-backdrop) {
  background:var(--app-theme-scrim)!important;
}

/* Home's photo content stays intact; its chrome, labels, focus rings and active
   indicators are UI and must consume the same theme as every other section. */
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body .app-shell:has(#homeScreen:not([hidden])) {
  --home-green:var(--app-theme-icon-active);
  background:var(--app-theme-background)!important;
}
/* Home alone keeps its existing photograph behind the transparent logo.
   Other screens retain themed header surfaces; header controls stay unchanged. */
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body .app-shell:has(#homeScreen:not([hidden]))>.top-header,
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body .app-shell:has(#homeScreen:not([hidden]))>.top-header::before,
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body .app-shell:has(#homeScreen:not([hidden]))>.top-header::after {
  background:transparent!important;box-shadow:none!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body .app-shell:has(#homeScreen:not([hidden])) :is(.menu-button,.notification-button,.global-language-control) {
  background:var(--app-theme-media-control-bg)!important;color:var(--app-theme-media-control-ink)!important;
  border-color:var(--app-theme-border)!important;box-shadow:var(--app-theme-shadow-sm)!important;text-shadow:none!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body .app-shell:has(#homeScreen:not([hidden])) .global-language-trigger {
  color:var(--app-theme-media-control-ink)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body #homeScreen:not([hidden]) :is(.hero,.category-card) {
  background:var(--app-theme-card-bg)!important;box-shadow:0 0 0 1px var(--app-theme-border),var(--app-theme-shadow-sm)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body #homeScreen:not([hidden]) .category-card:is(:hover,:focus-visible) {
  outline-color:var(--app-theme-focus-border)!important;box-shadow:0 0 0 1px var(--app-theme-focus-border),var(--app-theme-shadow-md)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body .global-language-control {
  background:var(--app-theme-button-secondary)!important;border-color:var(--app-theme-input-border)!important;
}
/* Shared media controls, not image pixels or promotional artwork. */
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .car-favorite,.public-car-favorite,.parts-favorite,.section-listing-card-favorite,.rental-save,
  .vehicle-gallery-control,.vehicle-gallery-counter,.vehicle-gallery-dots,.public-car-media-count,.rental-photo-count
) {
  background:var(--app-theme-media-control-bg)!important;color:var(--app-theme-media-control-ink)!important;
  border-color:var(--app-theme-border)!important;box-shadow:var(--app-theme-shadow-sm)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .vehicle-gallery-fullscreen,.vehicle-gallery-expanded
) { background:var(--app-theme-background)!important;color:var(--app-theme-text-primary)!important; }
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) .vehicle-gallery-dot::after {
  background:var(--app-theme-icon-default)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) .vehicle-gallery-dot[aria-current=true]::after {
  background:var(--app-theme-icon-active)!important;
}
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) body:has(>.app-shell) :is(
  .car-favorite,.public-car-favorite,.parts-favorite,.section-listing-card-favorite,.rental-save
)[aria-pressed=true] { color:var(--app-theme-status-danger)!important; }
html:is([data-theme="dark-gold"],[data-theme="diamond-light"]) .app-theme-switch>button[aria-pressed=true] {
  border-color:var(--app-theme-switch-accent)!important;
}
