:root{--bg:#f5f7fb;--panel:#fff;--border:#dfe5ef;--accent:#2563eb;--accent2:#16826a;--warn:#bc3646;--text:#24344d;--text-muted:#66758b;--wire:#334155;--wire-sel:#2563eb;--comp-fill:#fff;--comp-stroke:#334155;--shadow:0 16px 50px #15254425;--radius:8px}
body{font-family:Inter,'Segoe UI',Arial,sans-serif;font-size:13px}button,input,select{font:inherit}button{touch-action:manipulation}button:disabled{opacity:.35;cursor:default}button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #93b8ff;outline-offset:2px}button:hover:not(:disabled){background:#edf3ff;color:var(--accent)}[hidden]{display:none!important}
#workspace-header{height:66px;display:flex;align-items:center;gap:14px;padding:10px 18px;border-bottom:1px solid var(--border);background:#fff;flex-shrink:0;z-index:110}.brandmark{display:grid;place-items:center;width:36px;height:36px;background:#e9f0ff;color:#2563eb;border-radius:10px}.brandmark svg{width:22px;height:22px}.document-heading{min-width:0;flex:1}.document-heading small{font-size:10px;letter-spacing:1.4px;font-weight:700;color:#738198}.document-heading input{display:block;background:transparent;border:0;border-radius:4px;font-weight:650;font-size:16px;color:#24344d;width:min(100%,440px);padding:2px 0}.document-heading input:hover{background:#f1f5fb}.header-actions{display:flex;gap:8px;align-items:center}#autosave-badge{font-size:11px;color:#16745c!important;margin:0!important;background:#eaf8f1!important;padding:6px 9px;border-radius:20px;max-width:240px}.tb-btn{font-size:12px;min-height:34px;padding:7px 10px;color:#45566e;border-radius:7px;gap:7px;font-weight:500}.tb-btn svg{height:17px;width:17px;flex-shrink:0}.tb-btn.active,.dt-btn.active{color:var(--accent);background:#eaf1ff;border-color:#b8cefb}.tb-btn.pro,.tb-btn.purple,.tb-btn.success{color:#45566e;border-color:transparent}.tb-btn.pro:hover,.tb-btn.purple:hover,.tb-btn.success:hover{background:#edf3ff}.tb-btn.danger{color:var(--warn)}.tb-btn.danger:hover{background:#fff0f1;border-color:#f4c6cc}.primary-btn{background:var(--accent);color:white;border:1px solid var(--accent)}.primary-btn:hover:not(:disabled){background:#1d4ed8;color:#fff}.tool-menu{position:relative}.tool-menu>summary{list-style:none;display:flex;align-items:center;gap:7px;cursor:pointer;padding:8px 12px;border:1px solid var(--border);border-radius:8px;background:#fff;font-weight:550;min-height:34px}.tool-menu>summary::-webkit-details-marker{display:none}.tool-menu>summary:after{content:'⌄';margin-left:8px;font-size:12px;color:#8190a4}.tool-menu[open]>summary{border-color:#a3bff2}.menu-sheet{position:absolute;top:calc(100% + 8px);right:0;width:244px;padding:8px;background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);z-index:200}.menu-sheet .tb-btn{width:100%}.menu-sheet label{font-size:11px;color:var(--text-muted);display:block;margin:10px 8px 4px}.menu-sheet select{width:calc(100% - 16px);margin:0 8px;height:32px;background:#fff}.menu-separator{height:1px;background:var(--border);margin:6px 0}.menu-heading{color:#738198;font-size:10px;font-weight:750;letter-spacing:1px;text-transform:uppercase;margin:8px}
#toolbar{height:50px;padding:7px 18px;gap:5px;flex-wrap:nowrap;z-index:105}.tool-group{display:flex;align-items:center;gap:3px}.tb-sep{height:22px;margin:0 8px}.toolbar-tail{margin-left:auto;display:flex;gap:4px}#main{min-height:0}#sidebar{width:226px;overflow:hidden;background:#fff}#sidebar-tools{position:static;padding:16px 12px 12px}.panel-title{font-size:12px;font-weight:700;margin:0 0 10px;color:#253854}.panel-caption{font-size:11px;color:#7a879c;margin-top:6px}#comp-search{font-size:12px;background:#f6f8fc;border-color:#e2e7f0;border-radius:8px;height:36px}#sidebar-content{padding:10px 10px 16px}details.component-category{margin-bottom:6px;border-bottom:1px solid #edf0f6;padding-bottom:6px}.component-category>summary{cursor:pointer;padding:9px 3px;font-size:11px;font-weight:700;color:#6c7c93;list-style:none;display:flex;align-items:center;justify-content:space-between}.component-category>summary:after{content:'⌄';font-size:13px}.component-category:not([open])>summary:after{content:'›'}.component-category>summary::-webkit-details-marker{display:none}.component-grid{display:grid;grid-template-columns:1fr 1fr;gap:5px}.comp-btn{padding:8px 4px;border:1px solid #e7ecf4;border-radius:8px;font-size:11px;text-align:center;flex-direction:column;gap:4px;min-height:69px;line-height:1.3;color:#3f5067;background:#fff}.comp-btn:hover{background:#edf3ff;border-color:#b5cdf9}.comp-btn svg{width:48px;height:28px;flex-shrink:0}.comp-btn.custom-comp{color:#655094;position:relative}.comp-btn .del-custom{opacity:1;position:absolute;right:4px;top:2px;background:#fff;border:0;border-radius:4px;padding:2px}.empty-search{padding:20px 5px;text-align:center;color:#77869b;font-size:12px}.library-footer{padding:10px;border-top:1px solid var(--border);background:white}.library-footer .tb-btn{width:100%;justify-content:center;border:1px dashed #b9c8e0}
#canvas-wrap{background:#f8fafd;margin:0;min-width:0;isolation:isolate}#schematic-svg,#draw-area{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.comp-body,.comp-symbol{stroke-width:2}.comp-group:hover .comp-body{filter:none}.comp-group.selected .comp-body,.comp-group.multi-selected .comp-body{stroke:#2563eb;filter:drop-shadow(0 0 3px #2563eb40)}.comp-group.selected .comp-symbol,.comp-group.multi-selected .comp-symbol{stroke:#2563eb}.comp-label-group.selected text,.comp-label-group.multi-selected text{stroke:none;fill:#2563eb}.comp-text,.comp-label{font-family:Inter,'Segoe UI',Arial,sans-serif}.wire.selected,.wire-hit.selected-hit+.wire,.wire-hit:hover+.wire{stroke:#2563eb}.pin-dot{r:5;fill:#2563eb;stroke:#fff;stroke-width:2}.pin-dot.visible{opacity:1}.wire-label{font-family:Inter,'Segoe UI',Arial,sans-serif;fill:#52657f}.free-text-item.selected text{stroke:transparent!important;fill:#2563eb}.free-text-item text{font-family:Inter,'Segoe UI',Arial,sans-serif!important}.free-text-item.locked .free-text-box{stroke:#b6c2d4!important}.comp-group.locked .comp-body,.wire.locked{stroke-dasharray:none!important}.editor-handle{fill:#fff;stroke:#2563eb;stroke-width:2;cursor:move}.canvas-hint{position:absolute;top:16px;left:18px;font-size:11px;color:#7a8aa1;pointer-events:none;max-width:70%;background:#f8fafdce;border-radius:6px;padding:6px 8px}.canvas-zoom{position:absolute;right:16px;bottom:16px;background:#fff;display:flex;align-items:center;gap:2px;padding:4px;border:1px solid var(--border);border-radius:10px;box-shadow:0 3px 12px #182b4c0b;z-index:5}.canvas-zoom button{background:white;border:0;padding:6px;border-radius:5px;min-width:30px;cursor:pointer;color:#536882}.canvas-zoom output{font-size:11px;min-width:44px;text-align:center}.canvas-zoom input{width:70px;accent-color:var(--accent)}.canvas-zoom #btn-fit{width:auto;border:0;background:#fff;padding:5px 8px;margin:0!important;color:#536882;min-height:30px;font-size:11px}.selection-actions{position:absolute;bottom:16px;left:16px;display:flex;align-items:center;gap:1px;background:#fff;padding:4px;border:1px solid var(--border);border-radius:10px;box-shadow:0 3px 12px #182b4c0b;max-width:calc(100% - 300px);flex-wrap:wrap;z-index:6}.selection-actions .tb-btn{padding:6px 8px;font-size:11px}.selection-actions .tool-menu>summary{border:0;font-size:11px;padding:6px}.selection-actions .menu-sheet{bottom:calc(100% + 8px);top:auto;right:auto;left:0}
#props-panel{width:250px;padding:16px;background:#fff;gap:12px}#props-panel h3{font-size:12px;text-transform:none;letter-spacing:0;color:#253854}.selection-kind{font-size:10px;color:#6f80a0;letter-spacing:.6px;text-transform:uppercase;padding-bottom:8px;border-bottom:1px solid var(--border)}.prop-row{gap:5px}.prop-row label{font-size:11px;color:#6a7a92}.prop-row input,.prop-row select,.ce-row input,.ce-row select{padding:8px 9px;border-radius:7px;background:#fff;font-size:12px;min-height:34px;max-width:100%;min-width:0}.prop-row input[type=checkbox]{min-height:unset;width:auto;accent-color:var(--accent)}.prop-row input[type=color]{padding:3px;width:100%;height:35px}.prop-btn{background:#eef4ff;border-color:#c9dbfa;color:var(--accent);font-weight:600;border-radius:7px;padding:9px}.prop-btn:hover{background:#dfeaff;color:#1d4ed8}.prop-btn.red{background:#fff;border-color:#f0d9de;color:var(--warn)}.prop-btn.red:hover{background:#fff0f2;color:var(--warn)}#no-sel{margin:12px 0;font-size:12px;padding:10px;background:#f6f8fc;border:1px dashed #dfe5ee;border-radius:10px;text-align:left;line-height:1.8}.property-details{border-top:1px solid #e8edf5;margin-top:8px}.property-details>summary{font-size:11px;font-weight:650;padding:12px 0;cursor:pointer;color:#596c8a}.property-details>div{display:flex;flex-direction:column;gap:10px}.inspector-position{display:grid;grid-template-columns:1fr 1fr;gap:6px}.prop-section-label{font-size:10px;font-weight:600;color:#8593a7}.shortcuts{font-size:10px;color:#8c9aaf;padding:12px 0;border-top:1px solid #edf1f7;margin-top:auto;line-height:1.8}#statusbar{height:28px;padding:6px 16px;gap:5px;font-family:Inter,'Segoe UI',Arial,sans-serif;font-size:10px;overflow:hidden;white-space:nowrap;color:#8592a5}#st-sel{margin-right:auto}#workspace-toast{position:fixed;bottom:64px;left:50%;transform:translateX(-50%);padding:10px 16px;border-radius:10px;background:#21344f;color:white;font-size:12px;box-shadow:var(--shadow);z-index:2000;pointer-events:none;max-width:80%}
.modal-overlay{background:#18284465;backdrop-filter:blur(4px)}#ced{width:min(1080px,95vw)}#ced h2{font-family:Inter,'Segoe UI',Arial,sans-serif;color:#253854;font-size:18px}.ced-grid{grid-template-columns:minmax(0,1fr) 250px}.dt-btn{background:#fff;border-radius:6px;min-height:30px}.dt-toggle{background:#f4f7fc}.ce-row label{font-size:11px}.ce-btn{border-radius:7px}#ce-clear-btn{background:white}#ced-help{font-size:11px}.list-item{background:#f6f8fc}.list-item.active{background:#eaf1ff}.mini-dialog{width:min(560px,94vw);padding:26px}.mini-dialog h2{font-size:20px;margin-bottom:8px}.mini-dialog p{color:#6f8097;line-height:1.6;font-size:12px}.dialog-cards{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:20px 0}.template-card{border:1px solid #dde5f0;background:#fff;border-radius:10px;padding:16px;text-align:left;cursor:pointer}.template-card strong{display:block;font-size:13px;color:#283b57;margin-bottom:6px}.template-card span{font-size:11px;color:#7a8ba3}.template-card svg{width:100%;height:64px;margin-bottom:12px;stroke:#435b7b;fill:none;stroke-width:2}.dialog-footer{display:flex;justify-content:flex-end;margin-top:16px}.dialog-footer button{border:1px solid #dce5f2;border-radius:7px;background:white;padding:8px 16px;cursor:pointer}.help-list{display:grid;grid-template-columns:auto 1fr;gap:12px;margin-top:20px;color:#586d8a;font-size:12px}.help-list kbd{font:11px Inter,Arial;padding:3px 7px;background:#eff3f9;border:1px solid #dce4f0;border-radius:5px}.backlink{font-size:11px;color:#687c99;text-decoration:none;white-space:nowrap}.mobile-sidebar-button{display:none}body.focus-mode #sidebar,body.focus-mode #props-panel{display:none}body.focus-mode #btn-focus{background:#eaf1ff;color:#2563eb}
@media(max-width:1100px){#sidebar{width:190px}#props-panel{width:220px}#toolbar{padding:6px 10px}.tb-btn{padding:7px 8px}.selection-actions{max-width:calc(100% - 260px)}.canvas-zoom input{display:none}#autosave-badge{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
@media(max-width:850px){#workspace-header{height:62px;padding:10px;gap:8px}.backlink{display:none}#autosave-badge{display:none}#sidebar{width:170px}#props-panel{width:190px;padding:12px}.tb-btn .optional-label{display:none}.document-heading input{font-size:14px}.toolbar-tail .tb-btn{padding:7px}.selection-actions .tb-btn span{display:none}.selection-actions{max-width:calc(100% - 180px)}.canvas-zoom #btn-fit{font-size:0}.canvas-zoom #btn-fit svg{width:18px}.canvas-zoom input{display:none}.ced-grid{grid-template-columns:1fr}#draw-area{height:320px}}
@media(max-width:650px){#sidebar,#props-panel{display:none}#sidebar.mobile-open{display:flex;position:absolute;left:0;top:112px;bottom:28px;z-index:50;box-shadow:var(--shadow);width:220px}#props-panel.mobile-open{display:flex;position:absolute;right:0;top:112px;bottom:28px;z-index:50;width:230px;box-shadow:var(--shadow)}.mobile-sidebar-button{display:flex}.header-actions>button span{display:none}#toolbar{overflow:visible;padding:6px;gap:0}.tb-sep{margin:0 4px}.canvas-hint{top:10px;left:8px;font-size:10px}.selection-actions{left:8px;bottom:60px;max-width:calc(100% - 16px)}.toolbar-tail #btn-focus{display:none}.document-heading small{font-size:9px}.brandmark{display:none}.header-actions{gap:4px}.tool-menu>summary{font-size:11px;padding:8px}.dialog-cards{grid-template-columns:1fr}.selection-actions .tool-menu>summary{font-size:11px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
.canvas-zoom button svg{width:17px;height:17px}.canvas-zoom #btn-fit{display:flex;gap:5px;align-items:center}.canvas-zoom #btn-fit span{white-space:nowrap}.comp-group.selected .pin-dot{opacity:1}.tb-btn.pro{color:#45566e!important;border-color:transparent!important}.tb-btn.pro.active{color:#2563eb!important;border-color:#b8cefb!important}.tb-btn.pro:hover{background:#edf3ff!important}#ced-modal{isolation:isolate}
