
:root{color-scheme:dark;--bg:#101315;--panel:#1a1e21;--line:#32393c;--muted:#9ca9ae;--green:#c4ed92}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:#edf1ed;font:14px system-ui,'Microsoft YaHei',sans-serif}button,input,select{font:inherit;color:inherit;background:#242a2d;border:1px solid var(--line);border-radius:9px;padding:10px 12px}button{cursor:pointer}button:hover{border-color:var(--green)}button:disabled{opacity:.4;cursor:wait}.primary{background:var(--green);color:#182111;border:0;font-weight:700}header{display:flex;align-items:center;justify-content:space-between;padding:22px 30px;border-bottom:1px solid var(--line);gap:20px}h1{font-size:23px;margin:0 0 5px;letter-spacing:2px}h2{font-size:16px;margin:0}p{line-height:1.7}.muted,small{color:var(--muted)}.actions{display:flex;gap:8px;flex-wrap:wrap}main{max-width:1700px;margin:auto;padding:22px;display:grid;grid-template-columns:250px minmax(360px,1fr) 430px;gap:16px}.panel{background:var(--panel);border:1px solid var(--line);border-radius:15px;padding:18px;min-width:0}.intro{font-size:12px;color:var(--muted);margin:9px 0 18px}.category{width:100%;display:block;text-align:left;padding:15px 12px;margin-top:10px;background:transparent}.category.active{background:#2b3527;border-color:var(--green)}.category strong{display:block;font-size:15px;margin-bottom:7px}.category span{display:block;color:var(--muted);font-size:12px;line-height:1.5}.category.active strong{color:var(--green)}.toolbar{display:flex;align-items:center;gap:8px}.toolbar h2{flex:1}.toolbar select{padding:7px}.toolbar button{padding:7px 10px}.preview{height:490px;border-radius:10px;background:radial-gradient(ellipse at 50% 10%,#2b3438,#090c0d 75%);overflow:hidden;margin-top:15px}canvas{width:100%;height:100%;object-fit:contain}.mix{display:flex;flex-wrap:wrap;gap:6px;margin-top:15px}.chip{border-radius:20px;background:#293034;color:#cdd6cf;padding:6px 10px;font-size:11px}label{display:block;color:var(--muted);font-size:12px;margin:17px 0 7px}#search{width:100%}.searchrow{display:flex;gap:8px;margin:15px 0 10px}.searchrow input{min-width:0;flex:1}#gallery{display:grid;grid-template-columns:1fr 1fr;gap:9px;max-height:500px;overflow:auto;padding:2px 4px 2px 0}.card{position:relative;padding:10px;text-align:left;min-width:0;display:flex;flex-direction:column;min-height:145px}.card.selected{border-color:var(--green);background:#2b3527}.card.selected:before{content:'已选';position:absolute;top:8px;right:8px;border-radius:20px;padding:3px 7px;color:#182111;background:var(--green);font-size:10px}.card img{width:100%;height:83px;object-fit:contain;margin-bottom:10px}.card .empty{height:83px;display:grid;place-items:center;color:var(--muted);font-size:30px}.card strong{font-size:12px;line-height:1.6;display:block}.card small{font-size:10px;line-height:1.5;margin-top:5px}.card:disabled{cursor:default}.card.missing{opacity:.45}details{margin-top:12px}summary{cursor:pointer;color:#b9c5bd;font-size:12px}.hint{font-size:12px;color:var(--muted);line-height:1.8}#status{padding:13px 28px;background:#101315f5;border-top:1px solid var(--line);position:sticky;bottom:0;font-size:12px;color:#bdc9c1;min-height:45px}#status.error{color:#ffb6a1}.hidden{display:none}.progress{font-size:12px;color:var(--muted);margin-top:12px}.smalllink{font-size:11px;color:var(--muted)}@media(max-width:1200px){main{grid-template-columns:210px 1fr}.library{grid-column:1/-1}#gallery{grid-template-columns:repeat(auto-fill,minmax(155px,1fr));max-height:400px}}@media(max-width:650px){header{display:block;padding:18px}.actions{margin-top:15px}main{display:flex;flex-direction:column;padding:10px}.category{margin-top:6px;padding:10px}.preview{height:420px}}

.preview{height:auto;aspect-ratio:1136/640}main{grid-template-columns:210px minmax(420px,1fr) 360px;max-width:1900px} @media(max-width:1100px){main{grid-template-columns:180px 1fr}.library{grid-column:1/-1}}
.toolbar{flex-wrap:wrap}.toolbar h2{flex:1 0 100%;white-space:nowrap}.toolbar label{display:flex;align-items:center;gap:5px;margin:0;white-space:nowrap}.toolbar>select,.toolbar>button{flex-shrink:0}.toolbar input{padding:7px}
.animationSettings{margin-top:16px;padding:12px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.animationHeading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.animationHeading h3{margin:0;font-size:13px}.animationHeading label,.animationOptions label{display:flex;align-items:center;gap:6px;margin:0}.animationHeading select{padding:6px 8px}.animationOptions{display:flex;align-items:center;gap:10px 20px;flex-wrap:wrap;margin-top:12px}.animationOptions label{color:#edf1ed;white-space:nowrap}.animationOptions input{accent-color:var(--green)}.modeStatus::after{content:'静态';color:var(--muted)}.animationOptions input:checked~.modeStatus::after{content:'动态';color:var(--green)}#characterModeStatus{display:block;font-size:12px;margin-top:8px;line-height:1.5}#characterModeStatus:empty{display:none}
.videoSettings{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:12px;font-size:12px}.videoSettings label{margin:0}.videoSettings input[type=number]{width:68px;padding:6px 8px}.videoSettings input[type=color]{width:38px;height:30px;padding:2px}.videoSettings .autoSetting{display:flex;align-items:center;gap:4px}.videoSettings .autoSetting input{accent-color:var(--green)}
.keyRecommendation{display:inline-flex;align-items:center;gap:6px;color:var(--muted)}.keyRecommendation[hidden]{display:none}.keyRecommendation.hasColor::before{content:'';width:18px;height:18px;background:var(--key-color);border:1px solid #8c9998;border-radius:3px}

/* Official character/outfit catalog. Art is contained at its original aspect
   ratio and anchored to the official card/portrait baselines; it is never
   cropped or stretched to the panel. */
.character-panel{max-width:1700px;margin:16px auto 0;padding:16px 18px}
.character-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:12px}
.character-head h2{margin:0 0 4px}.character-head small{color:var(--muted)}
.character-picker{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.character-picker label{display:flex;align-items:center;gap:7px;margin:0;white-space:nowrap}
.character-picker select{min-width:230px;padding:8px 10px}.character-picker button{padding:8px 11px}
.character-layout{display:grid;grid-template-columns:minmax(570px,1.35fr) minmax(410px,1fr) minmax(300px,.8fr);gap:16px;align-items:stretch;min-height:465px}
.character-art-stage{display:grid;grid-template-columns:minmax(250px,.92fr) minmax(270px,1fr);align-items:end;gap:10px;min-height:465px;border:1px solid var(--line);border-radius:13px;background:radial-gradient(ellipse at 55% 72%,#314044,#121718 68%);overflow:hidden;padding:8px}
.official-frame-wrap,.official-hd-wrap{position:relative;height:447px;display:flex;align-items:flex-end;justify-content:center;min-width:0}
.official-frame-wrap img{display:block;width:100%;height:100%;object-fit:contain;object-position:center bottom}
.official-hd-wrap img{display:block;width:100%;height:100%;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 12px 22px #0008)}
.art-empty{display:none;position:absolute;inset:12px;place-items:center;border:1px dashed #465257;border-radius:10px;color:var(--muted);text-align:center;font-size:12px}
.official-frame-wrap.missing img,.official-hd-wrap.missing img{display:none}.official-frame-wrap.missing .art-empty,.official-hd-wrap.missing .art-empty{display:grid}
.character-summary{min-width:0;border:1px solid var(--line);border-radius:13px;padding:15px;background:#171c1e}
.character-title{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.character-title h3{margin:0;font-size:20px;letter-spacing:1px}.character-title p{margin:5px 0 0;font-size:11px}
.quality{align-self:flex-start;border:1px solid #475552;border-radius:20px;padding:3px 8px;color:var(--green);font-size:11px;white-space:nowrap}
.stat-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin:13px 0}
.stat{background:#22292c;border:1px solid #333c3f;border-radius:8px;padding:7px 5px;text-align:center}.stat b{display:block;font-size:17px;color:#f0f5ee}.stat span{display:block;margin-top:2px;color:var(--muted);font-size:10px}
.character-columns{display:grid;grid-template-columns:1fr 1fr;gap:12px;min-height:200px}
.character-columns h4{margin:0 0 7px;font-size:12px;color:#c9d5cc}
.skill-list{height:205px;overflow:auto;padding-right:3px}.skill{background:#202629;border:1px solid #30383b;border-radius:8px;padding:7px 8px;margin-bottom:6px}.skill strong{display:block;font-size:11px;color:#edf2ec}.skill span{display:block;color:var(--muted);font-size:10px;line-height:1.55;margin-top:2px}
.item-ledger{display:flex;flex-direction:column;gap:5px}.item-row{display:grid;grid-template-columns:20px 1fr auto;align-items:center;gap:6px;background:#202629;border:1px solid #30383b;border-radius:8px;padding:5px 6px;font-size:10px}.item-row img{width:20px;height:20px;object-fit:contain}.item-row .base{color:var(--muted)}.item-row b{color:var(--green);font-size:12px}.item-row small{grid-column:2/-1;color:#84928b;font-size:9px;line-height:1.45;margin-top:-2px}
.character-desc{font-size:11px;margin:11px 0 0;min-height:20px}
.outfit-panel{border:1px solid var(--line);border-radius:13px;padding:13px;background:#171c1e;min-width:0}
.outfit-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:9px}.outfit-head h3{font-size:13px;margin:0}.outfit-head span{font-size:10px}
.outfit-gallery{display:grid;grid-template-columns:1fr 1fr;gap:8px;max-height:405px;overflow:auto;padding-right:3px}
.outfit-card{position:relative;display:grid;grid-template-rows:112px auto;gap:6px;padding:7px;text-align:left;background:#202629;border:1px solid #323b3e;border-radius:9px;min-width:0}
.outfit-card.selected{border-color:var(--green);background:#2b3527}.outfit-card img{width:100%;height:112px;object-fit:contain;object-position:center bottom}.outfit-card strong{font-size:10px;line-height:1.45;display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical}.outfit-card small{display:block;color:var(--muted);font-size:9px;margin-top:2px}.outfit-empty{grid-column:1/-1;color:var(--muted);text-align:center;padding:28px 10px;border:1px dashed #465257;border-radius:9px;font-size:11px}
@media(max-width:1320px){.character-layout{grid-template-columns:minmax(500px,1.25fr) minmax(410px,1fr)}.outfit-panel{grid-column:1/-1}.outfit-gallery{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));max-height:235px}.character-art-stage{min-height:430px}.official-frame-wrap,.official-hd-wrap{height:412px}}
@media(max-width:900px){.character-panel{margin:10px}.character-head{align-items:flex-start;flex-direction:column}.character-picker{justify-content:flex-start}.character-layout{display:flex;flex-direction:column}.character-art-stage{min-height:390px;grid-template-columns:1fr 1fr}.official-frame-wrap,.official-hd-wrap{height:372px}.character-columns{grid-template-columns:1fr}.skill-list{height:auto;max-height:210px}.outfit-gallery{max-height:300px}}
@media(max-width:560px){.character-art-stage{grid-template-columns:1fr;min-height:520px}.official-frame-wrap{height:300px}.official-hd-wrap{height:210px}.character-summary{padding:11px}.stat-grid{grid-template-columns:repeat(3,1fr)}.character-picker select{width:100%;min-width:0}.character-picker label{width:100%}}

.customWorkshopDialog{width:min(1080px,calc(100vw - 24px));height:min(820px,calc(100dvh - 24px));max-height:calc(100dvh - 24px);overflow:hidden;margin:auto;padding:18px;border:1px solid var(--line);border-radius:16px;background:var(--panel);color:#edf1ed;box-shadow:0 18px 70px #0008}
.customWorkshopDialog .customAssetCard header,.customWorkshopDialog .customSkillCard header{padding:0;margin:0;border:0;background:none;position:static}
.customWorkshopDialog #customWorkshopStatus.error{color:#ffb6a1}.customWorkshopDialog[aria-busy=true]{cursor:progress}
.customWorkshopDialog[open]{display:flex;flex-direction:column}.customWorkshopDialog>.animationHeading{flex:none;flex-wrap:nowrap;align-items:flex-start}.customWorkshopDialog>.animationHeading>div{min-width:0;flex:1}.customWorkshopDialog>.animationHeading>button{flex:none}.customWorkshopDialog>.customWorkshopLayout{display:flex;flex-direction:column;gap:12px;min-height:0;margin-top:12px}
.customWorkshopNav{display:flex;gap:6px;flex:none;padding:4px;border-radius:11px;background:#111719}.customWorkshopNav button{flex:1;text-align:center;padding:10px 12px;border:1px solid transparent;background:none;border-radius:8px}.customWorkshopNav button[aria-current=true]{border-color:#53664b;background:#293428;color:#f4ffe8}
.customWorkshopContent{overflow:auto;padding:0 5px 12px 0;min-width:0;flex:1}.customWorkshopContent h4{margin:8px 0;font-size:14px}.customWorkshopContent .hint{font-size:12px;line-height:1.6}.customAssetGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:start}.customAssetCard,.customSkillCard{border:1px solid var(--line);border-radius:10px;background:#171c1e;padding:10px;min-width:0}.customAssetRow{display:flex;align-items:center;gap:10px;min-height:52px}.customAssetInfo{flex:1;min-width:0}.customAssetCard header strong,.customSkillCard strong{font-size:13px}.customAssetCard .customAssetSpec{color:var(--muted);font-size:11px;line-height:1.5;margin:3px 0}.customAssetFilename{display:block;font:10px/1.5 ui-monospace,monospace;color:#9ca99e;overflow-wrap:anywhere}.customAssetActions{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin:8px 0}.customAssetPreview{display:block;width:62px;height:48px;flex:none;object-fit:contain;margin:0;border:1px solid #394449;border-radius:6px;background:repeating-conic-gradient(#242a2d 0% 25%,#192024 0% 50%) 0/12px 12px}.customUploadEmpty{display:grid;place-items:center;color:var(--muted);font-size:10px}.customUploadButton{flex:none;padding:7px 10px}.customVideoPreview{max-width:100%;height:180px;margin-top:8px}.customPrompt{box-sizing:border-box;width:100%;height:240px;min-height:120px;resize:vertical;font:12px/1.55 ui-monospace,monospace;color:#e1eae4;background:#111719;border:1px solid #354043;border-radius:8px;padding:9px}.customDetails{margin-top:9px;border-top:1px solid #313a35;padding-top:7px;min-width:0}.customDetails>summary{cursor:pointer;color:#bac8bc;font-size:12px;padding:4px 0}.customDetails[open]>summary{margin-bottom:8px}.customSkillList{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:12px}.customSkillCard>label{display:flex;align-items:flex-start;gap:8px}.customSkillCard input[type=checkbox]{accent-color:var(--green);margin-top:3px}.customSkillValues{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0}.customSkillValues label{font-size:11px;color:var(--muted)}.customSkillValues input,.customWorkshopContent select{box-sizing:border-box;width:100%;min-width:0;padding:7px}.customWorkshopFootnote{padding:9px 10px;border-left:3px solid var(--green);background:#212a27;color:#c7d4cc;font-size:11px;line-height:1.55}.customWorkshopDialog #customWorkshopStatus{min-height:1.5em;margin:7px 0 0;font-size:12px;max-height:3.5em;overflow:auto;overflow-wrap:anywhere}.customWorkshopDialog .animationDialogFooter{gap:8px;align-items:center}.customDropZone{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px dashed #66775c;border-radius:12px;padding:16px;background:#202a21}.customDropZone strong{font-size:14px}.customDropZone .hint{margin:5px 0 0}.customDropZone button{flex:none}.customDropZone.dragging{border-color:#c4e68b;background:#34452a}.customImportReport ul{margin:6px 0;padding-left:18px;font-size:12px;line-height:1.6;overflow-wrap:anywhere}.customImportError{font-size:12px;color:#ffb6a1;overflow-wrap:anywhere}.customAssetFilters{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0}.customAssetFilters button{padding:6px 11px;font-size:12px;border:1px solid var(--line);background:#171c1e}.customAssetFilters button[aria-current=true]{border-color:var(--green);color:#d5edb4;background:#283326}

@media(max-width:650px){.customWorkshopDialog{padding:12px}.customAssetGrid,.customSkillList{grid-template-columns:1fr}.customDropZone{align-items:stretch;flex-direction:column;padding:12px}.customSkillValues{grid-template-columns:1fr 1fr}.customWorkshopDialog>.animationHeading>div{min-width:0}.customWorkshopDialog>.animationHeading .hint{max-width:calc(100vw - 78px)}.customAssetFilters{gap:5px}.customAssetFilters button{padding:6px 9px}}


/* Character library lives in the normal right-hand selector, while the chosen
   character and slot icons are rendered inside the gameplay canvas. */

.role-outfits{border-top:1px solid var(--line);margin-top:15px;padding-top:13px}
.role-outfits h3{font-size:14px;margin:0 0 8px}
.role-outfit-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px;max-height:260px;overflow:auto;padding-right:3px}.role-outfit-grid .outfit-card{grid-template-rows:96px auto}.role-outfit-grid .outfit-card img{height:96px;object-fit:contain;object-position:center top}
.actions>label{display:flex;align-items:center;gap:6px;margin:0;white-space:nowrap}
.previewControls{display:flex;align-items:center;gap:8px;padding-top:8px;border-top:1px solid #30383b}.previewControls label{margin:0;color:var(--muted);font-size:11px}.previewControls select{min-width:76px}.previewControls button{margin-left:auto}

/* Preview settings are opened from the pause controls. */
.previewActions{display:flex;align-items:center;gap:8px;flex-shrink:0;white-space:nowrap}
.animationDialog{width:min(480px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;margin:auto;padding:18px;border:1px solid var(--line);border-radius:15px;background:var(--panel);color:#edf1ed;box-shadow:0 18px 70px #0008}
.animationDialog::backdrop{background:#080c10b3}
.animationDialog .animationSettings{margin:0;padding:0;border:0}
.animationDialog .animationHeading{margin-bottom:14px}
.animationDialog .animationHeading h3{font-size:16px}
.animationDialog .animationHeading button{padding:5px 10px;font-size:21px;line-height:1}
.animationDialog :focus-visible{outline:2px solid var(--green);outline-offset:3px}
.animationDialogFooter{display:flex;justify-content:flex-end;margin-top:18px}

.card .thumbnail-atlas{display:block;flex:none;align-self:center;width:83px;height:83px;margin-bottom:10px;background-repeat:no-repeat}

.hueDialog{width:min(620px,calc(100vw - 32px))}
.huePreview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:16px 0}
.huePreview figure{margin:0;text-align:center;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#111923}
.huePreview canvas{display:block;width:100%;height:auto}
.huePreview figcaption{padding:6px 0 10px;font-size:13px;color:#c1d0cc}
.hueControl{display:grid;grid-template-columns:100px minmax(0,1fr) 45px;align-items:center;gap:8px;margin:14px 0}
.hueControl input{width:100%;accent-color:var(--green)}
.hueControl output{text-align:right;font-variant-numeric:tabular-nums}
.hueDialog .animationDialogFooter{justify-content:space-between;gap:12px}
@media(max-width:480px){.previewActions{flex-wrap:wrap;justify-content:flex-end}.hueControl{grid-template-columns:88px minmax(0,1fr) 40px}}

.skinInfoDialog{width:min(760px,calc(100vw - 24px))}
.skinInfoDialog>p:first-of-type{margin:0 0 16px}
.skinInfoField{min-width:0;margin:15px 0}
.skinInfoField>label,.skinInfoLabel label{margin:0 0 7px}
.skinInfoField>input,.skinInfoField>textarea,.skinInfoField>select{width:100%;min-width:0}
.skinInfoField textarea{font:inherit;color:inherit;background:#242a2d;border:1px solid var(--line);border-radius:9px;padding:10px 12px;resize:vertical;line-height:1.7}
.skinInfoField textarea:disabled,.skinInfoField input:disabled{color:var(--muted);opacity:1}
.skinInfoLabel{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}
.skinInfoAuto{display:flex;align-items:center;gap:6px}
.skinInfoAuto input{accent-color:var(--green);margin:0}
.skinInfoImages{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:20px}
.skinInfoImageCard{min-width:0;padding:14px;border:1px solid var(--line);border-radius:12px}
.skinInfoImageCard h4{margin:0 0 10px;font-size:14px}
.skinInfoImageView{width:100%;position:relative;padding:0;overflow:hidden;background:repeating-conic-gradient(#242a2d 0% 25%,#192024 0% 50%) 0/20px 20px}
.skinInfoImageView img{display:block;width:100%;height:170px;object-fit:contain}
.skinInfoImageView span{display:block;padding:6px;background:#111b21c9;font-size:11px;color:#cdd6cf}
.skinInfoImageCard>p{font-size:12px;margin:8px 0 12px}
.skinInfoImageActions{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.skinInfoImageActions button{padding:8px 5px;font-size:12px}
.skinInfoAdvanced{padding-top:14px;border-top:1px solid var(--line)}
.skinInfoAdvanced summary{font-size:14px}
.skinInfoAdvancedGrid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.skinInfoField .hint{margin:6px 0 0}
.skinInfoDialog .animationDialogFooter{gap:10px;position:sticky;bottom:-18px;background:var(--panel);padding:12px 0;margin-top:0}
#skinInfoStatus{min-height:1.7em;font-size:12px;margin:10px 0 0}
#skinInfoStatus.error{color:#ffb6a1}
.skinInfoImageDialog{width:min(1000px,calc(100vw - 24px))}
#skinInfoFullImage{display:block;max-width:100%;max-height:calc(100dvh - 130px);object-fit:contain;margin:auto;background:repeating-conic-gradient(#242a2d 0% 25%,#192024 0% 50%) 0/20px 20px}
@media(max-width:560px){.skinInfoImages,.skinInfoAdvancedGrid{grid-template-columns:1fr}.skinInfoAdvancedGrid{gap:0}.skinInfoImageView img{height:150px}.skinInfoDialog{padding:14px}.skinInfoDialog .animationDialogFooter{bottom:-14px}}

/* Desktop workbench: the viewport sizes the panels, and long lists scroll inside them. */
@media (min-width: 1000px) and (min-height: 540px) {
  body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100vh;
    height: 100dvh;
  }
  header { padding: 14px 24px; }
  main {
    grid-template-columns: clamp(160px, 15vw, 210px) minmax(0, 1fr) clamp(260px, 26vw, 360px);
    grid-template-rows: minmax(0, 1fr);
    width: 100%;
    min-height: 0;
    margin: 0 auto;
    padding: 12px 16px;
    gap: 12px;
  }
  main > .panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 14px;
  }
  .categories-panel .intro { margin: 6px 0 8px; }
  #categories { min-height: 0; overflow: auto; }
  .category { margin-top: 5px; padding: 6px 10px; }
  .category strong { margin-bottom: 2px; }
  .categories-panel .progress { margin: 8px 0 0; }
  .preview-panel > .toolbar, .preview-panel > .mix { flex: none; }
  .preview-panel .preview {
    display: grid;
    place-items: center;
    flex: 1;
    min-height: 0;
    aspect-ratio: auto;
    container-type: size;
    margin-top: 10px;
  }
  /* Keep the canvas box itself at 1136:640 so pointer coordinates match the artwork. */
  #stage {
    display: block;
    width: min(100cqw, 177.5cqh);
    height: auto;
  }
  .preview-panel .mix { margin-top: 8px; }
  .previewActions { flex-wrap: wrap; flex-shrink: 1; }
  .library { grid-column: auto; }
  .library .toolbar h2 { flex: 1 1 auto; white-space: normal; }
  .library .searchrow { margin: 9px 0 8px; }
  #gallery {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
  }
  .role-outfits:not([hidden]) {
    display: flex;
    flex-direction: column;
    max-height: 42%;
    min-height: 0;
    margin-top: 8px;
    padding-top: 8px;
  }
  .role-outfit-grid { min-height: 0; max-height: none; }
  #status { position: static; min-height: 0; padding: 8px 16px; }
}

/* Combined prompts share the single-asset technical specifications. */
.customStyleLabel{display:block;margin:12px 0 6px;font-size:13px}.customStyleInput{display:block;width:100%;min-height:76px;resize:vertical;padding:10px;border:1px solid #354043;border-radius:8px;background:#111719;color:#e1eae4;font-size:13px;line-height:1.6}.customCombinationActions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:12px 0}.customComponentGroups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.customComponentGroup{min-width:0;margin:0;padding:10px 12px;border:1px solid var(--line);border-radius:9px}.customComponentGroup>summary{cursor:pointer;font-size:13px;line-height:1.7;color:#d2dfcf}.customComponentGroup[open]>summary{margin-bottom:9px}.customComponentGroup label{display:flex;align-items:flex-start;gap:8px;font-size:12px;line-height:1.6;margin:7px 0;overflow-wrap:anywhere}.customComponentGroup input{flex:none;margin-top:4px;accent-color:var(--green)}.customCombinedOutput{height:300px;box-sizing:border-box}.customStyleInput{box-sizing:border-box;font-family:inherit}.customCombinedPromptEditor>.hint{overflow-wrap:anywhere}
@media(max-width:650px){.customComponentGroups{grid-template-columns:1fr}.customCombinedOutput{min-height:280px}}
