/* Two accessible working surfaces. Keep photography and printable reports untouched. */
html[data-theme='light'], :root {
  --ws-canvas:#edf3f5; --ws-panel:#ffffff; --ws-raised:#f5f9fa; --ws-field:#ffffff;
  --ws-ink:#17313a; --ws-muted:#526771; --ws-line:#c4d2d8; --ws-control-line:#7d939e;
  --ws-accent:#146c62; --ws-on-accent:#ffffff; --ws-selected:#e1f2ed;
  --ws-focus:#956b1f; --ws-warning:#775719; --ws-warning-bg:#fff7e4;
  --ws-disabled:#e4ebee; --ws-disabled-ink:#526771; --ws-shadow:0 8px 28px #16333d0b;
  color-scheme:light;
}
html[data-theme='dark'] {
  --ws-canvas:#14212b; --ws-panel:#20313e; --ws-raised:#293e4d; --ws-field:#192a36;
  --ws-ink:#f0f5f8; --ws-muted:#bbcbd5; --ws-line:#536b7a; --ws-control-line:#8299a6;
  --ws-accent:#8ce0cb; --ws-on-accent:#102d29; --ws-selected:#304f50;
  --ws-focus:#f0ce88; --ws-warning:#f3d794; --ws-warning-bg:#36352b;
  --ws-disabled:#2d404c; --ws-disabled-ink:#a8bac5; --ws-shadow:0 8px 28px #0000001f;
  color-scheme:dark;
}
html[data-theme] {
  --ink:var(--ws-ink); --muted:var(--ws-muted); --line:var(--ws-line);
  --blue:var(--ws-accent); --blue-dark:var(--ws-accent); --cream:var(--ws-canvas);
  --moke-ivory:var(--ws-canvas); --moke-paper:var(--ws-panel); --moke-ink:var(--ws-ink);
  --moke-muted:var(--ws-muted); --moke-line:var(--ws-line); --moke-shadow:var(--ws-shadow);
  --ref-ivory:var(--ws-canvas); --ref-paper:var(--ws-panel); --ref-paper-soft:var(--ws-raised);
  --ref-sage:var(--ws-selected); --ref-sage-2:var(--ws-raised); --ref-ink:var(--ws-ink);
  --ref-muted:var(--ws-muted); --ref-line:var(--ws-line);
  background:var(--ws-canvas);
}
html[data-theme] body { background:var(--ws-canvas); color:var(--ws-ink); }
.app-shell[data-theme] { color:var(--ws-ink); font-family:'Noto Sans SC','Microsoft YaHei',sans-serif; }
.app-shell[data-theme] :is(.main-area,.mobile-content-shell,.aw-shell,.aw-workspace,.template-library-page,.project-records-page,.material-page,.membership-page,.support-page,.awf-page) { background:var(--ws-canvas); color:var(--ws-ink); }
.app-shell[data-theme] .topbar { background:var(--ws-panel); border-color:var(--ws-line); box-shadow:none; }
.app-shell[data-theme] :is(.breadcrumbs,.status,.topbar .icon-button) { color:var(--ws-muted); font-size:12px; }
.app-shell[data-theme] .breadcrumbs strong { color:var(--ws-ink); }
.app-shell[data-theme] :is(.top-workbench-summary,.breadcrumbs em) { background:var(--ws-selected); border-color:var(--ws-line); color:var(--ws-ink); }

/* The fixed navigation retains the brand's deep teal in both themes. */
.app-shell[data-theme] .sidebar { background:#12343b; border-right:1px solid #52747a; box-shadow:none; }
.app-shell[data-theme] .sidebar::after { display:none; }
.app-shell[data-theme] :is(.nav-item,.sidebar-workbench-subnav button) { color:#ccdee1; font-size:13px; }
.app-shell[data-theme] :is(.nav-label,.logo-lockup small,.profile span,.credit-head span,.credit-foot span) { color:#b6ced3; }
.app-shell[data-theme] :is(.nav-item:hover,.sidebar-workbench-subnav button:hover) { background:#244d54; color:#fff; }
.app-shell[data-theme] :is(.nav-item.active,.sidebar-workbench-subnav button.active) { background:#31615f; color:#fff; box-shadow:inset 3px 0 #f0ce88; }
.app-shell[data-theme] .sidebar-workbench-subnav { border-color:#52747a; }
.app-shell[data-theme] .sidebar-workbench-subnav button:disabled { color:#b3c9cf; opacity:1; background:transparent; }
.app-shell[data-theme] :is(.credit-card,.credit-balance-card,.workspace-pill) { background:#1c444b; border-color:#52747a; }
.app-shell[data-theme] .profile { border-color:#52747a; color:#fff; }
.app-shell[data-theme] .theme-picker { background:var(--ws-panel); border-color:var(--ws-control-line); color:var(--ws-ink); box-shadow:0 12px 40px #0004; padding:14px; }
.app-shell[data-theme] .theme-picker header strong { color:var(--ws-ink); font-size:14px; }
.app-shell[data-theme] .theme-picker header span { color:var(--ws-muted); font-size:11px; }
.app-shell[data-theme] .theme-picker header>button { color:var(--ws-ink); border-color:var(--ws-control-line); width:30px; height:30px; }
.app-shell[data-theme] .theme-picker>div { gap:8px; }
.app-shell[data-theme] .theme-picker>div>button { background:var(--ws-raised); color:var(--ws-ink); border-color:var(--ws-control-line); padding:12px 8px; }
.app-shell[data-theme] .theme-picker>div>button.active { background:var(--ws-selected); border:2px solid var(--ws-accent); padding:11px 7px; box-shadow:none; }
.app-shell[data-theme] .theme-picker :is(b,svg) { color:var(--ws-ink); font-size:12px; }
.app-shell[data-theme] .theme-picker small { color:var(--ws-muted); font-size:10px; }
.app-shell[data-theme] .theme-picker>div>button { gap:6px; flex-direction:column; align-items:flex-start; }
.app-shell[data-theme] .theme-picker small { text-overflow:clip; white-space:normal; overflow:visible; line-height:1.4; }
.app-shell[data-theme] .breadcrumbs>span { color:var(--ws-muted); }

/* White/graphite surfaces are intentionally separated from the canvas. */
.app-shell[data-theme] :is(.aw-tool-page,.setup-panel,.preview-panel,.template-inputs,.template-controls,.template-picker-dialog,.project-records-table,.aesthetic-records-empty,.material-editor,.personal-card,.organization-admin,.membership-card,.support-card,.awf-card,.awf-continue-card) { background:var(--ws-panel); color:var(--ws-ink); border-color:var(--ws-line); box-shadow:var(--ws-shadow); }
.app-shell[data-theme] :is(.aw-tool-head,.aw-tool-heading,.aw-controls,.aw-preview,.aw-help-popover,.aw-recovery-preview,.aw-timeline-board,.aw-runbar,.aw-recovery-runbar,.aw-stage-timeline,.aw-preview-state,.aw-comparison,.aw-result-grid>div,.ri-result) { background:var(--ws-panel); color:var(--ws-ink); border-color:var(--ws-line); }
.app-shell[data-theme] :is(.aw-tool-heading h1,.aw-tool-heading h2,.aw-preview h2,.aw-section h3,.aw-form-section>header>strong,.page-heading h1,.template-hero h1,.template-output h2,.awf-heading h1,.personal-card h2,.material-page h1,.material-page h2) { color:var(--ws-ink); }
.app-shell[data-theme] :is(.aw-tool-heading h1,.page-heading h1,.awf-heading h1) { font-family:'Noto Serif SC','Source Han Serif SC',serif; font-size:clamp(23px,2.1vw,30px); line-height:1.4; }
.app-shell[data-theme] :is(.aw-tool-heading p,.aw-field-hint,.aw-section-note,.aw-choice-group>span,.aw-section p,.aw-preview>header small,.aw-preview>header span,.aw-runbar>span,.aw-back-project span,.aw-stage-side,.aw-run-reason,.aw-disclaimer,.page-heading p,.template-hero p,.template-prompt>small,.template-reference-notice,.template-run-hint,.aw-report-export-hint) { color:var(--ws-muted)!important; font-size:12px; line-height:1.7; }
.app-shell[data-theme] :is(.aw-form-section>header>strong,.aw-choice-group>span,.template-effect-options>strong) { font-size:14px; }
.app-shell[data-theme] :is(.aw-eyebrow,.aw-tool-heading>div>span,.aw-section-number,.aw-form-section>header>span) { color:var(--ws-accent); border-color:var(--ws-accent); }
.app-shell[data-theme] :is(.aw-compliance,.template-confirmations,.notice,.awf-disclaimer) { background:var(--ws-warning-bg); color:var(--ws-warning); border-color:var(--ws-warning); }
.app-shell[data-theme] :is(.aw-compliance strong,.aw-compliance span,.template-confirmations>summary strong,.template-confirmations>summary span,.notice b,.notice span) { color:var(--ws-warning)!important; font-size:12px; }
.app-shell[data-theme] :is(.aw-section,.aw-tool-heading,.aw-form-section,.aw-preview>header) { border-color:var(--ws-line); }

/* Input surfaces and empty previews remain distinct, even without an image. */
.app-shell[data-theme] :is(.aw-upload,.aw-field,.aw-note textarea,.aw-form-section textarea,.template-upload>div,.template-prompt textarea,.template-focus-input input,.template-effect-options,.aw-stage-main,.aw-stage-side>span,.material-source-picker,.material-asset-dropdown,.material-source-picker .material-upload) { background:var(--ws-field); color:var(--ws-ink); border-color:var(--ws-control-line); }
.app-shell[data-theme] :is(.aw-upload-empty,.aw-upload-caption,.template-reference-list small) { background:var(--ws-raised); color:var(--ws-muted); }
.app-shell[data-theme] .aw-upload-empty strong { color:var(--ws-ink)!important; font-size:14px; }
.app-shell[data-theme] .aw-upload-empty :is(small,em) { color:var(--ws-muted)!important; font-size:12px; line-height:1.65; }
.app-shell[data-theme] .aw-upload-empty>span { background:var(--ws-selected); }
.app-shell[data-theme] :is(.aw-upload-empty svg,.aw-stage-main svg) { color:var(--ws-accent)!important; }
.app-shell[data-theme] .aw-stage-main>div:not(.aw-preview-state) { color:var(--ws-muted)!important; }
.app-shell[data-theme] .aw-stage-main>div:not(.aw-preview-state) strong { color:var(--ws-ink)!important; font-size:15px; }
.app-shell[data-theme] .aw-stage-main>div:not(.aw-preview-state) :is(span,small) { color:var(--ws-muted)!important; font-size:12px; }
.app-shell[data-theme] :is(.aw-field input,.aw-field select,.aw-field textarea,.template-controls select,.template-controls input,.template-effect-options select,.material-editor input,.material-editor textarea,.material-editor select,.personal-card input,.personal-card select) { color:var(--ws-ink); background:var(--ws-field); border-color:var(--ws-control-line); font-size:13px; min-height:38px; }
.app-shell[data-theme] :is(input,textarea)::placeholder { color:var(--ws-muted)!important; opacity:1; }
.app-shell[data-theme] :is(.template-prompt,.template-controls label,.template-focus-input,.template-upload-guide) { color:var(--ws-ink); background:transparent; }
.app-shell[data-theme] :is(.template-prompt>span,.template-focus-input>span,.template-controls label>span,.template-effect-options>strong,.template-effect-options>div>span,.template-upload b,.template-upload strong) { color:var(--ws-ink); font-size:13px; }
.app-shell[data-theme] :is(.template-upload small,.template-card-copy p,.template-card-copy span,.material-source-heading span,.material-source-switch button small) { color:var(--ws-muted); font-size:12px; }
.app-shell[data-theme] .template-upload>span { color:var(--ws-ink); font-size:13px; }
.app-shell[data-theme] .template-selected-flow { background:var(--ws-selected); border-color:var(--ws-line); }
.app-shell[data-theme] .template-selected-copy strong { color:var(--ws-ink); font-size:14px; }
.app-shell[data-theme] .template-selected-copy :is(span,p) { color:var(--ws-muted); font-size:11px; }
.app-shell[data-theme] .template-selected-flow li { border-color:var(--ws-line); }
.app-shell[data-theme] .template-selected-flow li strong { color:var(--ws-ink); font-size:11px; }
.app-shell[data-theme] .template-selected-flow li span { color:var(--ws-accent); background:var(--ws-panel); border-color:var(--ws-accent); font-size:10px; }
.app-shell[data-theme] .template-confirmations summary :is(small,em) { color:var(--ws-warning)!important; font-size:12px; }
.app-shell[data-theme] :is(.template-page-heading,.template-gallery-heading)>div>span { color:var(--ws-muted); font-size:11px; }
.app-shell[data-theme] .template-output-empty { background:var(--ws-panel); border-color:var(--ws-line); }
.app-shell[data-theme] .template-output-empty strong { color:var(--ws-ink); }
.app-shell[data-theme] .template-output-empty p { color:var(--ws-muted); font-size:12px; }
.app-shell[data-theme] .template-output-empty>span { color:var(--ws-accent); background:var(--ws-selected); }
.app-shell[data-theme] .aw-upload-empty em { background:var(--ws-field)!important; border-color:var(--ws-control-line); }

/* One interaction language: solid selected controls, outlined idle controls. */
.app-shell[data-theme] :is(.aw-choice-group button,.aw-prompt-presets button,.aw-stage-list button,.aw-ratio-grid button,.template-effect-options button,.aw-back-project,.aw-help>summary,.aw-recovery-preview-head button,.aw-recovery-preview-actions button,.aw-recovery-runbar>button,.aw-timeline-board header button,.button.ghost,.button.secondary,.personal-tabs button,.material-asset-options button,.template-picker-categories button) { border-color:var(--ws-control-line); color:var(--ws-ink); background:var(--ws-field); box-shadow:none; min-height:36px; font-size:12px; }
.app-shell[data-theme] :is(.aw-choice-group button,.template-effect-options button,.aw-ratio-grid button,.aw-prompt-presets button):hover:not(:disabled) { background:var(--ws-selected); border-color:var(--ws-accent); }
.app-shell[data-theme] :is(.aw-choice-group button.selected,.template-effect-options button.active,.template-effect-options button[aria-pressed='true'],.aw-ratio-grid button.active,.aw-stage-list button.active,.aw-prompt-presets button.selected) { background:var(--ws-accent); color:var(--ws-on-accent); border-color:var(--ws-accent); font-weight:700; box-shadow:none; }
.app-shell[data-theme] :is(.aw-runbar>button,.aw-generate,.button.primary,.template-run,.generate-button,.awf-button.primary,.aw-recovery-runbar>button.primary) { background:var(--ws-accent); color:var(--ws-on-accent); border-color:var(--ws-accent); box-shadow:none; font-weight:700; }
.app-shell[data-theme] :is(.aw-choice-group button,.template-effect-options button,.aw-runbar>button,.aw-recovery-runbar>button,.template-run,.button,.awf-button,.aw-recovery-preview-actions button):disabled { opacity:1; color:var(--ws-disabled-ink); background:var(--ws-disabled); border:1px dashed var(--ws-control-line); box-shadow:none; cursor:not-allowed; }
.app-shell[data-theme] :is(button,a,input,textarea,select,summary):focus-visible { outline:3px solid var(--ws-focus)!important; outline-offset:3px; }
.app-shell[data-theme] :is(.aw-stage-arrow,.aw-stage-timeline button.active,.template-asset-entry,.awf-link) { color:var(--ws-accent); border-color:var(--ws-accent); }
.app-shell[data-theme] .aw-stage-timeline button { color:var(--ws-muted); font-size:12px; }
.app-shell[data-theme] :is(.template-confirmation-options>label,.template-confirmation-options label.checked) { background:var(--ws-panel); color:var(--ws-ink); }
.app-shell[data-theme] .template-confirmation-options label :is(b,span,small) { color:var(--ws-ink); }

/* Workflows use their existing semantic tokens, including modal/step surfaces. */
.app-shell[data-theme] .awf { --awf-ink:var(--ws-ink); --awf-muted:var(--ws-muted); --awf-paper:var(--ws-panel); --awf-line:var(--ws-line); --awf-green:var(--ws-accent); --awf-soft:var(--ws-selected); }
.app-shell[data-theme] :is(.awf-step-heading,.awf-step-panel,.awf-controls,.awf-preview,.awf-panel,.awf-input,.awf-upload,.awf-draft,.awf-modal>section,.awf-direction-editor) { color:var(--ws-ink); background:var(--ws-panel); border-color:var(--ws-line); }
.app-shell[data-theme] .awf-card-copy { background:linear-gradient(to right,var(--ws-panel) 24%,color-mix(in srgb,var(--ws-panel) 90%,transparent) 47%,transparent 82%); }
.app-shell[data-theme] :is(.awf-eyebrow,.awf-cover-disclaimer) { color:var(--ws-muted); font-size:12px!important; }
.app-shell[data-theme] :is(.awf-empty,.awf-lock,.awf-notice,.awf-presets button) { background:var(--ws-raised); color:var(--ws-muted); border-color:var(--ws-control-line); }
.app-shell[data-theme] .awf fieldset:disabled { opacity:1; }
.app-shell[data-theme] .awf :is(input,textarea,select) { color:var(--ws-ink); background:var(--ws-field); border-color:var(--ws-control-line); }
.app-shell[data-theme] .awf-button.primary { color:var(--ws-on-accent); }
.app-shell[data-theme] :is(.generation-progress,.gp-card) { color:var(--ws-ink); background:var(--ws-raised); border-color:var(--ws-line); }
html[data-theme] { scrollbar-color:var(--ws-control-line) var(--ws-canvas); }
@media(max-width:760px) {
  .app-shell[data-theme] :is(.aw-tool-heading h1,.page-heading h1,.awf-heading h1) { font-size:23px; }
  .app-shell[data-theme] :is(input,textarea,select) { font-size:16px; }
  .app-shell[data-theme] :is(.aw-mobile-tools,.mobile-bottom-nav,.mobile-topbar) { background:var(--ws-panel); color:var(--ws-ink); border-color:var(--ws-line); }
  .app-shell[data-theme] :is(.aw-mobile-tools button,.mobile-bottom-nav button) { color:var(--ws-muted); }
}
@media(prefers-reduced-motion:reduce) {
  .app-shell[data-theme] button { transition:none; }
}
