/* Original-layout refinement. Functional positioning is retained; tokens and
   narrowly scoped layout fixes sit after the existing compatibility sheets. */
html[data-zq-theme] body.reference-ui-shell{--ref-bg:#101724;--ref-bg-2:#131e2e;--ref-surface:#182233;--ref-surface-2:#202e43;--ref-surface-3:#28384e;--ref-card:#182233;--ref-border:#2b3a50;--ref-border-2:#40526c;--ref-text:#ecf2fb;--ref-sub:#b7c5da;--ref-muted:#a6b5cc;--ref-primary:#73a5ff;--ref-primary-2:#8ab3ff;--ref-blue:#87b9ff;--ref-orange:#2463eb;--ref-orange-2:#3976ef;--ref-shadow:0 7px 24px #02081624;--refine-button:#2463eb;--refine-soft:#223b60;--refine-focus:#8bb8ff;--refine-panel-shadow:0 18px 50px #0005;--refine-success-bg:#143c30;--refine-success:#8bdec0;--refine-warning-bg:#3d301e;--refine-warning:#f5cf81;--refine-danger-bg:#3b2430;--refine-danger:#ffb7c1;--bg:var(--ref-bg);--bg-2:var(--ref-bg-2);--panel:var(--ref-surface);--panel-solid:var(--ref-surface);--panel-hi:var(--ref-surface-2);--line:var(--ref-border);--line-2:var(--ref-border-2);--text:var(--ref-text);--sub:var(--ref-sub);--muted:var(--ref-muted);--accent:var(--ref-primary);--accent-2:var(--ref-blue);--coral:var(--refine-button);font-family:'Segoe UI','Microsoft YaHei','PingFang SC',sans-serif;background:var(--ref-bg)!important;color:var(--ref-text)!important;font-size:14px;line-height:1.55;-webkit-font-smoothing:antialiased}
html[data-zq-theme=light] body.reference-ui-shell{--ref-bg:#f3f6fa;--ref-bg-2:#f8fafd;--ref-surface:#fff;--ref-surface-2:#f0f4fa;--ref-surface-3:#e7edf6;--ref-card:#fff;--ref-border:#dce3ed;--ref-border-2:#bbc9dc;--ref-text:#182b45;--ref-sub:#435975;--ref-muted:#566980;--ref-primary:#2463eb;--ref-primary-2:#1f56ca;--ref-blue:#205eb5;--ref-shadow:0 5px 20px #253e6010;--refine-soft:#eaf1ff;--refine-focus:#2463eb;--refine-panel-shadow:0 18px 50px #21345228;--refine-success-bg:#e4f4ed;--refine-success:#1d6c4f;--refine-warning-bg:#fff3dd;--refine-warning:#80550c;--refine-danger-bg:#ffedf0;--refine-danger:#a42e47}
html body.reference-ui-shell::before{background:none!important}
.reference-ui-shell :is(button,input,select,textarea){font-family:inherit}
.reference-ui-shell :is(button,input,select,textarea,a,summary,[tabindex]):focus-visible{outline:2px solid var(--refine-focus)!important;outline-offset:3px!important;box-shadow:none!important}
.reference-ui-shell :is(input,textarea)::placeholder{color:var(--ref-muted)!important;opacity:1}
.reference-ui-shell ::selection{background:var(--refine-button);color:#fff}
.reference-ui-shell :is(.topbar,.works,.right-view){background:var(--ref-bg)!important}
.reference-ui-shell .topbar{background:var(--ref-surface)!important;border-color:var(--ref-border)!important;box-shadow:0 1px 0 var(--ref-border)!important;backdrop-filter:none!important}
.reference-ui-shell .brand-copy{letter-spacing:-.3px;font-weight:700!important}.reference-ui-shell .brand-copy small{color:var(--ref-muted)!important;font-size:10px;letter-spacing:1.1px}
.reference-ui-shell .brand-mark{background:var(--refine-button)!important;box-shadow:none!important;border-radius:9px!important}
.reference-ui-shell .nav{gap:5px!important}.reference-ui-shell .nav button{font-size:13px!important;font-weight:500!important;border-radius:7px!important;color:var(--ref-sub)!important;transition:background .15s,color .15s}
.reference-ui-shell .nav button.active{background:var(--refine-soft)!important;border-color:var(--ref-border-2)!important;color:var(--ref-primary)!important;box-shadow:none!important;font-weight:650!important}
.reference-ui-shell .nav button:hover{background:var(--ref-surface-2)!important;color:var(--ref-text)!important}
.reference-ui-shell :is(.app-version-badge,.quota-box,.recharge,.admin-switch,.top-right>.icon-btn){background:var(--ref-bg-2)!important;border-color:var(--ref-border)!important;color:var(--ref-sub)!important;box-shadow:none!important;border-radius:7px!important}
.reference-ui-shell .quota-box strong{color:var(--ref-text)!important;font-variant-numeric:tabular-nums}.reference-ui-shell .app-version-badge{max-width:122px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reference-ui-shell :is(h1,h2,h3){letter-spacing:-.025em}.reference-ui-shell :is(.content-head h2,.reference-section-head h1){font-size:23px!important;line-height:1.35;font-weight:700!important}.reference-ui-shell :is(.reference-section-head h2,.works-head h2){font-size:19px!important;font-weight:650!important}
.reference-ui-shell :is(.content-head p,.reference-section-head p,.info-card p,.help-step p,.production-tool-card p){font-size:13px!important;line-height:1.75!important;color:var(--ref-sub)!important}
.reference-ui-shell :is(.info-card,.help-step,.help-hero,.help-troubleshoot,.production-tool-card,.project-panel,.project-card,.reference-recent-project,.asset-library-card,.model-channel,.model-table-wrap,.project-detail-toolbar,.project-panel-head,.project-detail-tabs,.project-asset-card,.project-resource-card,.detail-block,.mini-row,.chat-panel,.chat-sidebar,.chat-provider-card){background:var(--ref-surface)!important;border-color:var(--ref-border)!important;color:var(--ref-text)!important;box-shadow:none!important;border-radius:10px!important}
.reference-ui-shell :is(.info-card,.help-step,.production-tool-card){padding:18px!important}.reference-ui-shell :is(.info-card h3,.production-tool-card h3){font-size:16px!important;line-height:1.45!important}
.reference-ui-shell :is(.reference-recent-project,.project-asset-card,.project-resource-card):hover{border-color:var(--ref-primary)!important;background:var(--ref-bg-2)!important;transform:none!important}
.reference-ui-shell :is(.reference-recent-project small,.project-stat-label,.project-card-meta,.model-table small,.work-sub,.job-meta,.detail-block p,.project-inline-hint){color:var(--ref-muted)!important;font-size:12px!important}
.reference-ui-shell :is(.content-head,.reference-section-head){gap:16px!important}.reference-ui-shell .reference-home{gap:28px!important}.reference-ui-shell .reference-home-recent{margin-top:6px!important}
.reference-ui-shell :is(.reference-section-head>button,.content-head button,.stack-actions button,.project-detail-tabs button,.project-tab-button,.info-card button,.production-tool-card>button,.job-actions button,.card-actions button,.bulkbar button,.dialog-actions button,.drawer-head button,.drawer-body button){font-size:12px!important;font-weight:550!important;border-radius:7px!important;min-height:34px;box-shadow:none!important}
.reference-ui-shell :is(.stack-actions button,.job-actions button,.card-actions button,.bulkbar button,.dialog-actions button,.drawer-head button,.drawer-body button,.info-card button){background:var(--ref-bg-2)!important;color:var(--ref-text)!important;border-color:var(--ref-border-2)!important}
.reference-ui-shell :is(.stack-actions button,.job-actions button,.card-actions button,.bulkbar button,.dialog-actions button,.drawer-body button):hover:not(:disabled){background:var(--refine-soft)!important;border-color:var(--ref-primary)!important;color:var(--ref-primary)!important}
.reference-ui-shell :is(button.primary,.stack-actions button.primary,.dialog-actions button[type=submit],.generate,.login-submit,#chatSendBtn,.model-use-btn){background:var(--refine-button)!important;color:#fff!important;border:1px solid var(--refine-button)!important;box-shadow:none!important;border-radius:8px!important}
.reference-ui-shell :is(button.danger,.card-actions button.danger,.job-actions button.danger,.drawer-body button.danger){color:var(--refine-danger)!important;border-color:var(--refine-danger)!important;background:var(--refine-danger-bg)!important}
.reference-ui-shell :is(.badge,.work-status,.project-chip,.tag){font-size:11px!important;line-height:1.4;font-weight:550;border-radius:5px!important}
.reference-ui-shell :is(.badge.succeeded,.work-status.succeeded){background:var(--refine-success-bg)!important;color:var(--refine-success)!important;border:1px solid transparent!important}
.reference-ui-shell :is(.badge.failed,.badge.canceled,.work-status.failed,.work-alert,.job-failure-reason){color:var(--refine-danger)!important;background:var(--refine-danger-bg)!important;border-color:transparent!important}
.reference-ui-shell :is(.badge.queued,.badge.awaiting_confirmation,.work-status.queued){background:var(--refine-warning-bg)!important;color:var(--refine-warning)!important;border-color:transparent!important}
.reference-ui-shell :is(.badge.running,.badge.submitted,.badge.downloading,.work-status.running,.project-chip,.tag){background:var(--refine-soft)!important;color:var(--ref-primary)!important;border-color:transparent!important}
.reference-ui-shell :is(.search,.filter,.field input,.field select,.field textarea,.chat-compose textarea){border-color:var(--ref-border-2)!important;background:var(--ref-bg-2)!important;color:var(--ref-text)!important;border-radius:7px!important;box-shadow:none!important;font-size:13px!important}
.reference-ui-shell :is(.search,.filter){min-height:36px!important}.reference-ui-shell :is(.works-toolbar-sticky,.inspire-toolbar,.asset-library-toolbar){background:var(--ref-bg)!important;border-color:var(--ref-border)!important}
.reference-ui-shell :is(.inspire-filters button,.job-view-switch button,.asset-library-view-switch button,.asset-library-filter-tabs button){background:var(--ref-surface)!important;color:var(--ref-sub)!important;border-color:var(--ref-border-2)!important;border-radius:6px!important;font-size:12px!important;min-height:32px!important}
.reference-ui-shell :is(.inspire-filters button.active,.job-view-switch button[aria-pressed=true],.asset-library-view-switch button.active,.project-detail-tabs button.active){background:var(--refine-soft)!important;color:var(--ref-primary)!important;border-color:var(--ref-primary)!important;box-shadow:none!important}
.reference-ui-shell :is(.job-row,.work-card){background:var(--ref-surface)!important;border-color:var(--ref-border)!important;border-radius:10px!important;box-shadow:0 2px 8px #00000008!important}
.reference-ui-shell :is(.job-row.selected,.work-card.selected){border-color:var(--ref-primary)!important;box-shadow:0 0 0 1px var(--ref-primary)!important}
.reference-ui-shell :is(.job-main h3,.work-title){font-size:14px!important;line-height:1.65!important;font-weight:650!important;color:var(--ref-text)!important}.reference-ui-shell .job-actions{background:var(--ref-bg-2)!important;border-color:var(--ref-border)!important}
.reference-ui-shell .job-parameter-chips span{border-color:var(--ref-border)!important;color:var(--ref-sub)!important;background:var(--ref-bg-2)!important;font-size:11px!important}
.reference-ui-shell .job-row .progress{display:none!important}.reference-ui-shell .menu-btn{min-width:36px!important;font-size:12px!important}
.reference-ui-shell :is(.card-menu,.topbar-popover,.mention-menu,.reference-composer-settings,.model-menu,.asset-library-more-menu,.asset-library-filter-more[open]>div){background:var(--ref-surface)!important;border:1px solid var(--ref-border-2)!important;color:var(--ref-text)!important;box-shadow:var(--refine-panel-shadow)!important;border-radius:10px!important}
.reference-ui-shell :is(.card-menu button,.topbar-popover button,.model-option){color:var(--ref-text)!important;background:transparent!important;border-radius:6px!important;font-size:13px!important;min-height:36px}
.reference-ui-shell :is(.card-menu button,.topbar-popover button,.model-option):hover,.reference-ui-shell .model-option.active{background:var(--refine-soft)!important;color:var(--ref-primary)!important}
.reference-ui-shell .card-menu button.danger{color:var(--refine-danger)!important}.reference-ui-shell :is(.drawer,dialog){background:var(--ref-surface)!important;border-color:var(--ref-border)!important;color:var(--ref-text)!important;box-shadow:var(--refine-panel-shadow)!important}
.reference-ui-shell :is(.drawer-head,.dialog-head,.reference-composer-settings>header){background:var(--ref-surface)!important;border-color:var(--ref-border)!important;padding:15px 18px!important}.reference-ui-shell .drawer-body{padding:20px!important}
.reference-ui-shell .reference-composer-settings>header strong{font-size:15px!important;color:var(--ref-text)!important}.reference-ui-shell .reference-composer-settings>header span{font-size:12px!important;color:var(--ref-muted)!important}.reference-ui-shell .reference-composer-settings-body{padding:16px!important}
.reference-ui-shell :is(.empty,.reference-empty){background:var(--ref-bg-2)!important;border-color:var(--ref-border-2)!important;color:var(--ref-muted)!important;border-radius:10px!important;font-size:13px!important;line-height:1.8!important}
.reference-ui-shell .refine-breadcrumb{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--ref-muted);margin-bottom:12px}.reference-ui-shell .refine-breadcrumb button{border:0;background:transparent;color:var(--ref-primary);padding:0;min-height:28px;font-size:12px}
/* Composer stays in its existing home/project slots and the production dock. */
.reference-ui-shell .reference-composer-slot{padding-top:0!important}
html .reference-ui-shell #workspace #creationComposer[data-reference-surface]{background:var(--ref-surface)!important;border-color:var(--ref-border-2)!important;border-radius:12px!important;box-shadow:var(--ref-shadow)!important}
html .reference-ui-shell #workspace #creationComposer[data-reference-surface]:not([data-inline-audio=true]):has(#generationForm) #generationForm{padding:94px 16px 16px!important}
html .reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #assetField{top:14px!important;left:16px!important;right:308px!important;height:62px!important;min-height:62px!important;max-height:62px!important}
html .reference-ui-shell #workspace #creationComposer #generationForm #assetGrid{height:62px!important;min-height:62px!important;max-height:62px!important;gap:8px!important;padding:0!important}
html .reference-ui-shell #workspace #creationComposer #assetGrid>.asset-tile:not(.asset-add){flex-basis:96px!important;width:96px!important;min-width:96px!important;height:60px!important;min-height:60px!important;max-height:60px!important;border-radius:7px!important;border-color:var(--ref-border)!important;background:var(--ref-bg-2)!important}
html .reference-ui-shell #workspace #creationComposer #generationForm #assetGrid>.asset-add{grid-template-columns:84px 92px!important;flex-basis:184px!important;width:184px!important;min-width:184px!important;height:60px!important;min-height:60px!important;gap:8px!important}
html .reference-ui-shell #workspace #creationComposer #assetGrid>.asset-add :is(.asset-add-primary,.asset-add-option){width:100%!important;min-width:0!important;height:60px!important;min-height:60px!important;border-radius:7px!important;background:var(--ref-bg-2)!important;border-color:var(--ref-border-2)!important;font-size:12px!important;color:var(--ref-sub)!important;gap:1px!important}
html .reference-ui-shell #workspace #creationComposer #assetGrid>.asset-add strong{font-size:20px!important;line-height:1.1!important}.reference-ui-shell .asset-add-primary span{font-size:11px!important}
html .reference-ui-shell #workspace #creationComposer #generationForm #assetField .asset-floating-meta{inset:65px auto auto 0!important;font-size:11px!important}
html .reference-ui-shell #workspace #creationComposer[data-reference-surface]:not([data-inline-audio=true]) .seg{top:26px!important;right:16px!important;border-radius:8px!important;background:var(--ref-bg-2)!important;border-color:var(--ref-border)!important;box-shadow:none!important;padding:3px!important}
html .reference-ui-shell #workspace #creationComposer .seg button{min-height:32px!important;border-radius:6px!important;font-size:12px!important;color:var(--ref-sub)!important;background:transparent!important}.reference-ui-shell #workspace #creationComposer .seg button.active{background:var(--refine-button)!important;color:white!important;box-shadow:none!important}
html .reference-ui-shell #workspace #creationComposer[data-reference-surface] #prompt{border:1px solid var(--ref-border-2)!important;border-radius:8px!important;background:var(--ref-bg-2)!important;color:var(--ref-text)!important;font-size:14px!important;line-height:1.6!important;padding:12px!important;box-shadow:none!important}
html .reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #referenceComposerControls{gap:7px!important;margin-top:12px!important}
html .reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #referenceComposerControls>:is(button,label),html .reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #referenceComposerControls>.reference-duration-inline{height:35px!important;border-radius:7px!important;border-color:var(--ref-border-2)!important;background:var(--ref-bg-2)!important;color:var(--ref-text)!important;font-size:12px!important;padding:0 10px!important}
.reference-ui-shell .refine-chip-label{color:var(--ref-muted);font-size:11px;white-space:nowrap}.reference-ui-shell #referenceDurationNumber{font-variant-numeric:tabular-nums}
.reference-ui-shell #costTotal.refine-duplicate-cost{display:none!important}
html .reference-ui-shell #workspace #creationComposer #referenceComposerControls #generationFooter :is(.generate,#audioCloneContinue){height:38px!important;min-height:38px!important;min-width:140px!important;font-size:13px!important;background:var(--refine-button)!important;color:#fff!important;border-radius:8px!important;box-shadow:none!important}
.reference-ui-shell #view-work .reference-work-composer-slot{left:max(16px,calc((100vw - var(--ref-directory-width))/2))!important;right:max(16px,calc((100vw - var(--ref-directory-width))/2))!important;bottom:14px!important;max-height:calc(100dvh - 150px)}
.reference-ui-shell #view-work #jobBoard{padding-bottom:var(--refine-dock-reserve,320px)!important;scroll-padding-bottom:var(--refine-dock-reserve,320px)!important}
.reference-ui-shell #refineDockToggle{display:none;position:fixed;z-index:65;right:max(20px,calc((100vw - var(--ref-directory-width))/2 + 12px));bottom:var(--refine-dock-toggle-bottom,300px);height:31px;min-height:31px;padding:0 12px;border:1px solid var(--ref-border-2);border-radius:7px;background:var(--ref-surface);color:var(--ref-primary);font-size:12px;box-shadow:var(--ref-shadow)}
.reference-ui-shell #workspace[data-active-view=work] #refineDockToggle{display:block}.reference-ui-shell.refine-dock-collapsed #workspace[data-active-view=work] #creationComposer[data-reference-surface=work]{display:none!important}
.reference-ui-shell #workspace[data-active-view=work][data-creation-type=text] #refineDockToggle{display:none}
.reference-ui-shell #creationComposer[data-reference-surface=work] .compose-scroll{max-height:min(66dvh,640px)!important;overflow:auto!important;overscroll-behavior:contain}
/* Login remains a focused centered form. */
.reference-ui-shell .login{background:var(--ref-bg)!important}.reference-ui-shell .login-aura{display:none!important}.reference-ui-shell .loginbox{background:var(--ref-surface)!important;border:1px solid var(--ref-border)!important;border-radius:16px!important;box-shadow:0 16px 55px #10223f18!important;max-width:420px;padding:34px!important;text-align:left!important}
.reference-ui-shell .login-logo{background:var(--refine-soft)!important;color:var(--ref-primary)!important;box-shadow:none!important;margin:0 0 24px!important;border-radius:12px!important;width:46px!important;height:46px!important}.reference-ui-shell .loginbox h1{font-size:25px!important;font-weight:700!important;color:var(--ref-text)!important}.reference-ui-shell .loginbox>p{color:var(--ref-muted)!important;font-size:13px!important;line-height:1.7!important}.reference-ui-shell .login-capabilities{justify-content:flex-start!important;gap:6px!important;margin:20px 0!important}.reference-ui-shell .login-capabilities span{color:var(--ref-sub)!important;background:var(--ref-bg-2)!important;border-color:var(--ref-border)!important;font-size:11px!important;border-radius:5px!important}.reference-ui-shell .login-code-label{display:block;font-size:13px;font-weight:600;margin-bottom:8px}.reference-ui-shell #code{background:var(--ref-bg-2)!important;border:1px solid var(--ref-border-2)!important;border-radius:8px!important;min-height:44px;font-size:14px!important;color:var(--ref-text)!important}.reference-ui-shell .login-submit{min-height:44px!important;font-size:14px!important;font-weight:600!important}.reference-ui-shell .login-error{color:var(--refine-danger)!important}
/* Responsive adjustments keep the same top navigation and bottom composer. */
@media(max-width:1100px){.reference-ui-shell .app-version-badge{display:none!important}.reference-ui-shell #workspace #creationComposer #referenceComposerControls #generationFooter{flex-basis:100%!important}.reference-ui-shell .nav button{font-size:12px!important}.reference-ui-shell .userbar{gap:7px!important}}
@media(max-width:700px){.reference-ui-shell .topbar{height:58px!important;min-height:58px!important;padding:0 8px!important;gap:5px!important}.reference-ui-shell .workspace{height:calc(100dvh - 58px)!important}.reference-ui-shell .brand{display:none!important}.reference-ui-shell .nav{flex:1!important;min-width:0!important;overflow-x:auto!important;scrollbar-width:none;gap:2px!important}.reference-ui-shell .nav button{flex:0 0 auto!important;padding:0 10px!important;height:38px!important;font-size:12px!important}.reference-ui-shell .userbar{flex:0 0 auto!important;margin-left:0!important;gap:5px!important}.reference-ui-shell #appThemeToggle,.reference-ui-shell #notificationTrigger{display:none!important}.reference-ui-shell .user-dot{width:34px!important;height:34px!important}.reference-ui-shell .topbar-popover{position:fixed!important;right:8px!important;left:auto!important;top:64px!important;max-width:calc(100vw - 16px)!important;max-height:calc(100dvh - 85px)!important;overflow:auto!important}
 .reference-ui-shell :is(.content-head h2,.reference-section-head h1){font-size:21px!important}.reference-ui-shell :is(.reference-section-head h2,.works-head h2){font-size:18px!important}.reference-ui-shell :is(.content-head,.reference-section-head){flex-wrap:wrap!important;gap:9px!important}.reference-ui-shell .reference-section-head>button{white-space:nowrap;min-height:34px}.reference-ui-shell .reference-home{gap:24px!important}
 html .reference-ui-shell #workspace #creationComposer[data-reference-surface]:not([data-inline-audio=true]):has(#generationForm) #generationForm{padding:126px 12px 12px!important}
 html .reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #assetField{top:12px!important;left:12px!important;right:12px!important}
 html .reference-ui-shell #workspace #creationComposer[data-reference-surface]:not([data-inline-audio=true]) .seg{top:83px!important;left:12px!important;right:12px!important;display:flex!important;justify-content:stretch!important}
 html .reference-ui-shell #workspace #creationComposer .seg button{flex:1!important;min-height:32px!important;font-size:12px!important}
 html .reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #referenceComposerControls>:is(button,label),html .reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #referenceComposerControls>.reference-duration-inline{height:38px!important;padding:0 9px!important;font-size:12px!important}
 html .reference-ui-shell #workspace #creationComposer #referenceComposerControls #generationFooter{margin-left:0!important;flex-basis:100%!important;justify-content:flex-end!important}
 html .reference-ui-shell #workspace #creationComposer #referenceComposerControls #generationFooter .generate{min-width:145px!important;height:42px!important;min-height:42px!important}
 .reference-ui-shell #view-work .reference-work-composer-slot{left:8px!important;right:8px!important;bottom:8px!important}.reference-ui-shell #refineDockToggle{right:14px;height:36px;min-height:36px}
 .reference-ui-shell :is(.job-actions button,.card-actions button,.job-view-switch button,.drawer-body button,.inspire-filters button){min-height:38px!important;font-size:12px!important}.reference-ui-shell .job-actions{padding:10px!important;gap:7px!important}.reference-ui-shell :is(.job-main,.work-info){padding:14px!important}
 .reference-ui-shell .drawer{width:100vw!important;max-width:100vw!important}.reference-ui-shell .drawer-body{padding:14px!important}.reference-ui-shell .lightbox-head{left:12px!important;right:12px!important;gap:10px!important}.reference-ui-shell .lightbox-actions button{min-height:38px}
 .reference-ui-shell .model-table-wrap{overflow:visible!important}.reference-ui-shell .model-table{min-width:0!important;width:100%!important;display:block!important}.reference-ui-shell .model-table thead{display:none}.reference-ui-shell .model-table tbody{display:grid;gap:12px}.reference-ui-shell .model-table tr{display:grid;grid-template-columns:1fr 1fr;border:1px solid var(--ref-border)!important;border-radius:9px;overflow:hidden;background:var(--ref-surface)}.reference-ui-shell .model-table td{display:block;min-width:0!important;width:auto!important;padding:10px 12px!important;white-space:normal!important;overflow-wrap:anywhere;border-color:var(--ref-border)!important}.reference-ui-shell .model-table td:first-child{grid-column:1/-1;font-size:14px!important;font-weight:650}.reference-ui-shell .model-table td::before{content:attr(data-refine-label);display:block;font-size:11px;font-weight:400;color:var(--ref-muted);margin-bottom:4px}.reference-ui-shell .model-table td:last-child{grid-column:1/-1}.reference-ui-shell .model-use-btn{width:100%;min-height:40px!important}
 .reference-ui-shell .loginbox{width:calc(100vw - 32px)!important;padding:27px!important}
}
@media(prefers-reduced-motion:reduce){.reference-ui-shell *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

html .reference-ui-shell #workspace #creationComposer #assetGrid>.asset-add .asset-add-primary span::after{content:none!important}

html body.reference-ui-shell #toast{background:#182233!important;color:#fff!important;border:1px solid #40526c!important;border-radius:8px!important;box-shadow:0 8px 25px #0003!important;font-size:13px!important;line-height:1.6!important;padding:12px 16px!important;max-width:min(420px,calc(100vw - 32px))!important}

/* Contrast pass: legacy hard-coded dark surfaces now follow the shared theme. */
html[data-zq-theme] body.reference-ui-shell{--amber:var(--refine-warning);--green:var(--refine-success);--red:var(--refine-danger)}
html .reference-ui-shell :is(.model-table th,.asset-library-filter-more>summary,.asset-library-relation-slot){background:var(--ref-bg-2)!important;color:var(--ref-sub)!important;border-color:var(--ref-border)!important}
html .reference-ui-shell .model-table th{font-size:12px!important;color:var(--ref-muted)!important}
html .reference-ui-shell .help-orbit{background:var(--refine-soft)!important;color:var(--ref-primary)!important}
html .reference-ui-shell .help-troubleshoot .mini-row span:last-child{color:var(--ref-sub)!important}
html .reference-ui-shell .model-score.balanced{background:var(--refine-warning-bg)!important;color:var(--refine-warning)!important}
html .reference-ui-shell .model-score.high{background:var(--refine-success-bg)!important;color:var(--refine-success)!important}
html .reference-ui-shell :is(#view-assets,.project-assets-panel) .asset-library-relation-slot.bound{background:var(--refine-soft)!important}
html .reference-ui-shell :is(#view-assets,.project-assets-panel) .asset-library-relation-copy b{color:var(--ref-text)!important;font-size:11px!important}
html .reference-ui-shell :is(#view-assets,.project-assets-panel) .asset-library-relation-copy small{color:var(--ref-muted)!important;font-size:10px!important}
html .reference-ui-shell .asset-library-kind{color:var(--ref-primary)!important}
html .reference-ui-shell .asset-library-targets span{background:var(--refine-soft)!important;color:var(--ref-primary)!important;font-size:10px!important}
html .reference-ui-shell .asset-library-relation-icon{background:var(--refine-warning-bg)!important;color:var(--refine-warning)!important}
html .reference-ui-shell .asset-library-relation-slot.bound .asset-library-relation-icon{background:var(--refine-soft)!important;color:var(--ref-primary)!important}
html .reference-ui-shell :is(#view-assets,.project-assets-panel) .asset-library-card-actions button{height:34px!important;min-height:34px!important;font-size:12px!important}
html .reference-ui-shell :is(#view-assets,.project-assets-panel) .asset-library-more>summary{min-height:34px!important;height:34px!important}
@media(max-width:700px){html .reference-ui-shell :is(#view-assets,.project-assets-panel) .asset-library-card-actions button,html .reference-ui-shell :is(#view-assets,.project-assets-panel) .asset-library-more>summary{min-height:40px!important;height:40px!important}}
html .reference-ui-shell .asset-library-more>summary{background:var(--ref-bg-2)!important;color:var(--ref-sub)!important;border-color:var(--ref-border-2)!important}

html .reference-ui-shell #workspace #creationComposer[data-reference-surface]:not([data-inline-audio=true]):has(#assetField[style*="display: none"]) #generationForm{padding-top:66px!important}
html .reference-ui-shell #workspace #creationComposer[data-reference-surface]:not([data-inline-audio=true]):has(#assetField[style*="display: none"]) .seg{top:14px!important}
html .reference-ui-shell #workspace #creationComposer:has(#chanjingDigitalHumanPanel:not([hidden])) #referenceComposerControls>:is(#referenceComposerReferenceButton,#referenceComposerRatioButton,#referenceComposerResolutionButton,.reference-duration-inline){display:none!important}
@media(max-width:700px){html .reference-ui-shell .project-detail-tabs{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;overflow:visible!important}html .reference-ui-shell .project-detail-tabs button{width:100%!important;min-width:0!important;min-height:40px!important;margin:0!important}}

.reference-ui-shell #refineDockToggle[hidden]{display:none!important}
.reference-ui-shell #workspace[data-active-view=projects] #refineDockToggle{display:block}
.reference-ui-shell.refine-dock-collapsed #workspace[data-active-view=projects] #creationComposer[data-reference-surface=projects]{display:none!important}
.reference-ui-shell #view-projects>.project-manager{padding-bottom:var(--refine-dock-reserve,0px)!important;scroll-padding-bottom:var(--refine-dock-reserve,0px)!important}
.reference-ui-shell #creationComposer[data-reference-surface=projects] .compose-scroll{max-height:min(66dvh,640px)!important;overflow:auto!important;overscroll-behavior:contain}
.reference-ui-shell #view-projects>.reference-project-create:has(.reference-project-composer-slot:empty){display:none!important}

.reference-ui-shell #workspace:has(#referenceComposerSettingsPanel:not([hidden])) #refineDockToggle,.reference-ui-shell #workspace:has(#audioVoicePicker:not([hidden])) #refineDockToggle{visibility:hidden!important}

html .reference-ui-shell .app-dialog{background:var(--ref-surface)!important;border:1px solid var(--ref-border-2)!important;border-radius:12px!important;box-shadow:var(--refine-panel-shadow)!important;color:var(--ref-text)!important}html .reference-ui-shell .app-dialog :is(h3,p){color:var(--ref-text)!important}html .reference-ui-shell .app-dialog button{min-height:40px!important;font-size:13px!important}html .reference-ui-shell .app-dialog input{background:var(--ref-bg-2)!important;color:var(--ref-text)!important;border-color:var(--ref-border-2)!important}

/* Media badges use opaque surfaces so photographs cannot lower contrast. */
html .reference-ui-shell :is(.asset-type-badge,.asset-auth-badge){background:var(--ref-surface)!important;color:var(--ref-text)!important;border:1px solid var(--ref-border-2)!important;backdrop-filter:none!important;font-size:11px!important;height:22px!important;padding:0 6px!important}
html .reference-ui-shell .asset-auth-badge.verified{background:var(--refine-success-bg)!important;color:var(--refine-success)!important}
html .reference-ui-shell .asset-auth-badge.processing{background:var(--refine-warning-bg)!important;color:var(--refine-warning)!important}
html .reference-ui-shell .asset-auth-badge.issue{background:var(--refine-danger-bg)!important;color:var(--refine-danger)!important}
html .reference-ui-shell :is(.asset-type-badge,.asset-auth-badge){z-index:3!important}

/* Raised reference shelf: the 60px upload cards straddle the panel edge. */
html .reference-ui-shell #workspace #creationComposer[data-reference-surface]:not([data-inline-audio=true]):not(:has(#assetField[style*="display: none"])){
  background:transparent!important;border:0!important;box-shadow:none!important;isolation:isolate;
}
html .reference-ui-shell #workspace #creationComposer[data-reference-surface]:not([data-inline-audio=true]):not(:has(#assetField[style*="display: none"]))::before{
  content:"";position:absolute;inset:30px 0 0;z-index:0;pointer-events:none;
  border:1px solid var(--ref-border-2);border-radius:12px;background:var(--ref-surface);box-shadow:var(--ref-shadow);
}
html .reference-ui-shell #workspace #creationComposer[data-reference-surface]:not([data-inline-audio=true]):not(:has(#assetField[style*="display: none"]))>.compose-scroll{position:relative;z-index:1;background:transparent!important}
html .reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #assetField{top:0!important}
html .reference-ui-shell #workspace #creationComposer #assetGrid>.asset-add :is(.asset-add-primary,.asset-add-option){background:var(--ref-bg-2)!important;box-shadow:0 3px 10px #10223f08!important}
html .reference-ui-shell #workspace #creationComposer[data-reference-surface]:not([data-inline-audio=true]):not(:has(#assetField[style*="display: none"])) .seg{top:44px!important}
@media(max-width:700px){
  html .reference-ui-shell #workspace #creationComposer[data-reference-surface]:not([data-inline-audio=true]):not(:has(#assetField[style*="display: none"])) .seg{top:83px!important}
}

/* Material selection opens as a centered workspace with a persistent action row. */
html .reference-ui-shell #detailDrawer.asset-picker-drawer{
  inset:50% auto auto 50%!important;transform:translate(-50%,-50%)!important;
  width:min(1120px,calc(100vw - 64px))!important;max-width:calc(100vw - 64px)!important;
  height:min(820px,calc(100dvh - 64px))!important;max-height:calc(100dvh - 64px)!important;
  border:1px solid var(--ref-border-2)!important;border-radius:16px!important;overflow:hidden;
  box-shadow:0 24px 80px #07132638!important;backdrop-filter:none!important;transition:none!important;
  animation:refine-asset-modal-enter .18s ease-out both;
}
html .reference-ui-shell #detailDrawer.asset-picker-drawer>.drawer-head{
  position:relative!important;flex:0 0 62px;min-height:62px;height:auto!important;padding:14px 22px!important;
}
html .reference-ui-shell #detailDrawer.asset-picker-drawer>.drawer-head strong{font-size:17px!important;font-weight:650!important}
html .reference-ui-shell #detailDrawer.asset-picker-drawer>.drawer-body{
  display:flex;flex:1;min-height:0;padding:18px 22px 0!important;overflow:hidden!important;animation:none!important;
  background:var(--ref-bg)!important;
}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-shell{
  display:flex;flex-direction:column;flex:1;gap:12px;width:100%;min-width:0;min-height:0!important;height:100%;
}
html .reference-ui-shell #detailDrawer.asset-picker-drawer :is(.asset-picker-source-tabs,.asset-picker-toolbar,.asset-picker-model,.asset-picker-footer,.asset-picker-refresh-warning){flex-shrink:0}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-source-tabs{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior:contain;scrollbar-width:thin;background:var(--ref-surface)!important}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-source-tabs button{flex-shrink:0;min-width:102px;min-height:38px!important}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-toolbar{position:static;grid-template-columns:minmax(220px,1.7fr) repeat(5,minmax(0,1fr));padding:0!important;background:transparent!important}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-toolbar :is(input,select){min-width:0;height:38px;font-size:12px}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-model{padding:10px 12px;background:var(--ref-surface)!important}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-model :is(strong,b){font-size:12px}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-grid{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:1px 4px 8px 1px;gap:10px;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));grid-auto-rows:max-content;align-items:start}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-card{min-height:134px;grid-template-columns:88px minmax(0,1fr)}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-media{width:88px;height:88px}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-copy{padding:10px;gap:6px}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-title-row strong{font-size:12px}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-copy small{font-size:10px;line-height:1.5}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-copy p{font-size:11px;line-height:1.5;min-height:0}
html .reference-ui-shell #detailDrawer.asset-picker-drawer :is(.asset-picker-check,.asset-picker-favorite){width:28px!important;height:28px!important;min-height:28px!important}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-card.selected .asset-picker-check{background:var(--refine-button)!important;color:#fff!important}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-footer{position:static;margin:0 -22px;padding:14px 22px;gap:12px;background:var(--ref-surface)!important;border-top:1px solid var(--ref-border)!important;backdrop-filter:none!important}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-footer button{height:40px!important;font-size:13px!important;padding-inline:18px}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-footer .primary{background:var(--refine-button)!important;color:#fff!important;border-color:var(--refine-button)!important}
html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-loading-shell{align-items:center;justify-content:center}
html .reference-ui-shell #detailDrawerBackdrop:has(+.asset-picker-drawer.open){background:#0c16294d!important;backdrop-filter:blur(4px);touch-action:none}
html:has(#detailDrawer.asset-picker-drawer.open),body:has(#detailDrawer.asset-picker-drawer.open){overflow:hidden!important}
@keyframes refine-asset-modal-enter{from{opacity:0;transform:translate(-50%,calc(-50% + 8px)) scale(.99)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}
@media(max-width:1100px){
  html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-toolbar{grid-template-columns:repeat(3,minmax(0,1fr))}
  html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-toolbar input{grid-column:1/-1}
}
@media(max-width:700px){
  html .reference-ui-shell #detailDrawer.asset-picker-drawer{width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important;height:calc(100dvh - 32px)!important;max-height:calc(100dvh - 32px)!important;border-radius:12px!important}
  html .reference-ui-shell #detailDrawer.asset-picker-drawer>.drawer-head{flex-basis:56px;min-height:56px;padding:10px 14px!important}
  html .reference-ui-shell #detailDrawer.asset-picker-drawer>.drawer-body{padding:12px 12px 0!important}
  html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-shell{gap:10px}
  html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-toolbar{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-source-tabs button{min-width:88px;padding-inline:10px}
  html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-model{grid-template-columns:auto minmax(0,1fr);gap:5px;padding:8px 10px}
  html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-model span{grid-column:1/-1;grid-row:2;white-space:nowrap}
  html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-model b{text-align:right;font-size:10px}
  html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-grid{grid-template-columns:minmax(0,1fr);padding-right:2px}
  html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-footer{margin:0 -12px;padding:12px;gap:8px}
  html .reference-ui-shell #detailDrawer.asset-picker-drawer .asset-picker-footer button{padding-inline:14px}
}
@media(prefers-reduced-motion:reduce){html .reference-ui-shell #detailDrawer.asset-picker-drawer{animation:none!important}}

/* Creating material follows the same centered surface as choosing material. */
html .reference-ui-shell #detailDrawer:is([data-kind="asset-source"],[data-kind="asset-editor"]){
  inset:50% auto auto 50%!important;transform:translate(-50%,-50%)!important;
  width:min(900px,calc(100vw - 64px))!important;max-width:calc(100vw - 64px)!important;
  height:min(820px,calc(100dvh - 64px))!important;max-height:calc(100dvh - 64px)!important;
  border:1px solid var(--ref-border-2)!important;border-radius:16px!important;overflow:hidden;
  box-shadow:0 24px 80px #07132638!important;backdrop-filter:none!important;transition:none!important;
}
html .reference-ui-shell #detailDrawer[data-kind="asset-source"]{width:min(660px,calc(100vw - 64px))!important;height:auto!important}
html .reference-ui-shell #detailDrawer:is([data-kind="asset-source"],[data-kind="asset-editor"])>.drawer-head{flex:0 0 62px;min-height:62px}
html .reference-ui-shell #detailDrawer:is([data-kind="asset-source"],[data-kind="asset-editor"])>.drawer-body{min-height:0;overflow:auto!important;overscroll-behavior:contain}
html .reference-ui-shell #detailDrawerBackdrop:has(+#detailDrawer:is([data-kind="asset-source"],[data-kind="asset-editor"]).open){background:#0c16294d!important;backdrop-filter:blur(4px);touch-action:none}
@media(max-width:700px){
  html .reference-ui-shell #detailDrawer:is([data-kind="asset-source"],[data-kind="asset-editor"]){width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 32px)!important;border-radius:12px!important}
  html .reference-ui-shell #detailDrawer[data-kind="asset-editor"]{height:calc(100dvh - 32px)!important}
  html .reference-ui-shell #detailDrawer:is([data-kind="asset-source"],[data-kind="asset-editor"])>.drawer-head{flex-basis:56px;min-height:56px}
}
