:root{--bg:#e9ebee;--panel:#f7f7f8;--panel-2:#fff;--line:#cfd3d9;--text:#1f2328;--muted:#69707a;--accent:#1e6fff;--accent-bg:#dce8ff;--danger:#d93025;--ok:#188038;color:var(--text);font-family:Segoe UI,Malgun Gothic,system-ui,sans-serif;font-size:12px}*{box-sizing:border-box}html,body{background:var(--bg);-webkit-user-select:none;user-select:none;height:100%;margin:0;overflow:hidden}button{font:inherit;color:var(--text);cursor:pointer}input,select,textarea{font:inherit;border:1px solid var(--line);background:#fff;border-radius:3px;padding:3px 5px}textarea{resize:vertical;-webkit-user-select:text;user-select:text;width:100%}#app{grid-template-rows:24px 50px 1fr 28px;height:100%;display:grid}#menubar{background:var(--panel-2);border-bottom:1px solid var(--line);align-items:stretch;padding-left:6px;display:flex}#menubar .site-note{color:var(--accent);white-space:nowrap;border:1px solid;border-radius:4px;align-self:center;margin-left:auto;margin-right:8px;padding:3px 10px;font-size:13px;text-decoration:none}#menubar .site-note:hover{background:var(--accent);color:#fff}@media (width<=900px){#menubar .site-note{display:none}}#menubar .brand{color:var(--accent);align-items:center;padding:0 10px 0 4px;font-weight:700;display:flex}.menu{position:relative}.menu>button{background:0 0;border:0;height:100%;padding:0 9px}.menu>button:hover,.menu.open>button{background:var(--accent-bg)}.menu-list{z-index:30;border:1px solid var(--line);background:#fff;min-width:230px;padding:4px 0;display:none;position:absolute;top:100%;left:0;box-shadow:0 6px 18px #0002}.menu.open .menu-list{display:block}.menu-item{text-align:left;background:0 0;border:0;gap:12px;width:100%;padding:5px 14px;display:flex}.menu-item:hover{background:var(--accent-bg)}.menu-item .k{color:var(--muted);margin-left:auto}.menu-item.checked:before{content:"✓";width:10px;margin-left:-10px}.menu-sep{background:var(--line);height:1px;margin:4px 0}#toolbar-top{background:var(--panel);border-bottom:1px solid var(--line);align-items:center;gap:2px;padding:0 6px;display:flex;overflow-x:auto}.tb-sep{background:var(--line);flex:none;width:1px;height:32px;margin:0 4px}.view-seg{flex:none;display:flex}.view-seg .text-btn{border-radius:0;height:28px;margin-left:-1px;padding:0 8px;font-size:13px}.view-seg .text-btn:first-child{border-radius:4px 0 0 4px;margin-left:0}.view-seg .text-btn:last-child{border-radius:0 4px 4px 0}.view-seg .text-btn:hover{z-index:1;position:relative}@media (width<=1560px){.view-seg [data-view=back],.view-seg [data-view=left]{display:none}.view-seg [data-view=right]{border-radius:0 4px 4px 0}}@media (width<=1320px){.view-seg [data-view=right],.view-seg [data-view=front]{display:none}.view-seg [data-view=top]{border-radius:0 4px 4px 0}}.tool-btn{color:#34465b;background:0 0;border:1px solid #0000;border-radius:4px;flex:none;place-items:center;width:40px;height:42px;padding:3px;display:grid}.tool-btn svg{width:32px;height:32px}.tool-btn:hover{border-color:var(--line);background:#fff}.tool-btn.active{background:var(--accent-bg);border-color:#8fb1ff}.text-btn{border:1px solid var(--line);background:#fff;border-radius:4px;flex:none;height:30px;padding:0 9px}.text-btn:hover{border-color:#8fb1ff}.text-btn.primary,button.primary{background:var(--accent);border-color:var(--accent);color:#fff}#layout{grid-template-columns:142px 1fr 300px;min-height:0;display:grid}#toolset{background:var(--panel);border-right:1px solid var(--line);padding:6px 4px;overflow-y:auto}#toolset .ts-group{border-bottom:1px solid var(--line);grid-template-columns:42px 42px 42px;justify-content:center;gap:3px;margin-bottom:6px;padding-bottom:6px;display:grid}#toolset .ts-group:last-child{border-bottom:0}#viewport{min-width:0;position:relative;overflow:hidden}#viewport canvas{width:100%;height:100%;display:block}.snap-marker{pointer-events:none;border:2px solid var(--snap,#1f9d3a);z-index:5;background:#fff;width:12px;height:12px;margin:-6px 0 0 -6px;position:absolute}.snap-marker.dot{background:var(--snap);border-radius:50%}.snap-marker.dot.mid{background:#fff}.snap-marker.square{background:var(--snap);width:9px;height:9px;margin:-4px 0 0 -4px}.snap-marker.diamond{background:var(--snap);width:9px;height:9px;margin:-4px 0 0 -4px;transform:rotate(45deg)}.snap-tip{pointer-events:none;white-space:nowrap;z-index:5;background:#fffbe0;border:1px solid #c9b95a;border-radius:2px;padding:1px 6px;position:absolute}.select-box{pointer-events:none;z-index:4;background:#1e6fff14;border:1px solid #1e6fff;display:none;position:absolute}.select-box.crossing{background:#1e6fff0a;border-style:dashed}#tray{background:var(--panel);border-left:1px solid var(--line);overflow-y:auto}.panel{border-bottom:1px solid var(--line)}.panel h3{cursor:pointer;background:#eceef1;align-items:center;gap:6px;margin:0;padding:7px 10px;font-size:12px;display:flex}.panel h3:before{content:"▸";color:var(--muted)}.panel.open h3:before{content:"▾"}.panel h3 small{color:var(--muted);font-weight:400}.panel-body{padding:8px 10px;display:none}.panel.open .panel-body{display:block}.hint{color:var(--muted);line-height:1.6}.sub{color:var(--muted);margin:8px 0 4px;font-weight:600}.row{gap:6px;margin-top:6px;display:flex}.row .primary{flex:1}.row button{border:1px solid var(--line);background:#fff;border-radius:3px;padding:4px 8px}.row button.primary{background:var(--accent);color:#fff}.prop-title{word-break:break-all;margin-bottom:6px;font-weight:600}.prop{grid-template-columns:64px 1fr;align-items:center;gap:6px;margin:3px 0;display:grid}.prop input[type=number],.prop input[type=text]{width:100%}.image-box{gap:4px;margin-top:8px;display:grid}.swatches{grid-template-columns:repeat(6,1fr);gap:4px;display:grid}.swatch{aspect-ratio:1;cursor:pointer;border:1px solid #0003;border-radius:3px;padding:0}.swatch.active{outline:2px solid var(--accent);outline-offset:1px}.mat-current{align-items:center;gap:8px;margin-bottom:8px;display:flex}.mat-current .preview{background-position:50%;background-size:cover;border:1px solid #0003;border-radius:4px;width:44px;height:44px}.comp-search{width:100%;margin-bottom:6px}.comp-cats{flex-wrap:wrap;gap:4px;margin-bottom:8px;display:flex}.comp-cat{border:1px solid var(--line);cursor:pointer;background:#fff;border-radius:12px;padding:2px 9px;font-size:13px}.comp-cat:hover{border-color:#8aa4d6}.comp-cat.on{color:#fff;background:#1e5bff;border-color:#1e5bff}.comp-grid{grid-template-columns:repeat(auto-fill,minmax(76px,1fr));gap:4px;max-height:420px;display:grid;overflow-y:auto}.comp-tile{cursor:pointer;background:0 0;border:1px solid #0000;border-radius:4px;flex-direction:column;align-items:center;gap:2px;min-width:0;padding:4px 2px;display:flex}.comp-tile:hover{border-color:var(--line);background:#fff}.comp-tile img{background:#eef0f3;border-radius:3px;width:64px;height:64px}.comp-tile span{text-align:center;text-overflow:ellipsis;-webkit-line-clamp:2;word-break:keep-all;-webkit-box-orient:vertical;font-size:13px;line-height:1.2;display:-webkit-box;overflow:hidden}.tag-row{align-items:center;gap:6px;padding:3px 0;display:flex}.tag-row button{background:0 0;border:0;width:22px}.booth-size{flex-wrap:wrap;align-items:center;gap:3px;margin-bottom:6px;display:flex}.booth-size input{width:58px}#ai-thumbs{flex-wrap:wrap;gap:6px;margin-bottom:6px;display:flex}.thumb{position:relative}.thumb img{object-fit:cover;border:1px solid var(--line);border-radius:3px;width:64px;height:48px}.thumb button{border:1px solid var(--line);background:#fff;border-radius:50%;padding:0 5px;position:absolute;top:-6px;right:-6px}#ai-log{border:1px solid var(--line);white-space:pre-wrap;-webkit-user-select:text;user-select:text;background:#fff;border-radius:4px;max-height:300px;margin-top:8px;padding:6px;font-size:11px;line-height:1.5;overflow-y:auto}#ai-log:empty{display:none}.log-message{color:var(--text);margin:4px 0}.log-tool,.log-status{color:var(--muted)}.log-error{color:var(--danger)}#statusbar{background:var(--panel);border-top:1px solid var(--line);align-items:center;gap:8px;padding:0 8px;display:flex}.icon-btn{border:1px solid var(--line);background:#fff;border-radius:50%;width:20px;height:20px;padding:0;font-weight:700}#status-conn.ok{color:var(--ok)}#status-conn.bad{color:var(--danger)}#status-hint{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}#status-info{color:var(--muted);white-space:nowrap}#vcb{border-left:1px solid var(--line);align-items:center;gap:6px;padding-left:8px;display:flex}#vcb-label{color:var(--muted);text-align:right;min-width:40px}#vcb-input{text-align:right;width:150px;height:22px;font-family:Consolas,monospace}#vcb-input:focus{outline:2px solid var(--accent)}#toast{z-index:50;gap:6px;display:grid;position:fixed;bottom:40px;left:50%;transform:translate(-50%)}.toast{color:#fff;background:#222;border-radius:6px;padding:7px 14px;box-shadow:0 4px 16px #0003}.toast.error{background:var(--danger)}.modal{z-index:60;background:#0005;place-items:center;display:none;position:fixed;inset:0}.modal.open{display:grid}.modal-box{background:#fff;border-radius:8px;width:min(640px,92vw);max-height:86vh;padding:18px 22px;overflow-y:auto}.modal-box h2{margin:0 0 10px;font-size:16px}#shortcut-list{grid-template-columns:1fr 1fr;gap:4px 20px;display:grid}.sc-row{align-items:center;gap:8px;display:flex}.sc-row svg{width:20px;height:20px}.sc-row kbd{border:1px solid var(--line);background:#f0f2f5;border-bottom-width:2px;border-radius:3px;margin-left:auto;padding:0 6px;font-family:Consolas,monospace}.ctx-menu{border:1px solid var(--line);z-index:30;background:#fff;border-radius:6px;min-width:170px;padding:4px;display:none;position:absolute;box-shadow:0 6px 20px #0002}.ctx-menu button{text-align:left;background:0 0;border:0;border-radius:4px;padding:6px 10px;font-size:13px}.ctx-menu button:hover:not(:disabled){background:var(--accent-bg)}.ctx-menu button:disabled{color:var(--muted);cursor:default}.tex-panel{border:1px solid var(--line);z-index:20;background:#fff;border-radius:8px;gap:8px;width:240px;padding:10px 12px;font-size:13px;display:none;position:absolute;bottom:12px;left:12px;box-shadow:0 6px 20px #0002}.tex-panel label{gap:2px;display:grid}.tex-panel input[type=range]{width:100%}.tex-head{justify-content:space-between;align-items:center;display:flex}.tex-close{background:0 0;border:0;padding:0 4px;font-size:18px;line-height:1}.tex-btns{flex-wrap:wrap;gap:6px;display:flex}.tex-btns button{border:1px solid var(--line);background:#fff;border-radius:4px;padding:4px 8px;font-size:13px}.tex-btns button:hover{border-color:#8fb1ff}.fast-tip{z-index:100;pointer-events:none;color:#fff;white-space:pre-line;background:#1f2329;border-radius:5px;max-width:280px;padding:5px 9px;font-size:12px;line-height:1.4;display:none;position:fixed;box-shadow:0 4px 14px #0003}.agent-tab{z-index:15;writing-mode:vertical-rl;background:var(--accent);color:#fff;letter-spacing:1px;border:1px solid #8fb1ff;border-right:0;border-radius:8px 0 0 8px;padding:12px 6px;font-weight:600;position:absolute;top:38%;right:0;box-shadow:-2px 2px 10px #0002}.agent-tab:hover,.agent-tab.active{background:#1450c8}.agent-win{border:1px solid var(--line);z-index:40;background:#fff;border-radius:12px;flex-direction:column;width:420px;height:min(720px,100vh - 130px);display:none;position:fixed;top:84px;right:348px;overflow:hidden;box-shadow:0 12px 40px #0003}.agent-win.open{display:flex}.agent-win.drop{outline:3px dashed var(--accent);outline-offset:-6px}.agent-head{border-bottom:1px solid var(--line);cursor:move;-webkit-user-select:none;user-select:none;background:#f6f8fb;align-items:center;gap:6px;padding:8px 10px;display:flex}.agent-chip{color:#445;white-space:nowrap;background:#eceef1;border-radius:999px;padding:2px 8px;font-size:12px}.agent-chip[data-state=ready]{color:#1d6b34;background:#e3f5e8}.agent-chip[data-state=busy],.agent-chip[data-state=starting]{color:#7a5200;background:#fff3d6}.agent-model{max-width:120px;font-size:12px}.agent-spacer{flex:1}.agent-icon{background:0 0;border:1px solid #0000;border-radius:6px;width:28px;height:28px;font-size:16px;line-height:1}.agent-icon:hover{border-color:var(--line);background:#fff}.agent-log{-webkit-user-select:text;user-select:text;flex-direction:column;flex:1;gap:8px;padding:12px;font-size:13px;line-height:1.55;display:flex;overflow-y:auto}.agent-msg{word-break:break-word;border-radius:10px;max-width:92%;padding:8px 11px}.agent-me{background:var(--accent);color:#fff;border-bottom-right-radius:3px;align-self:flex-end}.agent-ai{background:#f2f4f7;border-bottom-left-radius:3px;align-self:flex-start}.agent-msg code{background:#0001;border-radius:3px;padding:0 4px}.agent-thumbs{flex-wrap:wrap;gap:4px;margin-top:6px;display:flex}.agent-thumbs img{object-fit:cover;border:1px solid #fff6;border-radius:6px;width:56px;height:56px}.agent-thought{color:#778;max-height:60px;font-size:12px;font-style:italic;overflow:hidden}.agent-tool{color:#3a4a5e;background:#f7f9fc;border:1px solid #e3e8ef;border-radius:6px;align-self:flex-start;padding:3px 8px;font-family:ui-monospace,monospace;font-size:12px}.agent-tool[data-status=failed]{color:#a02020;background:#fdecec;border-color:#f3c2c2}.agent-plan{background:#fbfbf4;border:1px solid #eee8c8;border-radius:6px;padding:6px 8px;font-size:12px}.agent-plan .done{color:#7a8;text-decoration:line-through}.agent-perm{background:#fff8e8;border:1px solid #f0c36d;border-radius:8px;gap:6px;padding:8px;display:grid}.agent-perm.answered{opacity:.6}.agent-note-row{border-radius:6px;padding:6px 9px;font-size:12px}.agent-note-row.err{color:#a02020;background:#fdecec}.agent-note-row.info{color:#234;background:#eef4ff}.agent-settings{border-top:1px solid var(--line);background:#fafbfd;max-height:60%;padding:10px 12px;font-size:13px;display:none;overflow-y:auto}.agent-settings.open{display:block}.agent-settings h4{margin:6px 0;font-size:13px}.agent-opt{align-items:flex-start;gap:8px;padding:6px 0;display:flex}.agent-opt .ok{color:#1d6b34;word-break:break-all;font-size:12px}.agent-opt .bad{color:#a02020;font-size:12px}.agent-opt code{-webkit-user-select:all;user-select:all;background:#eef;border-radius:4px;margin-top:2px;padding:2px 6px;font-size:11px;display:block}.agent-note{color:var(--muted);font-size:12px}.agent-composer{border-top:1px solid var(--line);gap:6px;padding:8px 10px;display:grid}.agent-chips{flex-wrap:wrap;gap:6px;display:flex}.agent-chips:empty{display:none}.agent-pic{position:relative}.agent-pic img{object-fit:cover;border:1px solid var(--line);border-radius:6px;width:52px;height:52px}.agent-pic button{color:#fff;background:#333;border:0;border-radius:50%;width:18px;height:18px;padding:0;font-size:12px;line-height:18px;position:absolute;top:-6px;right:-6px}.agent-dims{align-items:center;gap:4px;font-size:12px;display:none}.agent-dims.open{display:flex}.agent-dims input{width:72px}.agent-input{resize:none;border:1px solid var(--line);width:100%;font:inherit;border-radius:8px;padding:8px;font-size:13px}.agent-input:focus{border-color:#0000;outline:2px solid #8fb1ff}.agent-bar{align-items:center;gap:6px;display:flex}.agent-text-btn{border:1px solid var(--line);background:#fff;border-radius:6px;padding:4px 10px;font-size:13px}.agent-text-btn.primary{background:var(--accent);color:#fff;border-color:var(--accent)}.agent-send{border:1px solid var(--accent);border-radius:6px;padding:5px 16px}.agent-send.stop{background:#c0392b;border-color:#c0392b}.agent-grip{cursor:nwse-resize;background:linear-gradient(135deg,#0000 50%,#b8c0cc 50% 60%,#0000 60% 70%,#b8c0cc 70% 80%,#0000 80%);width:16px;height:16px;position:absolute;bottom:0;right:0}.agent-icon.agent-text-btn{width:auto;padding:0 8px;font-size:12px}.tex-help{color:var(--muted);font-size:12px}.tex-handles{pointer-events:none;z-index:22;display:none;position:absolute;inset:0}.tex-panel.right{left:auto;right:12px}.tex-handles svg{width:100%;height:100%;position:absolute;inset:0;overflow:visible}.tex-handles polygon{fill:#2f6bff14;stroke:#2f6bff;stroke-width:1.5px;stroke-dasharray:6 4}.tex-h{pointer-events:auto;border:2px solid #fff;width:14px;height:14px;margin:-7px 0 0 -7px;position:absolute;box-shadow:0 0 0 1px #2f6bff,0 2px 6px #0004}.tex-h-move{cursor:move;background:#2f6bff;border-radius:50%;width:20px;height:20px;margin:-10px 0 0 -10px}.tex-h-corner{cursor:nwse-resize;background:#e0301e;border-radius:3px}.tex-h-sideX{cursor:ew-resize;background:#22914a;border-radius:50%}.tex-h-sideY{cursor:ns-resize;background:#22914a;border-radius:50%}.ctx-menu{gap:1px;min-width:230px}.ctx-item{justify-content:space-between;align-items:center;gap:18px;display:flex}.ctx-key{color:var(--muted);font-family:ui-monospace,monospace;font-size:12px}.ctx-item.danger{color:#c0392b}.ctx-item.danger .ctx-key{color:#d77}.ctx-sep{background:var(--line);height:1px;margin:3px 4px}.ctx-sub{z-index:31}.cut-bar{flex-wrap:wrap;align-items:center;gap:6px;margin-bottom:6px;font-size:12px}.cut-table{border-collapse:collapse;width:100%;font-size:12px}.cut-table th{text-align:left;color:var(--muted);border-bottom:1px solid var(--line);padding:3px 4px;font-weight:600}.cut-table td{border-bottom:1px solid #eef0f3;padding:3px 4px}.cut-table tbody tr:not(.cut-head):hover{background:var(--accent-bg);cursor:pointer}.cut-table .cut-head td{background:#f4f6f9;font-weight:600}.scene-tabs{pointer-events:none;z-index:5;flex-wrap:wrap;gap:4px;display:flex;position:absolute;top:6px;left:8px;right:8px}.scene-tabs>*{pointer-events:auto}.scene-tab{border:1px solid var(--line);background:#fffffff0;border-radius:4px;align-items:center;display:flex;box-shadow:0 1px 2px #00000014}.scene-tab.on{border-color:#1e5bff;box-shadow:inset 0 0 0 1px #1e5bff}.scene-name{cursor:pointer;color:#1f2733;background:0 0;border:none;padding:4px 4px 4px 10px;font-size:13px}.scene-del{color:#8a93a0;cursor:pointer;background:0 0;border:none;padding:4px 7px 4px 3px;font-size:13px}.scene-del:hover{color:#d0352b}.scene-add{color:#44505f;cursor:pointer;background:#ffffffd9;border:1px dashed #9aa6b6;border-radius:4px;padding:3px 9px;font-size:13px}.scene-add:hover{color:#1e5bff;border-style:solid;border-color:#1e5bff}.scene-input{border:1px solid #1e5bff;border-radius:4px;width:120px;padding:3px 6px;font-size:13px}@media (width<=1280px){#toolbar-top .tool-btn{width:36px}#toolbar-top .tool-btn svg{width:28px;height:28px}}
