*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}body{font-family:'DM Sans',system-ui,sans-serif;color:#343840;background:#f4f5f7;font-size:12px}button,input,textarea,select{font:inherit;color:inherit}button{cursor:pointer;border:0;background:none}button:disabled{opacity:.35;cursor:not-allowed}input,textarea,select{outline:none}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,a:focus-visible{outline:2px solid #6d9ae8;outline-offset:3px}h1,h2,h3,p{margin:0}.icon{flex-shrink:0;vertical-align:middle}#app{display:grid;grid-template-columns:70px 1fr;grid-template-rows:56px minmax(0,1fr) 28px;height:100dvh}.topbar{grid-column:1/-1;background:#fff;border-bottom:1px solid #e4e6eb;display:flex;justify-content:space-between;align-items:center;padding:0 19px;gap:16px;z-index:5}.document-info,.view-controls,.file-controls{display:flex;align-items:center;gap:9px}.document-name{width:170px;border:0;background:none;padding:7px 4px;font-size:12px;font-weight:500}.document-name:focus{background:#f2f5fa;border-radius:4px}.file-icon{color:#848b97;padding:4px}.file-icon .icon{width:19px;height:19px}.topbar select{border:0;font-size:11px;background:white;width:80px;color:#808895}.top-divider{height:19px;width:1px;background:#e8eaef;margin:0 5px}.icon-btn{display:inline-grid;place-items:center;width:30px;height:30px;color:#8b929f;border-radius:5px;padding:0}.icon-btn:hover{color:#4b535f;background:#f2f4f8}.icon-btn.active{color:#3f70bd;background:#edf3fc}.icon-btn .icon{width:16px;height:16px}.btn{display:inline-flex;gap:7px;align-items:center;justify-content:center;border:1px solid #dfe3e9;border-radius:5px;background:#fff;padding:9px 13px;font-size:11px;white-space:nowrap}.btn:hover{background:#f6f8fb;border-color:#bcc7d8}.btn .icon{width:14px;height:14px}.btn.primary{background:#3d73ca;color:#fff;border-color:#3d73ca}.btn.primary:hover{background:#2e63b7}.btn.danger{color:#b36666}.btn.wide{width:100%}#save-status{font-size:10px;color:#929aa6;margin-right:4px}.tool-rail{grid-column:1;grid-row:2;background:#fff;border-right:1px solid #e4e6eb;display:flex;flex-direction:column;align-items:center;padding:17px 8px 12px;gap:9px;z-index:4}.add-tools{display:flex;flex-direction:column;gap:7px;width:100%}.rail-bottom{display:flex;flex-direction:column;gap:7px;margin-top:auto;width:100%;padding-top:15px;border-top:1px solid #edf0f4}.tool{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;height:49px;width:100%;border-radius:6px;color:#737d8c}.tool .icon{width:19px;height:19px;stroke-width:1.5}.tool span{font-size:8px;letter-spacing:.1px}.tool:hover{background:#eef4fe;color:#3b70bd}.workspace{grid-column:2;grid-row:2;position:relative;min-width:0;min-height:0;overflow:hidden}.canvas-scroll{height:100%;overflow:auto;padding:30px 50px 24px;scrollbar-color:#d7dce5 transparent;scrollbar-width:thin}.stage-label{display:flex;justify-content:space-between;align-items:center;max-width:1200px;margin:0 auto 10px;color:#959ca8;font-size:10px}.stage-label span:last-child{font-variant-numeric:tabular-nums}#canvas-wrap{position:relative;margin:0 auto;box-shadow:0 2px 10px #25314806;flex-shrink:0}.stage{position:absolute;left:0;top:0;transform-origin:top left;box-shadow:0 0 0 1px #e1e5eb;overflow:visible;background:#fff}.stage.grid-on{background-image:radial-gradient(#e9edf2 .65px,transparent .65px);background-size:16px 16px}.stage:empty{background-image:none}.editor-block{position:absolute;cursor:move;touch-action:none;user-select:none}.block-visual{overflow:hidden}.editor-block:hover:after{content:'';position:absolute;inset:-1px;outline:1px solid #a3bff0;pointer-events:none}.editor-block.selected:after{content:'';position:absolute;inset:-1px;outline:1.5px solid #4f88e1;pointer-events:none}.editor-block.hidden-block{opacity:.25}.block-label{position:absolute;top:-20px;left:-1px;background:#4f88e1;color:white;font-size:10px;line-height:20px;padding:0 7px;border-radius:3px 3px 0 0;pointer-events:none;white-space:nowrap;z-index:3;font-family:'DM Sans',sans-serif}.resize-handle{position:absolute;width:8px;height:8px;background:white;border:1.5px solid #4f88e1;z-index:4}.resize-handle.nw{left:-4px;top:-4px;cursor:nwse-resize}.resize-handle.ne{right:-4px;top:-4px;cursor:nesw-resize}.resize-handle.sw{left:-4px;bottom:-4px;cursor:nesw-resize}.resize-handle.se{right:-4px;bottom:-4px;cursor:nwse-resize}.resize-handle.n{left:calc(50% - 4px);top:-4px;cursor:ns-resize}.resize-handle.s{left:calc(50% - 4px);bottom:-4px;cursor:ns-resize}.resize-handle.w{left:-4px;top:calc(50% - 4px);cursor:ew-resize}.resize-handle.e{right:-4px;top:calc(50% - 4px);cursor:ew-resize}.block-copy[contenteditable=true]{outline:0;cursor:text;user-select:text;min-height:100%;background:#edf4ff33}.canvas-bottom{display:flex;align-items:center;justify-content:space-between;max-width:1200px;margin:17px auto 0;font-size:9px;color:#a1a8b2;gap:20px}.canvas-bottom button{font-size:10px;color:#8a96a8;padding:5px}.statusbar{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;background:#fff;border-top:1px solid #e7eaf0;font-size:9px;color:#939ba7;padding:0 18px;gap:20px}.inspector{position:absolute;right:22px;top:28px;width:270px;background:white;border:1px solid #dfe4ec;border-radius:8px;box-shadow:0 8px 32px #3446660d;max-height:calc(100% - 56px);display:flex;flex-direction:column;z-index:6}.inspector>header{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;border-bottom:1px solid #edf0f4}.inspector>header strong{font-size:11px;font-weight:500}.inspector-body{overflow:auto;padding:16px;scrollbar-width:thin}.inspector>footer{padding:12px 14px;display:flex;justify-content:space-between;border-top:1px solid #edf0f4}.field{display:block;margin:0 0 13px}.field>span{display:block;font-size:10px;color:#8b93a0;margin-bottom:6px}.field input:not([type=checkbox]),.field select,.field textarea{width:100%;border:1px solid #e0e5ed;border-radius:4px;padding:8px 9px;font-size:11px;background:#fff;line-height:1.5}.field input[type=color]{height:32px;padding:4px;cursor:pointer}.field textarea{resize:vertical;min-height:70px}.field small{display:block;margin-top:6px;font-size:10px;line-height:1.6;color:#98a1af}.field-row,.geometry-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}.geometry-grid{padding-bottom:4px;border-bottom:1px solid #eef1f5;margin-bottom:15px}.geometry-grid .field span{font-size:9px}.geometry-grid input{font-variant-numeric:tabular-nums}.checkbox-field{display:flex;gap:8px;align-items:center;font-size:10px;color:#8590a0;margin:13px 0}.checkbox-field input{accent-color:#4f88e1;margin:0}.layer-tools{margin:8px 0 15px}.layer-tools .btn{font-size:10px;padding:7px}.image-preview{position:relative;min-height:100px;border:1px dashed #dde3eb;background:#f7f9fc;border-radius:5px;display:flex;align-items:center;justify-content:center;margin-bottom:14px;padding-bottom:39px;overflow:hidden}.image-preview>img{width:100%;max-height:150px;object-fit:cover}.image-preview>.icon{width:25px;height:25px;color:#c0cad8}.image-preview>.btn{position:absolute;bottom:7px;font-size:10px;padding:6px 10px}.modal-backdrop{position:fixed;inset:0;background:#1c293e35;z-index:30;display:flex;align-items:center;justify-content:center;padding:25px;backdrop-filter:blur(2px)}.modal{background:white;max-width:100%;width:460px;max-height:90dvh;display:flex;flex-direction:column;border-radius:10px;box-shadow:0 15px 70px #18284620}.modal.wide-modal{width:850px}.modal>header{display:flex;justify-content:space-between;align-items:center;padding:18px 23px;border-bottom:1px solid #edf0f4}.modal h2{font-size:15px;font-weight:500;letter-spacing:-.2px}.modal-body{padding:22px 23px;overflow:auto}.modal>footer{padding:16px 23px;border-top:1px solid #edf0f4;display:flex;justify-content:flex-end;gap:10px}.modal h3{font-size:12px;font-weight:500;margin-bottom:15px}.modal .field>span{font-size:11px}.modal .field input,.modal .field select,.modal .field textarea{font-size:12px}.help{font-size:11px;line-height:1.8;color:#919cad;margin:0 0 17px}.help code{font-size:10px;background:#f2f5fa;padding:2px 4px;color:#6b7f9b}.file-list{display:grid;gap:9px}.file-list .btn{justify-content:flex-start;padding:12px 15px;font-size:12px}.file-list .icon{margin-right:4px;color:#8d9aaa}.page-list{display:grid;gap:6px;margin-bottom:22px}.page-list button{display:flex;align-items:center;gap:12px;border:1px solid #e4e9f1;border-radius:5px;padding:12px;text-align:left;font-size:12px}.page-list small{font-size:10px;color:#a1a9b6;margin-left:auto}.page-list .icon{width:14px;height:14px;color:#b0bac9;margin-left:auto}.connection-state{padding:13px 15px;background:#f3f6fb;border-radius:5px;color:#7d8da5;font-size:11px;line-height:1.8;margin-bottom:16px}.error{color:#ab6464!important}.connection-state a{color:#4175c4}.store-grid{display:grid;grid-template-columns:1fr 1fr;gap:35px}.modal-section-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.modal-section-heading h3{margin:0}.product-list{display:grid;gap:8px;margin-bottom:20px}.product-list button{display:flex;align-items:center;gap:13px;text-align:left;padding:12px;border:1px solid #e5e9f0;border-radius:5px}.product-thumb{display:grid;place-items:center;width:39px;height:43px;background:#f4f6fa;overflow:hidden;border-radius:3px;color:#b3bfce;flex-shrink:0}.product-thumb img{width:100%;height:100%;object-fit:cover}.product-list strong{display:block;font-size:11px;font-weight:500}.product-list small{display:block;font-size:10px;color:#939faf;margin-top:5px}.product-list>button>.icon{margin-left:auto;width:14px;color:#a7b5c8}.order-row{display:grid;gap:9px;padding:17px 0;border-bottom:1px solid #e8edf3}.order-row strong{font-size:11px;font-weight:500}.order-row span,.order-row small{font-size:10px;color:#8a99ad}.preview-overlay{position:fixed;inset:0;background:#edf0f5;z-index:25;display:flex;flex-direction:column;align-items:center}.preview-toolbar{background:white;width:100%;display:flex;align-items:center;justify-content:space-between;padding:12px 20px;border-bottom:1px solid #e1e6ee;font-size:11px;color:#7a879b}.preview-toolbar>span:last-child{display:flex;gap:9px}.preview-overlay iframe{border:1px solid #dce3ed;border-radius:5px;background:white;width:calc(100% - 40px);max-width:1440px;height:calc(100% - 94px);margin:20px}.preview-overlay iframe.mobile{max-width:390px}.toast{position:fixed;bottom:44px;left:50%;transform:translateX(-50%);background:#303e54;color:#fff;font-size:11px;padding:12px 18px;border-radius:6px;box-shadow:0 3px 20px #0002;opacity:0;pointer-events:none;z-index:50;max-width:90%;line-height:1.8}.toast.visible{opacity:1}.toast.error{background:#955959;color:white!important}hr{border:0;border-top:1px solid #e7ebf2;margin:21px 0}
@media(max-width:1000px){.document-name{width:130px}.view-controls{gap:3px}.file-controls{gap:6px}#save-status{display:none}.topbar{padding:0 12px;gap:8px}.canvas-scroll{padding:25px 20px}.inspector{right:12px;width:250px}.statusbar span:last-child{display:none}}@media(max-width:650px){#app{grid-template-columns:52px 1fr;grid-template-rows:52px 1fr 28px}.tool-rail{padding:10px 4px}.tool{height:43px}.tool .icon{width:17px;height:17px}.tool span{font-size:7px}.add-tools,.rail-bottom{gap:4px}.document-name{width:105px;font-size:11px}.topbar{padding:0 8px}.document-info{gap:4px}.document-info .top-divider,.view-controls,.file-icon{display:none}.topbar select{font-size:10px;width:58px}.document-info .icon-btn{width:22px}.file-controls .btn{font-size:10px;padding:7px 9px}.canvas-scroll{padding:20px 15px}.canvas-bottom span{display:none}.canvas-bottom{justify-content:center}.inspector{top:auto;bottom:12px;right:12px;left:12px;width:auto;max-height:52%}.inspector-body{display:grid;grid-template-columns:1fr 1fr;gap:0 15px}.geometry-grid{grid-column:1/-1;grid-template-columns:repeat(4,1fr);gap:8px}.image-preview{grid-column:1/-1}.inspector>header{padding:7px 14px}.inspector>footer{padding:9px 14px}.store-grid{grid-template-columns:1fr;gap:25px}.modal-backdrop{padding:15px}.modal>header{padding:16px 18px}.modal-body{padding:19px 18px}.modal>footer{padding:13px 18px}.preview-toolbar{font-size:10px;padding:10px}.preview-toolbar .btn{font-size:0;gap:0;padding:8px}.preview-toolbar .btn .icon{width:16px;height:16px}.preview-overlay iframe{width:calc(100% - 18px);margin:9px;height:calc(100% - 73px)}.statusbar{font-size:8px;padding:0 10px}}
/* The editor is a continuous workspace; controls float above it. */
#app{display:block;height:100dvh;background:#fff}.workspace{position:absolute;inset:0;overflow:hidden}.canvas-scroll{height:100%;padding:0;overflow:auto;scrollbar-width:thin;scrollbar-color:#e7e7eb transparent;background:#fff}#canvas-wrap{margin:0;box-shadow:none;position:relative}.stage{position:absolute;inset:0 auto auto 0;box-shadow:none;transform:none;overflow:visible}.stage.grid-on,.stage.grid-on:empty{background-image:radial-gradient(#b9c3d1 1px,transparent 1px);background-size:16px 16px}.stage.placing{cursor:crosshair}.tool-rail{position:absolute;top:16px;left:16px;bottom:auto;width:44px;display:flex;gap:0;padding:5px;border:1px solid #e9e9ed;background:#fff;border-radius:11px;box-shadow:0 3px 14px #00000008;z-index:10}.add-tools{gap:3px}.tool{height:34px;width:32px;gap:0;border-radius:7px}.tool .icon{width:18px;height:18px}.tool.active{color:#426cd9;background:#eef2ff}.rail-bottom{padding-top:5px;margin-top:5px;gap:3px;border-top:1px solid #ededf1}.rail-bottom .icon-btn{width:32px;height:32px}.floating-actions{position:absolute;right:16px;top:16px;display:flex;gap:3px;align-items:center;padding:5px;border:1px solid #e9e9ed;border-radius:10px;box-shadow:0 3px 14px #00000005;background:#fff;z-index:10}.floating-actions #save-status{font-size:10px;margin:0 6px;color:#a0a3ab}.floating-actions #presence-count{font-size:10px;color:#6375db;margin:0 4px}.floating-actions #presence-count:empty{display:none}.placement-hint{position:absolute;bottom:20px;left:50%;transform:translateX(-50%);border:1px solid #e9e9ed;background:#fff;border-radius:8px;padding:9px 12px;color:#818794;box-shadow:0 3px 14px #00000005;z-index:9;white-space:nowrap}.placement-hint kbd{margin-left:8px;font-size:9px}.inspector{top:72px;right:16px;max-height:calc(100% - 90px);box-shadow:0 6px 24px #00000009}.block-label{display:none}.remote-cursor{position:absolute;pointer-events:none;z-index:1000;color:var(--peer);display:flex;align-items:flex-start;gap:2px}.remote-cursor .icon{width:16px;height:20px;fill:var(--peer);stroke:white;stroke-width:1}.remote-cursor span,.remote-selection span{font-size:10px;padding:3px 6px;color:white;background:var(--peer);border-radius:4px;white-space:nowrap}.remote-selection{position:absolute;outline:1px solid var(--peer);pointer-events:none;z-index:999}.remote-selection span{position:absolute;top:-21px;right:0}.shortcut-list>div{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:9px 0;border-bottom:1px solid #f0f0f3}.shortcut-list kbd{font-family:inherit;color:#888e99;font-size:11px;white-space:nowrap}.invite-actions{display:flex;gap:8px;margin-bottom:14px}.invite-list>div{display:flex;justify-content:space-between;align-items:center;padding:12px 0;gap:12px;border-top:1px solid #ededf1}.invite-list small{display:block;margin-top:4px;color:#959aa5}.invite-result{padding:14px;border:1px solid #e4e9f4;border-radius:6px;margin:14px 0}.invite-result .field input{font-size:10px}.floating-actions .icon-btn.active{color:#426cd9;background:#eef2ff}
@media(max-width:760px){#app{display:block}.tool-rail{left:10px;top:10px;width:40px;padding:3px}.floating-actions{right:10px;top:10px}.floating-actions #save-status{font-size:9px;margin:0 3px}.canvas-scroll{padding:0}.inspector{top:auto;bottom:10px;left:60px;right:10px;max-height:52%;width:auto}.placement-hint{bottom:12px;font-size:10px}.floating-actions #presence-count{font-size:9px}}
.security-grid{display:grid;grid-template-columns:1fr 1fr;gap:28px}.security-grid h3{font-weight:500;font-size:12px;margin-bottom:12px}.security-grid hr{border:0;border-top:1px solid #eee;margin:22px 0}.security-sessions>div,.security-activity>div,.version-row{border-bottom:1px solid #eee;padding:12px 0}.security-sessions small,.security-activity small,.version-row small{display:block;font-size:10px;color:#8c929d;line-height:1.6;margin-top:4px;overflow-wrap:anywhere}.security-sessions .btn{margin-top:8px}.security-grid .btn.wide{margin:5px 0}.security-backups a{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid #eee;color:#5875a5}.security-backups small{color:#929aaa}.security-activity{max-height:240px;overflow:auto}.version-row{display:flex;justify-content:space-between;gap:14px}.setup-key{display:block;padding:12px;background:#f4f6fa;border-radius:5px;overflow-wrap:anywhere;margin-bottom:15px}.recovery-box{padding:16px;border:1px solid #dce4f4;border-radius:6px}.recovery-box pre{line-height:1.7}.recovery-box .btn{margin-top:8px}@media(max-width:760px){.security-grid{grid-template-columns:1fr}}
/* Motion stays on controls and overlays, so placing and resizing remain direct. */
.tool,.icon-btn,.btn{transition:background-color 160ms ease,color 160ms ease,border-color 160ms ease,box-shadow 180ms ease,transform 180ms cubic-bezier(.2,.8,.2,1)}
.tool{position:relative;touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none}
.tool:hover{transform:translateX(2px)}.tool:active,.tool.dragging{cursor:grabbing;transform:scale(.93);background:#edf2ff;color:#426cd9}
.tool:focus-visible,.icon-btn:focus-visible,.btn:focus-visible{outline:2px solid #7896e3;outline-offset:3px}
.tool:after{content:attr(data-tip);position:absolute;left:calc(100% + 14px);top:50%;transform:translate(-7px,-50%);padding:8px 11px;border:1px solid #e8eaf0;border-radius:7px;background:#fff;color:#687183;font-size:11px;white-space:nowrap;box-shadow:0 4px 16px #2029430c;opacity:0;pointer-events:none;transition:opacity 150ms ease,transform 180ms cubic-bezier(.2,.8,.2,1)}
.tool:hover:after,.tool:focus-visible:after{opacity:1;transform:translate(0,-50%)}.tool.dragging:after,.pulling-tool .tool:after{opacity:0}
.icon-btn:active,.btn:active{transform:scale(.96)}
.tool-drag-preview{position:fixed;left:0;top:0;z-index:40;pointer-events:none;opacity:.86;outline:1.5px solid #7896e3;outline-offset:1px;will-change:transform;transition:opacity 120ms ease;box-shadow:0 10px 30px #24335812}
.tool-drag-content{overflow:hidden;box-sizing:border-box;animation:drag-reveal 180ms cubic-bezier(.2,.8,.2,1);transform-origin:24px 18px}
.tool-drag-label{position:absolute;left:0;top:-27px;font-size:10px;line-height:20px;padding:0 8px;color:#fff;background:#557bc9;border-radius:5px;white-space:nowrap}
.tool-drag-preview.invalid-drop{opacity:.45;outline-style:dashed}.pulling-tool,.pulling-tool *{cursor:grabbing!important;user-select:none!important}
.inspector-enter{animation:panel-reveal 220ms cubic-bezier(.2,.8,.2,1)}
.modal-backdrop{animation:fade-reveal 160ms ease}.modal{animation:dialog-reveal 220ms cubic-bezier(.2,.8,.2,1)}
.preview-overlay{animation:fade-reveal 180ms ease}.preview-overlay iframe{transition:max-width 240ms cubic-bezier(.2,.8,.2,1)}
.toast{transform:translate(-50%,8px);transition:opacity 180ms ease,transform 220ms cubic-bezier(.2,.8,.2,1)}.toast.visible{transform:translate(-50%,0)}
.remote-cursor,.remote-selection{transition:left 100ms linear,top 100ms linear,width 100ms linear,height 100ms linear}
.motion-leaving{animation:none;opacity:0;pointer-events:none;transition:opacity 160ms ease}
.inspector.motion-leaving{transform:translateX(12px);transition:opacity 160ms ease,transform 160ms ease}
.modal-backdrop.motion-leaving .modal{animation:none;transform:translateY(10px) scale(.98);transition:transform 160ms ease}
@keyframes fade-reveal{from{opacity:0}to{opacity:1}}
@keyframes panel-reveal{from{opacity:0;transform:translateX(16px)}to{opacity:1;transform:translateX(0)}}
@keyframes dialog-reveal{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes drag-reveal{from{opacity:.3;transform:scale(.86)}to{opacity:1;transform:scale(1)}}
@media(hover:none){.tool:after{display:none}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
