/* Shared additions; both palettes use the same layout and controls. */
:root{color-scheme:light}
.header-inner{gap:clamp(16px,2.7vw,44px)}
.header-actions{display:flex;align-items:center;gap:8px;margin-left:auto}
.theme-toggle{display:flex;align-items:center;justify-content:center;min-width:38px;min-height:38px;border:1px solid var(--line);border-radius:8px;color:var(--muted);background:#fff}
.theme-toggle:hover{color:var(--purple);background:var(--light-purple)}
.book-contents{display:flex;flex-wrap:wrap;gap:4px;margin-top:3px;font-size:.75rem;font-weight:500;line-height:1.45;color:#69507f}
.book-contents>span{padding:2px 6px;border-radius:4px;background:#f1ebf8;border:1px solid #e4d9ed}
.slot .book-contents{font-size:.75rem}
.library-items{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 12px}
.library-item{border:1px solid #ded3ec;background:#f5effb;color:#64458a;padding:5px 9px;font-size:.875rem;line-height:1.4;border-radius:6px;text-decoration:underline;text-underline-offset:3px}
.library-item:hover{background:#e9ddf7;border-color:#a78bca}
.library-hint{font-size:.75rem;color:var(--muted)}
.dialog-foot{flex-wrap:wrap}
.material-tile{align-items:flex-start}
.material-edit{align-items:flex-start}
.form-note{font-size:.8125rem}
html[data-theme=dark]{color-scheme:dark;color:var(--ink);background:#141019;--ink:#eee9f5;--muted:#b5aabd;--purple:#c1a1f3;--light-purple:#30223f;--line:#3c3148;--green:#9fd492}
[data-theme=dark] .site-header{background:#1b1523}
[data-theme=dark] :is(.card,.library-card,dialog,.dialog-head){background:#211a2a}
[data-theme=dark] :is(.primary-nav a,.saved-builds,.theme-toggle,.text-button){color:#c7bbd3}
[data-theme=dark] :is(.saved-builds,.theme-toggle,.button){background:#2b2236;border-color:#493b57}
[data-theme=dark] .primary-nav a.active{background:#382649;color:#dec2ff}
[data-theme=dark] :is(.primary-nav a:hover,.saved-builds:hover,.theme-toggle:hover,.text-button:hover,.button:hover,.icon-button:hover){background:#3b2b4b;color:#e8d4ff}
[data-theme=dark] .head-icon{background:#39264e;color:#c6a3f6}
[data-theme=dark] .base-tile{background:#2b2038;border-color:#534064}
[data-theme=dark] .base-tile:hover{border-color:#ba91e8}
[data-theme=dark] :is(.item-thumb,.slot .item-thumb){background:#362645;border-color:#59406c}
[data-theme=dark] :is(.item-thumb.base,.slot .item-thumb.base){background:#20383b;border-color:#365157}
[data-theme=dark] :is(.tile-end,.options summary,.metric-label,.metric-unit,.slot-label,.slot-origin,.result-label,.operation-note,.plan-bottom>span,.steps-title span,.site-footer,.site-footer span:first-child){color:#b9abc7}
[data-theme=dark] .count{background:#382c44;color:#d0bedf}
[data-theme=dark] :is(.add-material,.preset-button,.library-item){background:#332341;border-color:#604675;color:#dbb7fa}
[data-theme=dark] :is(.add-material:hover,.preset-button:hover:enabled,.library-item:hover){background:#453054;border-color:#b78cde}
[data-theme=dark] .material-tile{background:#241c2e;border-color:#44364f}
[data-theme=dark] .icon-button{color:#b4a4c2}
[data-theme=dark] .icon-button.danger:hover{background:#4d2737;color:#ffb2c4}
[data-theme=dark] :is(input:not([type=checkbox]),.field-select,select.standard,.select-inline select){background-color:#19141f;border-color:#51415f;color:#eee9f5}
[data-theme=dark] input::placeholder{color:#a397ae}
[data-theme=dark] input[type=checkbox]{accent-color:#b68ae8}
[data-theme=dark] .check-field:has(:disabled){color:#a497b0}
[data-theme=dark] .plan-state{background:#21382b;border-color:#405f45;color:#b0dda5}
[data-theme=dark] .plan-state.attention{background:#423222;border-color:#6d5234;color:#f2cc9b}
[data-theme=dark] .plan-state.pending{background:#352843;border-color:#5c436e;color:#d6b8ee}
[data-theme=dark] .metrics{background:#2c2039;border-color:#4c375d}
[data-theme=dark] .metric+.metric{border-color:#4c375d}
[data-theme=dark] .metric:first-child .metric-number{color:#d1acff}
[data-theme=dark] .metric-label .icon{color:#b79acc}
[data-theme=dark] .step{background:#261d30;border-color:#493950}
[data-theme=dark] :is(.step-toggle:hover,.step summary:hover){background:#33253f}
[data-theme=dark] .step-num{background:#3d2853;border-color:#5e4176;color:#d9b9ff}
[data-theme=dark] .cost{color:#abd99a}
[data-theme=dark] .slots{background:#1d1726;border-color:#3c2d46}
[data-theme=dark] .step-detail{background:#251c2e}
[data-theme=dark] .step-detail strong{color:#dfcee9}
[data-theme=dark] .final-result{background:#30213f;border-color:#63457b}
[data-theme=dark] .button.primary{background:#8354bb;border-color:#9d70cf;color:#fff}
[data-theme=dark] .button.primary:hover{background:#9464cc}
[data-theme=dark] .empty-message{background:#281f32;border-color:#564063}
[data-theme=dark] .notice{background:#3b2d20;border-color:#6c5133;color:#e7cba4}
[data-theme=dark] .site-footer{border-color:var(--line)}
[data-theme=dark] dialog{box-shadow:0 20px 90px #0009}
[data-theme=dark] dialog::backdrop{background:#0b0718aa}
[data-theme=dark] .dialog-foot{background:#1c1623}
[data-theme=dark] :is(.dialog-body p,.library-card p,.faq p,.guide-grid aside p){color:#beb0cb}
[data-theme=dark] :is(.library-card p b,.guide-grid aside a){color:#dfc7f1}
[data-theme=dark] .form-error{color:#ffb3c0}
[data-theme=dark] :is(.enchant-row,.chip){background:#39264a;border-color:#634479;color:#e3bfff}
[data-theme=dark] :is(.editor-kind,.setup-switch){background:#17121e;border-color:#44334f}
[data-theme=dark] :is(.editor-kind button[aria-pressed=true],.setup-switch button[aria-pressed=true]){background:#3b2a4d;border-color:#674a7d;color:#e6c6ff}
[data-theme=dark] .setup-switch button{color:#bcadcb}
[data-theme=dark] .preset-button[aria-pressed=true]{background:#8053b4;border-color:#b387e2;color:#fff}
[data-theme=dark] :is(.goal-chip,.book-contents>span){background:#362741;border-color:#59406a;color:#d9bce9}
[data-theme=dark] .goal-row{border-color:#483650}
[data-theme=dark] .goal-row.chosen{background:#30213e;border-color:#62467b}
[data-theme=dark] :is(.goal-choice:has(input:disabled),.goal-choice small,.goal-max,.filter-toggle){color:#b7a6c4}
[data-theme=dark] .shopping{background:#2f213c;border-color:#604475;color:#dec4ef}
[data-theme=dark] .shopping li{background:#201828;border-color:#5b406e}
@media(max-width:850px){.header-inner{column-gap:10px}.header-actions{gap:6px}.theme-toggle{min-width:34px;min-height:34px}}
@media(max-width:700px){.header-actions{margin-left:auto}.header-inner{gap:0}.library-item{min-height:36px}.dialog-foot .button{min-height:40px}}
