/* Shared workspace language. Loaded after module styles; artwork/canvas typography stays local. */
:root{--wx-ui-ink:#171717;--wx-ui-muted:#626262;--wx-ui-line:#dededb;--wx-ui-soft:#f6f6f4;--wx-ui-surface:#fff;--wx-ui-radius:12px;--wx-ui-control:8px;--wx-ui-gap:24px}
/* The old sidebar flyout is also mounted by legacy navigation; the shared header replaces it. */
html body.wx-unified[data-site-app=main]>.wx-desktop-dropdown{display:none!important}
html body.wx-unified dialog{margin:auto}
html body.wx-unified [data-workspace-title]{font-size:clamp(26px,3vw,36px)!important;line-height:1.25!important;letter-spacing:-.025em!important}
html body.wx-unified[data-site-page] :is(.overlay-hero,.studio-hero,.page-header,header:not(.site-header)) h1{font-size:clamp(26px,3vw,36px)!important;line-height:1.25!important;letter-spacing:-.025em!important}
html body.wx-unified[data-site-page=tryon] .result-head h3{font-size:16px!important;line-height:1.5!important}
html body.wx-unified :is(.pr-section-title,.step1-section-title,.pt-stage-title){font-size:16px!important;line-height:1.5;font-weight:650}
html body.wx-unified .pr-upload-area{border:1px dashed #a5a5a1!important;background:var(--wx-ui-soft)!important;border-radius:12px!important}
html body.wx-unified :is(.poster-controls,.pt-stage-card){border:1px solid var(--wx-ui-line)!important;border-radius:12px!important;background:#fff!important}
html body.wx-unified{font-family:'Geist','PingFang SC','Microsoft YaHei',system-ui,sans-serif;font-size:16px;line-height:1.6;color:var(--wx-ui-ink);--text-secondary:var(--wx-ui-muted);--input-bg:var(--wx-ui-surface);--input-border:var(--wx-ui-line)}
/* Component titles must not inherit the marketing heading scale. */
html body.wx-unified :is(.panel-title,.section-title,.tool-input-label,.ap-label,.overlay-section-head h2,.card-header h2,.card-header h3,.favorite-section h2,.custom-form h2){font-size:16px!important;line-height:1.5!important;font-weight:650;letter-spacing:0}
html body.wx-unified :is(.tool-panel-header h2,.page-header h1,.page-header h2,.ap-title,.studio-hero h1){font-size:clamp(26px,3vw,36px)!important;line-height:1.25!important;letter-spacing:-.025em}
html body.wx-unified :is(.tool-panel-header,.page-header){gap:16px;flex-wrap:wrap;margin-bottom:24px}
html body.wx-unified :is(.tool-panel-header p,.page-header p,.ap-desc,.studio-hero p){font-size:14px;line-height:1.7;color:var(--wx-ui-muted)}
html body.wx-unified :is(.step1-card,.ap-card,.tool-panel-left,.tool-panel-right,.panel,.card,.settings-section,.overlay-controls,.overlay-output,.login-panel){border:1px solid var(--wx-ui-line)!important;border-radius:var(--wx-ui-radius)!important;background:var(--wx-ui-surface)!important;box-shadow:none!important;min-width:0}
html body.wx-unified :is(.tool-panel-left,.tool-panel-right,.panel,.ap-card,.step1-card){padding:24px!important}
html body.wx-unified :is(.tool-panel-layout,.overlay-workspace){gap:var(--wx-ui-gap)}
html body.wx-unified :is(#pageProductImage,#pagePhotoEdit,#pagePhotoID,#pageBeauty) .tool-panel-layout{align-items:flex-start}
html body.wx-unified[data-site-page=tryon] main>.layout{align-items:start}
html body.wx-unified :is(.tool-panel-left,.tool-panel-right,.wx-rich-wrap,.overlay-controls,.overlay-output,.main-content,.main-workspace){min-width:0}
html body.wx-unified .tool-input-group{margin-bottom:24px}
html body.wx-unified :is(.tool-input-label,.form-label,.ap-label){display:block;margin-bottom:8px}
html body.wx-unified :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]),select,textarea):not(.wx-rich-value){box-sizing:border-box;min-height:44px;max-width:100%;font-family:inherit;font-size:14px;line-height:1.6;border:1px solid var(--wx-ui-line)!important;border-radius:var(--wx-ui-control)!important;background:var(--wx-ui-surface)!important;color:var(--wx-ui-ink)!important;padding:10px 12px}
html body.wx-unified :is(textarea,.wx-rich-editor):not(.wx-rich-value){font-size:15px;line-height:1.8}
html body.wx-unified :is(input,textarea,select,.wx-rich-editor):focus-visible{outline:2px solid var(--wx-ui-ink)!important;outline-offset:3px!important}
html body.wx-unified :is(button,.btn){font-family:inherit;min-height:44px;line-height:1.5;touch-action:manipulation}
html body.wx-unified :is(.btn,.btn-primary,.btn-secondary,.ap-btn-blue,.ap-btn-ghost,.tool-action-btn,.tool-back-btn,.wx-media-button,.overlay-primary,.overlay-secondary){border-radius:var(--wx-ui-control)!important;padding:10px 16px;font-size:14px;font-weight:600}
html body.wx-unified :is(.btn-primary,.ap-btn-blue,.tool-action-btn,.overlay-primary,.btn.accent,button.primary){background:var(--wx-ui-ink)!important;color:#fff!important;border:1px solid var(--wx-ui-ink)!important;box-shadow:none!important}
html body.wx-unified :is(.btn-secondary,.ap-btn-ghost,.tool-back-btn,.wx-media-button,.overlay-secondary,.btn.ghost){background:var(--wx-ui-surface)!important;color:var(--wx-ui-ink)!important;border:1px solid var(--wx-ui-line)!important;box-shadow:none!important}
html body.wx-unified button:disabled{cursor:not-allowed;opacity:.45}
html body.wx-unified :is(.hint,.tool-hint,.overlay-help,.anchor-note,.wx-rich-tools){font-size:13px;line-height:1.65;color:var(--wx-ui-muted)}
html body.wx-unified :is(.upload,.upload-area,.ref-upload,.anchor-box,.outfit-anchor-upload,.outfit-detail-upload,.upload-zone){border:1px dashed #a5a5a1!important;border-radius:var(--wx-ui-radius)!important;background:var(--wx-ui-soft)!important;color:var(--wx-ui-ink)!important}
html body.wx-unified :is(.upload,.upload-area,.anchor-box,.outfit-anchor-upload):focus-within{outline:2px solid var(--wx-ui-ink);outline-offset:3px}
/* Editable image-tag prompts retain their existing focus/blur behavior. */
html body.wx-unified :is(.wx-rich-editor,#outfitPromptEditor){border:1px solid var(--wx-ui-line);border-radius:var(--wx-ui-control);background:#fff;padding:14px;box-shadow:none}
html body.wx-unified .wx-rich-chip{background:var(--wx-ui-soft);border-color:#bdbdb8;color:var(--wx-ui-ink);min-height:28px}
html body.wx-unified .wx-rich-tools{gap:12px;flex-wrap:wrap;margin:8px 0}
/* Reference roles form a compact grid, while each card keeps its own explanation. */
html body.wx-unified .wx-reference-panel{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:12px;padding:20px;margin:24px 0;border:1px solid var(--wx-ui-line);border-radius:var(--wx-ui-radius);background:var(--wx-ui-soft)}
html body.wx-unified .wx-reference-panel>h3{grid-column:1/-1;font-size:16px!important;line-height:1.5;letter-spacing:0;margin:0}
html body.wx-unified .wx-reference-panel>p{grid-column:1/-1;margin:0;font-size:13px;color:var(--wx-ui-muted);line-height:1.7}
html body.wx-unified .wx-reference-row{min-width:0;display:flex;flex-direction:column;align-items:stretch;gap:8px;padding:16px;border:1px solid var(--wx-ui-line);border-radius:var(--wx-ui-control);background:#fff}
html body.wx-unified .wx-reference-row>label{font-size:14px;font-weight:650;margin:0}
html body.wx-unified .wx-reference-row>small{font-size:12px;line-height:1.6;color:var(--wx-ui-muted)}
html body.wx-unified .wx-reference-row[data-reference-role=other]{grid-column:1/-1}
html body.wx-unified .wx-reference-row input[type=file]{box-sizing:border-box;width:100%;max-width:100%;font-size:12px;min-height:44px!important;margin:0;background:transparent!important;border:0!important;padding:0;color:var(--wx-ui-muted)!important}
html body.wx-unified .wx-reference-row input[type=file]::file-selector-button{font-family:inherit;font-size:13px;font-weight:600;line-height:1.5;background:var(--wx-ui-soft);color:var(--wx-ui-ink);border:1px solid var(--wx-ui-line);border-radius:var(--wx-ui-control);min-height:44px;padding:8px 12px;margin-right:8px;cursor:pointer}
html body.wx-unified .wx-reference-row textarea{min-height:90px;margin:0}
html body.wx-unified .wx-reference-upload{position:relative;display:flex;align-items:center;justify-content:center;min-height:64px;padding:12px;border:1px dashed #a5a5a1;border-radius:8px;background:var(--wx-ui-soft);font-size:13px;cursor:pointer}
html body.wx-unified .wx-reference-upload input[type=file]{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
html body.wx-unified .wx-reference-upload:focus-within{outline:2px solid var(--wx-ui-ink);outline-offset:3px}
html body.wx-unified .wx-reference-upload:hover{background:#ececea}
html body.wx-unified .wx-reference-thumbs{gap:12px;margin:0}
html body.wx-unified .wx-reference-item{width:96px;gap:6px;font-size:12px}
html body.wx-unified .wx-reference-item img{width:96px;height:96px;object-fit:contain;border:1px solid var(--wx-ui-line);border-radius:8px;background:var(--wx-ui-soft)}
html body.wx-unified .wx-reference-item button{border:1px solid var(--wx-ui-line);background:#fff;border-radius:8px;font-size:12px;min-height:36px}
/* Result actions and history use the same toolbar and card language. */
html body.wx-unified .wx-generation-actions{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0;padding-top:12px;border-top:1px solid var(--wx-ui-line)}
html body.wx-unified .wx-generation-actions[hidden]{display:none}
html body.wx-unified [data-module-history]{margin:0 0 16px}
html body.wx-unified .wx-module-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:16px 0 0}
html body.wx-unified .wx-module-toolbar [data-module-history]{margin:0}
html body.wx-unified #pageCreation>.wx-module-toolbar{padding:0 24px;margin-bottom:16px}
/* Free-image header shares the entire grid row; its template controls reserve inline space. */
html body.wx-unified #pageRawImg .wx-template-raw-header{grid-column:1/-1;min-width:0}
html body.wx-unified #pageRawImg .ap-hero-wrap{min-width:0}
html body.wx-unified .wx-generation-dialog{box-sizing:border-box;width:min(1120px,94vw);max-height:90dvh;padding:24px;background:#fff;border:1px solid var(--wx-ui-line);border-radius:16px;color:var(--wx-ui-ink);box-shadow:0 24px 80px #0003}
html body.wx-unified .wx-generation-dialog>header{top:-24px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;margin:0;background:#fff;border-bottom:1px solid var(--wx-ui-line)}
html body.wx-unified .wx-generation-dialog>header h2{font-size:20px!important;line-height:1.4!important;letter-spacing:0!important;margin:0}
html body.wx-unified .wx-generation-dialog>header button{flex-shrink:0;min-width:64px}
html body.wx-unified .wx-media-history-grid{gap:16px;margin-top:16px;grid-template-columns:repeat(auto-fill,minmax(210px,1fr))}
html body.wx-unified .wx-media-history-card{border:1px solid var(--wx-ui-line);border-radius:12px;padding:12px;background:#fff}
html body.wx-unified .wx-media-history-card img{height:220px;border-radius:8px;background:var(--wx-ui-soft)}
html body.wx-unified .wx-media-history-card p{font-size:13px;color:var(--wx-ui-ink);margin:12px 0 8px}
html body.wx-unified .wx-media-history-card small{font-size:12px;color:var(--wx-ui-muted)}
html body.wx-unified :is(.wx-rich-preview,.direction-editor,.wide-dialog){border-radius:16px;border:1px solid var(--wx-ui-line)}
html body.wx-unified :is(.dialog-head h2,.model-picker-head h2,.model-picker-head h3){font-size:20px!important;line-height:1.4!important;letter-spacing:0}
@media(max-width:1100px){html body.wx-unified .wx-reference-panel{grid-template-columns:1fr}}
@media(max-width:760px){
 html body.wx-unified{--wx-ui-gap:16px}
 html body.wx-unified :is(.tool-panel-left,.tool-panel-right,.panel,.ap-card,.step1-card){padding:16px!important}
 html body.wx-unified .tool-panel-layout{grid-template-columns:minmax(0,1fr)!important;flex-direction:column}
 html body.wx-unified :is(.tool-panel-left,.tool-panel-right){width:100%!important;max-width:100%!important;flex-basis:auto!important}
 html body.wx-unified :is(.tool-panel-header h2,.page-header h1,.ap-title,.studio-hero h1){font-size:26px!important}
 html body.wx-unified .wx-reference-panel{padding:12px;gap:12px}
 html body.wx-unified :is(input,select,textarea,.wx-rich-editor):not(.wx-rich-value){font-size:16px}
 html body.wx-unified .wx-generation-dialog{width:calc(100vw - 24px);padding:16px;max-height:90dvh}
 html body.wx-unified .wx-generation-dialog>header{top:-16px}
 html body.wx-unified .wx-media-history-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 html body.wx-unified .wx-media-history-card{padding:8px}
 html body.wx-unified .wx-media-history-card img{height:160px}
 html body.wx-unified .wx-media-history-card .wx-media-button{width:100%;margin:4px 0;padding:8px}
 html body.wx-unified .wx-reference-item button{min-height:44px}
}
@media(prefers-reduced-motion:reduce){html body.wx-unified *,html body.wx-unified *::before,html body.wx-unified *::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
