/* Editing chrome: calm white surfaces, soft controls, and a clear blue primary action. */
body[data-page="proposal"]{--editor-blue:#2b5fce;--editor-line:#e8e9ec;--editor-muted:#737982}
.proposal-header{border-color:var(--editor-line)}
.proposal-project-title{border:0;background:#f5f5f6;border-radius:13px;box-shadow:none}
.proposal-controls{border-color:var(--editor-line)}
.proposal-brief textarea{background:#f5f5f6;border:1px solid transparent;border-radius:16px;box-shadow:none;padding:15px}
.proposal-modes{border:0;background:#f1f2f3;padding:4px;border-radius:14px;gap:4px}
.proposal-modes button{border-radius:10px;background:transparent}
.proposal-modes .is-active{background:#fff;color:#181a1d;box-shadow:0 1px 4px #10182810}
.proposal-generate{background:var(--editor-blue);border-color:var(--editor-blue);border-radius:24px;box-shadow:none}
.proposal-generate:hover{background:#214eae}
.proposal-outline-button{border-color:#e3e5e8;border-radius:14px;box-shadow:none}
.proposal-canvas{background:#f8f9fa;padding:30px 28px}
.proposal-canvas-toolbar{gap:16px;align-items:flex-start;flex-wrap:wrap}
.proposal-canvas-heading{display:flex;flex-direction:column;gap:5px;min-width:110px}
.proposal-canvas-heading h1{font-size:19px;letter-spacing:-.02em}
.editor-save-status{font-size:12px;color:#777f89;display:inline-flex;align-items:center;gap:6px}
.editor-save-status::before{content:"";height:5px;width:5px;border-radius:50%;background:#5d9d7a}
.editor-save-status[data-state="pending"]::before,.editor-save-status[data-state="saving"]::before{background:#5880d5}
.editor-save-status[data-state="error"],.editor-save-status[data-state="conflict"]{color:#b54708}
.editor-save-status[data-state="error"]::before,.editor-save-status[data-state="conflict"]::before{background:#b54708}
.proposal-preview-actions{flex-wrap:wrap;align-items:center;gap:8px}
.editor-history{display:flex;gap:4px;padding-right:8px;border-right:1px solid #dddfe4}
.editor-history .proposal-outline-button{border-color:transparent;background:transparent;padding:8px 10px}
button:disabled{cursor:default;opacity:.45}
.proposal-preview-actions .editor-download,.editor-primary{background:var(--editor-blue);border-color:var(--editor-blue);color:#fff}
.proposal-preview-actions .editor-download:hover,.editor-primary:hover{background:#214eae;color:white;border-color:#214eae}
.editor-toolbar{min-height:52px;background:#fff;border:1px solid var(--editor-line);border-radius:16px;margin-top:22px;padding:8px 12px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.editor-hint{font-size:12px;color:var(--editor-muted);flex:1}
.editor-tool-group{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.editor-tool-label{font-size:12px;color:#8b9098;padding-right:10px;border-right:1px solid #e8e9ec}
.editor-toolbar button,.editor-toolbar select{border:0;border-radius:8px;padding:7px 10px;background:#f4f5f7;color:#333b49;font-size:12px;min-height:32px}
.editor-toolbar button:hover{background:#e9edf5}
.editor-toolbar button[aria-pressed="true"]{background:#e9efff;color:#265ecf}
.editor-toolbar label{display:flex;align-items:center;gap:7px;font-size:12px;color:#727985}
.editor-toolbar input[type="number"]{width:54px;height:32px;border:1px solid #e7e9ed;background:#fff;border-radius:8px;padding:0 5px;text-align:center;color:#333}
.editor-toolbar input[type="color"]{width:28px;height:28px;border:0;background:none;padding:2px;cursor:pointer}
.editor-toolbar input[type="color"]::-webkit-color-swatch{border:1px solid #d2d7df;border-radius:6px}
.editor-alert{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:12px;padding:11px 14px;font-size:12px;line-height:1.6;color:#995213;background:#fff4e5;border:1px solid #f3dfc5;border-radius:12px}
.editor-alert button{border:0;border-radius:8px;background:white;padding:6px 10px;font-size:12px;color:#8c4c16;white-space:nowrap}
.proposal-canvas-body{margin-top:22px}
.proposal-slide-stage{border-radius:6px;box-shadow:0 3px 24px #1d253114;border:1px solid #e6e5e2}
.editor-slide,.proposal-generated-slide.editor-slide{position:relative;padding:0;container-type:inline-size;overflow:hidden;box-sizing:border-box}
.editor-element{position:absolute;box-sizing:border-box;margin:0;padding:0;border:0;background:transparent;border-radius:0;outline:0;color:inherit;text-decoration:none;text-transform:none;letter-spacing:normal}
.editor-text{white-space:pre-wrap;overflow-wrap:anywhere;overflow:hidden;word-break:normal}
.editor-text.is-editable{cursor:text;outline:1px solid transparent;outline-offset:3px}
.editor-text.is-editable:hover{outline-color:#8bade2}
.editor-text.is-selected,.editor-picture.is-selected{outline:1.5px solid #2b65d6;outline-offset:3px}
.editor-text.is-editable:empty::before{content:attr(data-placeholder);color:#8e9195;opacity:0;font-size:inherit;pointer-events:none}
.editor-text.is-editable:empty:hover::before,.editor-text.is-editable:empty:focus::before{opacity:.65}
.editor-picture{display:block;overflow:hidden;cursor:pointer}
.editor-picture img,.editor-crop-frame img{position:absolute;display:block;max-width:none;max-height:none;object-fit:fill;user-select:none;pointer-events:none}
.editor-picture:hover{outline:1px solid #8bade2;outline-offset:3px}
.editor-picture.is-empty{border:1px dashed #b7bec9;border-radius:8px;color:#7a8492;font-size:1.4cqw;background:#ffffff30}
.editor-text.is-overflowing{outline:1.5px solid #cf7b2c;outline-offset:3px}
.editor-measure{position:fixed;left:-20000px;top:0;pointer-events:none;visibility:hidden}
.proposal-thumbs{gap:16px;margin-top:25px;justify-content:flex-start}
.proposal-thumb.editor-thumb{min-width:130px;max-width:175px;flex:0 0 21%}
.editor-thumb .editor-slide{border:1px solid #e1e3e7;border-radius:5px;box-shadow:0 2px 5px #00000005;width:100%}
.editor-thumb .editor-picture{cursor:inherit;outline:none}
.editor-thumb.is-active .editor-slide{outline:2px solid #2b5fce;outline-offset:3px}
.proposal-thumb.editor-thumb>span{font-size:11px;color:#818894;text-align:left;margin-top:9px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.editor-dialog{border-radius:22px;padding:26px;width:min(660px,calc(100vw - 32px))}
.editor-dialog [hidden]{display:none!important}
.editor-dialog .proposal-dialog-header h2{font-size:20px}
.editor-dialog .proposal-dialog-header p{font-size:12px;color:#858a92;margin:6px 0 0;line-height:1.5}
.editor-image-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:20px;max-height:43vh;overflow:auto;padding:3px}
.editor-image-choice{min-width:0;border:1px solid #e8e9ec;border-radius:12px;padding:6px;background:#fff;text-align:left;color:#535f6b}
.editor-image-choice:hover{border-color:#8cabeb;background:#f7f9ff}
.editor-image-choice img{display:block;aspect-ratio:1.35;width:100%;object-fit:contain;background:#f6f7f9;border-radius:7px}
.editor-image-choice span{font-size:11px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:8px 3px 3px}
.editor-dialog-status{font-size:12px;color:#9b5815;line-height:1.6}
.editor-crop-modes{display:flex;width:fit-content;gap:3px;border-radius:12px;background:#f0f1f3;padding:4px;margin-bottom:15px}
.editor-crop-modes button{border:0;background:transparent;border-radius:9px;padding:8px 16px;font-size:13px;color:#68717d}
.editor-crop-modes button[aria-pressed="true"]{background:#fff;color:#2b5fce;box-shadow:0 1px 4px #0000000b}
.editor-crop-frame{position:relative;overflow:hidden;background:#eef0f3;border:1px solid #e3e6eb;border-radius:10px;width:min(100%,calc(40svh * var(--crop-ratio,1)));max-width:470px;margin:auto;touch-action:none}
.editor-crop-frame.is-cropping{cursor:grab}
.editor-crop-frame.is-cropping:active{cursor:grabbing}
.editor-crop-frame.is-cropping::after{content:"";position:absolute;inset:33.33%;border:1px solid #ffffff70;pointer-events:none}
.editor-crop-controls{margin-top:22px;display:grid;gap:13px}
.editor-crop-controls label{display:flex;gap:14px;align-items:center;font-size:12px;color:#717a85}
.editor-crop-controls input{flex:1;min-width:0;accent-color:#2b5fce}
.editor-crop-controls output{width:40px;text-align:right;font-variant-numeric:tabular-nums}
.editor-dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:24px}
.proposal-output-options{flex-wrap:wrap}
.editor-page-controls{margin-top:25px;display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.editor-page-meta{display:flex;flex-direction:column;gap:4px}
.editor-page-meta strong{font-size:13px;color:#344054;font-weight:600}
.editor-page-actions{display:flex;align-items:center;flex-wrap:wrap;gap:5px}
.editor-page-actions button{display:flex;align-items:center;gap:5px;border:1px solid transparent;border-radius:10px;background:#fff;padding:8px 11px;color:#526071;font-size:12px;min-height:34px}
.editor-page-actions button:hover:not(:disabled){color:#285dc9;background:#edf2ff}
.editor-page-actions #addPage{color:#285dc9;border-color:#dce5f7}
.editor-page-actions #deletePage:hover:not(:disabled){color:#b34434;background:#fff0ee}
.editor-page-divider{width:1px;height:16px;background:#dfe3e9;margin:0 4px}
.editor-page-status{margin:10px 0 0;color:#64748b;font-size:12px}
.proposal-thumbs.has-page-editor{margin-top:12px;padding:6px 6px 13px;gap:16px;align-items:flex-start}
.proposal-page-card{position:relative;flex:0 0 158px;min-width:0;user-select:none}
.editor-thumb-heading{display:flex;justify-content:space-between;align-items:center;height:28px;margin-bottom:7px;color:#939baa;font-size:10px;font-variant-numeric:tabular-nums}
.editor-page-grip{border:0;border-radius:6px;background:transparent;min-width:24px;text-align:left;padding:5px 0;color:#8b95a4;font-size:10px;cursor:grab;touch-action:none;user-select:none}
.editor-page-grip:hover:not(:disabled){color:#2b5fce;background:#eaf0fd}
.proposal-page-card .proposal-thumb.editor-thumb{display:block;width:100%;min-width:0;max-width:none;touch-action:pan-x}
.proposal-page-card.is-active .editor-thumb-heading>.editor-page-grip{color:#2b5fce;font-weight:650}
.proposal-page-card.is-page-dragging{opacity:.4}
.proposal-thumbs.is-sorting,.proposal-thumbs.is-sorting *{cursor:grabbing!important;user-select:none!important}
.proposal-page-card.is-drop-before::before,.proposal-page-card.is-drop-after::after{content:"";position:absolute;top:25px;bottom:20px;width:3px;background:#2b5fce;border-radius:3px;pointer-events:none}
.proposal-page-card.is-drop-before::before{left:-9px}.proposal-page-card.is-drop-after::after{right:-9px}
.editor-page-layouts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.editor-page-layouts>button{display:flex;flex-direction:column;align-items:flex-start;gap:10px;min-height:150px;border:1px solid #e4e8ef;border-radius:15px;background:#fafbfc;padding:20px;color:#344054;text-align:left}
.editor-page-layouts>button:hover{background:#f0f4ff;border-color:#96b0ed}
.editor-page-layouts i{font-size:26px;color:#4773cf;margin-bottom:6px}
.editor-page-layouts strong{font-size:14px;font-weight:600}.editor-page-layouts span{font-size:11px;color:#8993a1}
@media(max-width:600px){.editor-page-actions{gap:4px}.editor-page-actions button{padding:7px 9px}.editor-page-layouts{gap:8px}.editor-page-layouts>button{padding:13px;min-height:135px}.proposal-page-card{flex-basis:140px}.editor-page-layouts span{line-height:1.5}}
.editor-layout-hint{font-size:11px;color:#8a919a;white-space:nowrap}
#layoutTools{margin-left:auto}
#editablePreview .editor-text.is-editable,#editablePreview .editor-picture{cursor:grab;touch-action:none;user-select:none}
#editablePreview .editor-text.is-editing{cursor:text;touch-action:auto;user-select:text}
.editor-slide .editor-element.is-selected{outline:none}
.editor-slide.is-transforming,.editor-slide.is-transforming *{user-select:none!important}
.editor-slide.is-transforming .editor-element{cursor:grabbing}
.editor-selection{position:absolute;z-index:10;border:1.5px solid #2b65d6;box-sizing:border-box;pointer-events:none}
.editor-selection button{position:absolute;pointer-events:auto;touch-action:none;user-select:none}
.editor-resize-handle{width:11px;height:11px;min-width:0;min-height:0;padding:0;margin:0;border:1.5px solid #2b65d6;border-radius:3px;background:#fff;transform:translate(-50%,-50%);box-shadow:0 1px 3px #142a4c20}
.editor-resize-handle::after{content:"";position:absolute;inset:-6px}
.editor-resize-handle[data-handle="nw"]{left:0;top:0;cursor:nwse-resize}
.editor-resize-handle[data-handle="n"]{left:50%;top:0;cursor:ns-resize}
.editor-resize-handle[data-handle="ne"]{left:100%;top:0;cursor:nesw-resize}
.editor-resize-handle[data-handle="e"]{left:100%;top:50%;cursor:ew-resize}
.editor-resize-handle[data-handle="se"]{left:100%;top:100%;cursor:nwse-resize}
.editor-resize-handle[data-handle="s"]{left:50%;top:100%;cursor:ns-resize}
.editor-resize-handle[data-handle="sw"]{left:0;top:100%;cursor:nesw-resize}
.editor-resize-handle[data-handle="w"]{left:0;top:50%;cursor:ew-resize}
.editor-move-handle{left:50%;top:-27px;transform:translateX(-50%);padding:3px 11px;border:1px solid #dbe3f0;border-radius:7px;background:#fff;box-shadow:0 2px 6px #1d365117;font-size:11px;line-height:17px;color:#41669a;cursor:grab;white-space:nowrap}
.editor-selection.move-inside .editor-move-handle{top:5px}
.editor-guide{position:absolute;z-index:9;pointer-events:none}
.editor-guide-x{top:0;height:100%;border-left:1px dashed #5a81d8}
.editor-guide-y{left:0;width:100%;border-top:1px dashed #5a81d8}
.editor-resize-handle:focus-visible,.editor-move-handle:focus-visible{outline:2px solid #1d4eaf;outline-offset:3px}
.is-expanded .proposal-slide-stage{inset:auto;left:50%;top:50%;transform:translate(-50%,-50%);width:min(90vw,calc(84vh * var(--editor-ratio,1.777778)));height:auto;max-height:none;aspect-ratio:var(--editor-ratio,1.777778)}
.is-expanded .editor-toolbar{position:relative;z-index:501}
@media(max-width:1100px){.proposal-canvas{padding:24px 20px}.proposal-preview-actions .proposal-outline-button{font-size:12px;padding:7px 9px}.proposal-canvas-toolbar{gap:12px}.editor-history{padding-right:5px}}
@media(max-width:800px){.proposal-canvas{padding:22px 18px}.proposal-preview-actions{gap:5px}.editor-toolbar{margin-top:16px;border-radius:12px}.editor-image-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.editor-dialog{padding:20px}.editor-tool-group{gap:8px}.proposal-slide-stage{overflow:visible}.editor-slide{border-radius:5px}.editor-text:focus{z-index:3;background:#fffef5}.editor-history .proposal-outline-button{padding:7px}.proposal-thumb.editor-thumb{flex-basis:30%}}
