*{box-sizing:border-box}html,body{margin:0;height:100%;overflow:hidden;font-family:Inter,system-ui,-apple-system,sans-serif;background:#fff;overscroll-behavior:none}#stage{position:fixed;top:0;right:0;bottom:0;left:0;touch-action:none;background-color:#fff}#stage canvas{display:block;touch-action:none}.panel{position:fixed;z-index:10;background:#fff;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 4px 16px #0000001a;padding:6px;display:flex;gap:4px;align-items:center}#toolbar{top:12px;left:50%;transform:translate(-50%);flex-wrap:nowrap;max-width:calc(100vw - 16px)}.menu{position:relative}.menu .trigger{display:flex;align-items:center;gap:2px;padding:0 6px}.menu .popover{display:none;position:absolute;top:calc(100% + 10px);left:0;background:#fff;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 4px 16px #0000001f;padding:6px;gap:4px;align-items:center}.menu .popover.right{left:auto;right:0}.menu .popover.vertical{flex-direction:column;align-items:stretch}.menu .popover.vertical button{text-align:left;white-space:nowrap}.menu.open .popover{display:flex}.menu.open>.trigger{background:#f3f4f6}.dot{width:18px;height:18px;border-radius:50%;background:#1f2937;box-shadow:0 0 0 1px #d1d5db}.panel button{display:flex;align-items:center;justify-content:center;min-width:36px;height:36px;border:0;background:transparent;border-radius:8px;padding:0 10px;font-size:13px;color:#374151;cursor:pointer}.panel button:hover{background:#f3f4f6}.panel button.active{background:#dbeafe;color:#1d4ed8}.panel button svg{display:block;flex:none}.menu .popover.vertical button{justify-content:flex-start}.pop-label{font-size:11px;font-weight:600;color:#6b7280;padding:2px 4px 0}.pop-row{display:flex;gap:6px;align-items:center;padding:2px 4px 6px}.pop-row button[data-grid]{height:30px;padding:0 10px}.panel .swatch.custom{position:relative;display:block;overflow:hidden;cursor:pointer;background:conic-gradient(#ef4444,#f59e0b,#10b981,#3b82f6,#8b5cf6,#ef4444)}.swatch.custom input{position:absolute;top:-6px;right:-6px;bottom:-6px;left:-6px;width:40px;height:40px;opacity:0;cursor:pointer}.panel hr{width:1px;height:24px;border:0;background:#e5e7eb;margin:0 4px}.panel .swatch{width:22px;min-width:22px;height:22px;padding:0;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px #d1d5db}.panel .swatch.active{box-shadow:0 0 0 2px #3b82f6}.editor{position:absolute;z-index:5;border:1.5px dashed #3b82f6;outline:none;resize:none;background:#fff;font-family:Inter,system-ui,sans-serif;line-height:1.2;padding:0;margin:0;overflow:hidden}@media(max-width:640px){#toolbar{gap:0;padding:4px}#toolbar button[data-tool],#toolbar #undo,#toolbar #redo{min-width:32px}#toolbar hr{margin:0 2px}}.dialog-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;display:flex;align-items:center;justify-content:center;background:#11182766;padding:16px}.dialog{width:100%;max-width:360px;background:#fff;border-radius:14px;box-shadow:0 12px 40px #00000040;padding:20px}.dialog h2{margin:0 0 8px;font-size:17px;color:#111827}.dialog p{margin:0 0 18px;font-size:14px;line-height:1.5;color:#4b5563}.dialog-actions{display:flex;justify-content:flex-end;gap:8px}.dialog-actions button{border:1px solid #e5e7eb;background:#fff;color:#374151;border-radius:8px;padding:8px 16px;font-size:14px;cursor:pointer}.dialog-actions button:hover{background:#f3f4f6}.dialog-actions button.primary{background:#2563eb;border-color:#2563eb;color:#fff}.dialog-actions button.primary:hover{background:#1d4ed8}.dialog-actions button.primary.danger{background:#dc2626;border-color:#dc2626}.dialog-actions button.primary.danger:hover{background:#b91c1c}#corner{top:auto;right:12px;bottom:12px;border-radius:999px;padding:4px}.connect-btn{display:flex;align-items:center;gap:6px;color:#1d4ed8;border-radius:999px;padding:8px 14px;font-size:13px;font-weight:600}.connect-btn:hover{background:#eff6ff}.dialog.wide{max-width:560px}.dialog.wide p{margin-bottom:10px}.dialog-steps{margin:0 0 12px;padding-left:20px;font-size:14px;line-height:1.6;color:#374151}.dialog-prompt{width:100%;resize:vertical;border:1px solid #e5e7eb;border-radius:8px;background:#f9fafb;padding:10px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.5;color:#111827}.dialog .dialog-note{font-size:12px;color:#6b7280;margin:8px 0 16px}.zoom-badge{border-radius:999px;padding:8px 12px;font-size:13px;font-weight:600;min-width:52px}.zoom-badge[hidden]{display:none}.context-menu{position:fixed;z-index:50;min-width:200px;display:flex;flex-direction:column;background:#fff;border:1px solid #e5e7eb;border-radius:10px;box-shadow:0 6px 24px #00000029;padding:4px}.context-menu button{border:0;background:transparent;text-align:left;padding:8px 12px;border-radius:6px;font-size:13px;color:#374151;cursor:pointer}.context-menu button:hover{background:#f3f4f6}.context-menu hr{width:100%;height:1px;border:0;background:#e5e7eb;margin:4px 0}
