.proposal-workspace{grid-template-columns:360px minmax(0,1fr)}
.proposal-controls{padding:22px 18px;height:calc(100svh - 76px);position:sticky;top:0;overflow:hidden;gap:20px}
.studio-navigation{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;padding:4px;background:#f0f2f5;border-radius:14px;flex-shrink:0}
.studio-navigation button{border:0;background:transparent;color:#6e7785;border-radius:10px;padding:10px 3px;font-size:13px;white-space:nowrap}
.studio-navigation button[aria-selected="true"]{background:#fff;color:#245ec6;box-shadow:0 1px 5px #182b4d12;font-weight:600}
.studio-panel{overflow:auto;min-height:0;flex:1;padding:0 4px 16px;scrollbar-width:thin}
.studio-panel .proposal-section{margin-top:22px}.studio-panel .proposal-brief textarea{min-height:120px;height:145px;font-size:13px}
.studio-panel .proposal-modes{min-height:44px}.studio-panel .proposal-modes button{font-size:12px}
.studio-panel .proposal-current-template{gap:10px}.studio-panel .proposal-current-template img{width:86px}
.studio-panel .proposal-current-template>span{font-size:13px}.studio-panel .proposal-output-options{gap:13px 18px}
.studio-panel .proposal-output-options label{font-size:12px;gap:8px}.studio-panel .proposal-output-options select{width:92px!important}
.studio-panel .proposal-template-section{padding-top:18px}.studio-panel .proposal-section h2,.studio-panel .proposal-brief>label{font-size:14px}
.studio-panel .proposal-generate{height:44px;font-size:14px!important}.studio-manual{width:100%;justify-content:center;margin-top:9px;background:#fff;min-height:40px}
.studio-panel-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px;gap:12px}
.studio-panel-heading h2{font-size:17px;margin:0}.studio-panel-heading .proposal-outline-button{padding:7px 12px;min-height:34px;font-size:12px}
.studio-library-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.studio-library-card{display:flex;flex-direction:column;gap:7px;padding:8px;background:#fafbfc;border:1px solid #e7eaf0;border-radius:12px;min-width:0}
.studio-library-card>img{width:100%;aspect-ratio:1.4;object-fit:contain;border-radius:7px;background:#f1f3f6}
.studio-library-card>strong{font-size:11px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;color:#5c6778;font-weight:500}
.studio-library-card>small{font-size:10px;color:#4a72be}
.studio-library-card button,.studio-result button{border:0;border-radius:8px;background:#eef3ff;color:#2b5fce;padding:8px 9px;font-size:11px}
.studio-library-card button:hover,.studio-result button:hover{background:#e1eaff}
.studio-library-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-top:auto}
.studio-library-actions>button{display:flex;align-items:center;justify-content:center;min-width:0;min-height:34px;padding:8px 4px;white-space:nowrap;line-height:1.4}
.studio-library-actions>button:only-child{grid-column:1/-1}
.studio-library-search{display:flex;align-items:center;gap:8px;padding:0 10px;height:36px;margin-bottom:14px;border:1px solid #e3e7ee;border-radius:10px;background:#f8f9fb;color:#78869b}
.studio-library-search>i{font-size:16px;flex-shrink:0}.studio-library-search>input{min-width:0;width:100%;height:100%;padding:0;border:0;outline:none;background:none;font:12px Arial,"PingFang SC","Microsoft YaHei",sans-serif;color:#344054}
.studio-library-search>.pi-search-line::before{content:"\f0d1"}
.studio-library-search:focus-within{border-color:#2b5fce;box-shadow:0 0 0 2px #2b5fce12}.studio-library-search>input::placeholder{color:#98a2b3}
.studio-library-footer{display:flex;justify-content:center;gap:10px;margin-top:14px}.studio-library-footer>button{border:1px solid #e1e8f5;background:#fff;color:#2b5fce;padding:8px 14px;border-radius:8px;font-size:12px;cursor:pointer}
#workspaceLibrary .studio-library-card>img{aspect-ratio:1.45;object-fit:cover;cursor:default}
#workspaceLibrary button:disabled{opacity:.5;cursor:wait}#workspaceLibrary button:focus-visible{outline:2px solid #8bb0fa;outline-offset:2px}
.studio-document-icon{display:grid;place-items:center;aspect-ratio:1.4;background:#eef1f6;border-radius:7px;color:#7d8ca5;font-weight:600}
.studio-ai-modes{display:flex;gap:7px;margin-bottom:18px}.studio-ai-modes button{flex:1;border:1px solid #e8ebf1;background:#fff;border-radius:10px;padding:9px 3px;font-size:12px;color:#7c8695}
.studio-ai-modes button[aria-selected="true"]{background:#edf3ff;border-color:#bcd0fa;color:#2b5fce}
.studio-field{display:flex;flex-direction:column;gap:8px;font-size:12px;color:#5a6575;margin:14px 0}
.studio-field textarea,.studio-field input,.studio-field select{width:100%;min-width:0;border:1px solid #e4e8ee;background:#f6f7f9;border-radius:11px;padding:10px;color:#344054;font:inherit;box-sizing:border-box}
.studio-field textarea{min-height:118px;resize:vertical;line-height:1.7}.studio-field input,.studio-field select{height:39px;padding:7px 9px}
.studio-field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.studio-field-row .studio-field{margin-bottom:0}
.studio-run{margin-top:17px}.studio-status{font-size:12px;line-height:1.6;color:#7a8698;margin:10px 0;overflow-wrap:anywhere}.studio-status:empty{display:none}.studio-status.is-error{color:#b04d3f}
.studio-library-texts h3{font-size:13px;color:#647087;font-weight:500}
.studio-result{border:1px solid #e3e8f0;border-radius:13px;background:#fff;padding:13px;margin:12px 0}
.studio-result-header{display:flex;justify-content:space-between;gap:10px;align-items:center;font-size:12px}.studio-result-header strong{font-weight:600;color:#4f5e74}.studio-result-header span{font-size:10px;color:#8691a0}
.studio-result-prompt{font-size:11px;color:#8a94a2;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.studio-result-text{font-size:12px;line-height:1.8;white-space:pre-wrap;color:#445164;overflow-wrap:anywhere;max-height:220px;overflow:auto}
.studio-result-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:12px}.studio-warning{font-size:11px;color:#a56d27;line-height:1.6}.studio-result-progress{color:#95a0ae;font-size:12px;line-height:1.7}
.studio-preview-button{width:100%;padding:0!important;display:block;overflow:hidden;border-radius:8px!important;text-align:left;background:#f5f3ef!important}
.studio-preview-button>img{display:block;width:100%;height:auto;max-height:260px;object-fit:contain}.studio-slide-preview{width:100%}
.studio-insert-bar{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:17px}.studio-insert-bar>span{flex:1}.studio-insert-bar button{border:1px solid #e3e7ee;border-radius:10px;background:#fff;color:#607086;padding:8px 11px;font-size:12px}
.editor-tool-group{gap:7px}.editor-toolbar{padding:8px 10px}.editor-toolbar button{font-size:11px;padding:7px 9px}
.editor-page-layouts{grid-template-columns:repeat(2,minmax(0,1fr))}.studio-ai-page{width:100%;margin-top:16px;justify-content:center;color:#2b5fce;border-color:#cbdafa}
.studio-preview-dialog{width:min(1000px,calc(100vw - 32px));padding:22px;border-radius:18px;box-sizing:border-box}
#creativePreviewContent>img{display:block;max-width:100%;max-height:72svh;object-fit:contain;margin:auto}
.studio-panel [hidden]{display:none!important}
.studio-drop-target{outline:3px solid #2b5fce;outline-offset:3px}.studio-library-card>img,.studio-preview-button{cursor:grab}
.studio-drag-ghost{position:fixed;z-index:2000;pointer-events:none;padding:9px 14px;border:1px solid #cbd9f4;border-radius:9px;background:#fff;color:#2b5fce;box-shadow:0 4px 18px #25467625;font:12px/1.4 sans-serif}
@media(max-width:1050px){.proposal-workspace{grid-template-columns:320px minmax(0,1fr)}.proposal-controls{padding:18px 14px}.studio-insert-bar button{font-size:11px;padding:7px 9px}.studio-panel .proposal-output-options{gap:10px}}
@media(max-width:800px){.proposal-workspace{grid-template-columns:1fr}.proposal-controls{position:static;height:auto;max-height:60svh;padding:16px 18px;gap:14px}.studio-panel{max-height:46svh}.studio-library-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.studio-insert-bar>span{display:none}.studio-preview-dialog{padding:16px}.studio-panel .proposal-brief textarea{height:110px;min-height:110px}}
@media(max-width:440px){.studio-library-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:800px){#workspaceLibrary .studio-library-actions>button{min-height:44px}}

/* Native selects retain keyboard behavior with a consistent, inset chevron. */
.studio-field .studio-select-control{display:block;width:100%}
.studio-field .studio-select-control select{appearance:none;-webkit-appearance:none;height:42px;padding:0 40px 0 12px;cursor:pointer;line-height:normal;transition:border-color .15s,box-shadow .15s,background-color .15s}
.studio-field .studio-select-control>i{right:13px;width:18px;height:18px;font-size:18px;color:#78869b}
.studio-field .studio-select-control select:hover:not(:disabled){border-color:#b8c7df;background-color:#f0f4fa}
.studio-field .studio-select-control select:focus-visible{outline:0;border-color:#2b5fce;box-shadow:0 0 0 3px #2b5fce1a}
.studio-select-control:focus-within>i{color:#2b5fce}
.studio-field .studio-select-control select:disabled{cursor:default;color:#98a2b3;background-color:#f6f7f9}
.proposal-canvas:not(:has(#editorToolbar:not([hidden])))>.proposal-canvas-body{margin-top:0}
.studio-document-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:14px}
.studio-document-actions:not(:has(#editorSaveStatus:not([hidden]),#editorHistory:not([hidden]),#downloadPptx:not([hidden]))){display:none}
.studio-document-actions>.proposal-preview-actions{margin-left:auto}
@media(forced-colors:active){.studio-field .studio-select-control select{appearance:auto;-webkit-appearance:menulist;padding-right:12px}.studio-select-control>i{display:none}}

/* A stable canvas viewport and a separate, always reachable document dock. */
.studio-canvas-viewport{min-width:0;display:flex;align-items:center;justify-content:center}
.studio-bottom-bar{min-width:0}
.studio-document-actions{margin-top:0;padding:10px 0;min-height:52px}
.studio-bottom-bar .editor-page-controls{margin-top:0;padding:0 0 6px}
.studio-bottom-bar .proposal-thumbs{justify-content:flex-start;margin-top:0;gap:12px;padding:5px 5px 8px}
.studio-bottom-bar .proposal-page-card{flex:0 0 130px;min-width:130px}
.studio-bottom-bar .proposal-thumb{flex:0 0 130px;min-width:130px;max-width:130px}
.studio-bottom-bar .editor-thumb-heading{height:20px;margin-bottom:3px}
.studio-bottom-bar .proposal-thumb span{margin-top:5px;font-size:11px}
.studio-bottom-bar .editor-page-status{margin:0 0 6px}
.studio-document-actions .proposal-outline-button{min-height:34px;padding:6px 11px;font-size:12px}
.editor-selection.is-locked{border-style:dashed;border-color:#8a96a6}
.editor-selection.is-locked .editor-resize-handle,.editor-selection.is-locked .editor-move-handle{display:none}
.editor-element.is-locked{cursor:default}
#lockElement[aria-pressed="true"]{color:#245ec6;background:#edf3ff;border-color:#bcd0fa}
.studio-reference-button{width:100%;display:flex;align-items:center;gap:10px;text-align:left;min-height:46px;border:1px solid #e4e8ee;border-radius:11px;background:#f6f7f9;color:#344054;padding:8px 12px;font-size:12px}
.studio-reference-button>img{width:54px;height:40px;object-fit:cover;border-radius:6px}
.studio-reference-button>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.studio-reference-button>i{color:#78869b;font-size:18px}.studio-reference-button:hover{border-color:#b8c7df;background:#f0f4fa}
.studio-reference-actions{display:flex;gap:10px;margin-bottom:18px}
.editor-image-choice[aria-pressed="true"]{outline:2px solid #2b5fce;outline-offset:2px}
.studio-versions-dialog{width:min(1100px,calc(100vw - 32px))}
.studio-version-help,#versionPageLabel{font-size:12px;color:#758198;line-height:1.6}
.studio-versions-layout{display:grid;grid-template-columns:240px minmax(0,1fr);gap:22px}
#versionList{max-height:55svh;overflow:auto;display:flex;flex-direction:column;gap:8px}
.studio-version-item{display:flex;flex-direction:column;gap:8px;border:1px solid #e4e8ee;border-radius:10px;background:#f8f9fb;text-align:left;padding:12px;color:#344054}
.studio-version-item>span{font-size:11px;color:#758198;line-height:1.7}
.studio-version-item[aria-pressed="true"]{border-color:#2b5fce;background:#edf3ff}
#versionPreview .editor-slide{width:100%;border-radius:8px;overflow:hidden}
#versionNavigation{display:flex;gap:8px;flex-wrap:wrap}#versionNavigation[hidden]{display:none}
#versionNavigation button{font-size:12px;padding:8px 12px;min-height:36px}
@media(min-width:1051px){
 body[data-page="proposal"]{height:100svh;overflow:hidden}
 .proposal-workspace{height:calc(100svh - 76px);min-height:0}
 .proposal-canvas{display:flex;flex-direction:column;height:100%;min-height:0;padding:16px 24px 0;overflow:auto}
 .proposal-canvas>.studio-insert-bar{margin-top:0;flex-shrink:0}
 .proposal-canvas>.editor-toolbar,.proposal-canvas>.editor-alert{flex-shrink:0}
 .proposal-canvas>.proposal-canvas-body,.proposal-canvas:not(:has(#editorToolbar:not([hidden])))>.proposal-canvas-body{display:flex;flex-direction:column;flex:1;min-height:220px;margin-top:12px;gap:8px}
 .studio-canvas-viewport{flex:1;min-height:100px;overflow:hidden;padding:0}
 .studio-bottom-bar{flex-shrink:0;background:#f8f9fa;border-top:1px solid #e8ecf1}
 .studio-bottom-bar .proposal-thumbs{max-height:132px}
}
@media(max-width:1050px){.studio-bottom-bar{position:sticky;bottom:0;z-index:10;background:#f8f9fa;padding-top:8px;border-top:1px solid #e8ecf1;margin-top:14px}.studio-canvas-viewport>.proposal-slide-stage{width:100%;height:auto}.studio-bottom-bar .proposal-thumbs{max-height:130px}}
@media(max-width:700px){.studio-versions-layout{grid-template-columns:1fr}#versionList{max-height:160px}.studio-document-actions{gap:6px}.studio-document-actions>.proposal-preview-actions{gap:4px}.studio-insert-bar{gap:5px}.studio-bottom-bar .proposal-page-card{flex-basis:110px;min-width:110px}}

.studio-ratio-label{margin:0 0 14px;color:#78869b;font-size:11px}
.studio-comparison-dialog{width:min(1200px,calc(100vw - 32px))}
.studio-comparison-tabs{display:flex;gap:8px;margin-bottom:18px}
.studio-comparison-tabs button{border:1px solid #e4e8ee;border-radius:10px;background:#fff;color:#647087;padding:9px 13px;font-size:12px}
.studio-comparison-tabs button[aria-pressed="true"]{background:#edf3ff;border-color:#bcd0fa;color:#2b5fce}
.studio-comparison-tabs [hidden]{display:none}
.studio-comparison-images{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.studio-comparison-images figure{margin:0;min-width:0}
.studio-comparison-images img{display:block;width:100%;height:clamp(180px,42svh,480px);object-fit:contain;background:#f4f5f7;border-radius:10px}
.studio-comparison-images figcaption{padding:9px 0;font-size:12px;color:#647087;text-align:center}
@media(max-width:650px){.studio-comparison-images{grid-template-columns:1fr;gap:10px}.studio-comparison-images img{height:27svh}}

#editablePreview.is-multi-mode{touch-action:none}
#editablePreview:focus-visible{outline:2px solid #8baaf0;outline-offset:3px}
#editablePreview.has-multi-selection .editor-element.is-selected,#editablePreview .editor-element.is-marquee-hit{outline:1.5px solid #2b65d6;outline-offset:-1px}
#editablePreview.has-multi-selection .editor-element.is-locked.is-selected{outline-style:dashed;outline-color:#8a96a6}
.editor-selection.is-multi .editor-resize-handle{display:none}
.editor-marquee{position:absolute;pointer-events:none;z-index:12;border:1px solid #2b65d6;background:#2b65d619}
#multiSelectMode[aria-pressed="true"]{background:#edf3ff;color:#245ec6;border-color:#bcd0fa}
.editor-arrange-tools{flex-wrap:wrap;gap:8px}
#selectionCount{font-size:12px;color:#526b91;margin-right:6px}

.editor-selection-actions{position:absolute;display:grid;grid-template-columns:repeat(5,30px);grid-auto-rows:30px;align-items:center;gap:4px;width:176px;height:40px;padding:4px;box-sizing:border-box;border:1px solid #e2e7ef;border-radius:10px;background:#fff;box-shadow:0 3px 12px #182b4d1a;pointer-events:auto;z-index:2}
.editor-selection-actions .editor-action-control{position:relative;display:flex;align-items:center;justify-content:center;flex:0 0 30px;width:30px;height:30px;min-width:30px;min-height:30px;padding:0;border:0;border-radius:6px;background:transparent;color:#52657f;cursor:pointer}
.editor-action-control i{font-size:18px;pointer-events:none;line-height:1}
.editor-selection-actions .editor-action-control:hover:not(:disabled),.editor-selection-actions .editor-lock-control[aria-pressed="true"]{background:#edf3ff;color:#245ec6}
.editor-selection-actions .editor-delete-control{color:#d02d25}
.editor-selection-actions .editor-delete-control:hover:not(:disabled){background:#fff0ee;color:#b9211a}
.editor-selection-actions .editor-action-control:focus-visible{outline:2px solid #2b65d6;outline-offset:1px}
.editor-selection-actions .editor-delete-control:focus-visible{outline-color:#d02d25}
.editor-selection-actions .editor-action-control:disabled{opacity:.4;cursor:default}
.editor-selection.compact-actions .editor-move-handle{display:none}
.editor-slide.is-transforming .editor-selection-actions{visibility:hidden}

/* Keep page management and export actions on one compact row. */
.studio-bottom-toolbar{display:flex;align-items:center;gap:12px;min-width:0;min-height:50px;padding:8px 0;overflow-x:auto;scrollbar-width:thin}
.studio-bottom-toolbar:not(:has(#pageControls:not([hidden]),#editorHistory:not([hidden]),#downloadPptx:not([hidden]))){display:none}
.studio-bottom-toolbar .editor-page-controls{flex:1 0 auto;flex-wrap:nowrap;gap:18px;margin:0;padding:0}
.studio-bottom-toolbar .editor-page-meta{flex-shrink:0;white-space:nowrap}
.studio-bottom-toolbar .editor-page-actions,.studio-bottom-toolbar .proposal-preview-actions{flex-wrap:nowrap;flex-shrink:0}
.studio-bottom-toolbar .studio-document-actions{flex:0 0 auto;flex-wrap:nowrap;margin:0 0 0 auto;padding:0;min-height:0}
.studio-bottom-toolbar button{flex-shrink:0;white-space:nowrap}
@media(max-width:700px){.studio-bottom-toolbar{gap:8px}.studio-bottom-toolbar .editor-page-controls{gap:12px}}

/* Compact contextual tools share the insertion row, aligned to its right. */
.studio-canvas-topbar{display:flex;align-items:center;flex-wrap:nowrap;flex-shrink:0;gap:16px;min-width:0;min-height:38px;overflow-x:auto;scrollbar-width:thin}
.studio-canvas-topbar:not(:has(#elementInsertToolbar:not([hidden]),#editorToolbar:not([hidden]))){display:none}
.studio-canvas-topbar .studio-insert-bar{flex:0 0 auto;flex-wrap:nowrap;margin:0;gap:7px}
.studio-canvas-topbar .studio-insert-bar button{white-space:nowrap;min-height:34px;padding:6px 10px}
.studio-canvas-topbar .editor-toolbar{flex:0 0 auto;flex-wrap:nowrap;margin:0 0 0 auto;padding:0;min-height:34px;border:0;border-radius:0;background:transparent;gap:7px}
.studio-canvas-topbar .editor-tool-group{flex-wrap:nowrap;flex-shrink:0;gap:6px}
.studio-canvas-topbar .editor-toolbar button,.studio-canvas-topbar .editor-toolbar select{white-space:nowrap;min-height:30px;font-size:12px;padding:5px 8px}
.studio-canvas-topbar .editor-toolbar label{white-space:nowrap;gap:5px}
.studio-canvas-topbar .editor-toolbar input[type="number"]{width:46px;height:30px}
.studio-canvas-topbar #layoutTools{margin-left:0;padding-left:7px;border-left:1px solid #e1e5ec}
@media(max-width:700px){.studio-canvas-topbar{gap:10px}.studio-canvas-topbar .editor-toolbar button,.studio-canvas-topbar .editor-toolbar select{font-size:11px;padding:5px 7px}}
