:root{--bg: #f4f5f7;--panel: #ffffff;--line: #dde1e7;--text: #1f2430;--muted: #6b7280;--accent: #0b7285;--accent-soft: #e3f4f6;--supply: #e03131;--ret: #1c64f2;--warn-bg: #fff4e6;--warn: #b35900}*{box-sizing:border-box}html,body{margin:0;height:100%}body{font:13px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;color:var(--text);background:var(--bg);display:flex;flex-direction:column;overflow:hidden}button,.btn,select,input{font:inherit;color:inherit}button,.btn{border:1px solid var(--line);background:#fff;border-radius:6px;padding:5px 10px;cursor:pointer;white-space:nowrap}button:hover,.btn:hover{border-color:#b7bec9;background:#fafbfc}button.active{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}button.primary{background:var(--accent);color:#fff;border-color:var(--accent);font-weight:600}button.primary:hover{background:#095f6f}button.danger{color:#c92a2a}input[type=number],input[type=text],select{border:1px solid var(--line);border-radius:5px;padding:4px 6px;background:#fff;width:100%}.hidden{display:none!important}.muted{color:var(--muted)}.small{font-size:11.5px}.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 14px;background:var(--panel);border-bottom:1px solid var(--line);flex-wrap:wrap}.brand{font-weight:700;font-size:15px;display:flex;align-items:center;gap:8px}.brand small{font-weight:400;color:var(--muted)}.logo{width:20px;height:20px;border-radius:5px;background:linear-gradient(135deg,var(--supply) 50%,var(--ret) 50%)}.actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.sep{width:1px;height:22px;background:var(--line);margin:0 4px}.layout{flex:1;display:grid;grid-template-columns:290px 1fr 360px;min-height:0}.side,.props{background:var(--panel);overflow-y:auto;min-height:0}.side{border-right:1px solid var(--line)}.props{border-left:1px solid var(--line);padding:12px 14px}.step{padding:12px 14px;border-bottom:1px solid var(--line)}.step h3{margin:0 0 8px;font-size:13px;display:flex;align-items:center;gap:8px}.step h3 span{width:20px;height:20px;border-radius:50%;background:var(--text);color:#fff;display:inline-grid;place-items:center;font-size:11px}.row{display:flex;gap:6px;align-items:flex-end;margin-top:6px;flex-wrap:wrap}.row label{flex:1;display:flex;flex-direction:column;gap:2px;font-size:12px;color:var(--muted)}.tools{display:flex;flex-wrap:wrap;gap:5px}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:8px}.grid2 label{display:flex;flex-direction:column;gap:2px;font-size:12px;color:var(--muted)}.chk{display:inline-flex!important;flex-direction:row!important;align-items:center;gap:4px;color:var(--text)!important;cursor:pointer}.drop{display:flex;flex-direction:column;align-items:center;gap:2px;border:1.5px dashed #b7bec9;border-radius:8px;padding:14px;cursor:pointer;text-align:center}.drop:hover,.drop.over{border-color:var(--accent);background:var(--accent-soft)}.drop small{color:var(--muted)}.list{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:3px}.list li{display:flex;align-items:center;gap:6px;padding:5px 8px;border-radius:6px;cursor:pointer;border:1px solid transparent}.list li:hover{background:#f6f7f9}.list li.sel{border-color:var(--accent);background:var(--accent-soft)}.list li .nm{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tag{font-size:10px;padding:1px 5px;border-radius:4px;font-weight:600}.tag.h{background:#fff0d6;color:#a85c00}.tag.c{background:#dff7fb;color:#0b7285}.tag.k{background:#eee;color:#555}.stage{display:flex;flex-direction:column;min-width:0;min-height:0}.canvasbar{display:flex;justify-content:space-between;gap:8px;padding:6px 10px;background:var(--panel);border-bottom:1px solid var(--line);flex-wrap:wrap}.layers{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.canvaswrap{flex:1;position:relative;min-height:0;background:#fbfbfc;overflow:hidden}#svg{width:100%;height:100%;display:block;touch-action:none;user-select:none}#svg.m-pan,#svg.panning{cursor:grab}#svg.m-poly,#svg.m-rect,#svg.m-calibrate,#svg.m-hp,#svg.m-man,#svg.m-door,#svg.m-fc,#svg.m-pick,#svg.m-split{cursor:crosshair}.statusbar{display:flex;justify-content:space-between;padding:4px 10px;background:var(--panel);border-top:1px solid var(--line);color:var(--muted);font-size:12px;gap:10px}.legend-html{position:absolute;left:10px;bottom:10px;background:#ffffffeb;border:1px solid var(--line);border-radius:6px;padding:6px 10px;display:flex;gap:14px;font-size:12px}.legend-html div{display:flex;align-items:center;gap:5px}.ln{display:inline-block;width:22px;height:0;border-top:2.5px solid}.ln.s{border-color:var(--supply)}.ln.r{border-color:var(--ret)}.ln.d{border-top-style:dashed;width:14px}.empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:var(--muted);pointer-events:none}.empty b{color:var(--text);font-size:15px}.props h4{margin:14px 0 6px;font-size:12.5px}.props h4:first-child{margin-top:0}.propbox{border:1px solid var(--line);border-radius:8px;padding:10px;margin-bottom:12px;display:flex;flex-direction:column;gap:8px}.propbox .title{font-weight:700;display:flex;justify-content:space-between;align-items:center}.propbox label{display:flex;flex-direction:column;gap:2px;font-size:12px;color:var(--muted)}.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-bottom:6px}.kpis div{background:#f6f7f9;border-radius:6px;padding:6px;text-align:center}.kpis b{display:block;font-size:13.5px}.kpis span{font-size:10.5px;color:var(--muted)}.tbl{width:100%;border-collapse:collapse;font-size:11.5px;font-variant-numeric:tabular-nums}.tbl th,.tbl td{padding:3px 4px;border-bottom:1px solid #eef0f3;text-align:right}.tbl th:nth-child(-n+2),.tbl td:nth-child(-n+2){text-align:left}.tbl th{color:var(--muted);font-weight:600}.tbl tr[data-circuit]{cursor:pointer}.tbl tr[data-circuit]:hover{background:#f6f7f9}.tbl tr.over td{color:#c92a2a}.warn{background:var(--warn-bg);color:var(--warn);border-radius:6px;padding:8px 10px;margin-bottom:8px;display:flex;flex-direction:column;gap:3px}.sum{padding-left:18px;margin:0;display:flex;flex-direction:column;gap:3px}.sheetbox{margin-top:8px;border:1px solid var(--line);border-radius:6px;padding:6px 8px}.sheetbox summary{cursor:pointer;font-weight:600;font-size:12px}.sheetbox label{display:flex;flex-direction:column;gap:2px;font-size:12px;color:var(--muted);margin-top:6px}.sheetbox .grid2 label{margin-top:0}.sheetbox .grid2{margin-top:6px}.logo-row{align-items:center}.logo-row img{height:34px;max-width:110px;object-fit:contain;border:1px solid var(--line);border-radius:4px;background:#fff}.logo-row img:not([src]),.logo-row img[src=""]{display:none}.modal{position:fixed;inset:0;z-index:50;background:#1f24308c;display:flex;flex-direction:column}.modal-bar{display:flex;align-items:center;gap:12px;padding:8px 14px;background:var(--panel)}.modal-bar button{margin-left:auto}.modal-body{flex:1;overflow:auto;padding:16px;display:flex;justify-content:center;align-items:flex-start}.modal-body svg{width:min(100%,1400px);height:auto;box-shadow:0 4px 24px #00000059;background:#fff}@media (max-width: 1100px){.layout{grid-template-columns:260px 1fr}.props{grid-column:1 / -1;max-height:40vh;border-left:0;border-top:1px solid var(--line)}}@media (max-width: 720px){body{overflow:auto}.layout{grid-template-columns:1fr}.side{max-height:none}.stage{height:70vh}}@media print{.topbar,.side,.canvasbar,.statusbar,.props,.empty{display:none!important}body,.layout,.stage,.canvaswrap{display:block;height:auto;overflow:visible;background:#fff}#svg{width:100%;height:95vh}}
