/* 3.88 review: bounded grids, useful canvas space, non-modal AI assistance. */
.studio-page,.reference-comparison-page{overflow-x:clip}
.studio-page *,.reference-comparison *{box-sizing:border-box}
.reference-comparison{width:100%;max-width:100vw}
.comparison-columns{grid-template-columns:repeat(2,minmax(0,1fr))!important;overflow:hidden}
.comparison-columns>section{min-width:0;overflow:hidden}.comparison-columns iframe{display:block;min-width:0;width:100%;height:100%;flex:1 1 0}
.comparison-header nav{min-width:0;flex-wrap:wrap}.comparison-header .btn{white-space:normal;text-align:center;min-width:0}
.comparison-label{min-height:68px;overflow-wrap:anywhere}.comparison-label>*{min-width:0}
.studio-page :is(.studio-start-options,.reference-quick,.studio-start-templates,.ai-composer-tools,.studio-header-actions){min-width:0;max-width:100%}
.studio-page .studio-start-options>div{min-width:0}.studio-page .studio-header-actions{flex-wrap:wrap}
.studio-page #ai-app .studio-ai-split{grid-template-columns:minmax(260px,28%) minmax(0,1fr)!important;grid-template-rows:auto minmax(0,1fr)!important}
.studio-page #ai-app .studio-ai-split>.studio-split-heading{min-width:0;gap:8px;flex-wrap:wrap;padding:8px 12px}
.studio-page #ai-app .studio-ai-split>.studio-focus-panel{min-width:0;min-height:0}
.studio-page #ai-app .studio-ai-split .ai-preview-stage{overflow:hidden!important;align-items:flex-start;justify-content:flex-start;padding:0!important}
.studio-page #ai-app .studio-ai-split #ai-preview{max-width:none!important;transform-origin:top left;flex:none!important}
.studio-page #ai-app .studio-focus-heading{gap:8px;flex-wrap:wrap}
.studio-page #ai-app .studio-focus-heading .studio-header-actions{flex:1 1 250px;min-width:0}
.studio-page .studio-manual-actions{flex-wrap:wrap;gap:4px}.studio-page .studio-device-controls{flex-wrap:wrap;min-width:0}
.studio-page #ai-app .ai-editor-switch{max-width:100%}
#studio-floating-ai{position:fixed;z-index:10030;right:20px;bottom:20px;width:380px;height:520px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);min-width:min(280px,calc(100vw - 16px));min-height:240px;display:flex;flex-direction:column;background:white;border:1px solid #c9c5e1;border-radius:16px;box-shadow:0 16px 64px #23204340;overflow:hidden;box-sizing:border-box}
#studio-floating-ai[hidden]{display:none!important}
.floating-ai-handle{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 12px;background:#51418d;color:white;cursor:move;touch-action:none;flex:none;min-height:46px}
.floating-ai-handle strong{font-size:14px}.floating-ai-handle button{border:0;border-radius:7px;background:#ffffff20;color:white;width:32px;height:32px;font:20px sans-serif;cursor:pointer}
.floating-ai-body{flex:1;min-height:0;display:flex;overflow:hidden}
#studio-floating-ai #ai-chat-panel{position:static!important;display:flex!important;flex-direction:column!important;width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;overflow:hidden!important;background:white}
#studio-floating-ai :is(.studio-focus-heading,.studio-box-heading,.ai-wallet-bar,.ai-chat-title,.ai-suggestions,.trial-notice,#trial-edit-copy,#trial-credit-guide,.ai-disclaimer){display:none!important}
#studio-floating-ai #ai-messages{flex:1!important;min-height:24px!important;max-height:none!important;height:auto!important;overflow:auto;padding:12px!important}
#studio-floating-ai #ai-chat-form{flex:none;display:grid;gap:6px;width:100%;margin:0;padding:10px 12px 20px;border-top:1px solid #eee;box-sizing:border-box}
#studio-floating-ai textarea{width:100%;min-height:54px;height:64px;max-height:110px;resize:vertical;font-size:16px;box-sizing:border-box}
#studio-floating-ai .ai-composer-tools{display:flex;gap:6px;flex-wrap:wrap;min-width:0}#studio-floating-ai select{min-width:0;max-width:100%}
#studio-floating-ai .ai-message{overflow-wrap:anywhere;font-size:14px;line-height:1.6}#studio-floating-ai small{font-size:11px}
.floating-ai-resize{position:absolute;right:0;bottom:0;width:24px;height:24px;border:0;background:#f0edfa;color:#57438d;touch-action:none;cursor:nwse-resize}
@media(max-width:900px){
 .studio-page #ai-app .ai-studio-grid.studio-ai-split{grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto minmax(120px,1fr) minmax(220px,40%)!important}
 .studio-page #ai-app .studio-ai-split>#studio-manual-panel{grid-column:1!important;grid-row:2!important}
 .studio-page #ai-app .studio-ai-split>#ai-chat-panel{grid-column:1!important;grid-row:3!important}
 .studio-page #ai-app .studio-ai-split #ai-chat-form{display:flex;flex-direction:column;width:100%;margin:0;padding:8px 12px}
 .studio-page #ai-app .studio-ai-split .ai-composer-tools{flex-direction:row;justify-content:space-between}
 .studio-page #ai-app .studio-ai-split #ai-prompt{height:52px;min-height:44px}
 .studio-page #ai-app .studio-ai-split>.studio-split-heading>div:first-child{flex:1}.studio-split-heading small{display:none}
 .studio-page #ai-app .studio-focus-heading .studio-header-actions{order:4;flex-basis:100%;overflow-x:auto;flex-wrap:nowrap}
 .studio-page .studio-header-actions button{font-size:12px!important;min-height:34px;padding:5px 8px;white-space:nowrap}
 .studio-page .studio-manual-actions{flex-wrap:nowrap}.studio-page #ai-app #studio-manual-panel.studio-focus-panel .ai-editor-switch{position:static!important;height:auto!important;width:auto!important}
 .studio-page #ai-app .studio-device-controls{gap:4px}.studio-page #ai-app .studio-device-controls button{font-size:11px;padding:5px 7px}
 body.editor-body.section-workspace.layer-workspace .editor-layout{grid-template-columns:64px minmax(0,1fr)!important}
 body.editor-body.section-workspace.layer-workspace .editor-sidebar{width:64px!important;padding:4px!important;overflow-x:hidden}
 body.editor-body.layer-workspace .workspace-nav-group button{font-size:10px!important;padding:7px 2px!important;word-break:keep-all;overflow-wrap:anywhere;min-height:38px}
 body.editor-body.layer-workspace .workspace-nav-group h2{font-size:10px!important;line-height:1.5}
 body.editor-body.layer-workspace .workspace-home-brand{font-size:10px!important}.editor-header{min-width:0;flex-wrap:wrap}
 .workspace-layer{box-sizing:border-box;max-width:calc(100vw - 16px)!important}.workspace-layer-body{min-width:0;overflow:auto}
 .comparison-header{gap:8px}.comparison-label{min-height:84px;padding:7px;font-size:10px}.comparison-label strong{font-size:11px}.comparison-label strong small{font-size:9px}
 #studio-floating-ai{right:8px;bottom:8px;width:340px;height:430px}
}
.comparison-viewport{position:relative;flex:1;min-height:0;min-width:0;overflow:hidden}.comparison-viewport iframe{position:absolute;inset:0;max-width:none!important;border:0}.comparison-columns>section{min-height:0;overflow:hidden}
@media(max-width:900px){.studio-page #ai-app .studio-focus-heading .studio-header-actions{overflow:visible;flex-wrap:wrap!important;gap:3px}.studio-page .studio-manual-actions{flex-wrap:wrap!important}.studio-page .studio-header-actions button{font-size:11px!important;padding:4px 6px}.studio-page .studio-focus-heading{padding:6px!important}.studio-page .studio-document-meta{max-width:190px}.studio-page .studio-float-launch{font-size:12px;padding:7px 10px}}
@media(max-width:900px){.studio-page #ai-app .studio-manual-actions{min-width:0!important;width:100%!important;max-width:100%!important;flex:1 1 100%!important}.studio-page #ai-app .studio-header-actions{width:100%;max-width:100%}body.editor-body.section-workspace.layer-workspace .editor-layout{grid-template-columns:80px minmax(0,1fr)!important}body.editor-body.section-workspace.layer-workspace .editor-sidebar{width:80px!important}}
