
:root{--ruler-size:24px;--v4-blue:#2caee8;--v4-guide:#f43f5e}
.canvas-workarea{position:relative;flex:1;min-height:0;overflow:hidden;background:transparent}
.canvas-workarea .canvas-viewport{position:absolute!important;left:var(--ruler-size);right:0;top:var(--ruler-size);bottom:0;min-height:0!important;width:auto;height:auto;z-index:1}
.canvas-ruler{position:absolute;z-index:12;background:#fafbfc;touch-action:none;user-select:none}
.ruler-horizontal{left:var(--ruler-size);right:0;top:0;height:var(--ruler-size);width:calc(100% - var(--ruler-size));cursor:ns-resize;border-bottom:1px solid #dfe3e8}
.ruler-vertical{left:0;top:var(--ruler-size);bottom:0;width:var(--ruler-size);height:calc(100% - var(--ruler-size));cursor:ew-resize;border-right:1px solid #dfe3e8}
.ruler-corner{position:absolute;z-index:13;left:0;top:0;width:var(--ruler-size);height:var(--ruler-size);background:#f4f6f8;border-right:1px solid #dfe3e8;border-bottom:1px solid #dfe3e8}
.zoom-controls{display:flex;align-items:center;border:1px solid #d1d5db;border-radius:8px;overflow:hidden;background:#fff}
.toolbar-actions .zoom-controls button{border:0;border-radius:0;min-width:28px;padding:7px 6px}.toolbar-actions .zoom-controls .zoom-label{min-width:48px;border-left:1px solid #eceef1;border-right:1px solid #eceef1;font-variant-numeric:tabular-nums}
.shortcut-help-btn{color:#4f46e5!important;border-color:#d9d9ff!important;background:#f7f7ff!important}
.resize-handle{stroke:#fff;stroke-width:1.4;vector-effect:non-scaling-stroke}
.resize-handle.nw,.resize-handle.se{cursor:nwse-resize}.resize-handle.ne,.resize-handle.sw{cursor:nesw-resize}.resize-handle.n,.resize-handle.s{cursor:ns-resize}.resize-handle.e,.resize-handle.w{cursor:ew-resize}
.selection-box{vector-effect:non-scaling-stroke}.selection-box.multi{stroke:#0ea5e9;stroke-dasharray:6 4;stroke-width:1.2}.selection-box.locked{stroke:#94a3b8;stroke-dasharray:2 3}.selection-lock-badge{font:700 9px/1 Arial,sans-serif;fill:#475569;paint-order:stroke;stroke:#fff;stroke-width:3px;stroke-linejoin:round;pointer-events:none}
.rotate-handle,.rotate-stem{vector-effect:non-scaling-stroke}.rotate-handle{cursor:grab}.rotate-handle:active{cursor:grabbing}
.marquee-selection{fill:rgba(44,174,232,.10);stroke:#2caee8;stroke-width:1;stroke-dasharray:5 3;vector-effect:non-scaling-stroke;pointer-events:none}
.user-guide{stroke:var(--v4-guide);stroke-width:1;stroke-dasharray:5 4;vector-effect:non-scaling-stroke;cursor:grab;pointer-events:stroke}.user-guide:hover{stroke-width:2}.user-guide.dragging{stroke-width:2}
.smart-distance-line{stroke:#8b5cf6;stroke-width:.8;vector-effect:non-scaling-stroke}.smart-distance-tick{stroke:#8b5cf6;stroke-width:.8;vector-effect:non-scaling-stroke}.smart-distance-label{font:800 7px/1 Arial,sans-serif;fill:#6d28d9;text-anchor:middle;dominant-baseline:central;paint-order:stroke;stroke:#fff;stroke-width:3px;stroke-linejoin:round}
.floating-toolbar{position:absolute;z-index:30;display:flex;align-items:center;gap:3px;padding:4px;border:1px solid #dfe3e8;border-radius:10px;background:rgba(255,255,255,.97);box-shadow:0 8px 24px rgba(15,23,42,.16);transform:translate(-50%,-100%);white-space:nowrap}.floating-toolbar.hidden{display:none}.floating-toolbar button{width:29px;height:29px;border:0;border-radius:7px;background:transparent;color:#475569;font-size:12px}.floating-toolbar button:hover{background:#f1f3f5}.floating-toolbar button.active{background:#eef2ff;color:#4338ca}.floating-toolbar button.danger{color:#b42318}.floating-size{padding:0 7px;font-size:9px;font-weight:800;color:#64748b;border-right:1px solid #eceef1;font-variant-numeric:tabular-nums}
.canvas-context-menu{position:fixed;z-index:150;width:210px;padding:6px;background:#fff;border:1px solid #dfe3e8;border-radius:11px;box-shadow:0 14px 42px rgba(15,23,42,.18)}.canvas-context-menu.hidden{display:none}.canvas-context-menu button{width:100%;display:grid;grid-template-columns:22px 1fr auto;align-items:center;gap:6px;border:0;border-radius:7px;background:transparent;padding:8px 9px;text-align:left;color:#374151;font-size:10px}.canvas-context-menu button:hover{background:#f4f5f7}.canvas-context-menu button.danger{color:#b42318}.canvas-context-menu kbd{color:#9ca3af;font-size:8px}.context-separator{height:1px;background:#eceef1;margin:4px}
.precision-head-actions{display:flex;align-items:center;gap:7px}.aspect-lock-btn{border:1px solid #d9dde3;background:#fff;border-radius:7px;padding:5px 7px;color:#64748b;font-size:8.5px;font-weight:800}.aspect-lock-btn.active{border-color:#c7d2fe;background:#eef2ff;color:#4338ca}
.shortcut-panel{position:fixed;inset:0;z-index:180;display:grid;place-items:center;padding:24px;background:rgba(15,23,42,.38);backdrop-filter:blur(2px)}.shortcut-panel.hidden{display:none}.shortcut-card{width:min(760px,96vw);max-height:88vh;overflow:auto;padding:18px;border:1px solid #dfe3e8;border-radius:16px;background:#fff;box-shadow:0 24px 72px rgba(15,23,42,.25)}.shortcut-head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:14px}.shortcut-head h2{margin:2px 0 0;font-size:18px}.shortcut-head button{width:34px;height:34px;border:1px solid #e5e7eb;border-radius:9px;background:#fff;font-size:20px;color:#64748b}.shortcut-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.shortcut-grid section{padding:13px;border:1px solid #e6e9ed;border-radius:11px;background:#fafbfc}.shortcut-grid strong{display:block;margin-bottom:9px;font-size:11px}.shortcut-grid p{display:flex;align-items:center;gap:5px;margin:6px 0;color:#64748b;font-size:9.5px}.shortcut-grid kbd{display:inline-grid;place-items:center;min-width:24px;min-height:20px;padding:2px 5px;border:1px solid #cfd4db;border-bottom-width:2px;border-radius:5px;background:#fff;color:#334155;font:700 8px/1 "Segoe UI",sans-serif;box-shadow:0 1px 0 rgba(15,23,42,.04)}
.canvas-viewport.space-pan-ready,.canvas-viewport.space-pan-ready *{cursor:grab!important}.canvas-viewport.panning,.canvas-viewport.panning *{cursor:grabbing!important}
.layer-row.locked{opacity:.78}.layer-lock{font-size:10px!important}.layer-lock.active{background:#eef2ff!important;color:#4338ca!important}
@media(max-width:1050px){.toolbar-actions #fitSelectionBtn,.toolbar-actions .shortcut-help-btn{display:none}.shortcut-grid{grid-template-columns:1fr}}
@media(max-width:760px){:root{--ruler-size:20px}.canvas-ruler{display:none}.ruler-corner{display:none}.canvas-workarea .canvas-viewport{left:0;top:0}.floating-toolbar{display:none!important}}


.frame-shape{pointer-events:all}

.floating-toolbar.below{transform:translate(-50%,0)}
