.warning {
  max-width: 1120px;
  margin: 0 auto 15px;
  padding: 10px 14px;
  border: 1px solid #6a4a22;
  border-radius: 9px;
  background: #211a12;
  color: #d8c2a6;
  display: flex;
  gap: 10px;
  font-size: 12px;
}
.panel-row-settings { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.panel-row-settings[hidden] { display:none; }
.settings-note { margin:0; color:#7f8a96; font-size:10px; line-height:1.35; }
.board { grid-auto-rows:160px; column-gap:2px; row-gap:120px; padding-top:28px; padding-bottom:28px; }
.warning b { color: #ff9a52; white-space: nowrap; }
.category-filter { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 13px; }
.filter-btn { padding:6px 9px; border-radius:999px; border:1px solid #303b48; background:#151d27; color:#aeb8c4; font-size:10px; }
.filter-btn.active { background:#ff7a1a; color:#17110c; border-color:#ff7a1a; }
.palette { max-height:54vh; overflow:auto; padding-right:4px; }
.device-icon, .placed { --device-accent:#ff7a1a; }
.device-icon { position:relative; grid-template-columns:repeat(var(--poles),1fr); gap:2px; padding:12px 4px 3px; border-top-color:var(--device-accent); }
.device-icon .mini-lever { height:17px; background:#24282c; border-radius:2px; box-shadow:inset 0 -5px 0 var(--device-accent); }
.device-icon .device-code { position:absolute; inset:auto 0 2px; font-size:7px; text-align:center; }
.placed .lever-bank { width:76%; display:grid; grid-template-columns:repeat(var(--poles),1fr); gap:3px; }
.placed .lever { height:24px; background:#24282c; border-radius:2px; box-shadow:inset 0 -7px 0 var(--device-accent); }
.placed::before { display:none; }
.placed.control .lever { border-radius:50%; height:20px; background:#39424b; box-shadow:inset 0 0 0 5px var(--device-accent); }
.device-icon, .placed { background:linear-gradient(90deg,#f8f8f5,#dfe1df 48%,#f5f5f2); border-color:#9a9c9a; box-shadow:inset 2px 0 #fff8,inset -2px 0 #9993,1px 2px 4px #0004; }
.device-icon::before, .placed::after { content:""; position:absolute; left:9%; right:9%; top:4px; height:4px; border-radius:2px; background:var(--device-accent); }
.device-icon .mini-lever, .placed .lever { border:1px solid #0f1113; background:linear-gradient(#30353a,#111416); box-shadow:inset 0 -6px 0 var(--device-accent),0 1px 1px #fff8; }
.placed .rating { padding:2px 3px; background:#fff8; border-radius:2px; line-height:1.15; }
.placed .test-button { position:absolute; right:5px; top:40px; width:12px; height:12px; border-radius:50%; background:#5aaee0; border:2px solid #fff; box-shadow:0 0 0 1px #777; }
.planner-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
fieldset { border:1px solid #354250; border-radius:10px; padding:12px; display:grid; grid-template-columns:1fr 1fr; gap:9px; }
fieldset legend { color:#ff9a52; font-weight:800; padding:0 6px; }
fieldset label { display:flex; align-items:center; gap:8px; font-size:13px; }
fieldset input { width:auto; }
.planner-note { color:#aeb8c4; background:#10161e; border-left:3px solid #ff7a1a; padding:10px; font-size:12px; }
.legend-row .reason { display:block; margin-top:3px; color:#8a633f; font-size:10px; font-weight:600; }
.legend-head,.legend-row { grid-template-columns:42px 1.35fr 155px 1.35fr; }
.legend-row span { min-width:0; }
.workspace-tools { display:flex; align-items:center; gap:9px; }
.wire-toggle.active { color:#17110c; background:#ff7a1a; border-color:#ff7a1a; }
.test-toggle.running { color:#07120a; background:#54d47a; border-color:#54d47a; box-shadow:0 0 0 3px #54d47a33; }
.test-summary { padding:12px 14px; border-radius:10px; font-weight:900; }
.test-summary.ok { background:#143523; color:#8ff0ad; border:1px solid #32794a; }
.test-summary.warn { background:#3a2d10; color:#ffd36b; border:1px solid #806321; }
.test-summary.danger { background:#46191b; color:#ff9b9f; border:1px solid #a83b41; animation:testPulse .65s ease-in-out 3; }
.test-results { display:grid; gap:7px; max-height:330px; overflow:auto; }
.test-result { display:grid; grid-template-columns:24px 1fr; gap:8px; padding:8px 10px; border-radius:8px; background:#10161e; color:#d9e0e8; font-size:12px; }
.test-result b { color:#fff; }.test-result.ok span:first-child{color:#54d47a}.test-result.warn span:first-child{color:#ffd04f}.test-result.danger span:first-child{color:#ff646b}
.test-result p { margin:5px 0 0; line-height:1.45; }
.test-result button, .test-issue-actions button {
  min-height:36px; padding:5px 10px; border:1px solid #78cfe5; border-radius:7px;
  background:#142b3c; color:#dff9ff; font:inherit; font-weight:700; cursor:pointer;
}
.test-result button { margin-top:7px; }
.test-result button:focus-visible, .test-issue-actions button:focus-visible {
  outline:2px solid #38d8f5; outline-offset:3px;
}
.test-issue-detail {
  position:fixed; z-index:70; bottom:16px; left:50%; transform:translateX(-50%);
  width:min(620px,calc(100% - 24px)); max-height:34vh; overflow:auto; box-sizing:border-box;
  padding:10px 13px; border:1px solid #aa426d; border-left:4px solid #ff70aa;
  border-radius:9px; background:#271a2a; color:#fff0f6; overflow-wrap:anywhere;
  box-shadow:0 4px 22px #0007; font-size:14px;
}
.test-issue-detail p { margin:5px 0 0; line-height:1.45; }
.test-issue-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:9px; }
body.light-mode .test-issue-detail { border-color:#a71957; background:#fff0f6; color:#4e1833; }
body.light-mode .test-issue-actions button { background:#fff; color:#14364a; border-color:#607e91; }
.terminal.test-issue-mark, .placed.test-issue-mark {
  outline:3px dashed #a90056; outline-offset:3px;
  box-shadow:0 0 0 3px #fff;
}
.terminal.test-issue-mark { position:relative; z-index:7; }
#wireLayer path.wire.test-issue-mark {
  stroke:#ae005b!important; stroke-width:6!important; stroke-dasharray:8 4;
  filter:drop-shadow(0 0 2px white); opacity:1;
}
#wireLayer .comb.test-issue-mark .comb-casing { stroke:#ae005b; stroke-dasharray:8 3; }
.test-note { margin:0; color:#8f9aa7; font-size:10px; line-height:1.45; }
.test-electron { filter:drop-shadow(0 0 4px currentColor); pointer-events:none; }
.test-explosion { pointer-events:none; transform-box:fill-box; transform-origin:center; animation:explode .9s ease-out forwards; }
.test-explosion text { fill:#d71920; stroke:#fff; stroke-width:3px; paint-order:stroke; font-size:28px; font-weight:1000; }
.wire.test-live { filter:drop-shadow(0 0 4px #fff); }
.wire.test-problem { stroke:#ff00d4!important; stroke-width:8!important; stroke-dasharray:13 7; filter:drop-shadow(0 0 7px #ff00d4); animation:problemMarch .55s linear infinite; }
.terminal.test-problem-terminal { transform:scale(1.35)!important; border-color:#fff!important; box-shadow:0 0 0 4px #ff00d4,0 0 18px 8px #a600ff!important; animation:problemTerminal .7s ease-in-out infinite alternate; }
.wire.test-danger { stroke:#ff2028!important; filter:drop-shadow(0 0 8px #ff2028); }
.test-electron.sequence-hidden { display:none; }
.circuit-sequencing .wire:not(.test-circuit-focus) { opacity:.1; filter:none!important; }
.wire.test-circuit-focus { stroke-width:8!important; filter:drop-shadow(0 0 8px #65fff2); }
@keyframes testPulse{50%{transform:scale(1.025);box-shadow:0 0 24px #ff3c4470}}
@keyframes explode{0%{transform:scale(.2);opacity:0}25%{transform:scale(1.45);opacity:1}100%{transform:scale(1);opacity:.95}}
@keyframes problemMarch{to{stroke-dashoffset:-20}}
@keyframes problemTerminal{to{box-shadow:0 0 0 5px #77ff00,0 0 22px 10px #ff00d4}}
.comb-toggle.active { color:#17110c; background:#e2b436; border-color:#e2b436; }
.comb-tools { display:none; align-items:end; gap:6px; padding:5px 7px; border:1px solid #554a2f; border-radius:9px; background:#1c1a14; }
.comb-tools.show { display:flex; }
.comb-tools label { display:grid; gap:2px; color:#d8c9a3; font-size:8px; font-weight:800; }
.comb-tools select { min-width:104px; padding:5px 6px; border:1px solid #4b5360; border-radius:5px; background:#111821; color:#f4f6f8; font-size:10px; }
.comb-tools button { padding:6px 8px; font-size:9px; }.comb-done { background:#3b7e48; color:#fff; }.comb-cancel { background:#713f3f; color:#fff; }
.wire-colors { display:none; gap:5px; padding:5px 7px; border:1px solid #303b48; border-radius:999px; background:#151c25; }
.wire-colors.show { display:flex; }
.wire-colors button { width:19px; height:19px; padding:0; border-radius:50%; background:var(--wire); border:2px solid #fff5; }
.wire-colors button.active { box-shadow:0 0 0 2px #ff7a1a; }
.wire-colors .wire-pe { background:repeating-linear-gradient(135deg,#59a83f 0 5px,#f2d63b 5px 10px); }
.wire-custom { width:21px; height:21px; padding:2px; border-radius:50%; border:1px dashed #ffffff80; overflow:hidden; cursor:pointer; }
.wire-custom input { width:30px; height:30px; padding:0; border:0; transform:translate(-7px,-7px); cursor:pointer; }
.board-wrap { position:relative; min-height:430px; padding-top:42px; overflow:visible; }
.supply-entry { position:absolute; z-index:7; top:0; left:8px; display:flex; align-items:center; gap:6px; color:#555; font-size:8px; font-weight:900; letter-spacing:.08em; }
.supply-entry i { width:54px; height:20px; border-radius:10px 2px 2px 10px; background:linear-gradient(90deg,#383c40,#777d82); box-shadow:inset 0 0 0 2px #25292d; }
.supply-entry .terminal { position:static; color:#fff; font-size:7px; font-weight:900; border-width:2px; }
.supply-entry .l,.terminal.out.l { background:#8b5a2b; }.supply-entry .n,.terminal.out.n,.bus-terminal.n { background:#2589d8; }.supply-entry .pe,.terminal.out.pe,.bus-terminal.pe { background:repeating-linear-gradient(135deg,#59a83f 0 4px,#f2d63b 4px 8px); color:#172111; }
.board { position:relative; z-index:2; }
.wire-layer { position:absolute; inset:0; width:100%; height:100%; overflow:visible; z-index:4; pointer-events:none; }
.wire-outline { fill:none; stroke:#f7f5ef; stroke-width:8; stroke-linecap:round; stroke-linejoin:round; opacity:.94; pointer-events:none; }
.wire { fill:none; stroke-width:5.5; stroke-linecap:round; stroke-linejoin:round; filter:drop-shadow(0 1px 1px #0008); pointer-events:stroke; cursor:pointer; }
.comb { fill:none; stroke:var(--comb-color,#8b5a2b); stroke-width:7; stroke-linecap:round; stroke-linejoin:round; filter:drop-shadow(0 2px 1px #0007); pointer-events:stroke; cursor:pointer; }
.comb path:first-child { stroke:var(--comb-color,#8b5a2b); stroke-width:11; }
.comb-lug { fill:var(--comb-color,#8b5a2b); stroke:#f4f4ef; stroke-width:2; }
.comb-label { fill:var(--comb-color,#8b5a2b); stroke:#fff; stroke-width:2.5px; paint-order:stroke; font-size:8px; font-weight:900; pointer-events:none; }
.comb.draft { opacity:.65; stroke-dasharray:5 3; }
.placed { height:152px; padding-top:24px; padding-bottom:22px; overflow:visible; }
.placed .brand-mark { position:absolute; top:17px; left:0; right:0; text-align:center; font-size:6px; letter-spacing:.08em; font-weight:900; color:#555; }
.placed .terminals { position:absolute; left:6%; right:6%; display:grid; grid-template-columns:repeat(var(--poles),1fr); gap:3px; z-index:6; }
.placed .terminals.top { top:-7px; }.placed .terminals.bottom { bottom:-7px; }
.terminal { width:15px; height:15px; min-width:0; justify-self:center; padding:0; border-radius:50%; border:3px solid #d8d8d2; background:radial-gradient(circle,#25282b 0 33%,#797e82 36% 60%,#d8d8d2 63%); box-shadow:0 1px 2px #0008; }
.placed .terminal.named { width:25px; height:18px; border-width:2px; border-radius:9px; background:#39424b; color:#fff; font-size:6px; font-weight:900; line-height:14px; }
.board-wrap:not(.wiring):not(.placing-comb) .terminal { pointer-events:none; }.board-wrap.wiring .terminal,.board-wrap.placing-comb .placed .terminal { cursor:crosshair; transform:scale(1.08); }
.terminal:hover,.terminal.selected { box-shadow:0 0 0 3px #ff7a1a,0 1px 2px #0008; }
.terminal.comb-selected { box-shadow:0 0 0 4px #e2b436,0 1px 2px #0008; }
.devices-transparent .placed,.wiring-only .placed { background:transparent!important; border-color:#6f747944!important; box-shadow:none!important; }
.devices-transparent .placed > :not(.terminals) { opacity:.12!important; }
.wiring-only .placed > :not(.terminals) { opacity:0!important; }
.placed .num.multi { width:auto; min-width:23px; padding:0 6px; border-radius:99px; white-space:nowrap; font-size:9px; }
.wiring-only .legend-head,.wiring-only .legend,.wiring-only .empty-note { display:none!important; }
#devicesBtn.active { background:#e2b436; color:#17110c; border-color:#e2b436; }
.placed .test-button { display:grid; place-items:center; color:#fff; font-size:6px; font-weight:900; }
.busbars { display:flex; gap:22px; justify-content:flex-end; padding:14px 18px 0; }
.busbar { width:180px; display:grid; grid-template-columns:28px 1fr; align-items:center; gap:6px; font-size:11px; }
.busbar b { text-align:center; border-radius:3px; color:#fff; padding:3px; }.busbar span { height:12px; border-radius:2px; background:repeating-linear-gradient(90deg,#b7bbc0 0 12px,#535960 12px 15px); border:2px solid #6d7379; }
.busbar.neutral b { background:#2589d8; }.busbar.earth b { background:linear-gradient(90deg,#59a83f 50%,#e6d63a 50%); color:#15200f; }
.bus-zone { position:relative; z-index:5; min-height:154px; height:154px; margin:38px 8px 0; border:1px dashed #9ba1a6; background:#c9ccd066; border-radius:4px; overflow:hidden; transition:height .18s ease; pointer-events:none; }
.bus-zone .bus-head,.bus-zone .movable-bus { pointer-events:auto; }
.bus-head { position:relative; z-index:5; display:flex; align-items:center; justify-content:space-between; gap:10px; color:#454b51; font-size:9px; letter-spacing:.08em; }
.bus-head button { padding:5px 8px; border-radius:5px; background:#2589d8; color:#fff; font-size:9px; }
.bus-head { height:33px; padding:5px 7px; }.bus-head span { color:#666; font-size:8px; margin-left:8px; }
.neutral-buses { position:absolute; inset:0; pointer-events:none; }
.neutral-buses .movable-bus { pointer-events:auto; }
.bus-row { display:flex; align-items:center; gap:4px; }
.movable-bus { position:absolute; z-index:2; width:max-content; max-width:calc(100% - 4px); padding:3px; border:1px solid #777d82; border-radius:5px; background:#e2e3df; box-shadow:0 2px 5px #0004; }
.bus-grip { width:18px; height:25px; padding:0; border-radius:3px; background:#555c62; color:#fff; font-size:12px; cursor:grab; touch-action:none; }
.bus-grip:active { cursor:grabbing; background:#ff7a1a; }
.bus-content { display:grid; min-width:0; width:max-content; gap:2px; background:transparent!important; padding:0!important; }
.bus-row input { width:100%; min-width:0; box-sizing:border-box; padding:2px 4px; border:0; border-radius:2px; background:#fff8dc; color:#66500c; font-size:8px; font-weight:800; text-align:center; }
.bus-terminals { min-height:23px; padding:3px 5px; display:flex; align-items:center; gap:3px; border-radius:4px; background:#7f858b; }
.bus-row .terminal { position:static; width:16px; height:16px; padding:0; border-width:2px; color:#fff; font-size:7px; font-weight:900; line-height:12px; text-align:center; }
.bus-row .terminal.pe { color:#172111; }
.wire-end-number-bg { fill:#fff; stroke:#20242a; stroke-width:1.5; pointer-events:none; }
.wire-end-number { fill:#20242a; font-size:7px; font-weight:900; pointer-events:none; }
.earth-bus b { width:30px; padding:5px 3px; border-radius:4px; color:#15200f; background:linear-gradient(90deg,#59a83f 50%,#e6d63a 50%); font-size:9px; text-align:center; }
.bus-remove { flex:none; }
.bus-remove { width:24px; height:24px; padding:0; border-radius:50%; background:#8d3c3c; color:#fff; }
.outgoing-title { margin:18px 8px 8px; color:#555c62; font-size:9px; font-weight:900; letter-spacing:.09em; }
.outgoing-area { position:relative; z-index:5; display:grid; grid-template-columns:repeat(auto-fit,minmax(112px,1fr)); column-gap:18px; row-gap:14px; padding:0 14px 14px; }
.outgoing-cable { min-height:92px; padding:7px; border:1px solid #989da2; border-radius:5px; background:#ecece8; color:#3a3e42; text-align:center; position:relative; overflow:hidden; }
.outgoing-cable b,.outgoing-cable small { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }.outgoing-cable b { font-size:9px; }.outgoing-cable small { font-size:8px; color:#666; }
.outgoing-cable > div { display:flex; justify-content:center; gap:8px; margin:10px 0 5px; }.outgoing-cable .terminal { position:static; color:#fff; font-size:6px; border-width:2px; }
.outgoing-cable .terminal.route { width:52px; height:20px; border-radius:10px; background:#2589d8; font-size:7px; }
.outgoing-cable .terminal.bell-return { min-width:52px; }
.three-phase .outgoing-area { grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); }
.three-phase .terminal.supply,.three-phase .terminal.out { min-width:24px; height:20px; border-radius:10px; }
.three-phase .phase-circuit-card > div { gap:5px; }
.three-phase .terminal.l1,.phase-distribution i.l1 { background:#8b5a2b; }
.three-phase .terminal.l2,.phase-distribution i.l2 { background:#232323; }
.three-phase .terminal.l3,.phase-distribution i.l3 { background:#626971; }
.phase-distribution #phaseDistributionList { display:flex; flex-wrap:wrap; gap:8px 20px; }
.phase-distribution #phaseDistributionList > span { display:inline-flex; gap:6px; align-items:center; }
.phase-distribution i { width:11px; height:11px; border-radius:50%; border:1px solid #a1aab3; }
.phase-settings { display:grid; gap:10px; }
.phase-settings .phase-neutral { display:flex; align-items:center; gap:8px; }
.phase-settings .phase-neutral input { width:auto; }
.phase-settings[hidden],.phase-settings [hidden],.phase-distribution[hidden],.phase-distribution p:empty { display:none; }
.phase-distribution .three-phase-loads[hidden] { display:none; }
.three-phase-loads { border-top:1px solid #71839155; margin-top:12px; padding-top:10px; }
.three-phase-loads h4 { margin:0 0 6px; }
.three-phase-loads ul { display:grid; gap:7px; margin:0; padding:0; list-style:none; }
.three-phase-loads li,.phase-load-pins { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.three-phase-loads li { gap:6px 10px; }
.phase-check { display:inline-block; padding:1px 5px; min-width:26px; text-align:center; border:1px dashed currentColor; border-radius:4px; font-size:11px; }
.phase-check.connected { border-style:solid; color:white; background:#2b5369; }
.phase-check.connected.l1 { background:#8b5a2b; }
.phase-check.connected.l2 { background:#232323; }
.phase-check.connected.l3 { background:#626971; }
.phase-check.connected.n { background:#145e94; }
.phase-check.connected.pe { color:#15240d; background:#a9d877; }
.wire-key span.phase-key-triple { display:none; }
.three-phase-sheet .wire-key span.phase-key-mono { display:none; }
.three-phase-sheet .wire-key span.phase-key-triple { display:flex; }
.wire-key .line-2 { background:#232323; }
.wire-key .line-3 { background:#7b8188; }
.board-wrap.three-phase { padding-left:60px; }
.three-phase .wire-outline.wire-l1,.three-phase .wire-outline.wire-l2,.three-phase .wire-outline.wire-l3 {
 stroke:#c0cbd4; stroke-width:7.5; opacity:.88;
}
.outgoing-cable .terminal.ref { width:auto; min-width:28px; padding:0 4px; border-radius:10px; font-size:7px; }
.outgoing-cable.bell-button { border-color:#2589d8; background:#eaf5fc; }
.cable-core { position:absolute; bottom:-22px; width:5px; height:48px; border-radius:3px; }.cable-core.brown{left:42%;background:#8b5a2b}.cable-core.blue{left:49%;background:#2589d8}.cable-core.green{left:56%;background:repeating-linear-gradient(#59a83f 0 5px,#f2d63b 5px 10px)}
@media(max-width:1000px){.workspace-head{align-items:flex-start}.workspace-tools{flex-wrap:wrap;justify-content:flex-end}.wire-toggle{font-size:11px;padding:8px 10px}}
.device-art { display:block; width:82%; height:64px; overflow:visible; filter:drop-shadow(1px 2px 2px #0005); flex:none; }
.device-art.mini { width:42px; height:48px; }
.palette-item { grid-template-columns:46px 1fr auto; }
.rating-choice { width:100%; margin-top:6px; padding:5px 7px; border:1px solid #3a4654; border-radius:7px; color:#f4f6f8; background:#111821; font-size:11px; }
.rating-controls { display:grid; grid-template-columns:52px minmax(0,1fr); gap:5px; margin-top:6px; }
.curve-choice,.amp-choice { min-width:0; width:100%; padding:5px 6px; border:1px solid #3a4654; border-radius:7px; color:#f4f6f8; background:#111821; font-size:11px; }
.curve-help { margin:8px 0 10px; padding:8px 10px; border:1px solid #34404d; border-radius:9px; background:#151c24; color:#cbd3dc; font-size:11px; line-height:1.45; }
.curve-help summary { cursor:pointer; color:#ff8a2a; font-weight:700; }
.curve-help p { margin:7px 0 0; }
.rcd-controls { display:grid; grid-template-columns:minmax(54px,.9fr) minmax(68px,1fr) minmax(58px,.9fr); gap:4px; margin-top:6px; }
.rcd-type,.rcd-ma,.rcd-amp { min-width:0; width:100%; padding:5px 4px; border:1px solid #3a4654; border-radius:7px; color:#f4f6f8; background:#111821; font-size:10px; }
.cable-fields { display:grid; grid-template-columns:1fr; gap:10px; }
.cable-fields label span { color:#7f8a96; font-size:10px; font-weight:500; }
.cable-fields select { width:100%; }
.placed { justify-content:flex-start; gap:3px; padding-top:8px; }
.placed .device-art { margin-top:0; }
.placed .rating { margin-top:-18px; position:relative; z-index:2; background:#fffdf4; border:1px solid #c7c4b9; min-width:75%; text-align:center; }
.placed .brand-mark { display:none; }
.placed::after { display:none; }
.board { min-height:164px; }
.placed { height:160px; padding-bottom:8px; }
.placed.dragging { opacity:.48; }
.placed.drop-before { box-shadow:inset 6px 0 0 #ff7a1a,1px 2px 4px #0004; }
.placed.drop-after { box-shadow:inset -6px 0 0 #ff7a1a,1px 2px 4px #0004; }
.placed .short {
  display:-webkit-box;
  width:calc(100% + 4px);
  min-height:22px;
  max-height:22px;
  padding:0 1px;
  overflow:hidden;
  overflow-wrap:anywhere;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  line-clamp:2;
  font-size:9px;
  line-height:11px;
  text-align:center;
}

/* Editor experience inspired by professional visual panel builders */
.component-search{display:grid;gap:5px;margin:10px 0 12px}.component-search span{color:#7f8a96;font-size:9px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}.component-search input{width:100%;padding:10px 12px 10px 34px;border:1px solid #34404d;border-radius:10px;background:#111821;color:#f4f6f8;background-image:linear-gradient(45deg,transparent 48%,#8894a0 49% 52%,transparent 53%),radial-gradient(circle at 10px 10px,transparent 5px,#8894a0 6px 7px,transparent 8px);background-size:8px 8px,20px 20px;background-position:18px 17px,7px 6px;background-repeat:no-repeat}.component-search input:focus{outline:0;border-color:#ff7a1a;box-shadow:0 0 0 3px #ff7a1a22}.palette-item.search-hidden{display:none}
.editor-cluster{display:flex;align-items:center;gap:4px;padding:4px;border:1px solid #303b48;border-radius:10px;background:#111821}.tool-icon,.zoom-label{height:30px;min-width:30px;padding:0 7px;border:0;border-radius:6px;background:#1c2632;color:#cbd3dc;font-weight:900}.tool-icon:hover,.zoom-label:hover,.tool-icon.active{background:#ff7a1a;color:#15100b}.tool-icon:disabled{opacity:.28;cursor:not-allowed}.zoom-label{min-width:48px;font-size:10px}.tool-separator{width:1px;height:20px;background:#34404d;margin:0 2px}
.selection-bar{position:sticky;z-index:14;top:72px;max-width:1120px;margin:0 auto 10px;padding:8px 10px;display:flex;align-items:center;gap:7px;border:1px solid #e86e18;border-radius:10px;background:#211a12eF;box-shadow:0 8px 24px #0006;color:#fff}.selection-bar[hidden]{display:none}.selection-bar>span{display:grid;margin-right:auto}.selection-bar small{color:#b9c1ca;font-size:9px}.selection-bar button{padding:7px 10px;border-radius:7px;background:#25303c;color:#eef2f6;font-size:10px}.selection-bar button:hover{background:#ff7a1a;color:#17110c}.selection-bar .danger-compact{background:#7a3033;color:#fff}.placed.is-selected{outline:4px solid #ff7a1a;outline-offset:3px;z-index:8;box-shadow:0 0 0 8px #ff7a1a22,0 8px 18px #0006}.placed.is-selected .num{background:#10161e;color:#ff9a52}
.canvas-viewport{position:relative;max-width:1180px;margin:0 auto;padding:24px;border:1px solid #283442;border-radius:14px;background:#0c1219;overflow:auto;box-shadow:inset 0 0 45px #0006}.canvas-viewport.grid-visible{background-color:#0c1219;background-image:linear-gradient(#33404d40 1px,transparent 1px),linear-gradient(90deg,#33404d40 1px,transparent 1px),linear-gradient(#33404d25 1px,transparent 1px),linear-gradient(90deg,#33404d25 1px,transparent 1px);background-size:80px 80px,80px 80px,16px 16px,16px 16px}.canvas-viewport::before{content:'РАБОТНО ПЛАТНО';position:absolute;top:7px;left:12px;color:#607080;font-size:8px;font-weight:900;letter-spacing:.14em}.canvas-scaler{transform-origin:top left}.canvas-viewport .sheet{margin:0;transform-origin:top left;box-shadow:0 12px 42px #000b,0 0 0 1px #fff2}.canvas-viewport.no-grid{background-image:none}
.sheet-title{position:relative}.sheet-title::after{content:'ВИЗУАЛНА СХЕМА • CLASSIC EL';position:absolute;right:0;bottom:-16px;color:#989188;font-size:7px;font-weight:900;letter-spacing:.13em}.panel-shell{border:1px solid #5f6469;border-radius:7px;background:linear-gradient(135deg,#d7d9dc,#b9bec3 55%,#dfe1e3);box-shadow:inset 0 0 0 12px #777d82,inset 0 0 0 14px #e6e7e5,0 4px 14px #0004}.board-wrap{margin:12px;background:linear-gradient(#d0d4d7,#bbc0c4)}.board::before{content:'';position:absolute;left:0;right:0;top:72px;height:10px;border-radius:2px;background:linear-gradient(#e8e8e6,#8b9094 40%,#cfd2d3 45% 70%,#74797d);box-shadow:0 2px 3px #0005;z-index:-1}
.topbar{box-shadow:0 6px 22px #0006}.workspace{min-width:0}.workspace-head{max-width:1180px}.warning{max-width:1180px}
@media(max-width:1200px){.workspace-tools{gap:6px}.editor-cluster{order:3}.canvas-viewport{padding:20px 10px}.topbar .actions{gap:5px}.topbar .actions button{padding:8px 9px;font-size:10px}}
@media(max-width:820px){.layout{display:block}.sidebar{position:relative;width:auto;max-height:none}.palette{max-height:420px}.topbar{position:relative;align-items:flex-start;gap:10px}.topbar .actions{flex-wrap:wrap;justify-content:flex-end}.workspace{padding:14px 8px}.workspace-head{display:grid;gap:10px}.workspace-tools{justify-content:flex-start}.selection-bar{top:5px;flex-wrap:wrap}.selection-bar>span{width:100%}.canvas-viewport{border-radius:9px;padding:16px 6px}.sheet{min-width:980px}}

/* Professional project sheet */
.scheme-report{margin:0 0 18px;border:1px solid #c9c3b8;border-radius:7px;background:#fff;box-shadow:0 2px 8px #30261918;overflow:hidden}
.report-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:13px 16px;background:linear-gradient(100deg,#171d24 0 60%,#252e38);color:#fff;border-left:7px solid #ff7a1a}
.report-heading>div{display:grid}.report-heading small,.schedule-title small{color:#ff984d;font-size:7px;font-weight:900;letter-spacing:.16em}.report-heading strong{font-size:16px;line-height:1.2}.report-heading>span{padding:5px 9px;border:1px solid #ffffff30;border-radius:4px;color:#cfd6dd;font-size:9px;font-weight:800}
.report-metrics{display:grid;grid-template-columns:repeat(5,1fr);border-bottom:1px solid #ddd7cc}.report-metrics>div{min-width:0;padding:10px 12px;border-right:1px solid #e2ddd4}.report-metrics>div:last-child{border-right:0}.report-metrics b,.report-metrics span{display:block}.report-metrics b{color:#e55f00;font-size:19px;line-height:1}.report-metrics span{margin-top:4px;color:#656a70;font-size:8px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.module-map{padding:11px 14px 8px}.module-map-head{display:flex;justify-content:space-between;margin-bottom:7px;color:#565b60;font-size:8px;letter-spacing:.08em}.module-map-head span{color:#8b8e91;font-weight:700}.module-map-row{display:grid;grid-template-columns:42px 1fr;align-items:center;gap:7px;margin:4px 0}.module-map-row>b{color:#4c5156;font-size:7px;letter-spacing:.07em}.module-map-cells{display:grid;gap:2px}.module-map-cells>span{position:relative;height:15px;border-radius:2px;background:#e7e3db;border:1px solid #d4cec3}.module-map-cells>span::after{content:attr(data-number);position:absolute;inset:0;display:grid;place-items:center;color:#92908b;font-size:5px;font-weight:900}.module-map-cells>.occupied{background:linear-gradient(180deg,var(--map-accent),#d95800);border-color:#a94608}.module-map-cells>.occupied::after{color:#fff}.module-map-cells>.occupied.main{background:linear-gradient(#303943,#141a20);border-color:#0d1116}.module-map-cells>.occupied.rcd{background:linear-gradient(#2589d8,#176197);border-color:#14517e}.module-map-cells>.occupied.protected{background:linear-gradient(#ee8b3e,#d65a08)}
.wire-key{display:flex;align-items:center;gap:16px;padding:8px 14px;background:#f1eee8;border-top:1px solid #ddd7cc;color:#555a5e;font-size:8px;font-weight:800}.wire-key>b{margin-right:auto;color:#242a30;letter-spacing:.1em}.wire-key span{display:flex;align-items:center;gap:5px}.wire-key i{width:23px;height:4px;border-radius:3px;background:#8b5a2b}.wire-key .neutral-key{background:#2589d8}.wire-key .pe-key{background:repeating-linear-gradient(90deg,#59a83f 0 6px,#e6d63a 6px 12px)}.wire-key .comb-key{height:7px;background:#9b642d;border:1px solid #643b16}
.panel-shell{overflow:visible}.rail-label{display:flex;align-items:center;gap:8px;margin:0 8px 7px;padding:5px 9px;border-radius:4px;background:#495057;color:#fff;letter-spacing:.11em}.rail-label::before{content:'⚡';color:#ffad72}.rail-label::after{content:'АПАРАТИ И СВЪРЗВАНЕ';margin-left:auto;color:#cdd2d6;font-size:7px}
.board{align-content:start;background-color:#c2c6ca;background-image:linear-gradient(90deg,#ffffff20 1px,transparent 1px);background-size:calc(100% / 18) 100%}
.placed{border-top:4px solid var(--device-accent);transition:transform .15s,box-shadow .15s}.placed:hover{transform:translateY(-2px);box-shadow:0 7px 13px #0005}.placed.zone-start{margin-left:6px;box-shadow:-6px 0 0 #353d45,1px 2px 4px #0004}.zone-badge{position:absolute;z-index:8;top:-23px;left:-2px;max-width:calc(100% + 12px);padding:2px 4px;border-radius:3px;background:#353d45;color:#fff;font-size:5px;font-weight:900;letter-spacing:.04em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.placed[data-zone-tone="rcd"] .zone-badge,.placed[data-zone-tone="protected"] .zone-badge{background:#176197}.placed[data-zone-tone="main"] .zone-badge{background:#171d24}.placed:not(.zone-start) .zone-badge{display:none}
.schedule-title{display:flex;align-items:end;justify-content:space-between;margin-top:22px;padding:10px 12px 8px;border-bottom:3px solid #ff7a1a;background:#171d24;color:#fff}.schedule-title>div{display:grid}.schedule-title b{font-size:13px}.schedule-title>span{color:#bfc7cf;font-size:8px;font-weight:800}.legend-head{margin-top:0;background:#343b43}.legend-head,.legend-row{grid-template-columns:40px 1.25fr 150px 1.25fr 82px}.legend-row:nth-child(even){background:#eeece7}.legend-row:hover{background:#fff4e9}.schedule-cable{font-weight:800;color:#4c5b68;white-space:nowrap}
.wiring-only .scheme-report,.wiring-only .schedule-title{display:none!important}
@media print{.scheme-report{break-inside:avoid}.schedule-title{break-after:avoid}.legend-row{break-inside:avoid}}

/* Realistic enclosure and traceable cable routing */
.panel-shell{padding:15px 14px 22px;border-width:10px;background:linear-gradient(145deg,#20262b,#11161a 62%,#2d3439);box-shadow:inset 0 0 0 2px #6c7378,inset 0 0 30px #000b,0 5px 16px #0005}
.board-wrap{border:1px solid #535b61;border-radius:4px;background:linear-gradient(90deg,#171c20,#2a3035 50%,#171c20);box-shadow:inset 0 0 34px #000c;padding-left:16px;padding-right:16px}
.board{padding:34px 10px 34px;row-gap:132px;background-color:#252b30;background-image:repeating-linear-gradient(to bottom,transparent 0 65px,#c8cdd0 65px,#7c8388 70px,#dfe2e3 75px,#676e73 80px,transparent 86px,transparent 292px),repeating-linear-gradient(90deg,#ffffff0c 0 1px,transparent 1px 36px);box-shadow:inset 0 0 0 1px #41484e}
.board::before{display:none}.placed{height:160px;border-color:#7b8287;background:linear-gradient(90deg,#d5d8d9,#f8f8f4 10%,#eceeea 88%,#c3c7c8);box-shadow:1px 3px 5px #000a}.placed.zone-start{margin-left:8px;box-shadow:-8px 0 0 #11171b,-9px 0 0 #687177,1px 3px 5px #000a}.zone-badge{top:-27px;background:#0e1418;border:1px solid #657078;color:#f5f7f8}
.wire-outline{stroke:#171c20;stroke-width:9.5;opacity:1}.wire{stroke-width:5;filter:drop-shadow(0 1px 1px #000) drop-shadow(0 0 1px #fff5)}
.wire-red-outline{stroke:#fff4e8;stroke-width:11;opacity:1}.wire.wire-red{stroke-width:6.5;filter:drop-shadow(0 0 2px #fff) drop-shadow(0 2px 2px #000)}
.comb{filter:drop-shadow(0 2px 2px #000c)}.comb .comb-casing{fill:none;stroke:#15191c;stroke-width:13;stroke-linecap:round}.comb .comb-copper{fill:none;stroke:#d78a20;stroke-width:8;stroke-linecap:round}.comb .comb-pin{fill:none;stroke:#f0b53c;stroke-width:6;stroke-linecap:round}.comb-label{fill:#17110b;stroke:#ffd166;stroke-width:5px;font-size:8px}.comb.draft{opacity:.7}.wire-key .comb-key{background:#d78a20;border:3px solid #15191c}
.bus-zone{border-color:#69747c;background:#20272cd9}.bus-head{color:#d5dce0}.bus-head span{color:#9ca8af}.outgoing-title{color:#e1e6e9}.outgoing-area{padding-bottom:20px}.outgoing-cable{border-color:#717b82;background:#e7e9e6;box-shadow:0 3px 8px #0008}

/* v87 — true 35 mm DIN-rail profile and automatic neutral-bus guidance */
.board{
 background-color:#252b30;
 background-image:
  repeating-linear-gradient(to bottom,transparent 0 61px,#575e63 61px,#cfd3d5 64px,#f1f3f3 68px,#aeb4b7 70px,#6e757a 73px,#d7dbdd 77px,#858c91 81px,#4c5358 84px,transparent 87px,transparent 292px),
  repeating-linear-gradient(90deg,transparent 0 13px,#252b30 13px 25px,transparent 25px 43px),
  repeating-linear-gradient(90deg,#ffffff0c 0 1px,transparent 1px 36px);
 background-size:100% 100%,auto 292px,36px 100%;
 background-position:0 0,0 63px,0 0;
}
.board::after{content:'';position:absolute;z-index:0;inset:0;pointer-events:none;background:repeating-linear-gradient(to bottom,transparent 0 63px,#ffffff75 63px 65px,transparent 65px 79px,#171b1e80 79px 82px,transparent 82px 292px);}
.board>.placed{position:relative;z-index:2}
.bus-head span{max-width:none;text-align:right;line-height:1.35}
.bus-terminal.incoming{width:auto;min-width:22px;padding-inline:4px;background:#145f96!important;color:#fff!important;border-color:#8bd0ff!important;font-size:6px;font-weight:900}

/* v88 — one immutable visual width per DIN module; only the canvas scrolls */
html,body{max-width:100%;overflow-x:hidden}
.layout,.workspace,.workspace-head,.workspace-tools{min-width:0}
.canvas-viewport{width:100%;box-sizing:border-box;overflow-x:auto;overflow-y:auto;overscroll-behavior-inline:contain;scrollbar-gutter:stable;touch-action:pan-x pan-y}
.canvas-scaler{width:max-content;min-width:100%}
.canvas-viewport .sheet{min-width:1120px;max-width:none}
.board{grid-template-columns:repeat(12,64px);grid-auto-columns:64px;column-gap:2px;width:max-content;max-width:none;background-size:100% 100%,64px 292px,64px 100%}
.placed{min-width:0;width:auto;box-sizing:border-box}
.placed.zone-start{margin-left:0}
.panel-scroll{color:#ff9b55}
.canvas-viewport::-webkit-scrollbar{height:14px;width:12px}
.canvas-viewport::-webkit-scrollbar-track{background:#151d25;border-radius:99px}
.canvas-viewport::-webkit-scrollbar-thumb{background:#ff7a1a;border:3px solid #151d25;border-radius:99px}
.canvas-viewport::-webkit-scrollbar-thumb:hover{background:#ff9a52}
@media(max-width:820px){.canvas-viewport .sheet{min-width:1120px}.panel-scroll{display:inline-grid;place-items:center}}

/* v89 — realistic modular-device face instead of card-like blocks */
.placed{padding:4px 2px 7px;gap:0;border:1px solid #676d70;border-top:0;background:linear-gradient(90deg,#babfbe 0,#f5f5f1 5%,#e5e7e3 50%,#fbfbf8 92%,#aeb3b2 100%);border-radius:2px;box-shadow:inset 0 1px #fff,1px 3px 6px #0009}
.placed .device-art{display:block;width:calc(100% - 2px);height:104px;margin:-1px auto 0;overflow:visible;filter:drop-shadow(0 2px 1px #0006);flex:0 0 104px}
.placed>.rating{display:none}
.placed>.test-button{display:none}
.placed .num{position:relative;z-index:3;width:21px;height:21px;margin-top:-1px;font-size:9px;box-shadow:0 1px 2px #0005}
.placed .short{margin-top:2px;color:#11171a;font-weight:700;text-shadow:0 1px #fff}
.placed:hover{transform:translateY(-2px);filter:brightness(1.03)}
.device-art.mini{width:44px;height:64px;flex-basis:auto}
.panel-shell{max-width:100%;overflow-x:auto;overflow-y:visible;overscroll-behavior-inline:contain;scrollbar-gutter:stable}
.panel-shell::-webkit-scrollbar{height:14px}
.panel-shell::-webkit-scrollbar-track{background:#111820;border-radius:99px}
.panel-shell::-webkit-scrollbar-thumb{background:#ff7a1a;border:3px solid #111820;border-radius:99px}
.panel-shell::-webkit-scrollbar-thumb:hover{background:#ff9a52}

/* v90 — multi-select, group drag targets and printable label generator */
.board.drag-over{outline:4px solid #45d39a;outline-offset:3px;background-image:linear-gradient(#45d39a18,#45d39a18),repeating-linear-gradient(to bottom,transparent 0 61px,#575e63 61px,#cfd3d5 64px,#f1f3f3 68px,#aeb4b7 70px,#6e757a 73px,#d7dbdd 77px,#858c91 81px,#4c5358 84px,transparent 87px,transparent 292px),repeating-linear-gradient(90deg,transparent 0 62px,#45d39a70 62px 64px)}
.placed.is-selected{outline:4px solid #21c7a8;outline-offset:3px;z-index:9;box-shadow:0 0 0 8px #21c7a82e,0 8px 18px #0008}
.placed.dragging.is-selected{opacity:.72;filter:saturate(.8)}
.selection-bar select{width:auto;min-width:82px;height:30px;padding:4px 7px;border-radius:7px;background:#111821;color:#fff;font-size:9px}
.mobile-select-toggle{display:none;position:sticky;z-index:13;top:6px;margin:0 0 9px auto;padding:8px 11px;border:1px solid #314151;background:#17212c;color:#dbe4eb}
.mobile-select-toggle.active{background:#21c7a8;color:#081712;border-color:#21c7a8}
.labels-dialog{width:min(780px,calc(100% - 24px))}.labels-preview{display:flex;max-width:100%;padding:12px;overflow-x:auto;background:#f4f4f0;border:1px solid #aeb2b4;border-radius:8px;color:#111}.labels-preview>span{position:relative;display:grid;flex:0 0 calc(var(--label-modules)*35px);place-items:center;align-content:center;height:48px;padding:3px;border-right:1px dashed #777;text-align:center}.labels-preview i{font-style:normal;font-size:14px}.labels-preview b{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:7px}.labels-preview small{position:absolute;right:2px;bottom:1px;color:#777;font-size:5px}.labels-preview em{color:#555}
@media(max-width:820px){.mobile-select-toggle{display:block}.selection-bar select{min-width:72px}.selection-bar{max-height:170px;overflow:auto}}
@media print{.labels-dialog,.mobile-select-toggle{display:none!important}}

.auto-wire-toggle{border-color:rgba(34,197,94,.55)!important;background:linear-gradient(135deg,rgba(34,197,94,.16),rgba(14,165,233,.12))!important;color:#d9ffe7!important;font-weight:800}.auto-wire-toggle:hover{border-color:#22c55e!important;box-shadow:0 0 0 3px rgba(34,197,94,.12),0 8px 24px rgba(0,0,0,.22)}
