:root{--primary:#006bd6;--primary-light:#e9f3ff;--border:#d5dbe5;--bg:#f3f6fa;--text:#20252d;--text-muted:#596579;--surface:#fff;--surface-alt:#f5f8fc;--surface-raised:#fff;--theme-shadow:#18324d18;--theme-ink:#203044;--theme-muted:#63758b}
[data-theme=dark]{--primary:#78b7ff;--primary-deep:#459cff;--primary-light:#1e3854;--accent:#78b7ff;--text:#e4eaf3;--text-muted:#a8b5c8;--border:#364151;--bg:#10141c;--surface:#1a202b;--surface-alt:#222b38;--surface-raised:#252e3c;--theme-shadow:#0005;--theme-ink:#e4eaf3;--theme-muted:#a8b5c8;color-scheme:dark}
[data-theme=dark] body{background:var(--bg);color:var(--text)}
[data-theme=dark] :is(.card,.app-header,.app-navigation,.app-nav,.app-sidebar,.project-card,.work-card,.work-hub,.hub-store-card,.hub-photo-card,.batch-job,.prod-item,.brand-group,.brand-header,.review-section,.operator-note-dialog,.operator-note-entry,.editing-price-preview,.hud,.quick-edit,.price-table-dialog,.admin-dialog,.admin-edit-dialog,.analysis-chat-dialog,.creation-preview-dialog,.chart-expand-dialog,.selection-inspector,.inspector-empty,.catalog-product,.catalog-card,.app-settings-dialog,dialog,.zac-modal,.zac-modal-content){background:var(--surface);color:var(--text);border-color:var(--border)}
[data-theme=dark] :is(input,select,textarea,.input,.btn-secondary,.btn-ghost,.viewer-btn,.segmented button,.price-thumb,.admin-toolbar,.admin-cost-visibility,.preview-no-label){background:var(--surface-alt);color:var(--text);border-color:var(--border)}
[data-theme=dark] :is(.muted,small,.field-label,.admin-description,.admin-user-card small,.admin-user-card span,.operator-note-entry span,.preview-touch-hint,.identity-explanation,.quick-edit-heading span,.quick-edit-footer span,.price-product small,.editing-price-preview figcaption){color:var(--text-muted)}
[data-theme=dark] :is(h1,h2,h3,h4,.section-title,.prod-name,.admin-user-card b,.admin-dialog h3,.selected-product-card h3,.operator-workspace-title){color:var(--text)}
[data-theme=dark] :is(.selection-banner,.selected-product-card,.operator-notes-panel,.brand-group-header,.brand-header,.chat-message.user,.chat-photo-option,.analysis-efficiency-summary,.admin-usage-kpis>div,.admin-cost-visibility,.cost-panel,.canvas-view-popover,.quick-review-header,.quick-review-footer,.price-table-dialog .quick-review-header,.price-table-dialog .quick-review-footer,.access-form-panel){background:var(--surface-alt);color:var(--text);border-color:var(--border)}
[data-theme=dark] :is(.editing-preview-product img,.editing-preview-label img,.operator-note-content>img,.price-thumb){background:#131923}
[data-theme=dark] :is(.btn-primary,.btn-accent){background:#1878de;color:#fff;border-color:#348fe9}[data-theme=dark] .btn-danger{color:#ff9ca8;background:#472331;border-color:#844455}
[data-theme=dark] :is(th,thead,.admin-table-scroll thead th){background:#222c3b;color:#c8daee}[data-theme=dark] :is(td,th,tr,.divider,.admin-tabs,.admin-body,.admin-toolbar,.operator-note-dialog footer){border-color:var(--border)}
[data-theme=dark] .access-page{background:var(--bg);color:var(--text)}[data-theme=dark] .access-form-wrap h2{color:var(--text)}[data-theme=dark] .access-form-description,[data-theme=dark] .access-form-wrap label{color:var(--text-muted)}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;min-width:38px;min-height:38px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--theme-ink);cursor:pointer}.access-page>.theme-toggle{position:fixed;right:20px;top:16px;z-index:5}
/* These surfaces predate the shared palette and use high-specificity rules. */
[data-theme=dark] #appNavigation,[data-theme=dark] #studioGrid .card,[data-theme=dark] body :is(.studio-tabs,.dialog-footer,.quick-review-header,.quick-review-footer,.ai-policy-panel,.hub-sidebar,.hub-main,.hub-preview-pane,.inventory-body,.inventory-editor,.inventory-products,.inventory-product,.inventory-catalogs,.inventory-layout,.inventory-dialog,.inventory-product-dialog,.work-home-card,.work-list,.work-picker,.work-home,.batch-upload-panel,.upload-dropzone,.brand-header,.catalog-search,.review-board-family,.review-board-card,.chat-scope,.chat-header,.assistant-mode-bar,.assistant-options){background:var(--surface)!important;color:var(--text);border-color:var(--border)!important}
[data-theme=dark] body :is(.btn-ghost,.btn-secondary,.viewer-btn,.segmented,.segmented button,.canvas-view-popover,.canvas-view-options,.studio-tabs button,.batch-execution,.credential-state){background:var(--surface-alt)!important;color:var(--text)!important;border-color:var(--border)!important}
[data-theme=dark] body :is(.segmented button.active,.studio-tabs button[aria-selected=true],.viewer-btn.active,#appNavigation button.is-current,#appNavigation button:hover){background:var(--primary-light)!important;color:var(--primary)!important}
[data-theme=dark] #appNavigation button,[data-theme=dark] #appContextLabel{color:var(--text-muted)}[data-theme=dark] body :is(h1,h2,h3,h4){color:var(--text)!important}[data-theme=dark] body :is(label,.field-label,.muted,.ai-policy-heading p,.ai-policy-routing span,.ai-server-explanation,.ai-policy-scope,.batch-execution small,.identity-explanation,.preview-touch-hint,.operator-review-head p,.selectedLabelInfo){color:var(--text-muted)!important}[data-theme=dark] body .ai-policy-routing b{color:var(--primary)}
[data-theme=dark] .client-status{color:#e9c277}[data-theme=dark] .client-status.reviewed{color:#71d7ad}[data-theme=dark] .client-status.partial{color:#ffc58a}
[data-theme=dark] body :is(.dropzone,.batch-export,.hub-store,.hub-empty,.hub-trash-link,.hub-inventory-summary>div,.hub-source-photo,.hub-photo-original,.batch-job-actions,.inventory-dialog>footer,.inventory-catalog,.inventory-empty,.inventory-picker-row,.inventory-review-row,.inventory-settings,.inventory-photo-bar,.sku-gallery-item,.sku-gallery-large,.creation-card,.creation-error-card,.analysis-chat-message,.chat-examples button,.admin-user-card,.admin-toolbar,.admin-body,.admin-usage-kpis>div),[data-theme=dark] #analysisChatForm{background:var(--surface)!important;color:var(--text);border-color:var(--border)!important}
[data-theme=dark] body :is(.inventory-error,.creation-error-card){background:#3d252c!important;color:#ffa8b5}[data-theme=dark] body :is(.inventory-warning,.inventory-pending){background:#3d321e!important;color:#f0d29b}[data-theme=dark] body :is(.inventory-associated,.hub-inventory-badge){background:#173c35!important;color:#91dec3}
[data-theme=dark] body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea){background:var(--surface-alt)!important;color:var(--text)!important;border-color:var(--border)!important}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
/* Shared semantic tones: readable help, status and controls in either theme. */
:root{--positive-bg:#edf9f2;--positive-text:#176442;--warning-bg:#fff7e5;--warning-text:#875510;--warning-border:#e3c582;--negative-bg:#fff1f0;--negative-text:#b42338;--negative-border:#e8afb7}
[data-theme=dark]{--positive-bg:#173b32;--positive-text:#91dec3;--warning-bg:#3a301f;--warning-text:#f0d29b;--warning-border:#77613a;--negative-bg:#3d252e;--negative-text:#ffa8b5;--negative-border:#7c444f;--success:#91dec3;--warning:#f0d29b;--danger:#ffa8b5}
[data-theme] textarea,[data-theme] [contenteditable=true]{color:var(--theme-ink);caret-color:var(--primary)}
[data-theme=light] body :is(textarea,.textarea,input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=button]):not([type=submit]),select){background-color:var(--surface);color:var(--theme-ink);border-color:var(--border);color-scheme:light}
[data-theme] :is(input,textarea)::placeholder{color:var(--theme-muted)!important;opacity:1}
[data-theme] :is(input,textarea):-webkit-autofill{-webkit-text-fill-color:var(--theme-ink);caret-color:var(--primary);box-shadow:0 0 0 1000px var(--surface-alt) inset}
[data-theme] :is(input,select,textarea):disabled{color:var(--theme-muted)!important;cursor:not-allowed}
[data-theme] :is(.client-composer,#analysisChatForm) textarea{background:transparent!important;color:var(--theme-ink)!important}
[data-theme=dark] body :is(.inventory-bulk-bar,.inventory-dialog.is-embedded>header,.inventory-heading,.hub-preview-switch>div,.hub-preview-tabs,.hub-scope-stats,.hub-inventory-controls,.hub-inventory-help,.sku-bulk-row,.inventory-evidence,.inventory-choice,.inventory-change,.inventory-references label){border-color:var(--border);color:var(--theme-ink)}
[data-theme=dark] body :is(.hub-preview-switch button[aria-pressed=true],.hub-preview-tabs button[aria-selected=true],.inventory-catalog.is-active,.inventory-picker-row.is-active,.hub-store.is-current){background:var(--primary-light)!important;color:var(--primary)!important;border-color:var(--primary)!important}
[data-theme=dark] body :is(.inventory-table small,.inventory-product span,.inventory-heading p,.inventory-dialog>footer p,.sku-gallery-item small,.inventory-change small,.inventory-match-row small,.hub-basis,.hub-inventory-help,.hub-scope-stats,.hub-preview-caption,.hub-confirm-dialog p,.hub-store small){color:var(--theme-muted)}
[data-theme=dark] :is(.inventory-product img,.sku-bulk-identity>img,.inventory-review-content>img){background:var(--surface-alt)}
[data-theme=dark] :is(.app-dialog,.app-settings-dialog) :is(p,.help-text,.hint){color:var(--theme-muted)}
[data-theme] .theme-toggle-icons{position:relative;display:block;width:22px;height:22px;line-height:22px;pointer-events:none}
[data-theme] .theme-toggle-icons>i{position:absolute;inset:0;display:grid;place-items:center;width:22px;height:22px;margin:0!important;font-size:17px;line-height:1}
[data-theme=light] .theme-icon-sun,[data-theme=dark] .theme-icon-moon{opacity:0;transform:rotate(-35deg) scale(.7)}
[data-theme=light] .theme-icon-moon,[data-theme=dark] .theme-icon-sun{opacity:1;transform:rotate(0deg) scale(1)}
.theme-toggle:focus-visible{outline:3px solid var(--primary);outline-offset:3px}
@media(prefers-reduced-motion:no-preference){
 .theme-fading:not(.theme-crossfading) *,.theme-fading:not(.theme-crossfading) *::before,.theme-fading:not(.theme-crossfading) *::after{transition:background-color .28s ease,color .28s ease,border-color .28s ease,outline-color .28s ease,fill .28s ease,stroke .28s ease,box-shadow .28s ease!important}
 .theme-fading:not(.theme-crossfading) .theme-toggle-icons>i{transition:opacity .24s ease,transform .3s ease!important}
 .theme-crossfading::view-transition-old(root){animation:zac-theme-fade-out .28s ease both;mix-blend-mode:normal}
 .theme-crossfading::view-transition-new(root){animation:zac-theme-fade-in .3s ease both;mix-blend-mode:normal}
 @keyframes zac-theme-fade-out{to{opacity:0}}
 @keyframes zac-theme-fade-in{from{opacity:0}to{opacity:1}}
}
