/* Shared semantic palette. Day retains each surface's original Booksii colors. */
:root{
 --background:#f7f5ef;--surface:#fffdf8;--surface-raised:#ffffff;
 --text-primary:#263b30;--text-secondary:#657364;--border-soft:#deded2;
 --accent:#a86f56;--accent-soft:#e8e7da;--action-background:#31483a;--action-text:#fffdf6;
 --danger:#a3473b;--danger-soft:#f9eee9;--success:#476444;
 --room-sunlight:rgba(255,205,125,0);--library-ambient:#e8e7da;--library-light:rgba(255,220,161,0);--library-shadow:rgba(87,76,56,.16);
 --wood-frame:#b79d79;--wood-back:#e8d5b6;--wood-panel:#ecdbbd;--wood-panel-alt:#ead8b8;
 --wood-trim-light:#cfb792;--wood-trim-dark:#a88c65;--shelf-edge-light:#cbb08a;--shelf-edge-dark:#b79d78;
 --scene-floor:#d7d8ca;--lamp-glow:0;--scene-shade:0;
 color-scheme:light;
}
:root[data-theme="evening"]{
 --background:#efe0cb;--surface:#f7ead7;--surface-raised:#fff3e2;
 --text-primary:#283d2e;--text-secondary:#5e5647;--border-soft:#c9b59a;
 --accent:#97623c;--accent-soft:#e6d1ae;--action-background:#31483a;--action-text:#fff4e2;
 --danger:#9b4235;--danger-soft:#efd4c4;--success:#47603c;
 --room-sunlight:rgba(255,205,125,.4);--library-ambient:#d9bf99;--library-light:rgba(255,205,125,.4);--library-shadow:rgba(95,60,31,.27);
 --wood-frame:#aa7d4c;--wood-back:#e3ba87;--wood-panel:#ecc18a;--wood-panel-alt:#e8ba80;
 --wood-trim-light:#c99b61;--wood-trim-dark:#95683e;--shelf-edge-light:#c3945e;--shelf-edge-dark:#a57a4d;
 --scene-floor:#cbb28d;--lamp-glow:.28;--scene-shade:.04;
}
:root[data-theme="night"]{
 --background:#1c1815;--surface:#28211c;--surface-raised:#332921;
 --text-primary:#e9ddce;--text-secondary:#ad9d8c;--border-soft:#44382f;
 --accent:#d59a61;--accent-soft:#3b2e22;--action-background:#d59a61;--action-text:#241b14;
 --danger:#e1a293;--danger-soft:#3d2822;--success:#b2bf97;
 --room-sunlight:rgba(255,205,125,0);--library-ambient:#31261d;--library-light:rgba(229,153,65,.25);--library-shadow:rgba(12,8,5,.6);
 --wood-frame:#634326;--wood-back:#604326;--wood-panel:#684927;--wood-panel-alt:#634323;
 --wood-trim-light:#795130;--wood-trim-dark:#3c2a1c;--shelf-edge-light:#8c6037;--shelf-edge-dark:#4e341f;
 --scene-floor:#37291e;--lamp-glow:1;--scene-shade:.17;
 color-scheme:dark;
}
:root[data-theme="day"]{--muted:#5e6658}
:root[data-theme="evening"],:root[data-theme="night"]{
 --bg:var(--background);--paper:var(--background);--cream:var(--surface);
 --sidebar:var(--surface);--forest:var(--text-primary);--ink:var(--text-primary);
 --muted:var(--text-secondary);--line:var(--border-soft);--border:var(--border-soft);
 --sage:var(--accent-soft);--olive:var(--success);--brown:var(--accent);
 color:var(--text-primary);background:var(--background);
}
:root[data-theme="evening"] .primary,:root[data-theme="night"] .primary,
:root[data-theme="evening"] .nav-item.active,:root[data-theme="night"] .nav-item.active,
:root[data-theme="evening"] .room-tabs button.active,:root[data-theme="night"] .room-tabs button.active{
 background:var(--action-background);color:var(--action-text);
}
:root[data-theme="evening"] .primary:hover,:root[data-theme="night"] .primary:hover{background:var(--action-background)}
.theme-transitioning,.theme-transitioning *,.theme-transitioning *::before,.theme-transitioning *::after{
 transition:background-color 600ms ease,border-color 600ms ease,box-shadow 600ms ease,opacity 600ms ease,filter 600ms ease;
}
.appearance-settings fieldset{border:0;padding:0;margin:0;min-width:0}
.appearance-settings legend{font:400 23px var(--serif,'Lora',Georgia,serif);color:var(--text-primary)}
.appearance-settings p{font-size:12px;color:var(--text-secondary);margin:10px 0 16px}
.appearance-options{display:flex;gap:12px 24px;flex-wrap:wrap}
.appearance-options label{display:flex;gap:8px;align-items:center;cursor:pointer;font-size:13px}
.appearance-options input{accent-color:var(--action-background);width:16px;height:16px}
.appearance-control{display:flex;align-items:center;gap:8px;font-size:11px;color:var(--text-secondary)}
.appearance-control select{font:inherit;border:1px solid var(--border-soft);border-radius:6px;padding:7px 9px;background:var(--surface);color:var(--text-primary);max-width:110px}
.theme-transitioning :is(h1,h2,h3,p,small,button,input,textarea,select,a,summary,label,legend,.nav-item,.sanctuary,.status-dot){transition:background-color 600ms ease,color 600ms ease,border-color 600ms ease,box-shadow 600ms ease,opacity 600ms ease,filter 600ms ease}
@media(prefers-reduced-motion:reduce){.theme-transitioning,.theme-transitioning *,.theme-transitioning *::before,.theme-transitioning *::after{transition:none!important}}
:root[data-theme="evening"] input::placeholder,:root[data-theme="night"] input::placeholder,
:root[data-theme="evening"] textarea::placeholder,:root[data-theme="night"] textarea::placeholder{color:var(--text-secondary);opacity:1}
