/* Scoped asset-library canvas. Generic canvas gestures and layout remain independent. */
body .studio-shell .asset-canvas-mode{--ac-panel:#1e1e1e;--ac-muted:#929292;--ac-line:#363636;--ac-library-width:294px;position:relative;background:#090909;color:#e9e9e9;padding:0!important;min-height:0!important;overflow:hidden}
body .studio-shell .asset-canvas-mode .canvas-layout{position:relative;display:flex!important;width:100%;height:100%;gap:0;overflow:hidden!important;min-height:0}
body .studio-shell .asset-canvas-mode .canvas-viewport{position:relative;flex:1;min-width:0;height:100%;border:0;border-radius:0;background:#070707;overflow:hidden}
body .studio-shell .asset-canvas-mode .canvas-dots{opacity:.7;background-image:radial-gradient(#343434 .7px,transparent .7px);background-size:16px 16px}
body .studio-shell .asset-canvas-mode .canvas-inspector{display:none!important}
body .studio-shell .asset-canvas-mode .native-canvas-status{top:12px;right:14px;left:auto;background:transparent;color:#777;border:0;font-size:10px;pointer-events:none}
body .studio-shell .asset-canvas-mode button,body .studio-shell .asset-canvas-mode select,body .studio-shell .asset-canvas-mode input,body .studio-shell .asset-canvas-mode textarea{font-family:inherit}
body .studio-shell .asset-canvas-mode button{cursor:pointer}
body .studio-shell .asset-canvas-mode button:disabled{cursor:default}
body .studio-shell .asset-canvas-mode button:focus-visible,body .studio-shell .asset-canvas-mode a:focus-visible,body .studio-shell .asset-canvas-mode summary:focus-visible{outline:2px solid #cfcaed;outline-offset:3px}
body .studio-shell .asset-canvas-mode .ac-library{flex:0 0 var(--ac-library-width);width:var(--ac-library-width);min-width:0;display:flex;flex-direction:column;border-right:1px solid #3b3b3b;background:var(--ac-panel);z-index:25;overflow:hidden}
body .studio-shell .asset-canvas-mode .ac-library-heading{display:flex;align-items:center;gap:10px;padding:20px 16px 14px;min-height:62px;flex-shrink:0}
body .studio-shell .asset-canvas-mode .ac-library-heading strong{font-size:14px;font-weight:600;white-space:nowrap}
body .studio-shell .asset-canvas-mode .ac-view-switch{display:flex;border:1px solid #444;border-radius:20px;padding:2px;gap:1px}
body .studio-shell .asset-canvas-mode .ac-view-switch button{border:0;padding:3px 6px;color:#a9a9a9;background:transparent;border-radius:20px;display:flex;align-items:center}
body .studio-shell .asset-canvas-mode .ac-view-switch button.active{background:#3c3c3c;color:#fff}
body .studio-shell .asset-canvas-mode .ac-unplaced{margin-left:auto;white-space:nowrap;font-size:11px;color:#e7e7e7;border:1px solid #414141;padding:6px 9px;border-radius:20px;background:transparent}
body .studio-shell .asset-canvas-mode .ac-unplaced.active{border-color:#d6d6d6;background:#363636}
body .studio-shell .asset-canvas-mode .ac-library-filters{display:flex;align-items:center;gap:6px;padding:0 16px 14px;flex-shrink:0}
body .studio-shell .asset-canvas-mode .ac-library-search{min-width:0;flex:1;display:flex;align-items:center;border:1px solid #3d3d3d;background:#262626;border-radius:20px;padding:4px 9px;gap:6px;color:#777}
body .studio-shell .asset-canvas-mode .ac-library-search .icon{width:13px;height:13px;flex-shrink:0}
body .studio-shell .asset-canvas-mode .ac-library-search input{min-width:0;width:100%;padding:0!important;outline:none!important;border:0!important;border-radius:0;background:transparent!important;box-shadow:none!important;color:#ddd;font-size:11px;line-height:18px}
body .studio-shell .asset-canvas-mode .ac-library-filters select{max-width:98px;width:auto;border:0;background:transparent;color:#bdbdbd;font-size:11px;padding:3px 14px 3px 1px;min-height:24px}
body .studio-shell .asset-canvas-mode .ac-library-filters select[data-asset-canvas-kind]{max-width:76px}
body .studio-shell .asset-canvas-mode .ac-library-filters option{background:#242424}
body .studio-shell .asset-canvas-mode .ac-library-scroll{flex:1;overflow-y:auto;overflow-x:hidden;min-height:0;padding:0 12px 16px;scrollbar-width:thin;scrollbar-color:#454545 transparent}
body .studio-shell .asset-canvas-mode .ac-library-group{padding:0;margin:1px 0 7px;border:0;background:transparent}
body .studio-shell .asset-canvas-mode .ac-library-group>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:7px;height:36px;font-size:12px;color:#e2e2e2;user-select:none}
body .studio-shell .asset-canvas-mode .ac-library-group>summary::-webkit-details-marker{display:none}
body .studio-shell .asset-canvas-mode .ac-library-group>summary>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
body .studio-shell .asset-canvas-mode .ac-library-group>summary>.icon:first-child{width:11px;height:11px;transition:transform .15s;transform:rotate(-90deg);color:#888}
body .studio-shell .asset-canvas-mode .ac-library-group[open]>summary>.icon:first-child{transform:rotate(0)}
body .studio-shell .asset-canvas-mode .ac-library-group>summary>.icon:nth-child(2){width:16px;height:16px;flex-shrink:0}
body .studio-shell .asset-canvas-mode .ac-group-more{border:0;background:transparent;color:#aaa;margin-left:auto;padding:0 4px;font-size:17px;opacity:0}
body .studio-shell .asset-canvas-mode .ac-library-group>summary:hover .ac-group-more,body .studio-shell .asset-canvas-mode .ac-group-more:focus-visible{opacity:1}
body .studio-shell .asset-canvas-mode .ac-library-image{display:flex;align-items:center;gap:10px;width:100%;border:1px solid transparent;text-align:left;background:transparent;border-radius:8px;color:#a3a3a3;padding:5px 7px 5px 19px;font-size:11px;min-height:48px}
body .studio-shell .asset-canvas-mode .ac-library-image:hover{background:#292929;color:#e8e8e8}
body .studio-shell .asset-canvas-mode .ac-library-image.selected{background:#333;color:#f4f4f4;border-color:#484848}
body .studio-shell .asset-canvas-mode .ac-library-image>span:last-of-type{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
body .studio-shell .asset-canvas-mode .ac-library-thumb{width:38px;height:40px;flex:0 0 38px;border-radius:6px;overflow:hidden;background:#303030;display:flex;align-items:center;justify-content:center}
body .studio-shell .asset-canvas-mode .ac-library-thumb img{width:100%;height:100%;object-fit:contain}
body .studio-shell .asset-canvas-mode .ac-unplaced-dot{height:5px;width:5px;flex:0 0 5px;margin-left:auto;background:#b6a9df;border-radius:50%}
body .studio-shell .asset-canvas-mode .ac-library-pending{margin:0 0 8px 19px;border:0;padding:5px 6px;display:flex;align-items:center;gap:9px;font-size:11px;color:#6e6e6e;background:transparent;text-align:left}
body .studio-shell .asset-canvas-mode .ac-library-empty{padding:24px;text-align:center;color:#777;font-size:12px}
body .studio-shell .asset-canvas-mode .ac-library-grid .ac-library-group-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:3px 4px 9px 15px}
body .studio-shell .asset-canvas-mode .ac-library-grid .ac-library-image{position:relative;display:flex;flex-direction:column;align-items:stretch;gap:7px;padding:5px;min-width:0}
body .studio-shell .asset-canvas-mode .ac-library-grid .ac-library-thumb{width:100%;height:99px;flex:0 0 99px}
body .studio-shell .asset-canvas-mode .ac-library-grid .ac-unplaced-dot{position:absolute;right:9px;top:9px}
body .studio-shell .asset-canvas-mode .ac-library-grid .ac-library-pending{grid-column:1/-1;margin:0}
body .studio-shell .asset-canvas-mode .ac-library-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-shrink:0;height:48px;border-top:1px solid #353535;padding:0 15px;font-size:11px;color:#818181}
body .studio-shell .asset-canvas-mode .ac-library-footer button{display:flex;align-items:center;gap:7px;background:transparent;border:0;color:#cacaca;padding:6px 0;font-size:11px}
body .studio-shell .asset-canvas-mode .ac-library-reopen{position:absolute;left:12px;top:14px;width:34px;height:34px;display:grid;place-items:center;border:1px solid #383838;border-radius:10px;background:#222;color:#ddd;z-index:25;box-shadow:0 2px 12px #0003}
body .studio-shell .asset-canvas-mode .ac-image-node{overflow:visible;border:1px solid #292929!important;background:#111!important;border-radius:23px;padding:12px;box-shadow:none!important}
body .studio-shell .asset-canvas-mode .ac-image-node.selected{border-color:#d7d7d7!important;box-shadow:0 0 0 2px #ffffff16!important}
body .studio-shell .asset-canvas-mode .ac-node-group-caption{position:absolute;top:-24px;left:0;width:100%;text-align:center;color:#999;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body .studio-shell .asset-canvas-mode .ac-node-card{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden;border:1px solid #363636;border-radius:18px;background:#202020;padding:8px}
body .studio-shell .asset-canvas-mode .ac-node-image{display:block!important;position:static!important;width:100%!important;height:0!important;min-height:0;flex:1;object-fit:contain!important;border-radius:12px!important;background:#151515!important;margin:0!important}
body .studio-shell .asset-canvas-mode .ac-node-image-actions{display:flex;gap:5px;padding:8px 0 5px}
body .studio-shell .asset-canvas-mode .ac-node-image-actions button{display:grid;place-items:center;border:1px solid #3a3a3a;border-radius:7px;background:#2b2b2b;color:#bcbcbc;width:25px;height:25px;padding:4px}
body .studio-shell .asset-canvas-mode .ac-node-image-actions button:hover{background:#424242;color:white}
body .studio-shell .asset-canvas-mode .ac-node-image-actions .icon{width:12px;height:12px}
body .studio-shell .asset-canvas-mode .ac-node-name{font-size:10px;color:#d3d3d3;line-height:1.6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 2px}
body .studio-shell .asset-canvas-mode .ac-node-episodes{font-size:9px;line-height:1.6;color:#858585;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 2px 2px}
body .studio-shell .asset-canvas-mode .ac-selection{position:absolute;inset:0;pointer-events:none;z-index:20}
body .studio-shell .asset-canvas-mode .ac-selection-tools{position:absolute;top:var(--ac-tools-top,18px);left:var(--ac-tools-left,50%);transform:translateX(-50%);max-width:calc(100% - 34px);display:flex;align-items:center;gap:3px;padding:7px 11px;background:#222;border:1px solid #383838;border-radius:25px;box-shadow:0 8px 22px #0005;pointer-events:auto;white-space:nowrap;z-index:4}
body .studio-shell .asset-canvas-mode .ac-selection-tools>button,body .studio-shell .asset-canvas-mode .ac-selection-tools>a,body .studio-shell .asset-canvas-mode .ac-tool-menu>summary{display:flex;align-items:center;justify-content:center;gap:7px;border:0;border-radius:8px;background:transparent;color:#c9c9c9;font-size:12px;line-height:24px;padding:3px 7px;text-decoration:none;cursor:pointer;min-height:28px}
body .studio-shell .asset-canvas-mode .ac-selection-tools>button:hover,body .studio-shell .asset-canvas-mode .ac-selection-tools>a:hover,body .studio-shell .asset-canvas-mode .ac-tool-menu>summary:hover,body .studio-shell .asset-canvas-mode .ac-tool-menu[open]>summary{background:#383838;color:#fff}
body .studio-shell .asset-canvas-mode .ac-selection-tools>button:disabled,body .studio-shell .asset-canvas-mode .ac-selection-tools>button:disabled:hover{color:#686868;background:transparent;opacity:1}
body .studio-shell .asset-canvas-mode .ac-tool-menu{position:relative}
body .studio-shell .asset-canvas-mode .ac-tool-menu>summary{list-style:none;user-select:none}
body .studio-shell .asset-canvas-mode .ac-tool-menu>summary::-webkit-details-marker{display:none}
body .studio-shell .asset-canvas-mode .ac-tool-menu>summary>.icon:last-child{width:12px;height:12px}
body .studio-shell .asset-canvas-mode .ac-tool-menu>summary>.icon:first-child{width:16px;height:16px}
body .studio-shell .asset-canvas-mode .ac-toolbar-divider{height:20px;width:1px;background:#414141;flex:0 0 1px;margin:0 3px}
body .studio-shell .asset-canvas-mode .ac-tool-options{position:absolute;top:calc(100% + 13px);left:0;min-width:174px;border:1px solid #424242;border-radius:13px;padding:6px;background:#292929;box-shadow:0 12px 32px #0006;z-index:6}
body .studio-shell .asset-canvas-mode .ac-more-menu .ac-tool-options{left:auto;right:0}
body .studio-shell .asset-canvas-mode .ac-tool-options button{display:flex;align-items:center;justify-content:space-between;gap:14px;text-align:left;width:100%;background:transparent;border:0;border-radius:7px;min-height:34px;padding:7px 10px;font-size:12px;color:#e0e0e0;white-space:nowrap}
body .studio-shell .asset-canvas-mode .ac-tool-options button:not(:disabled):hover{background:#3d3d3d}
body .studio-shell .asset-canvas-mode .ac-tool-options button:disabled{color:#707070;opacity:1}
body .studio-shell .asset-canvas-mode .ac-tool-options small{font-size:9px;color:#727272}
body .studio-shell .asset-canvas-mode .ac-image-composer{position:absolute;bottom:88px;left:50%;transform:translateX(-50%);width:min(810px,calc(100% - 60px));max-height:50%;display:flex;flex-direction:column;padding:17px 20px 14px;border:1px solid #363636;border-radius:29px;background:#202020;box-shadow:0 10px 36px #0004;pointer-events:auto;overflow:visible}
body .studio-shell .asset-canvas-mode .ac-composer-top{display:flex;justify-content:flex-end;flex:0 0 10px;height:10px}
body .studio-shell .asset-canvas-mode .ac-composer-top button{display:grid;place-items:center;position:absolute;right:16px;top:14px;background:transparent;border:0;border-radius:5px;color:#828282;width:23px;height:23px;padding:4px}
body .studio-shell .asset-canvas-mode .ac-composer-top button:hover{color:#ddd;background:#363636}
body .studio-shell .asset-canvas-mode .ac-image-composer textarea{resize:none!important;min-height:80px!important;height:130px;max-height:240px;flex:1;min-width:0;width:100%;border:0!important;background:transparent!important;padding:9px 8px 7px 0!important;outline:none!important;box-shadow:none!important;color:#d4d4d4;font-size:12px;line-height:1.9;overflow:auto;scrollbar-width:thin;scrollbar-color:#4a4a4a transparent}
body .studio-shell .asset-canvas-mode .ac-image-composer textarea::placeholder{color:#777}
body .studio-shell .asset-canvas-mode .ac-image-composer.is-expanded{max-height:calc(100% - 164px);height:calc(100% - 164px)}
body .studio-shell .asset-canvas-mode .ac-image-composer.is-expanded textarea{max-height:none}
body .studio-shell .asset-canvas-mode .ac-reference-strip{display:flex;flex-wrap:nowrap;gap:9px;max-width:calc(100% - 30px);overflow:auto;padding:2px 3px 8px;min-height:58px}
body .studio-shell .asset-canvas-mode .ac-reference-thumb{width:44px;height:48px;flex:0 0 44px;position:relative;border-radius:6px;background:#303030;border:1px solid #454545}
body .studio-shell .asset-canvas-mode .ac-reference-thumb img{width:100%;height:100%;border-radius:5px;object-fit:contain}
body .studio-shell .asset-canvas-mode .ac-reference-thumb button{position:absolute;top:-4px;right:-4px;background:#414141;border:1px solid #555;color:white;font-size:11px;width:15px;height:15px;padding:0;border-radius:50%;line-height:12px}
body .studio-shell .asset-canvas-mode .ac-composer-controls{display:flex;align-items:center;gap:11px;min-height:35px;margin-top:4px;flex-shrink:0}
body .studio-shell .asset-canvas-mode .ac-composer-controls>button:not(.ac-generate){display:flex;align-items:center;justify-content:center;border:0;background:transparent;color:#b7b7b7;min-width:20px;height:28px;padding:3px;font-size:18px;border-radius:6px}
body .studio-shell .asset-canvas-mode .ac-composer-controls>button:not(.ac-generate):hover{background:#343434;color:#fff}
body .studio-shell .asset-canvas-mode .ac-model-label{display:flex;align-items:center;gap:6px;font-size:11px;color:#c7c7c7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:210px}
body .studio-shell .asset-canvas-mode .ac-model-label .icon{width:14px;height:14px;flex-shrink:0}
body .studio-shell .asset-canvas-mode .ac-composer-controls select{min-height:27px;border:0;border-radius:8px;background:transparent;color:#ccc;font-size:11px;padding:3px 15px 3px 4px;width:auto}
body .studio-shell .asset-canvas-mode .ac-composer-controls select option{background:#262626}
body .studio-shell .asset-canvas-mode .ac-composer-controls>.ac-prompt-save{font-size:10px!important;white-space:nowrap;color:#929292!important;padding:3px 6px!important}
body .studio-shell .asset-canvas-mode .ac-composer-spacer{flex:1;min-width:0}
body .studio-shell .asset-canvas-mode .ac-generation-quote{display:flex;align-items:center;gap:5px;white-space:nowrap;font-size:11px;color:#c7b2f4}
body .studio-shell .asset-canvas-mode .ac-generation-quote .icon{height:12px;width:12px}
body .studio-shell .asset-canvas-mode .ac-generate{display:grid;place-items:center;flex:0 0 38px;width:38px;height:38px;background:#f0f0f0;border:0;color:#222;border-radius:50%;padding:10px;box-shadow:0 0 0 3px #aaa0}
body .studio-shell .asset-canvas-mode .ac-generate:not(:disabled):hover{background:#fff;box-shadow:0 0 0 3px #a996d83d}
body .studio-shell .asset-canvas-mode .ac-generate:disabled{background:#383838;color:#6f6f6f;opacity:1}
body .studio-shell .asset-canvas-mode .ac-spinner{display:block;border:2px solid #666;border-top-color:#ddd;border-radius:50%;height:16px;width:16px;animation:ac-spin .8s linear infinite}
@keyframes ac-spin{to{transform:rotate(360deg)}}
/* The image composer uses the same compact, upward-opening controls as the canvas. */
body .studio-shell .asset-canvas-mode .ac-composer-controls{gap:9px}
body .studio-shell .asset-canvas-mode .ac-composer-controls>.ac-style-button{font-size:11px;gap:5px;max-width:190px;min-width:55px;white-space:nowrap;justify-content:flex-start}
body .studio-shell .asset-canvas-mode .ac-style-button>span{overflow:hidden;text-overflow:ellipsis}
body .studio-shell .asset-canvas-mode .ac-composer-controls .icon{width:15px;height:15px;flex-shrink:0}
body .studio-shell .asset-canvas-mode .ac-composer-menu{position:relative;min-width:0;flex-shrink:1}
body .studio-shell .asset-canvas-mode .ac-composer-menu>summary{display:flex;align-items:center;gap:5px;min-height:28px;max-width:190px;border-radius:6px;color:#c4c4c4;font-size:11px;cursor:pointer;list-style:none;white-space:nowrap;padding:3px 1px}
body .studio-shell .asset-canvas-mode .ac-composer-menu>summary::-webkit-details-marker{display:none}
body .studio-shell .asset-canvas-mode .ac-composer-menu>summary>span{overflow:hidden;text-overflow:ellipsis}
body .studio-shell .asset-canvas-mode .ac-composer-menu>summary>.icon:last-child,body .studio-shell .asset-canvas-mode .ac-style-button>.icon:last-child{width:11px;height:11px}
body .studio-shell .asset-canvas-mode .ac-composer-menu[open]>summary,body .studio-shell .asset-canvas-mode .ac-composer-menu>summary:hover{background:#333;color:#fff}
body .studio-shell .asset-canvas-mode .ac-composer-popover{position:absolute;bottom:calc(100% + 12px);left:0;z-index:42;min-width:235px;max-height:min(450px,60vh);overflow:auto;padding:10px;border:1px solid #414141;border-radius:14px;background:#292929;box-shadow:0 10px 30px #0007;color:#dedede}
body .studio-shell .asset-canvas-mode .ac-popover-label{font-size:11px;color:#999;padding:7px 6px 10px}
body .studio-shell .asset-canvas-mode .ac-model-menu .ac-composer-popover>button{display:flex;align-items:center;width:100%;gap:7px;padding:11px 9px;border:0;border-radius:8px;background:transparent;color:#ddd;text-align:left;font-size:12px}
body .studio-shell .asset-canvas-mode .ac-model-menu .ac-composer-popover>button>small{margin-left:auto;color:#8c8c8c;font-size:9px;white-space:nowrap}
body .studio-shell .asset-canvas-mode .ac-model-menu .ac-composer-popover>button>b{font-size:12px;font-weight:400}
body .studio-shell .asset-canvas-mode .ac-composer-popover button:hover,body .studio-shell .asset-canvas-mode .ac-composer-popover button.selected{background:#444}
body .studio-shell .asset-canvas-mode .ac-size-options{display:flex;gap:8px;padding:0 5px 7px}
body .studio-shell .asset-canvas-mode .ac-size-options button{flex:1;padding:7px 12px;border:1px solid #484848;border-radius:7px;color:#ddd;background:transparent;font-size:12px}
body .studio-shell .asset-canvas-mode .ac-size-options button.selected{border-color:#c5c5c5}
body .studio-shell .asset-canvas-mode .ac-ratio-options{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;padding:0 5px 8px}
body .studio-shell .asset-canvas-mode .ac-ratio-options button{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:7px;min-height:63px;border:1px solid #444;border-radius:8px;background:transparent;color:#aaa;font-size:11px}
body .studio-shell .asset-canvas-mode .ac-ratio-options button.selected{border-color:#c5c5c5;color:white}
body .studio-shell .asset-canvas-mode .ac-ratio-options i{display:block;height:23px;max-width:42px;border:1px solid currentColor;border-radius:2px}
body .studio-shell .asset-canvas-mode .ac-dimension-menu .ac-composer-popover{left:auto;right:0;width:265px}
.ac-prompt-presets{min-height:260px}.ac-preset-transfer{display:flex;justify-content:flex-end;gap:8px;margin-top:-8px;margin-bottom:14px}.ac-preset-import{cursor:pointer}.ac-preset-search{display:flex;align-items:center;gap:10px;margin-bottom:18px}.ac-preset-search input{flex:1;min-width:0}.ac-preset-search>.btn{white-space:nowrap}.ac-presets-empty{display:grid;place-items:center;min-height:200px;color:#888;font-size:13px}#ac-preset-results{max-height:52vh;overflow:auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}#ac-preset-results>.ac-presets-empty{grid-column:1/-1}.ac-saved-preset{display:flex;flex-direction:column;border:1px solid #3b3b3b;border-radius:13px;background:#252525;padding:14px;min-width:0}.ac-saved-preset>div{display:flex;align-items:center;gap:8px}.ac-saved-preset strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ac-saved-preset small{font-size:10px;color:#8f8f8f}.ac-saved-preset>div>button{margin-left:auto;background:none;border:0;color:#999;padding:0}.ac-saved-preset>div>button[aria-pressed=true]{color:#c7b5f0}.ac-saved-preset p{white-space:pre-wrap;overflow:auto;max-height:130px;min-height:60px;line-height:1.7;font-size:12px;color:#aaa}.ac-saved-preset footer{display:flex;align-items:center;gap:6px;margin-top:auto}.ac-saved-preset footer>.btn:last-child{margin-left:auto}.ac-preset-editor{display:grid;gap:14px}.ac-preset-editor label{display:grid;gap:8px;font-size:12px;color:#bbb}.ac-preset-editor textarea{resize:vertical;min-height:180px}
@media(max-width:900px){body .studio-shell .asset-canvas-mode .ac-composer-controls{gap:6px}body .studio-shell .asset-canvas-mode .ac-composer-controls>.ac-style-button{max-width:135px}body .studio-shell .asset-canvas-mode .ac-model-menu>summary{max-width:145px}}
@media(max-width:650px){body .studio-shell .asset-canvas-mode .ac-composer-controls{flex-wrap:wrap}body .studio-shell .asset-canvas-mode .ac-composer-spacer{min-width:10px}#ac-preset-results{grid-template-columns:1fr}body .studio-shell .asset-canvas-mode .ac-model-menu .ac-composer-popover{left:auto;right:0}}
body .studio-shell .asset-canvas-mode .native-canvas-tools,body .studio-shell .asset-canvas-mode .native-canvas-viewport-tools{bottom:18px;border-radius:24px;border:1px solid #3b3b3b;background:#242424;box-shadow:0 2px 13px #0003;z-index:21}
body .studio-shell .asset-canvas-mode .native-canvas-tools{left:50%;transform:translateX(-50%);gap:6px;padding:7px}
body .studio-shell .asset-canvas-mode .native-canvas-viewport-tools{left:16px;padding:6px 8px;gap:3px}
body .studio-shell .asset-canvas-mode .canvas-empty{pointer-events:none;color:#7e7e7e}
body .studio-shell .asset-canvas-mode .canvas-empty h3{font-weight:500;font-size:17px}
body .studio-shell .asset-canvas-mode .canvas-empty p{font-size:12px;color:#666}
@media(max-width:1350px){body .studio-shell .asset-canvas-mode{--ac-library-width:264px}body .studio-shell .asset-canvas-mode .ac-selection-tools{gap:0;padding:6px 8px}body .studio-shell .asset-canvas-mode .ac-tool-menu>summary{font-size:11px;gap:4px;padding:3px 5px}body .studio-shell .asset-canvas-mode .ac-tool-menu>summary>.icon:first-child{display:none}body .studio-shell .asset-canvas-mode .ac-image-composer{width:calc(100% - 36px);padding:15px 16px 13px}body .studio-shell .asset-canvas-mode .ac-composer-controls{gap:7px}body .studio-shell .asset-canvas-mode .ac-model-label{font-size:10px;max-width:158px}body .studio-shell .asset-canvas-mode .ac-prompt-save{display:none!important}}
@media(max-width:1050px){body .studio-shell .asset-canvas-mode{--ac-library-width:235px}body .studio-shell .asset-canvas-mode .ac-library-heading{gap:6px;padding:17px 12px 12px}body .studio-shell .asset-canvas-mode .ac-unplaced{font-size:10px;padding:5px 7px}body .studio-shell .asset-canvas-mode .ac-selection-tools{max-width:calc(100% - 18px);flex-wrap:wrap;justify-content:center;border-radius:17px}body .studio-shell .asset-canvas-mode .ac-image-composer{bottom:80px;border-radius:21px}body .studio-shell .asset-canvas-mode .ac-generation-quote{font-size:10px}body .studio-shell .asset-canvas-mode .ac-model-label{max-width:126px}body .studio-shell .asset-canvas-mode .native-canvas-tools{bottom:18px;left:auto;right:12px;transform:none}body .studio-shell .asset-canvas-mode .native-canvas-viewport-tools{left:10px}body .studio-shell .asset-canvas-mode .native-canvas-viewport-tools .btn{padding:4px;min-width:24px}}
@media(max-width:760px){body .studio-shell .asset-canvas-mode .ac-library{position:absolute;inset:0 auto 0 0;width:270px;box-shadow:14px 0 28px #0005;z-index:29}body .studio-shell .asset-canvas-mode .ac-selection-tools{top:10px}body .studio-shell .asset-canvas-mode .ac-image-composer{width:calc(100% - 24px);bottom:72px}body .studio-shell .asset-canvas-mode .ac-image-composer textarea{height:100px}body .studio-shell .asset-canvas-mode .ac-composer-controls{gap:5px}body .studio-shell .asset-canvas-mode .ac-model-label{max-width:115px}body .studio-shell .asset-canvas-mode .native-canvas-viewport-tools [data-action="native-canvas-edges"],body .studio-shell .asset-canvas-mode .native-canvas-viewport-tools [data-action="native-canvas-map"]{display:none}}
@media(prefers-reduced-motion:reduce){body .studio-shell .asset-canvas-mode .ac-spinner{animation:none}body .studio-shell .asset-canvas-mode .ac-library-group>summary>.icon:first-child{transition:none}}

.ac-reference-picker{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:12px;max-height:55vh;overflow:auto}.ac-reference-picker label{display:flex;flex-direction:column;position:relative;gap:8px;cursor:pointer}.ac-reference-picker input{position:absolute;right:8px;top:8px}.ac-reference-picker img{width:100%;height:140px;object-fit:contain;background:#171717;border-radius:12px}.ac-reference-picker span{font-size:12px}.ac-preview-image{display:block;max-width:100%;max-height:70vh;margin:auto;object-fit:contain}.ac-view-presets{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.ac-job-status{position:absolute;right:20px;bottom:68px;color:#bbb;background:#292929;border-radius:12px;padding:10px 16px;z-index:22;font-size:12px}body .studio-shell .asset-canvas-mode .ac-image-composer.expanded textarea{height:min(45vh,350px)}

/* Preset actions retain one explicit, price-bearing submission control. */
body .studio-shell .asset-canvas-mode .ac-character-action{position:absolute;bottom:88px;left:50%;transform:translateX(-50%);width:min(640px,calc(100% - 36px));height:64px;display:flex;align-items:center;gap:16px;padding:10px 14px;border:1px solid #363636;border-radius:26px;background:#202020ed;box-shadow:0 10px 30px #0003;pointer-events:auto}
body .studio-shell .asset-canvas-mode .ac-character-action>button:not(.ac-generate){border:0;background:transparent;color:#aaa;font-size:20px;padding:4px 8px;flex-shrink:0}
body .studio-shell .asset-canvas-mode .ac-character-action input{min-width:0;flex:1;border:0;background:transparent;box-shadow:none;padding:0;color:#eee;font-size:14px;outline:none}
body .studio-shell .asset-canvas-mode .ac-character-action .ac-generation-quote{max-width:180px;overflow:hidden;text-overflow:ellipsis;display:block}
body .studio-shell .asset-canvas-mode .ac-image-job{border:1px solid #777;border-radius:22px;background:radial-gradient(#ffffff24 .6px,transparent .6px),linear-gradient(130deg,#676b6c,#969c9d);background-size:9px 9px,100% 100%;overflow:visible}
body .studio-shell .asset-canvas-mode .ac-job-content{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;color:#f1f1f1;font-size:13px;text-align:center;padding:20px}
body .studio-shell .asset-canvas-mode .ac-job-content button{border:1px solid #bbb;color:white;background:transparent;border-radius:18px;padding:3px 12px;font-size:12px}
body .studio-shell .asset-canvas-mode .ac-job-content small{font-size:11px;max-width:100%;overflow-wrap:anywhere}
body .studio-shell .asset-canvas-mode .ac-derived-edge>path:first-child{stroke:#ad8af5;stroke-width:2;stroke-dasharray:6 6;fill:none}

.ac-host-style .native-style-panel{position:static;width:100%;min-width:0;box-shadow:none;display:flex;flex-direction:column;gap:20px;height:440px;max-height:65vh;background:#262626;border-radius:18px;padding:18px;overflow:hidden}.ac-host-style .native-style-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.ac-host-style .native-style-body{min-height:0}

/* Subject cards and generated image nodes follow separate canvas controls. */
/* Other image cards keep their existing compact density. Character cards use
   the measured 362 x 468 reference size and unscaled controls. */
body .studio-shell .asset-canvas-mode .ac-image-node{--ac-control-scale:.7;padding:6px;border-radius:28px;background:#222!important}
body .studio-shell .asset-canvas-mode .ac-card-character{--ac-control-scale:1;background:#1c1c1c!important}
body .studio-shell .asset-canvas-mode .ac-node-group-caption{top:-27px;display:flex;align-items:center;justify-content:space-between;gap:8px;text-align:left;overflow:visible}
.ac-node-group-caption>span{overflow:hidden;text-overflow:ellipsis;min-width:0;flex:1}
body .studio-shell .asset-canvas-mode .ac-node-group-caption>.icon{width:14px;height:14px;flex-shrink:0}
body .studio-shell .asset-canvas-mode .ac-node-group-caption button{background:transparent;border:0;border-radius:50%;color:#aaa;padding:0;display:grid;place-items:center;width:18px;height:18px;flex:0 0 18px}
body .studio-shell .asset-canvas-mode .ac-node-group-caption button .icon{width:12px;height:12px}
body .studio-shell .asset-canvas-mode .ac-node-card{border:0;padding:0;border-radius:22px;overflow:visible;background:transparent;gap:0}
.ac-node-visual{position:relative;display:flex;flex:1;min-height:0;overflow:hidden;border-radius:22px;background:#111;padding:8px}
body .studio-shell .asset-canvas-mode .ac-node-visual .ac-node-image{height:100%!important;width:100%!important;flex:auto;background:transparent!important;border-radius:4px!important}
.ac-node-corners{position:absolute;left:8px;top:8px;display:flex;flex-direction:column;gap:4px}
body .studio-shell .asset-canvas-mode .ac-node-corners button{border:0;border-radius:50%;width:32px;height:32px;min-width:32px;min-height:32px;padding:0;display:grid;place-items:center;background:#eeeeeef0;color:#333;font-size:18px;line-height:1}
body .studio-shell .asset-canvas-mode .ac-node-corners .icon{width:16px;height:16px}
.ac-node-sources{display:flex;gap:6px;padding:12px 10px 8px;flex-shrink:0}
body .studio-shell .asset-canvas-mode .ac-node-sources button{border:1px solid #3a3a3a;border-radius:16px;background:#292929;color:#ddd;width:50px;height:50px;flex:0 0 50px;padding:0;display:grid;place-items:center}
body .studio-shell .asset-canvas-mode .ac-node-sources .icon{width:20px;height:20px}
body .studio-shell .asset-canvas-mode .ac-node-sources [data-action="asset-canvas-card-materials"]{color:#888}
body .studio-shell .asset-canvas-mode .ac-node-sources [data-action="asset-canvas-card-materials"] .icon{width:16px;height:16px}
.ac-node-footer{display:flex;gap:8px;align-items:center;padding:8px 10px 12px;min-width:0;flex-shrink:0}
.ac-node-footer>div{min-width:0;flex:1}
body .studio-shell .asset-canvas-mode .ac-node-footer button{border:0;border-radius:8px;background:transparent;color:#aaa;width:24px;height:24px;flex:0 0 24px;padding:0;display:grid;place-items:center}
body .studio-shell .asset-canvas-mode .ac-card-character .ac-node-footer button{width:22px;height:22px;flex-basis:22px}
body .studio-shell .asset-canvas-mode .ac-node-footer button .icon{width:18px;height:18px}
body .studio-shell .asset-canvas-mode .ac-node-footer button:hover{background:#383838}
body .studio-shell .asset-canvas-mode .ac-node-name{font-size:11px}
body .studio-shell .asset-canvas-mode .ac-node-episodes{font-size:10px}
body .studio-shell .asset-canvas-mode .ac-card-image{padding:0;background:#161616!important}
body .studio-shell .asset-canvas-mode .ac-card-image .ac-node-visual{padding:0;background:transparent}
/* Leave room for the full-size selected role card above its prompt editor. */
body .studio-shell .asset-canvas-mode .ac-selection[data-card-kind="character"] .ac-image-composer{bottom:56px}
/* Measured character internals: 309px image well, 50px source strip and 42px footer. */
body .studio-shell .asset-canvas-mode .ac-card-character{padding:8px 8px 24px;border-color:#ffffff0a!important}
body .studio-shell .asset-canvas-mode .ac-card-character .ac-node-card{gap:16px}
body .studio-shell .asset-canvas-mode .ac-card-character .ac-node-visual{align-items:center;justify-content:center;background:#0000004d}
body .studio-shell .asset-canvas-mode .ac-card-character .ac-node-image{width:auto!important;height:auto!important;max-width:100%;max-height:100%;flex:0 1 auto;border:1px solid #ffffff0a}
body .studio-shell .asset-canvas-mode .ac-card-character .ac-node-sources{padding:0 12px;margin-top:1px}
body .studio-shell .asset-canvas-mode .ac-card-character .ac-node-sources button{background:#ffffff0a;border-color:#ffffff14;color:#fff;font-size:12px;font-weight:500;line-height:13.8px}
body .studio-shell .asset-canvas-mode .ac-card-character .ac-node-sources [data-action="asset-canvas-card-materials"]{color:#ffffff66}
body .studio-shell .asset-canvas-mode .ac-card-character .ac-node-footer{flex:0 0 42px;align-items:start;gap:12px;padding:0 12px}
body .studio-shell .asset-canvas-mode .ac-card-character .ac-node-footer>div{display:flex;flex-direction:column;gap:2px}
body .studio-shell .asset-canvas-mode .ac-card-character .ac-node-name{display:flex;align-items:center;height:22px;font-size:13px;line-height:18.2px;padding:0;color:#fff}
body .studio-shell .asset-canvas-mode .ac-card-character .ac-node-episodes{font-size:12px;line-height:16.8px;padding:0;color:#ffffff66}
body .studio-shell .asset-canvas-mode .ac-card-character .ac-node-footer button{font-size:13.3333px;line-height:15.3333px;color:#ffffffb3}
body .studio-shell .asset-canvas-mode .ac-card-character .ac-node-group-caption{top:-23.7143px;left:-1px;width:calc(100% + 2px);height:18px;padding-left:4px;font-size:13px;line-height:16px}
body .studio-shell .asset-canvas-mode .ac-card-character .ac-node-group-caption button{color:#fff;border:1px solid transparent;border-radius:32px;font-size:13px;font-weight:500;line-height:14.95px}
/* Native card controls: source strip/footer persist; corners and tags follow
   hover/selection. Hidden controls cannot intercept image clicks or tab focus. */
body .studio-shell .asset-canvas-mode .ac-node-corners,
body .studio-shell .asset-canvas-mode .ac-node-group-caption button{opacity:0;visibility:hidden;pointer-events:none;transition:opacity .15s ease,visibility .15s}
body .studio-shell .asset-canvas-mode .ac-image-node:is(:hover,.selected,:focus-visible,:has(button:focus-visible)) .ac-node-corners,
body .studio-shell .asset-canvas-mode .ac-image-node:is(:hover,.selected,:focus-visible,:has(button:focus-visible)) .ac-node-group-caption button{opacity:1;visibility:visible;pointer-events:auto}
body .studio-shell .asset-canvas-mode [data-action="asset-canvas-connect"]{position:absolute;top:50%;transform:translateY(-50%);width:68px;height:68px;padding:0;display:grid;place-items:center;border:0;background:transparent;color:#ccc;z-index:2;outline-offset:-20px}
body .studio-shell .asset-canvas-mode .ac-node-connector-right{right:-56px}
body .studio-shell .asset-canvas-mode .ac-node-connector-left{left:-56px}
body .studio-shell .asset-canvas-mode .ac-node-connector>span{display:grid;place-items:center;width:24px;height:24px;border:1px solid #373737;border-radius:50%;background:#222;opacity:0;transform:scale(.72);transition:opacity .15s ease,transform .15s ease;pointer-events:none}
body .studio-shell .asset-canvas-mode .ac-node-connector .icon{width:12px;height:12px}
body .studio-shell .asset-canvas-mode .ac-image-node:is(:hover,.selected,:focus-visible,:has(button:focus-visible)) .ac-node-connector>span{opacity:1;transform:scale(1)}
body .studio-shell .asset-canvas-mode :is(.ac-node-corners,.ac-node-sources button,.ac-node-footer button,.ac-node-group-caption button,.ac-node-connector){zoom:var(--ac-control-scale)}
body .studio-shell .asset-canvas-mode .ac-node-group-caption>.icon{zoom:var(--ac-control-scale)}
@media(prefers-reduced-motion:reduce){body .studio-shell .asset-canvas-mode :is(.ac-node-corners,.ac-node-group-caption button,.ac-node-connector>span){transition:none}}
/* Label strokes belong to the existing element, never an added inner frame. */
body .studio-shell .asset-canvas-mode .ac-image-node.ac-has-labels{border-color:var(--ac-tag-color)!important;outline:2px solid var(--ac-tag-color);outline-offset:0}
.ac-node-labels{position:absolute;bottom:calc(100% + 4px);left:36px;display:inline-flex;max-width:calc(100% - 72px);height:20px;min-height:20px;padding:4px 8px 0 0;border-radius:14px 14px 0 0;box-sizing:border-box;background:var(--ac-tag-color);color:rgba(0,0,0,.8);font:400 13px/16px system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;white-space:nowrap;isolation:isolate;z-index:3;pointer-events:none}
.ac-node-label-title{padding-left:8px;overflow:hidden;text-overflow:ellipsis;position:relative;z-index:2;background:inherit;border-radius:inherit}
.ac-node-labels:before{content:'';position:absolute;inset:0 0 -3px;background:inherit;border-radius:inherit;z-index:1}
.ac-node-label-tab{position:absolute;bottom:-3px;left:calc(100% - 8px + (var(--label-index) - 1)*56px);width:64px;height:23px;background:var(--label-color);border-radius:14px 14px 0 0;z-index:calc(0 - var(--label-index))}
.ac-label-popover,.ac-label-colors,.ac-label-confirm{font:400 14px/21px system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;box-sizing:border-box;color:#fff;-webkit-font-smoothing:antialiased}
.ac-label-popover,.ac-label-colors{position:fixed;z-index:140;width:288px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);background:rgba(38,38,38,.8);border:1px solid rgba(255,255,255,.04);border-radius:24px;padding:8px;box-shadow:0 8px 40px #00000014,0 0 0 .5px #ffffff14;backdrop-filter:blur(24px);outline:none}
.ac-label-popover[hidden]{display:none}
.ac-label-popover *,.ac-label-colors *,.ac-label-confirm *{box-sizing:border-box}
.ac-label-popover button,.ac-label-colors button,.ac-label-confirm button{font:inherit;cursor:pointer;color:inherit;background:none;border:1px solid transparent;padding:0;display:inline-flex;align-items:center;justify-content:center}
.ac-label-popover svg{width:16px;height:16px;flex-shrink:0;pointer-events:none}
.ac-label-popover button:focus-visible,.ac-label-row:focus-visible{outline:2px solid #ffffff80;outline-offset:1px}
.ac-label-options{max-height:288px;overflow:auto;overscroll-behavior:contain;margin:0 -8px;scrollbar-width:thin;scrollbar-color:#ffffff14 transparent}
.ac-label-options>[role=menu]{display:flex;flex-direction:column;gap:4px;padding:0 8px}
.ac-label-row{display:flex;align-items:center;gap:4px;padding:2px 8px;border:1px solid transparent;border-radius:16px;height:38px;min-height:38px;font-size:13px;line-height:19.5px;outline:none;cursor:pointer}
.ac-label-row:hover{background:#ffffff0a}
.ac-label-popover .ac-label-swatch{flex:none;width:32px;height:32px;padding:7px;border:1px solid #ffffff1f;border-radius:32px;background:transparent}
.ac-label-swatch:hover{border-color:#ffffff33}
.ac-label-swatch span{display:block;width:16px;height:16px;border-radius:50%;background:var(--swatch)}
.ac-label-name{min-width:0;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.ac-label-name>span{display:block;overflow:hidden;text-overflow:ellipsis}
.ac-label-check{flex:none;display:grid;place-items:center;width:16px;height:16px;border:1px solid #ffffff33;border-radius:5px;background:transparent}
.ac-label-check svg{width:14px;height:14px}
.ac-label-row[aria-checked=true] .ac-label-check{background:#fff;color:#000;border-color:#fff}
.ac-label-popover .ac-label-delete{width:24px;height:24px;flex:none;border-radius:50%;opacity:0;pointer-events:none}
.ac-label-delete svg{width:14px;height:14px}
.ac-label-row:hover .ac-label-delete,.ac-label-delete:focus-visible{opacity:1;pointer-events:auto}
.ac-label-delete:hover{background:#ffffff14}
.ac-label-popover .ac-label-add{margin-top:4px;justify-content:flex-start;gap:8px;width:100%;height:32px;min-height:32px;padding:0 8px;border-radius:16px;font-size:12px;line-height:13.8px;font-weight:500}
.ac-label-add:hover{background:#ffffff0a}
.ac-label-name input{min-width:0;width:100%;border:0;border-radius:0;background:transparent;color:inherit;padding:0;outline:none;box-shadow:none;font:inherit;height:auto}
.ac-label-new .ac-label-name{border:1px solid #ffffff33;border-radius:32px;padding:5px 12px;background:#ffffff14}
.ac-label-new:has(input[aria-invalid=true]) .ac-label-name{border-color:#e15858;box-shadow:0 0 0 4px #e1585833}
.ac-label-error{color:#e15858;font-size:12px;line-height:18px;padding:0 8px 0 44px;margin:0}
.ac-label-colors{z-index:141;padding:16px;display:flex;flex-direction:column;gap:12px;overflow:auto}
.ac-label-palette{display:flex;justify-content:space-between;gap:8px;padding:0 0 12px;border-bottom:1px solid #ffffff1f;margin-bottom:0}
.ac-label-colors .ac-label-palette button{width:24px;height:24px;border-radius:32px;background:var(--swatch);flex:none}
.ac-label-palette button[aria-pressed=true]{outline:2px solid #fff;outline-offset:3px}
.ac-label-sv{position:relative;height:128px;min-height:128px;border:1px solid #ffffff1f;border-radius:20px;touch-action:none;cursor:crosshair;overflow:hidden;outline:none}
.ac-label-sv:before,.ac-label-sv:after{content:"";position:absolute;inset:0;pointer-events:none}
.ac-label-sv:before{background:linear-gradient(to right,rgba(255,255,255,.95),transparent)}
.ac-label-sv:after{background:linear-gradient(to top,rgba(0,0,0,.8),transparent)}
.ac-label-sv i{position:absolute;z-index:2;width:12px;height:12px;border:2px solid #fff;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none}
.ac-label-hue{display:flex;align-items:center;gap:12px;margin:0;height:28px;min-height:28px}
.ac-label-hue span{width:28px;height:28px;border-radius:50%;flex:none}
.ac-label-hue input{appearance:none;height:12px;min-width:0;border:0;border-radius:32px;width:100%;padding:0;margin:0;background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red)}
.ac-label-hue input::-webkit-slider-thumb{appearance:none;width:14px;height:14px;border:2px solid white;border-radius:50%;background:transparent;box-shadow:0 0 2px #222}
.ac-label-colors .ac-label-hex{width:100%;height:36px;min-height:36px;background:#ffffff14;border:1px solid #ffffff33;border-radius:32px;padding:4px 12px;color:#fff;font:400 14px/16.1px system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;outline:none}
.ac-label-hex:focus{border-color:#ffffff66;box-shadow:0 0 0 4px #ffffff14}
.ac-label-colors .ac-label-hex[aria-invalid=true]{border-color:#e15858;box-shadow:0 0 0 4px #e1585833}
.ac-label-colors footer,.ac-label-confirm footer{display:flex;justify-content:flex-end;gap:8px}
.ac-label-colors footer button{min-width:64px;height:32px;padding:1px 14px;border-radius:32px;font-size:12px;line-height:13.8px;font-weight:500}
.ac-label-colors footer button:hover{background:#ffffff0a}
.ac-label-colors [data-label-color-apply]{background:#f4f4f5;color:#000}
.ac-label-colors [data-label-color-apply]:hover{background:#fff}
.ac-label-colors [data-label-color-apply]:disabled{background:#ffffff14;color:#ffffff4d;cursor:default}
.ac-label-confirm-backdrop{position:fixed;inset:0;background:#0008;backdrop-filter:blur(4px);z-index:142;display:grid;place-items:center}
.ac-label-confirm{width:448px;max-width:calc(100vw - 32px);padding:24px;background:#1c1c1c;border-radius:32px}
.ac-label-confirm h2{font:500 16px/24px system-ui;margin:0 0 6px}
.ac-label-confirm p{font:400 13px/19.5px system-ui;margin:0;color:#a3a3a3}
.ac-label-confirm footer{margin-top:24px}
.ac-label-confirm button{height:36px;min-width:72px;border-radius:32px;padding:1px 16px;font-size:12px;line-height:13.8px;font-weight:500;background:#ffffff14;border-color:#ffffff0a}
.ac-label-confirm [data-label-confirm-delete]{background:#e15858;border-color:transparent}

.appearance-card-modal{width:min(780px,95vw)}
.ap-card-editor{display:grid;grid-template-columns:240px 1fr;gap:24px}
.ap-card-editor.ap-card-scene{display:block;max-width:500px;margin:auto}
.ap-card-media{min-width:0;color:#aaa;font-size:12px;word-break:break-word}
.ap-card-media>button{width:100%;height:280px;position:relative;border:0;background:#151515;border-radius:16px;overflow:hidden;margin-bottom:12px;padding:10px}
.ap-card-media>button img{width:100%;height:100%;object-fit:contain}
.ap-card-media>button span{position:absolute;top:10px;left:10px;background:#303030bb;color:white;border-radius:5px;padding:2px 6px}
.ap-card-fields{display:flex;flex-direction:column;gap:15px;min-width:0}
.ap-card-fields>label{display:flex;flex-direction:column;gap:8px;color:#aaa;font-size:12px}
.ap-card-fields input:not([type=radio]):not([type=checkbox]),.ap-card-fields textarea,.ap-card-fields select{width:100%;font-size:13px}
.ap-card-episodes{border:1px solid #3b3b3b;border-radius:8px;padding:10px;font-size:12px}
.ap-card-episodes summary{display:flex;align-items:center;gap:12px;cursor:pointer;list-style:none}
.ap-card-episodes summary span{margin-left:auto;color:#aaa}.ap-card-episodes>div{padding:10px;display:flex;gap:12px;flex-wrap:wrap}
.ap-card-voice{border:0;padding:0;margin:0;display:grid;gap:10px}.ap-card-voice legend{color:#aaa;font-size:12px;margin-bottom:10px}
.ap-voice-choice{border:1px solid #414141;border-radius:12px;padding:10px;display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0}.ap-voice-choice.selected{border-color:#b1a4ce}
.ap-voice-choice textarea{background:transparent!important;border:0!important;resize:vertical}.ap-voice-choice>label{display:flex;align-items:center;gap:5px;font-size:12px}.ap-voice-choice select{width:auto;max-width:190px;margin-left:auto}.ap-voice-choice audio{width:100%;height:36px}.ap-voice-choice .ap-actions{width:100%;justify-content:center}
@media(max-width:640px){.ap-card-editor{grid-template-columns:1fr}.ap-card-media>button{height:180px}}

/* Compact appearance panel measured against the reference at 1671 x 798.
   Explicit save/cancel remains below the 640px content panel. */
#modal.appearance-card-modal:has(.ap-card-character){width:min(880px,calc(100vw - 24px));max-width:880px;max-height:calc(100dvh - 24px);border:0;border-radius:28px;background:#1c1c1c}
.appearance-card-modal:has(.ap-card-character) .modal-head{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);padding:0;border:0}
.appearance-card-modal:has(.ap-card-character) .modal-body{padding:0;overflow:visible;max-height:none;flex:0 0 auto}
.appearance-card-modal:has(.ap-card-character) .modal-head button{display:none}
.appearance-card-modal:has(.ap-card-character) .modal-foot{min-height:56px;padding:8px 20px;border-top:1px solid #ffffff14;background:#1c1c1c}
.ap-card-editor.ap-card-character{display:grid;grid-template-columns:392px minmax(0,1fr);gap:16px;height:min(640px,calc(100dvh - 80px));padding:20px;font-family:"PingFang SC",system-ui,sans-serif;font-size:12px;font-weight:400;line-height:18px}
.ap-card-character .ap-card-media{min-width:0;min-height:0;display:flex;flex-direction:column;padding:16px;background:#0a0a0a;border-radius:24px;color:#ffffffb3;font-size:14px;line-height:20px;overflow:auto}
.ap-card-character .ap-card-media>button{width:172px;height:230px;flex:none;position:relative;border:1px solid #ffffff1f;background:#1c1c1c;border-radius:14px;overflow:hidden;margin:0 0 4px;padding:0}
.ap-card-character .ap-card-media>button img{width:100%;height:100%;object-fit:contain}
.ap-card-character .ap-card-media>button span{position:absolute;top:8px;left:8px;background:#0009;color:#fff;border-radius:31px;min-width:36px;padding:0 5px;font-size:12px;line-height:20px}
.ap-card-character .ap-card-media>button+div{width:172px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ap-card-character .ap-card-media-spacer{flex:1}
.ap-card-character .ap-card-fields{display:flex;flex-direction:column;gap:12px;min-width:0;min-height:0;overflow:auto;padding:20px 22px 20px 20px;background:#0a0a0a;border-radius:24px}
.ap-card-character .ap-card-fields>label{display:flex;flex-direction:column;gap:8px;margin:0;color:#ffffff73;font-size:12px;line-height:16px}
.ap-card-character .ap-card-fields input:not([type=radio]):not([type=checkbox]),.ap-card-character .ap-card-fields select{width:100%;height:36px;padding:8px 12px;font-size:12px;font-weight:500;line-height:18px;background:#161616;border:1px solid #ffffff26;border-radius:20px}
.ap-card-character .ap-card-episodes{border:0;padding:0;border-radius:0;font-size:12px;line-height:16px;color:#ffffff73}
.ap-card-character .ap-card-episodes summary{display:flex;flex-wrap:wrap;align-items:center;cursor:pointer;list-style:none;gap:8px}
.ap-card-character .ap-card-episodes summary span{margin-left:0;display:block;order:2;flex-basis:100%;height:36px;padding:8px 12px;background:#161616;border:1px solid #ffffff26;border-radius:20px;color:#fff}
.ap-card-character .ap-card-episodes summary svg{margin-left:auto;width:12px;height:12px}.ap-card-character .ap-card-episodes>div{padding:10px;display:flex;gap:12px;flex-wrap:wrap}
.ap-card-voice{border:0;padding:0;margin:0;display:grid;gap:8px;min-width:0}.ap-card-voice legend{color:#ffffff73;font-size:12px;line-height:18px;margin-bottom:14px}
.ap-voice-choice{border:0;border-radius:20px;padding:4px;display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0;background:#222;color:#ffffff73}
.ap-voice-choice:focus-within{outline:1px solid #ffffff40}
.ap-card-character .ap-card-fields .ap-voice-choice textarea{width:100%;height:108px;min-height:108px;padding:10px 12px;background:#ffffff14!important;border:0!important;border-radius:16px;resize:none;font:400 12px/18px "PingFang SC",sans-serif;letter-spacing:normal;color:#ffffffb3}
.ap-voice-choice>label{display:flex;align-items:center;gap:8px;font-size:12px;line-height:18px;cursor:pointer}.ap-voice-choice input[type=radio]{margin:0;width:16px;height:16px;accent-color:#7d41ff}.ap-voice-choice.selected>label{color:#ffffffb3}
.ap-card-character .ap-card-fields .ap-voice-choice select{width:auto;max-width:190px;margin-left:auto;height:18px;padding:0 4px;border:0;border-radius:4px;background:transparent;font-weight:400;color:#ffffffb3}
.ap-voice-choice audio{width:100%;height:36px}.ap-voice-choice .ap-actions,.ap-audio-unavailable{width:100%;height:128px;border:1px solid #ffffff1f;border-radius:20px;background:#1c1c1c;display:flex;align-items:center;justify-content:center;gap:16px}
.ap-audio-unavailable{flex-direction:column;gap:6px;color:#fff}.ap-audio-unavailable small{font-size:12px;color:#ffffff73}
@media(max-width:760px){.ap-card-editor.ap-card-character{grid-template-columns:minmax(160px,40%) minmax(0,1fr);gap:12px;padding:12px}.ap-card-character .ap-card-media,.ap-card-character .ap-card-fields{padding:12px}.ap-card-character .ap-card-media>button{width:100%;height:auto;aspect-ratio:3/4}}
@media(max-width:560px){.ap-card-editor.ap-card-character{grid-template-columns:1fr;height:auto;max-height:calc(100dvh - 80px);overflow:auto}.ap-card-character .ap-card-media{min-height:190px;flex-direction:row;gap:12px;align-items:start}.ap-card-character .ap-card-media>button{width:110px;height:147px}.ap-card-character .ap-card-media>button+div{width:auto;flex:1;white-space:normal}.ap-card-character .ap-card-media-spacer{display:none}.ap-card-character .ap-card-fields{overflow:visible}.ap-voice-choice select{max-width:160px}}

.appearance-voice-modal{width:min(680px,95vw)}.ap-voice-studio>label{display:flex;flex-direction:column;gap:10px;color:#aaa;font-size:13px}.ap-voice-studio textarea{width:100%}.ap-voice-studio .music-options{display:flex;gap:16px;align-items:center;margin:16px 0}.ap-voice-studio .music-options label{display:flex;align-items:center;gap:8px;font-size:12px}.ap-voice-studio input[type=number]{width:65px}.ap-voice-studio select{width:auto}.ap-voice-studio .music-result audio{width:100%}.ap-voice-studio .music-actions{display:flex;gap:8px;flex-wrap:wrap}.ap-voice-studio .music-result{margin-top:16px}

/* Role candidates are previews; viewing never changes the current appearance. */
.ap-card-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:16px;min-height:0;overflow:auto;flex:1}
.ap-card-gallery figure{min-width:0;margin:0}.ap-card-gallery figure>button{display:block;position:relative;width:100%;height:230px;padding:0;border:1px solid #ffffff1f;border-radius:14px;background:#1c1c1c;overflow:hidden;cursor:pointer}
.ap-card-gallery img{width:100%;height:100%;object-fit:contain}.ap-card-gallery button span{position:absolute;top:8px;left:8px;background:#0009;color:#fff;border-radius:31px;padding:0 7px;font-size:12px;line-height:20px}
.ap-card-gallery figcaption{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:6px;font-size:12px;line-height:20px}.ap-card-gallery button:focus-visible{outline:2px solid #b9a1f1;outline-offset:2px}
.ap-card-media-actions{display:flex;gap:12px;flex:none;padding-top:16px}.ap-card-media-actions>*{flex:1;text-align:center}.ap-card-empty{grid-column:1/-1;display:grid;place-items:center;gap:12px;min-height:200px;color:#777}.ap-card-empty svg{width:40px;height:40px}
@media(max-width:760px){.ap-card-gallery{grid-template-columns:1fr}.ap-card-gallery figure>button{height:200px}}
@media(max-width:560px){.ap-card-character .ap-card-media{flex-direction:column;align-items:stretch;gap:0}.ap-card-gallery{grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible;flex:none}.ap-card-gallery figure>button{height:160px}}

/* Only the content of an empty image surface changes; the card/tag border stays owned by ac-node-card. */
.ac-empty-appearance{height:100%;width:100%;min-height:0;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:0 16px;color:#fff}
.ac-empty-placeholder{display:flex;align-items:center;justify-content:center;width:44px;height:44px;flex:0 0 44px;--xyq-node-placeholder-fill:rgba(255,255,255,.16)}
.ac-empty-placeholder>svg{display:block;width:44px;height:44px}
.ac-empty-actions{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;height:24px}
body .studio-shell .asset-canvas-mode .ac-empty-actions button{box-sizing:border-box;display:flex;align-items:center;justify-content:center;flex-shrink:0;gap:4px;min-width:40px;height:24px;padding:1px 10px;border:1px solid transparent;border-radius:32px;background:transparent;color:#fff;font:500 12px/13.8px system-ui,-apple-system,"Segoe UI",sans-serif;white-space:nowrap}
body .studio-shell .asset-canvas-mode .ac-empty-actions button:hover{background:rgba(255,255,255,.08)}
body .studio-shell .asset-canvas-mode .ac-empty-actions button:active{background:rgba(255,255,255,.12);transform:translateY(1px)}
.ac-empty-actions button>svg{display:block;width:12px;height:12px;flex:0 0 12px}
.ac-empty-upload-status{font-size:12px;line-height:24px;color:#aaa}
.ac-background-filter{display:flex;align-items:center;gap:6px;padding:0 16px 10px;color:#aaa;font-size:12px}.ac-appearance-status{font-size:12px;color:#aaa}.ac-selection-tools>strong{max-width:250px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ac-library-thumb>.icon{width:20px;height:20px}

body .studio-shell .asset-canvas-mode .ac-image-composer textarea[data-asset-appearance-prompt]{flex:0 0 auto;height:168px;min-height:min(168px,25vh)!important;max-height:240px;resize:vertical!important}body .studio-shell .asset-canvas-mode .ac-image-composer [data-action="asset-canvas-appearance-save"],body .studio-shell .asset-canvas-mode .ac-image-composer [data-action="asset-canvas-asset-open"]{font-size:13px;padding:8px 12px;border-radius:20px;background:#303030;white-space:nowrap}

body .studio-shell .asset-canvas-mode .ac-image-tool-return{position:absolute;top:78px;left:50%;transform:translateX(-50%);z-index:30;display:flex;align-items:center;gap:12px;pointer-events:auto;color:#aaa;font-size:12px;background:#242424;border:1px solid #444;border-radius:24px;padding:7px 14px}.ac-image-tool-return button{color:#eee;background:transparent;border:0;font-size:12px}

.ac-appearance-error{position:absolute;bottom:350px;left:50%;transform:translateX(-50%);padding:8px 16px;border-radius:12px;background:#432c2c;color:#ffc9c9;pointer-events:auto;max-width:80%}

body .studio-shell .asset-canvas-mode .ac-has-labels .ac-node-group-caption>span{visibility:hidden}
body .studio-shell .asset-canvas-mode .ac-node-group-caption button>svg{width:12px;height:12px}
/* Empty-card resource picker; does not restyle the shared resource manager. */
dialog.ac-resource-picker{box-sizing:border-box;width:min(960px,calc(100vw - 64px));max-width:none;height:calc(100dvh - 64px);max-height:900px;margin:auto;padding:24px;border:1px solid #393939;border-radius:32px;background:#1e1e1e;color:#f1f1f1;font:14px/1.5 system-ui,-apple-system,sans-serif;overflow:visible}
dialog.ac-resource-picker[open]{display:flex;flex-direction:column;gap:16px}
dialog.ac-resource-picker::backdrop{background:#0008;backdrop-filter:blur(8px)}
.ac-resource-picker button,.ac-resource-picker summary{border:1px solid #3d3d3d;border-radius:24px;background:transparent;color:inherit;padding:6px 14px;font-family:inherit;font-size:12px;font-weight:500;line-height:18px;cursor:pointer;white-space:nowrap}
.ac-resource-picker button:hover,.ac-resource-picker summary:hover{background:#ffffff0f}
.ac-resource-picker button:disabled{cursor:default;color:#666;background:#292929;border-color:transparent}
.ac-resource-picker .icon{width:12px;height:12px;vertical-align:middle}
.ac-resource-picker header{display:flex;align-items:center;justify-content:space-between;gap:24px;background:none;border:0;padding:0}
.ac-resource-picker header [role=tablist]{display:flex;gap:24px;padding:0 8px}
.ac-resource-picker header [role=tab]{border:0;border-radius:0;padding:8px 0;color:#999;font-size:14px}
.ac-resource-picker header [role=tab][aria-selected=true]{border-bottom:2px solid #fff;color:#fff}
.ac-resource-search{display:flex;align-items:center;gap:10px;background:#292929;border-radius:24px;width:240px;padding:8px 12px}
.ac-resource-search input{min-width:0;width:100%;padding:0;border:0!important;box-shadow:none!important;background:transparent!important;color:#eee;font-family:inherit;font-size:12px;line-height:20px;outline:0}
.ac-resource-controls{display:flex;align-items:center;gap:16px}
.ac-resource-controls [role=tablist]{display:flex;gap:8px}
.ac-resource-controls [aria-selected=true]{background:#353535;border-color:transparent}
.ac-resource-controls details{position:relative}.ac-resource-controls summary{display:flex;align-items:center;gap:6px;list-style:none}.ac-resource-controls summary::-webkit-details-marker{display:none}
.ac-resource-controls [role=menu]{position:absolute;right:0;top:calc(100% + 8px);z-index:2;min-width:165px;padding:6px;background:#292929;border:1px solid #444;border-radius:12px;box-shadow:0 8px 28px #0006}
.ac-resource-controls [role=menu] button{display:block;text-align:left;border:0;width:100%;border-radius:8px}.ac-resource-controls [role=menu] small,.ac-resource-controls [role=menu] label{display:block;padding:6px 10px}
.ac-resource-content{flex:1;min-height:0;overflow:auto;scrollbar-width:thin}.ac-resource-empty{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:#888;font-size:14px}.ac-resource-content h3{font-size:14px;font-weight:500}
.ac-resource-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px}
.ac-resource-item{position:relative;min-width:0}.ac-resource-item>button:first-child{width:100%;padding:0;border:0;text-align:left;display:flex;flex-direction:column;gap:8px;border-radius:12px;font-weight:400}.ac-resource-item>button:first-child>span:first-child{position:relative;width:100%;aspect-ratio:1;border:1px solid transparent;border-radius:12px;overflow:hidden;background:#292929;display:flex;align-items:center;justify-content:center}.ac-resource-item img{width:100%;height:100%;object-fit:contain}.ac-resource-item [aria-pressed=true]>span:first-child{border-color:#fff!important}.ac-resource-item [aria-pressed=true] .icon{position:absolute;right:8px;top:8px;background:#fff;color:#111;border-radius:50%;padding:3px;width:20px;height:20px}.ac-resource-item>button>span:last-child{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.ac-resource-item .ac-resource-preview{position:absolute;right:6px;bottom:32px;padding:5px;opacity:0;background:#111a}.ac-resource-item:hover .ac-resource-preview,.ac-resource-preview:focus-visible{opacity:1}
.ac-resource-picker footer{display:flex;align-items:center;gap:8px;border:0;padding:0;background:none}.ac-resource-picker footer button{height:36px;min-width:72px}.ac-resource-picker .ac-resource-add:not(:disabled){background:#fff;color:#171717}.ac-resource-count{color:#aaa;font-size:12px}
.ac-resource-image-preview{background:#111;border:0;padding:16px;border-radius:16px;max-width:90vw;max-height:90vh}.ac-resource-image-preview::backdrop{background:#000a}.ac-resource-image-preview>img{display:block;max-width:80vw;max-height:80vh;object-fit:contain}.ac-resource-image-preview button{position:absolute;right:10px;top:10px;border:0;border-radius:50%;background:#333;color:#fff;padding:8px}
.ac-resource-controls summary>.icon{transform:rotate(90deg)}
@media(max-width:600px){
 dialog.ac-resource-picker{height:88dvh}
 .ac-resource-picker header [role=tablist]{flex:0 0 90px;overflow-x:auto;scrollbar-width:none;box-sizing:border-box}
 .ac-resource-picker .ac-resource-search{box-sizing:border-box;width:156px;flex:0 1 156px}
 .ac-resource-controls{min-height:34px;overflow-x:auto;scrollbar-width:none;flex-shrink:0}
 .ac-resource-controls [role=tablist],.ac-resource-controls details{flex-shrink:0}
 .ac-resource-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .ac-resource-picker footer{justify-content:center}.ac-resource-picker footer>.grow{display:none}
}

.ac-empty-actions,.ac-resource-picker{-webkit-font-smoothing:antialiased}

/* Both entry points use the same quick creation surface (measured on the source). */
body .studio-shell .asset-canvas-mode .canvas-quick-create{pointer-events:auto;width:calc(100% - 96px);max-width:1016px;z-index:2}
.canvas-quick-create>div{display:grid;grid-template-columns:repeat(6,minmax(132px,1fr));gap:10px;padding:2px 0 10px;overflow:hidden}
.canvas-quick-create button{display:flex;align-items:center;gap:10px;box-sizing:border-box;height:64px;padding:0 14px;background:#ffffff0a;border:1px solid #ffffff14;border-radius:16px;color:#fafafa;font:600 17px/24px system-ui;cursor:pointer;min-width:0;white-space:nowrap}
.canvas-quick-create button>span{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;background:#ffffff14;flex:none}
.canvas-quick-create button>strong{overflow:hidden;text-overflow:ellipsis;font:inherit}
.canvas-quick-create button svg{width:22px;height:22px}
.canvas-quick-create button:hover{background:#ffffff14}
body .studio-shell .asset-canvas-mode .canvas-quick-create p{margin-top:18px;color:#a3a3a3;font:14px/20px system-ui}
body .studio-shell .canvas-unified-add{box-sizing:border-box;width:300px;padding:17px;border:1px solid #ffffff14;border-radius:36px;background:#262626b3;backdrop-filter:blur(20px);box-shadow:0 24px 60px #0004;z-index:70}
.canvas-add-title{font:12px/18px system-ui;color:#ffffff80;height:28px;padding-left:8px}
body .studio-shell .canvas-unified-add button{height:56px;padding:8px;border-radius:36px;gap:16px;color:#fff;font:13px/18px system-ui;border:0;margin:0}
.canvas-add-icon{display:grid;place-items:center;background:#ffffff0a;width:40px;height:40px;border-radius:10px;flex:none}
.canvas-add-icon svg{width:24px;height:24px}
body .studio-shell .canvas-unified-add button:hover,body .studio-shell .canvas-unified-add button:focus-visible{background:#ffffff14}

.canvas-add-icon{position:relative}.canvas-add-icon>span{display:grid;place-items:center}.canvas-add-icon>span+span{display:none}
.canvas-add-copy{display:flex;flex-direction:column;gap:3px}.canvas-add-copy small{display:none;color:#a3a3a3;font:11px/16px system-ui}
.canvas-unified-add button:hover .canvas-add-copy small,.canvas-unified-add button:focus-visible .canvas-add-copy small{display:block}
.canvas-unified-add button:hover .canvas-add-icon>span:first-child,.canvas-unified-add button:focus-visible .canvas-add-icon>span:first-child{display:none}
.canvas-unified-add button:hover .canvas-add-icon>span+span,.canvas-unified-add button:focus-visible .canvas-add-icon>span+span{display:grid}

/* Source quick actions are centered on the canvas beneath the overlaid library. */
body .studio-shell .asset-canvas-mode .canvas-layout:has(>.ac-library) .canvas-quick-create{width:calc(100% + var(--ac-library-width) - 96px);left:calc(50% - var(--ac-library-width)/2)}
