/* UI tokens only. Listing/hero photos, illustration SVGs and map tiles retain their original colors. */
:root{color-scheme:light;--surface:#ffffff;--page:#ffffff;--raised:#f2f5fb;--soft:#edf1fa;--muted:#5b667e;--control-border:#72809e;--focus:#145cc1;--error:#a42b35;--warning:#72500c;--success:#286344;--brand-blue:#293caa;--on-brand:#ffffff;--overlay:#101b30f8;--overlay-text:#ffffff;--overlay-muted:#c0cbe2;--overlay-border:#9aabc8;--shade:#101d4199}
:root[data-theme="dark"]{color-scheme:dark;--surface:#151f35;--page:#0d1426;--raised:#1d2a43;--soft:#202e49;--ink:#eff3ff;--muted:#b4bfd5;--blue:#b0bdff;--deep:#121b30;--paper:#1d2a43;--line:#4e607f;--control-border:#8b9dbb;--focus:#8bd3ff;--error:#ffb4ab;--warning:#ffdb91;--success:#a4e3ba;--shade:#000000b3}
:root[data-theme="contrast"]{color-scheme:dark;--surface:#000000;--page:#000000;--raised:#080808;--soft:#111111;--ink:#ffffff;--muted:#eeeeee;--blue:#ffe66d;--deep:#000000;--paper:#080808;--line:#ffffff;--control-border:#ffffff;--focus:#ffe66d;--error:#ffb8b8;--warning:#ffe66d;--success:#baffca;--overlay:#000000;--overlay-text:#ffffff;--overlay-muted:#eeeeee;--overlay-border:#ffffff;--shade:#000000e6}
html,body{background:var(--page);color:var(--ink)}
/* Keep the same content width on short/long routes and while dialogs lock scrolling. */
html{scrollbar-gutter:stable}
header{width:100%;max-width:1248px;height:auto;min-height:92px;flex-wrap:wrap;gap:10px 24px;padding:12px max(24px,env(safe-area-inset-right)) 12px max(24px,env(safe-area-inset-left))}
header>*{min-width:0;max-width:100%}
header>.brand{order:1;flex-shrink:0}
header>.language-switch{order:2;margin-left:auto;margin-right:0;flex-wrap:wrap}
header>.header-actions{order:3;margin-left:0;gap:8px 16px;flex-wrap:wrap}
header .language-switch button,header .header-actions a{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;font-size:13px}
header .header-actions .button{padding:10px 14px;font-size:13px;white-space:normal;text-align:center}
header #main-nav{order:4;flex:1 0 100%;align-items:center;flex-wrap:wrap;gap:8px 18px}
header #main-nav>.theme-picker{margin-left:auto}
@media(min-width:761px){header #main-nav>a:not(.mobile-only){display:inline-flex;align-items:center;min-height:44px;padding:8px 0}}
.theme-picker{display:inline-flex;align-items:center;gap:0;margin:0;padding:0;width:max-content;max-width:100%;border:0;border-radius:0;background:transparent}
.theme-picker .theme-choice{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;min-width:44px;height:44px;min-height:44px;margin:0;padding:0;border:0;border-radius:4px;color:var(--muted);background:transparent;cursor:pointer}
.theme-picker .theme-choice:hover{color:var(--ink);background:var(--soft)}
.theme-picker .theme-choice[aria-pressed="true"]{color:var(--blue);background:transparent}
.theme-choice>.theme-icon{display:block;width:16px;height:16px;pointer-events:none}
.theme-choice .theme-selected{display:none;position:absolute;left:50%;bottom:6px;transform:translateX(-50%);width:12px;height:2px;background:currentColor;pointer-events:none}
.theme-choice[aria-pressed="true"] .theme-selected{display:block}
.theme-picker .theme-choice:focus-visible{outline:3px solid var(--focus);outline-offset:3px;z-index:1}
.theme-helper{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
button,.button{color:var(--ink);background:var(--surface);border-color:var(--control-border)}
input,select,textarea{color:var(--ink);background:var(--surface);border-color:var(--control-border);caret-color:var(--ink)}
input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}
input[type="checkbox"],input[type="radio"]{accent-color:var(--blue)}
.primary,.primary:visited{color:var(--on-brand);background:var(--brand-blue);border-color:var(--brand-blue)}
.primary:hover{background:#1e2f91;color:var(--on-brand)}
.search-input input,.upload-zone input{background:transparent}
.form-error{color:var(--error)}
.hero-notes,.filter-heading,.row-tags,.location,.specs,.listing-price small,.listing-disclaimer,.description,.detail-section>p,.publication-dates,#description-counter{color:var(--muted)}
.demo-label{color:var(--muted)}
.favorite{color:var(--muted)}.favorite.saved{color:var(--blue)}
.status-review{color:var(--warning)}.status-published{color:var(--success)}
input[aria-invalid="true"],select[aria-invalid="true"],textarea[aria-invalid="true"]{border:2px solid var(--error)}
.moderation-note{color:var(--warning)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
.detail-tabs button:focus-visible{outline:3px solid var(--focus);outline-offset:-3px}
.lightbox,.lightbox::backdrop{background:var(--overlay);color:var(--overlay-text)}
.lightbox{width:100%;max-width:100%;box-sizing:border-box}
.lightbox .light-top button,.lightbox .light-stage button{background:#1b2943;color:var(--overlay-text);border-color:var(--overlay-border)}
.lightbox>p{color:var(--overlay-muted)}
.compact-dialog{background:var(--surface);color:var(--ink);border:1px solid var(--control-border)}
.compact-dialog::backdrop{background:var(--shade)}
/* Narrowly scoped dark/high-contrast overrides for legacy fixed UI colors. */
:root:is([data-theme="dark"],[data-theme="contrast"]) :is(.listing-row,.filter-box,.form-card,.seller-panel,.account-stats,.archive-item,.map-panel,.geo-editor,.saved-search-card,.ticket-card,.compare-tray,.edit-photo,.search-panel){background:var(--surface);border-color:var(--line);color:var(--ink)}
:root:is([data-theme="dark"],[data-theme="contrast"]) :is(.hero,.sidebar-note,.discover-tools,.empty,.profile-heading,.auth-story,.admin-section,.intro-preview,.cover,.gallery,.phone){background:var(--raised)}
:root:is([data-theme="dark"],[data-theme="contrast"]) :is(.badge,.demo-label,.avatar,.empty-icon,.form-card h2>span,.comparison-table .different){background:var(--soft);color:var(--blue)}
:root:is([data-theme="dark"],[data-theme="contrast"]) :is(.demo-bar,.notice){background:var(--raised);color:var(--muted);border-color:var(--line)}
:root:is([data-theme="dark"],[data-theme="contrast"]) :is(.hero-notes,.filter-heading,.row-tags,.location,.specs,.listing-price small,.listing-disclaimer,.description,.detail-section>p,.publication-dates,#description-counter){color:var(--muted)}
:root:is([data-theme="dark"],[data-theme="contrast"]) :is(.detail-section,.spec-table>div,.property-extra,.advanced-property,.private-archive,.future-promo,.comparison-table th,.comparison-table td){border-color:var(--line)}
:root:is([data-theme="dark"],[data-theme="contrast"]) :is(.gallery-controls,.gallery-zoom,.hero-slide-controls,.editor-save){background:var(--raised);color:var(--ink);box-shadow:none}
:root:is([data-theme="dark"],[data-theme="contrast"]) :is(.gallery-controls button,.hero-slide-controls button,.auth-tabs button,.detail-tabs button,.language-switch button){background:transparent;color:var(--ink)}
:root:is([data-theme="dark"],[data-theme="contrast"]) :is(.detail-tabs [aria-selected="true"],.row-actions [aria-pressed="true"],.language-switch [aria-pressed="true"],.mobile-bottom-nav [aria-current="page"]){background:var(--soft);color:var(--blue);border-color:var(--blue)}
:root:is([data-theme="dark"],[data-theme="contrast"]) .favorite{background:transparent;color:var(--muted)}
:root:is([data-theme="dark"],[data-theme="contrast"]) .cards-view .favorite{background:var(--surface);border:1px solid var(--control-border)}
:root:is([data-theme="dark"],[data-theme="contrast"]) .favorite.saved{color:var(--blue)}
:root:is([data-theme="dark"],[data-theme="contrast"]) .favorite.saved svg{fill:var(--soft)}
:root:is([data-theme="dark"],[data-theme="contrast"]) .area-chips a{background:var(--surface);border-color:var(--control-border);color:var(--blue)}
:root:is([data-theme="dark"],[data-theme="contrast"]) :is(.mobile-bottom-nav,header nav.is-open){background:var(--surface);border-color:var(--line)}
:root:is([data-theme="dark"],[data-theme="contrast"]) header nav a:hover{background:var(--soft)}
:root:is([data-theme="dark"],[data-theme="contrast"]) :is(button,.button){border-color:var(--control-border)}
:root:is([data-theme="dark"],[data-theme="contrast"]) .primary{background:var(--brand-blue);color:var(--on-brand)}
:root:is([data-theme="dark"],[data-theme="contrast"]) .primary:hover{background:#1e2f91}
:root:is([data-theme="dark"],[data-theme="contrast"]) .status-review{background:var(--soft);color:var(--warning)}
:root:is([data-theme="dark"],[data-theme="contrast"]) .status-archived{background:var(--soft);color:var(--muted)}
:root:is([data-theme="dark"],[data-theme="contrast"]) .status-published{background:var(--soft);color:var(--success)}
:root:is([data-theme="dark"],[data-theme="contrast"]) :is(.upload-zone,.thumbnails .selected){border-color:var(--control-border)}
:root:is([data-theme="dark"],[data-theme="contrast"]) #toast{background:var(--surface);color:var(--ink);border:1px solid var(--control-border)}
/* Map artwork stays untouched; only Leaflet controls, popup and attribution change. */
:root:is([data-theme="dark"],[data-theme="contrast"]) .listing-map{background:var(--raised)}
:root:is([data-theme="dark"],[data-theme="contrast"]) .listing-map :is(.leaflet-popup-content-wrapper,.leaflet-popup-tip,.leaflet-control-attribution,.leaflet-control-zoom a){background:var(--surface);color:var(--ink)}
:root:is([data-theme="dark"],[data-theme="contrast"]) .listing-map .leaflet-popup-content a,:root:is([data-theme="dark"],[data-theme="contrast"]) .listing-map .leaflet-control-attribution a{color:var(--blue);text-decoration:underline}
:root:is([data-theme="dark"],[data-theme="contrast"]) .listing-map :is(.leaflet-bar,.leaflet-control-zoom a){border-color:var(--control-border)}
:root:is([data-theme="dark"],[data-theme="contrast"]) .listing-map .leaflet-popup-close-button{color:var(--ink)}
:root[data-theme="contrast"] :is(.primary,.status-review,.status-published,.status-archived,.badge,.gallery-controls,.gallery-zoom,.hero-slide-controls,.mobile-bottom-nav a[aria-current],.lightbox button){border:2px solid var(--control-border)}
:root[data-theme="contrast"] :is(.description a,.notice a,.ticket-card a,.report-link,.reset){text-decoration:underline}
:root[data-theme="contrast"] :is(button:disabled,input:disabled,select:disabled,textarea:disabled){opacity:1;border-style:dashed;color:var(--muted)}
:root[data-theme="contrast"] .lightbox :is(.light-top button,.light-stage button){background:#000;color:#fff}
:root[data-theme="contrast"] :is(.cover-count,.art-caption,.edit-photo>span){background:#000;color:#fff;border:1px solid #fff;text-shadow:none}
@media(max-width:760px){header{min-height:78px;gap:8px 12px;padding:12px max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left))}header>.header-actions{display:none}header>.mobile-menu-button{order:3;min-width:44px;width:44px;height:44px;flex:0 0 44px}header #main-nav{align-items:stretch;gap:0;max-width:calc(100% - 32px)}header #main-nav>.theme-picker{align-self:flex-start;margin:8px 15px;padding:0}header #main-nav>a{min-height:44px}}
@media(max-width:420px){header>.language-switch{order:4;flex-basis:100%;justify-content:flex-end}header>.mobile-menu-button{margin-left:auto}}
@media(forced-colors:active){button,.button,input,select,textarea,.compact-dialog{border:1px solid ButtonText}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid Highlight}.brand-icon{forced-color-adjust:none}}
@media(forced-colors:active){.theme-picker .theme-choice[aria-pressed="true"]{color:Highlight}.theme-choice .theme-selected{background:Highlight}}
