/* Theme surfaces also serve the room-settings controls. Scene lighting is independent. */
:root{
  --surface:#fffefa;
  --surface-soft:#eeefe6;
  --surface-raised:#fffefa;
  --accent-soft:#e5e8da;
  --control-ink:#414d32;
  --field-bg:#fbfcf8;
  --theme-button-text:#fffefa;
  --theme-accent-hover:#434e32;
  --theme-emphasis:#697357;
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --paper:#20251f;
  --ink:#f1eedf;
  --olive:#b6c396;
  --muted:#b8bcae;
  --line:#49513f;
  --white:#f5f2e5;
  --surface:#292f27;
  --surface-soft:#343c2f;
  --surface-raised:#394132;
  --accent-soft:#45503a;
  --control-ink:#eceedd;
  --field-bg:#242a22;
  --theme-button-text:#20261c;
  --theme-accent-hover:#c7d4a9;
  --theme-emphasis:#bfcca6;
}
:root[data-theme="warm"]{
  color-scheme:light;
  --paper:#f6eadd;
  --ink:#4c332c;
  --olive:#9a5139;
  --muted:#826b5d;
  --line:#ddc9b8;
  --white:#fff9ee;
  --surface:#fff6ea;
  --surface-soft:#ecdcc9;
  --surface-raised:#fff9f0;
  --accent-soft:#e8cbb7;
  --control-ink:#6f4231;
  --field-bg:#fff9f1;
  --theme-button-text:#fff9ee;
  --theme-accent-hover:#7f3f2b;
  --theme-emphasis:#a36549;
}
body,.announcement,.footer,.planner-shell,.catalog-panel,.finish-bar,.small-button,.selected-card,.category-tabs button,.theme-picker,.theme-choice{transition:background-color .22s ease,color .22s ease,border-color .22s ease}
:root[data-theme="dark"] body,:root[data-theme="warm"] body{background:var(--paper);color:var(--ink)}
:root:is([data-theme="dark"],[data-theme="warm"]) :is(h1 em,h2 em){color:var(--theme-emphasis)}
:root:is([data-theme="dark"],[data-theme="warm"]) :is(.announcement,.footer){background:var(--surface-soft)}
:root:is([data-theme="dark"],[data-theme="warm"]) :is(.tiny-badge,.selected-card.active){background:var(--accent-soft);color:var(--ink)}
:root:is([data-theme="dark"],[data-theme="warm"]) :is(.hero-description,.hero-footnote,.strip-note,.section-heading>p,.room-title>span:last-child,.planner-top-actions>span,.panel-heading>span,.product-mini p,.catalog-hint,.selection-heading h3>span,.selection-heading>span,.selected-card p,.summary-label,.room-summary p>span,.summary-actions>span,.featured-card p,.about-copy>p:not(.eyebrow),.footer-bottom,.modal-intro,.modal-item p,.modal-disclaimer,.empty-state,.preset-choice p,.room-loading){color:var(--muted)}
:root:is([data-theme="dark"],[data-theme="warm"]) :is(.orbit-icon,.values-strip svg,.catalog-search svg,.wallpaper-button){color:var(--olive)}
:root:is([data-theme="dark"],[data-theme="warm"]) :is(.planner-shell,.small-button,dialog){background:var(--surface);border-color:var(--line);color:var(--ink)}
:root:is([data-theme="dark"],[data-theme="warm"]) :is(.catalog-search,.modal-search){background:var(--field-bg);border-color:var(--line);color:var(--ink)}
:root:is([data-theme="dark"],[data-theme="warm"]) .catalog-search input{color:var(--ink)}
:root:is([data-theme="dark"],[data-theme="warm"]) :is(input,textarea)::placeholder{color:var(--muted);opacity:1}
:root:is([data-theme="dark"],[data-theme="warm"]) :is(.category-tabs button,.product-mini-image,.selected-card,.featured-image,.modal-item .furniture-art){background:var(--surface-soft);color:var(--ink)}
:root:is([data-theme="dark"],[data-theme="warm"]) :is(.category-tabs button.active,.button.primary,.counter){background:var(--olive);color:var(--theme-button-text)}
:root:is([data-theme="dark"],[data-theme="warm"]) .button.primary:hover{background:var(--theme-accent-hover)}
:root:is([data-theme="dark"],[data-theme="warm"]) :is(.icon-button:hover,.small-button:hover,.selected-card:hover){background:var(--accent-soft);color:var(--ink)}
:root:is([data-theme="dark"],[data-theme="warm"]) :is(.add-product,.favorite-button,.product-tag,.try-product){background:var(--surface-raised);color:var(--ink)}
:root:is([data-theme="dark"],[data-theme="warm"]) .add-product:hover{background:var(--olive);color:var(--theme-button-text)}
:root:is([data-theme="dark"],[data-theme="warm"]) .favorite-button.active{color:#d38c74}
:root[data-theme="warm"] .favorite-button.active{color:#a34c34}
:root:is([data-theme="dark"],[data-theme="warm"]) :is(.modal-item,.footer-bottom,.catalog-hint,.back-to-top,.text-link){border-color:var(--line)}
:root:is([data-theme="dark"],[data-theme="warm"]) .swatch{border-color:var(--surface)}
:root:is([data-theme="dark"],[data-theme="warm"]) .swatch.active{box-shadow:0 0 0 1px var(--olive)}
:root:is([data-theme="dark"],[data-theme="warm"]) .finish-options i{background:var(--line)}
:root:is([data-theme="dark"],[data-theme="warm"]) .wallpaper-choice.active>span{border-color:var(--olive)}
:root:is([data-theme="dark"],[data-theme="warm"]) :is(.day-switch,.room-side-controls,.selected-tools,.undo-button){background:var(--surface);color:var(--control-ink);border-color:var(--line)}
:root:is([data-theme="dark"],[data-theme="warm"]) .day-switch button{color:var(--muted)}
:root:is([data-theme="dark"],[data-theme="warm"]) :is(.day-switch button.active,.room-side-controls button:hover,.selected-tools button:hover){background:var(--accent-soft);color:var(--ink)}
:root:is([data-theme="dark"],[data-theme="warm"]) .room-side-controls i{background:var(--line)}
:root:is([data-theme="dark"],[data-theme="warm"]) .room-hint{background:var(--surface);color:var(--muted)}
:root[data-theme="dark"] #remove-item{color:#e3a28b}
:root[data-theme="dark"] #toast{background:#c4d0abf2;color:#22291c;border-color:#e3ead4}
:root[data-theme="warm"] #toast{background:#84452fee;color:#fff8ed}
:root[data-theme="dark"] dialog::backdrop{background:#0e140d99}
/* A compact, self-contained picker with miniature samples of all three palettes. */
#theme-toggle[aria-expanded="true"]{background:var(--accent-soft);color:var(--olive)}
.theme-picker{position:fixed;z-index:100;width:360px;padding:22px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:16px;box-shadow:0 16px 60px #17200d33;overflow:auto;overscroll-behavior:contain;animation:theme-appear .2s ease-out}
.theme-picker-heading{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:13px}
.theme-picker-eyebrow{display:block;font-size:8px;font-weight:500;letter-spacing:1.5px;color:var(--muted);margin-bottom:7px}
.theme-picker h2{font-family:var(--serif);font-size:30px;line-height:1.1;letter-spacing:-1px;font-weight:400;margin:0}
.theme-picker-close{flex-shrink:0}
.theme-picker-close svg{width:17px;height:17px}
#theme-picker-description{font-size:11px;color:var(--muted);line-height:1.7;margin:0 0 18px}
.theme-picker-options{display:grid;gap:9px}
.theme-choice{display:flex;align-items:center;gap:12px;min-height:73px;border:1px solid var(--line);border-radius:9px;padding:10px;background:var(--surface);color:var(--ink);text-align:left}
.theme-choice:hover{background:var(--surface-soft);transform:translateX(2px)}
.theme-choice[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--olive)}
.theme-choice-preview{display:block;position:relative;width:61px;height:48px;flex-shrink:0;border-radius:5px;overflow:hidden;border:1px solid #80808025;background:var(--preview-paper)}
.theme-preview-light{--preview-paper:#f6f4ee;--preview-accent:#535f40;--preview-text:#30362c;--preview-panel:#e2e4d6}
.theme-preview-dark{--preview-paper:#20251f;--preview-accent:#b6c396;--preview-text:#f1eedf;--preview-panel:#3c4634}
.theme-preview-warm{--preview-paper:#f6eadd;--preview-accent:#9a5139;--preview-text:#4c332c;--preview-panel:#e2c6ad}
.theme-choice-preview i:first-child{position:absolute;left:8px;top:10px;width:19px;height:3px;background:var(--preview-accent);border-radius:2px}
.theme-choice-preview i:nth-child(2){position:absolute;left:8px;top:18px;width:14px;height:2px;background:var(--preview-text);border-radius:2px;opacity:.35}
.theme-choice-preview i:nth-child(3){position:absolute;right:6px;top:7px;width:21px;height:34px;background:var(--preview-panel);border-radius:3px 3px 9px 3px}
.theme-choice-preview b{position:absolute;left:8px;bottom:4px;font-family:var(--serif);font-weight:400;font-size:21px;color:var(--preview-text);line-height:1}
.theme-choice-text{flex:1;min-width:0}
.theme-choice strong{display:block;font-size:12px;font-weight:500;line-height:1.4;margin-bottom:4px}
.theme-choice small{display:block;font-size:9px;line-height:1.4;color:var(--muted)}
.theme-choice-mark{flex-shrink:0;color:var(--muted)}
.theme-choice-mark svg{width:17px;height:17px}
.theme-choice[aria-pressed="true"] .theme-choice-mark{color:var(--olive)}
.theme-picker-status{font-size:9px;color:var(--muted);line-height:1.6;margin:16px 0 0;min-height:15px}
@keyframes theme-appear{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:600px){.header-actions{gap:7px}.theme-picker{padding:18px;border-radius:12px}.theme-picker h2{font-size:27px}.theme-choice{min-height:74px}.theme-choice small{font-size:10px}}
@media(prefers-reduced-motion:reduce){.theme-picker{animation:none}}
