.header-actions{display:flex;align-items:center;gap:20px;flex-shrink:0}
.theme-toggle{display:grid;place-items:center;flex-shrink:0;width:44px;height:44px;border:1px solid var(--line);border-radius:50%;background:var(--cream);color:var(--ink)}
.theme-toggle:hover{border-color:var(--orange);color:var(--orange)}
.theme-toggle svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .theme-sun{display:none}
html[data-theme=dark]{color-scheme:only dark;--orange:#ff873e;--ink:#eef1ee;--muted:#a5afa8;--line:#363e42;--cream:#242c2e;--surface:#1d2428;--raised:#283135;--selected:#3b2c23}
html[data-theme=dark] body{background:#15191d}
html[data-theme=dark] .theme-moon{display:none}
html[data-theme=dark] .theme-sun{display:block}
html[data-theme=dark] .brand{background:#fff;border-radius:8px;padding:7px 9px}
html[data-theme=dark] :is(header,.panel,dialog){background:var(--surface);color:var(--ink)}
html[data-theme=dark] :is(.panel-head,.step-navigation,.option-details summary){background:var(--raised)}
html[data-theme=dark] :is(.steps button,.choice-grid button,.choice-stack button,.scene-picker button,.outline,.felt-choice,.opening-popup,.popup-actions button,.placement-banner button,.roof-inspection-actions button){background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme=dark] :is(.steps button>span,.preset-feedback,.tutorial-steps p>span:first-child){background:var(--raised);color:var(--muted)}
html[data-theme=dark] :is(.steps button:hover,.tutorial-close:hover){background:var(--raised)}
html[data-theme=dark] :is(.steps button[aria-selected=true],.choice-grid button[aria-pressed=true],.choice-stack button[aria-pressed=true],.scene-picker button[aria-pressed=true],.opening-row.selected){background:var(--selected);border-color:var(--orange);color:var(--ink)}
html[data-theme=dark] .steps button[aria-selected=true]>span{background:var(--orange);color:#24170f}
html[data-theme=dark] :is(.segmented button.active,.view-controls button.active){background:var(--selected);color:var(--orange)}
html[data-theme=dark] :is(select,.number-control){background:var(--raised);border-color:var(--line);color:var(--ink)}
html[data-theme=dark] input{color:var(--ink)}
html[data-theme=dark] .swatch-label{background:#242b30;color:var(--ink)}
html[data-theme=dark] :is(.tip,.felt-section,.tutorial-link,.roof-inspection){background:#232d29;border-color:#3c4b40;color:#c1cec0}
html[data-theme=dark] :is(.felt-choice small,.material-choices small,.material-detail,.finish-note,.range-labels,.number-control button,.number-control>span,.opening-row small,.summary-title div span,.stat>span,.below,.below button,footer,dialog p,dialog li,.tutorial-close,.tutorial-steps p,.scene-picker-title,.dimension-control>label span){color:var(--muted)}
html[data-theme=dark] :is(.tutorial-steps strong,.opening-popup>strong){color:var(--ink)}
html[data-theme=dark] :is(.product-image,.gutter-choices svg,.tutorial-visual){background:#30393d}
html[data-theme=dark] .manual-project-image{color:#b7c1bb}
html[data-theme=dark] :is(.primary,.save){background:#ec6c22;color:#fff}
html[data-theme=dark] :is(.add-button,.extra-badge,.summary-icon){background:#3b2c23;color:#ffac76;border-color:#6e4930}
html[data-theme=dark] :is(.validation-message,.placement-instruction){background:#382c24;color:#ffc397;border-color:#77513a}
html[data-theme=dark] .premium-label{color:#ffac76!important}
html[data-theme=dark] .preview{background:#20272d;border-color:var(--line)}
html[data-theme=dark] .preview .preview-top>span:first-child{color:#eef1ee;text-shadow:0 1px 5px #15191d}
html[data-theme=dark] :is(.view-controls,.detail-button,.dimension-chip,.preview #view-caption,.preview .preview-bottom){background:#1d2428ed;border-color:#455056;color:var(--ink)}
html[data-theme=dark] .preview .preview-bottom button{color:var(--ink)}
html[data-theme=dark] #loading{color:var(--muted)}
html[data-theme=dark] .placement-banner{background:#242d29f5;border-color:#536358;color:var(--ink)}
html[data-theme=dark] .placement-banner span{color:#c8d4ca}
html[data-theme=dark] .placement-banner.valid{border-color:#5ac98b}
html[data-theme=dark] .placement-banner.invalid{background:#3a2425f5;border-color:#d85c54}
html[data-theme=dark] .placement-banner.invalid span{color:#ffb6af}
html[data-theme=dark] .popup-actions .delete-opening{background:#3d2526;color:#ffaaa2;border-color:#744340}
html[data-theme=dark] .opening-row .remove{color:#ffaaa2}
html[data-theme=dark] .opening-row .remove:hover{background:#3d2526}
html[data-theme=dark] .unavailable-label{color:#e6b698}
html[data-theme=dark] .choice-grid button:disabled{background:#252c30}
html[data-theme=dark] dialog::backdrop{background:#070a0cbb}
@media(max-width:800px){header{gap:12px}.header-actions{gap:0}.theme-toggle{width:42px;height:42px}.brand img{width:190px}nav{margin-left:auto;gap:0}html[data-theme=dark] .brand{padding:5px 7px}}
@media(max-width:480px){header{gap:8px}.brand img{width:180px}header nav button{font-size:0;width:34px;height:40px}header nav button:after{content:'?';font-size:18px;font-weight:800}.header-actions{margin-left:auto}}
@media(max-width:360px){.brand img{width:172px}}
