/* Shared editor chrome. The artwork and the 3D renderer keep their own colours. */
:root[data-theme=light]{color-scheme:light}
:root[data-theme=dark]{color-scheme:dark;--bg:#171a21;--panel:#20242d;--sunken:#191d25;--stage:#11151c;--ink:#eef1f7;--ink-2:#c0c8d4;--muted:#9ca6b7;--line:#333b49;--line-strong:#465163;--accent:#9eb9e1;--accent-hover:#b9cdee;--accent-ink:#152035;--accent-text:#b9cdee;--accent-line:#526b8d;--soft:#2a374a;--paper:#20242d;--white:#20242d;--danger:#ff9b9e;--danger-soft:#40262d;--success:#8bd4ad;--warn:#e6bf83;--ring:0 0 0 3px rgb(158 185 225 / .25);--shadow-lg:0 20px 64px rgb(0 0 0 / .5);--surface:#20242d;--hover:#2a374a;--editor-ui-ink:#eef1f7;--editor-ui-muted:#c0c8d4;--editor-ui-surface:#20242d;--editor-ui-line:#465163;--editor-ui-hover:#2a374a;--editor-ui-accent:#9eb9e1;--editor-ui-accent-ink:#152035;--photo-checker-bg:#272e39;--photo-checker-tile:#343d4b;background:var(--bg);color:var(--ink)}
:root[data-theme=dark] body{background:var(--bg);color:var(--ink)}
:root[data-theme=dark] :is(input,select,textarea){background:var(--panel)}
:root[data-theme=dark] input::file-selector-button{background:var(--panel)}
:root[data-theme=dark] :is(.btn){background:var(--panel)}
:root[data-theme=dark] :is(.color-row){background:var(--panel)}
:root[data-theme=dark] :is(.segments button.active){background:var(--panel)}
:root[data-theme=dark] :is(.film-header select){background:var(--panel)}
:root[data-theme=dark] :is(dialog){background:var(--panel)}
:root[data-theme=dark] :is(.modal-head){background:var(--panel)}
:root[data-theme=dark] :is(.modal-foot){background:var(--panel)}
:root[data-theme=dark] :is(.file-field){background:var(--panel)}
:root[data-theme=dark] :is(.type-grid button){background:var(--panel)}
:root[data-theme=dark] :is(.review-proof){background:var(--panel)}
:root[data-theme=dark] :is(.pg-seg button[aria-pressed=true]){background:var(--panel)}
:root[data-theme=dark] :is(.pg-kind){background:var(--panel)}
:root[data-theme=dark] :is(.pg-card){background:var(--panel)}
:root[data-theme=dark] :is(.pg-badge){background:var(--panel)}
:root[data-theme=dark] :is(.pg-kebab:hover,.pg-kebab[aria-expanded=true]){background:var(--panel)}
:root[data-theme=dark] :is(.profile-tabs button.active){background:var(--panel)}
:root[data-theme=dark] :is(.pub-elements label){background:var(--panel)}
:root[data-theme=dark] :is(.public-close){background:var(--panel)}
:root[data-theme=dark] :is(.booklet-fold-sheet){background:var(--panel)}
:root[data-theme=dark] :is(.inspector-tabs button[aria-selected=true]){background:var(--panel)}
:root[data-theme=dark] :is(.scene-popover){background:var(--panel)}
:root[data-theme=dark] :is(.spaces button[aria-pressed=true]){background:var(--panel)}
:root[data-theme=dark] :is(.project-menu-list){background:var(--panel)}
:root[data-theme=dark] :is(.sources-back){background:var(--panel)}
:root[data-theme=dark] :is(.sources-steps button[aria-current=step]){background:var(--panel)}
:root[data-theme=dark] :is(.sources-rail,.sources-space .modal-body){background:var(--panel)}
:root[data-theme=dark] :is(:is(.cmdk,.cmdk-trigger,.context-menu,.shortcut-list) kbd){background:var(--panel)}
:root[data-theme=dark] :is(.cmdk-item[aria-selected=true] .cmdk-icon){background:var(--panel)}
:root[data-theme=dark] :is(.context-menu){background:var(--panel)}
:root[data-theme=dark] :is(.setup-inspector select,#setup-capture-popover select,#setup-image-quality){background:var(--panel)}
:root[data-theme=dark] :is(.setup-inspector input[type=color]){background:var(--panel)}
:root[data-theme=dark] :is(.setup-add-instance){background:var(--panel)}
:root[data-theme=dark] :is(.setup-instances button){background:var(--panel)}
:root[data-theme=dark] :is(.setup-view button[aria-pressed=true]){background:var(--panel)}
:root[data-theme=dark] :is(.dress-seg button[aria-pressed=true]){background:var(--panel)}
:root[data-theme=dark] :is(.dress-action,.dress-toolbar>button){background:var(--panel)}
:root[data-theme=dark] :is(.dress-note button){background:var(--panel)}
:root[data-theme=dark] :is(.dress-generate){background:var(--panel)}
:root[data-theme=dark] :is(.dress-progress button){background:var(--panel)}
:root[data-theme=dark] :is(.setup-table-size input){background:var(--panel)}
:root[data-theme=dark] :is(.v5-select select){background:var(--panel)}
:root[data-theme=dark] :is(.finish-presets button){background:var(--panel)}
:root[data-theme=dark] :is(.route-page){background:var(--panel)}
:root[data-theme=dark] :is(#dialog.guide-panel-open .modal-head){background:var(--panel)}
:root[data-theme=dark] :is(.guide-panel .guide-analysis){background:var(--panel)}
:root[data-theme=dark] :is(.object-rotation-row button){background:var(--panel)}
:root[data-theme=dark] :is(.rotation-presets button){background:var(--panel)}
:root[data-theme=dark] :is(.technical-picker){background:var(--panel)}
:root[data-theme=dark] :is(.technical-page){background:var(--panel)}
:root[data-theme=dark] :is(.technical-layers){background:var(--panel)}
:root[data-theme=dark] :is(.punch-page-pairing){background:var(--panel)}
:root[data-theme=dark] :is(.punch-cut-page){background:var(--panel)}
:root[data-theme=dark] :is(.lighting-presets button){background:var(--panel)}
:root[data-theme=dark] :is(.box-template-picker select,.box-template-picker input){background:var(--panel)}
:root[data-theme=dark] :is(.camera-presets button){background:var(--panel)}
:root[data-theme=dark] :is(.camera-number input){background:var(--panel)}
:root[data-theme=dark] :is(.import-live-grid figure){background:var(--panel)}
:root[data-theme=dark] :is(.booklet-sort-row){background:var(--panel)}
:root[data-theme=dark] :is(.booklet-sort-buttons button){background:var(--panel)}
:root[data-theme=dark] :is(.magnifier-actions){background:var(--panel)}
:root[data-theme=dark] :is(.preset-select-label select){background:var(--panel)}
:root[data-theme=dark] :is(#material-presets-dialog input[type=text],#material-presets-dialog input:not([type]),#material-presets-dialog select){background:var(--panel)}
:root[data-theme=dark] :is(.preset-name-row){background:var(--panel)}
:root[data-theme=dark] :is(.preset-summary span){background:var(--panel)}
:root[data-theme=dark] :is(.preset-library-card){background:var(--panel)}
:root[data-theme=dark] :is(.back-link){background:var(--panel)}
:root[data-theme=dark] :is(.card){background:var(--panel)}
:root[data-theme=dark] :is(#logout){background:var(--panel)}
:root[data-theme=dark] :is(.publication-actions button,.publication-actions a,.publication-reload){background:var(--panel)}

:root[data-theme=dark] :is(.btn.primary,.dress-action.primary,.dress-primary,.primary,#submit){background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
:root[data-theme=dark] :is(.btn.primary,.dress-action.primary,.dress-primary,.primary,#submit):hover{background:var(--accent-hover)}
:root[data-theme=dark] :is(.brand-mark,.dress-ambiance-check){color:var(--accent-ink)}
:root[data-theme=dark] :is(.dress-note.warn,.dress-badge,.setup-hidden-badge,.preset-warning,.box-analysis-warning){background:var(--sunken);color:var(--warn);border-color:var(--line-strong)}
:root[data-theme=dark] :is(.preset-error,.error){color:var(--danger)}
:root[data-theme=dark] .language-switch{background:var(--panel);color:var(--ink);border-color:var(--line-strong)}
:root[data-theme=dark] .dress-compare-handle{background:#26303d;color:#fff}
:root[data-theme=dark] .lib-body .btn{color:var(--ink);background:var(--panel)}
:root[data-theme=dark] .lib-body .btn.primary{background:var(--accent);color:var(--accent-ink)}
:root[data-theme=dark][data-studio-page=login] main,:root[data-theme=dark][data-studio-page=guide] main{background:var(--panel);border-color:var(--line)}
:root[data-theme=dark][data-studio-page=login] #switch{color:var(--accent-text)}
:root[data-theme=dark][data-studio-page=login] #message{color:var(--danger)}
:root[data-theme=dark][data-studio-page=guide] :is(nav,section){border-color:var(--line)}
:root[data-theme=dark][data-studio-page=guide] a{color:var(--accent-text)}
[data-theme-control]{display:inline-flex;flex:none}
.theme-control{position:relative;margin:0;border:0;padding:0;font:500 12px Onest,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:var(--ink,#242936)}
.theme-control>summary{margin:0;list-style:none;display:grid;place-items:center;width:34px;height:34px;padding:0;border:1px solid var(--line-strong,#d5d8df);border-radius:11px;background:var(--panel,#fff);color:var(--ink,#242936);cursor:pointer}
.theme-control>summary::-webkit-details-marker{display:none}
.theme-control svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}
.theme-control>summary:hover,.theme-control[open]>summary{background:var(--soft,#edf1f6);border-color:var(--accent-line,#cad7e5)}
.theme-control>summary:focus-visible{outline:2px solid var(--accent,#57677f);outline-offset:3px}
.theme-menu{position:absolute;top:calc(100% + 8px);right:0;z-index:200;width:184px;padding:6px;border:1px solid var(--line,#e0e3e9);border-radius:14px;background:var(--panel,#fff);box-shadow:var(--shadow-lg,0 12px 40px rgb(0 0 0 / .18))}
.theme-menu>button{display:flex;align-items:center;gap:10px;width:100%;min-height:42px;margin:0;padding:0 10px;border:0;border-radius:8px;background:transparent;color:var(--ink,#242936);font:inherit;text-align:left;cursor:pointer}
.theme-menu>button>span{flex:1}.theme-menu>button>svg:last-child{width:14px;visibility:hidden}
.theme-menu>button[aria-pressed=true]{background:var(--soft,#edf1f6);color:var(--accent-text,#4d6584)}.theme-menu>button[aria-pressed=true]>svg:last-child{visibility:visible}
.theme-menu>button:hover{background:var(--sunken,#f3f4f6)}.theme-menu>button:focus-visible{outline:2px solid var(--accent,#57677f);outline-offset:-2px}
.theme-site-control{position:fixed;top:12px;right:150px;z-index:50}
@media(max-width:860px){.theme-control>summary{width:40px;height:40px}.theme-site-control{right:140px}}

:root[data-theme=dark] :is(input,select,textarea){border-color:var(--line-strong)}

@media(max-width:1100px){.is-photo-workspace .dress-toolbar>.dress-photo-tools{order:1}.is-photo-workspace .dress-toolbar>[data-theme-control]{margin-left:auto}}

/* Floating scene controls and stateful buttons use the same palette as the inspector. */
:root[data-theme=dark] :is(.setup-tools,.setup-view,.setup-hint,#setup-empty,.view-chip,.thumb-size,.pg-kebab,.piece-visibility){background:var(--panel);color:var(--ink);border-color:var(--line-strong)}
:root[data-theme=dark] .setup-view{background:var(--sunken)}
:root[data-theme=dark] :is(.btn:not(.primary),.dress-action:not(.primary),.dress-toolbar>button,.back-link,#logout,.publication-actions button,.publication-actions a,.publication-reload):hover:not(:disabled){background:var(--soft)}
:root[data-theme=dark] :is(.setup-add-instance,.setup-instances button,.finish-presets button,.rotation-presets button,.camera-presets button,.lighting-presets button):hover:not(:disabled){background:var(--soft);border-color:var(--accent-line)}
:root[data-theme=dark] :is(.finish-presets button.active,.setup-instances button[aria-pressed=true]){background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
:root[data-theme=dark] :is(.camera-presets button[aria-pressed=true],.lighting-presets button[aria-pressed=true],.render-preset-list [aria-pressed=true],.rotation-presets button.active){background:var(--soft);color:var(--ink);border-color:var(--accent)}
:root[data-theme=dark] .setup-element.is-hidden.selected{background:var(--soft);border-color:var(--accent-line)}
:root[data-theme=dark] :is(.guide-actions button.fold){color:var(--accent-text);border-color:var(--accent-line)}
:root[data-theme=dark] :is(.guide-actions button.cut,.publication-actions .publication-delete,#publication-message[role=alert]){color:var(--danger)}
:root[data-theme=dark] :is(.error-msg,#message:not(:empty)){background:var(--danger-soft);color:var(--danger);border-color:var(--danger)}
:root[data-theme=dark] input::placeholder,:root[data-theme=dark] textarea::placeholder{color:var(--muted);opacity:1}
:root[data-theme=dark] .scene-label{background:var(--panel);border:1px solid var(--line);border-radius:6px;padding:4px 7px;color:var(--ink-2)}
:root[data-theme=dark] :is(.finish-presets button.active,.setup-instances button[aria-pressed=true]):hover:not(:disabled){background:var(--accent-hover);border-color:var(--accent-hover);color:var(--accent-ink)}
:root[data-theme=dark] :is(.ps-spin-help,.ps-spin-status){background:var(--panel);color:var(--ink)}
