.wiring-workspace { min-width:0; max-width:100%; color:var(--ink,#182b35); }
#wiringTab { min-width:0; max-width:100%; }
.wiring-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:14px 0; }
.wiring-toolbar h2 { margin-right:auto; }
.wiring-toolbar label { display:grid; gap:5px; flex:1 1 240px; min-width:0; }
.wiring-toolbar select,.wiring-search input { width:100%; min-width:0; }
.wiring-viewport { max-width:100%; height:560px; overflow:auto; border:1px solid var(--line,#ccd5dc); background:var(--panel,#fff); touch-action:pan-x pan-y; overscroll-behavior:contain; }
.wiring-svg { display:block; max-width:none!important; color:var(--ink,#182b35); font:14px Arial,sans-serif; }
.wiring-svg text { fill:currentColor; }
.wire-edge-bg { fill:var(--panel,#fff); stroke:var(--line,#ccd5dc); }
.wire-device rect { fill:var(--bg-section-alt,#edf4f7); stroke:var(--line,#ccd5dc); }
.wire-device,.wire-conductor { cursor:pointer; }
.wire-device.selected > rect { stroke:#d48200; stroke-width:3px; }
.wire-line { fill:none; stroke-width:3px; }
.wire-line.undefined { stroke-dasharray:6 6; }
.wire-conductor.selected .wire-line { stroke-width:7px; }
.wire-conductor.selected text { font-weight:700; }
.wire-conductor:focus,.wire-device:focus { outline:2px solid #d48200; }
.wire-end { font:12px monospace; }
.wire-step { font-size:12px; }
.wiring-table-scroll { max-width:100%; overflow:auto; }
.wiring-table { width:100%; min-width:840px; border-collapse:collapse; }
.wiring-table td,.wiring-table th { padding:8px; border:1px solid var(--line,#ccd5dc); text-align:left; }
.wiring-table button { white-space:nowrap; font:12px monospace; }
.wiring-table button.selected { outline:2px solid #d48200; }
.wiring-legend { display:flex; flex-wrap:wrap; gap:8px 18px; padding:12px 0; }
.wiring-warnings { background:var(--bg-warning,#fff7dd); padding:12px; }
.wiring-workspace details { margin:12px 0; }
.wiring-workspace summary { cursor:pointer; font-weight:600; }
.wiring-workspace li { margin:8px 0; }
.wiring-workspace dl { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; }
.wiring-workspace dd { margin:4px 0; overflow-wrap:anywhere; }
.wiring-search { display:grid; gap:6px; max-width:360px; margin:16px 0; }
[data-theme=dark] .wire-conductor text { fill:#eef5f8; }
[data-theme=dark] .wire-line { filter:brightness(1.6); }
@media(max-width:600px) { .wiring-viewport { height:450px; } .wiring-toolbar button { min-height:42px; } }
/* Server PDF, no native browser headers or footers. Each section is one physical sheet. */
@page wiring-sheet { size:A4 landscape; margin:8mm; }
.wiring-document { margin:0; color:#182b35; background:white; font:10px Arial,sans-serif; --panel:white; --line:#ccd5dc; --ink:#182b35; }
.wiring-page { page:wiring-sheet; width:281mm; height:192mm; box-sizing:border-box; display:flex; flex-direction:column; break-after:page; }
.wiring-page:last-child { break-after:auto; }
.wiring-page header { margin-bottom:5px; }
.wiring-page h1 { font-size:17px; margin:0 0 4px; }
.wiring-page h2 { font-size:14px; }
.wiring-page header p { margin:0; }
.wiring-page main { flex:1; min-height:0; }
.wiring-page .wire-note { margin:4px 0; }
.wiring-page .wiring-svg { width:100%; height:auto; }
.wiring-page .wiring-table { min-width:0; font-size:10px; }
.wiring-page .wiring-table td,.wiring-page .wiring-table th { padding:3px; }
.wiring-page .wiring-table button { border:0; padding:0; background:none; color:inherit; font:10px monospace; }
.wiring-page footer { margin-top:6px; border-top:1px solid #ccd5dc; padding-top:5px; font-size:8px; display:flex; justify-content:space-between; gap:10px; }
.wiring-page footer span { white-space:nowrap; }
.wire-tags { display:grid; grid-template-columns:repeat(3,1fr); gap:3mm; }
.wire-tag { border:1px dashed #526775; height:24mm; padding:2mm; display:flex; flex-direction:column; gap:2mm; overflow-wrap:anywhere; box-sizing:border-box; }
.wire-tag strong { font:12px monospace; }
.wire-note { font-size:8px; }
.wiring-toolbar button[aria-pressed=true] { outline:2px solid var(--accent,#007766); outline-offset:2px; }
.wiring-terminal-note { font-size:.9em; line-height:1.5; }
.wiring-diagram .apparatus-case { fill:var(--panel,#fff); }
.apparatus-name { font-size:14px; font-weight:600; }
.apparatus-terminal { fill:var(--ink,#182b35); stroke:var(--panel,#fff); stroke-width:1px; }
.apparatus-terminal.undefined { fill:var(--panel,#fff); stroke:#737373; stroke-width:2px; }
.apparatus-breaker .schema-wire { stroke:currentColor; stroke-width:3px; fill:none; }
.apparatus-breaker .schema-contact { stroke:currentColor; stroke-width:3px; fill:var(--panel,#fff); }
.apparatus-wire-label { font:12px Arial,sans-serif; paint-order:stroke; stroke:var(--panel,#fff); stroke-width:3px; stroke-linejoin:round; }
.wire-earth-stripe { stroke-dasharray:8 8; }
.wiring-diagram .wire-line { stroke-width:3px; }
.wiring-diagram .wire-conductor.selected .wire-line { stroke-width:6px; }
.wiring-page .wiring-diagram { max-height:157mm; }
.wiring-page .wiring-table td { overflow-wrap:anywhere; }
/* Generic plastic apparatus, deliberately independent of the Plan pictograms. */
.wiring-diagram .device-plastic { fill:#e1e5e8; stroke:#85939e; stroke-width:1.5px; }
.wiring-diagram .device-face { fill:#fafbfc; stroke:#b8c1c8; stroke-width:1px; }
.wiring-diagram .device-recess { fill:#d2d9de; stroke:#9ca9b2; stroke-width:2px; }
.wiring-diagram .device-dark { fill:#303d46; stroke:#17242c; stroke-width:1px; }
.wiring-diagram .device-screw { fill:#aebbc5; stroke:#5c6c78; stroke-width:1px; }
.wiring-diagram .device-seam { fill:none; stroke:#758794; stroke-width:2px; }
.wiring-diagram .device-lever { fill:#bd3934; stroke:#832622; stroke-width:1px; }
.wiring-diagram .device-lever-groove { fill:none; stroke:#e28f85; stroke-width:1px; }
.wiring-diagram .device-rocker-edge { fill:#cad2d8; stroke:#abb6c0; stroke-width:1px; }
.wiring-diagram .device-earth-base { fill:#4d8c47; stroke:#306834; stroke-width:1px; }
.wiring-diagram .device-brass { fill:#e4c768; stroke:#9b8132; stroke-width:1px; }
.wiring-diagram .device-glass { fill:#fff6cc; stroke:#ad994e; stroke-width:2px; }
.wiring-diagram .device-filament { fill:none; stroke:#8c7640; stroke-width:2px; }
.wiring-diagram .device-highlight { fill:none; stroke:white; stroke-width:5px; stroke-linecap:round; }
.wiring-diagram .device-cord { fill:none; stroke:#53626e; stroke-width:8px; }
.wiring-diagram .device-print { fill:#263641; font:11px Arial,sans-serif; }
.wiring-diagram .device-mark { fill:white; font:10px Arial,sans-serif; }
.wiring-diagram .real-apparatus { color:#263641; }
.wiring-diagram .apparatus-terminal-block { fill:var(--bg-section-alt,#edf4f7); stroke:var(--line,#ccd5dc); }
.wiring-diagram .apparatus-caption { font:11px Arial,sans-serif; }
.wiring-diagram .wire-device.selected .apparatus-case { stroke:#d48200; stroke-width:3px; }
.wiring-diagram .apparatus-wire-label { font-size:13px; }
.wiring-diagram .wire-line { stroke-width:4px; }
.wiring-diagram .wire-earth-stripe { stroke-width:2px; }
.wiring-technical { padding:10px; border:1px solid var(--line,#ccd5dc); border-radius:8px; }
.wiring-terminal-note { margin:8px 0; }

.apparatus-wire-label { pointer-events:none; }
.apparatus-wire-label.selected { font-weight:700; }

/* Rear connection views: insertion points belong to the device, not a UI card. */
.wiring-diagram .device-mount { fill:#e4e8eb; stroke:#8898a3; stroke-width:1.5px; }
.wiring-diagram .device-mount-slot { stroke:#7b8b96; stroke-width:5px; stroke-linecap:round; }
.wiring-diagram .socket-contact { fill:none; stroke:#ab8d39; stroke-width:9px; stroke-linecap:round; }
.wiring-diagram .switch-contact { fill:none; stroke:#e4c768; stroke-width:4px; }
.wiring-diagram .connection-housing { stroke:#596977; stroke-width:1px; }
.wiring-diagram .terminal-mark { fill:white; font:bold 11px Arial,sans-serif; }
.wiring-diagram .terminal-bridge { fill:none; stroke:#e4c768; stroke-width:5px; }
.wiring-diagram .apparatus-terminal { fill:#24333d; stroke:#dce5eb; stroke-width:1px; }
.wiring-diagram .apparatus-terminal.undefined { fill:var(--panel,#fff); stroke:#737373; stroke-width:2px; }
.wiring-diagram .splice-enclosure { fill:var(--panel,#fff); stroke:var(--line,#ccd5dc); stroke-dasharray:4 3; }
.wiring-diagram .wire-device.selected .device-mount,
.wiring-diagram .wire-device.selected .real-breaker > .device-plastic { stroke:#d48200; stroke-width:3px; }

/* Practical rear mechanisms and a narrow DIN modular breaker. */
.wiring-diagram .rear-frame-metal { fill:#657178; stroke:#39484f; stroke-width:1.5px; }
.wiring-diagram .rear-frame-bevel { fill:#899297; stroke:#b0b7b9; stroke-width:1px; }
.wiring-diagram .rear-frame-opening { fill:#27373e; stroke:#4d5c63; stroke-width:3px; }
.wiring-diagram .rear-fixing-slot { fill:var(--panel,#fff); stroke:#46565e; stroke-width:3px; }
.wiring-diagram .rear-fixing-hole { fill:#26353c; stroke:#a5afb4; stroke-width:2px; }
.wiring-diagram .rear-rib { fill:none; stroke:#a1aaad; stroke-width:2px; }
.wiring-diagram .rear-clamp { fill:#53666f; stroke:#2b3d46; stroke-width:1px; }
.wiring-diagram .rear-clip { fill:#b3b9b9; stroke:#596971; stroke-width:1px; }
.wiring-diagram .rear-mechanism-shadow { fill:#25343b; stroke:#16232a; stroke-width:2px; }
.wiring-diagram .rear-mechanism-body { fill:#45585f; stroke:#718086; stroke-width:1.5px; }
.wiring-diagram .rear-socket-chamber { fill:#53686e; stroke:#2e4048; stroke-width:2px; }
.wiring-diagram .rear-release { fill:#aab3b4; stroke:#3a515a; stroke-width:1px; }
.wiring-diagram .rear-terminal-shell { fill:#30464e; stroke:#819095; stroke-width:1px; }
.wiring-diagram .rear-terminal-clip { stroke:#bac5c7; stroke-width:.6px; }
.wiring-diagram .rear-insertion-rim { fill:#101e25; stroke:#9aa8ac; stroke-width:1.5px; }
.wiring-diagram .rear-embossed { fill:#e6ecee; font:10px Arial,sans-serif; }
.wiring-diagram .rear-schematic-print { fill:#d4dde0; font:9px Arial,sans-serif; }
.wiring-diagram .switch-contact { fill:none; stroke:#b9c7cc; stroke-width:1.5px; }
.wiring-diagram .terminal-bridge { stroke:#b6a263; stroke-width:2px; }
.wiring-diagram .apparatus-terminal { fill:#0b181e; stroke:#bac7ca; stroke-width:1px; }
.wiring-diagram .breaker-shell { fill:#e7e9e8; stroke:#7e8b90; stroke-width:1.5px; }
.wiring-diagram .breaker-terminal-recess { fill:#d3d9d9; stroke:#9ca6a8; stroke-width:1px; }
.wiring-diagram .breaker-face { fill:#fafaf7; stroke:#b4bdbc; stroke-width:1px; }
.wiring-diagram .breaker-screw { fill:#c5cecd; stroke:#78888c; stroke-width:1px; }
.wiring-diagram .breaker-screw-slot { fill:none; stroke:#65777b; stroke-width:1px; }
.wiring-diagram .breaker-print { fill:#3a4b51; font:10px Arial,sans-serif; }
.wiring-diagram .breaker-rating { fill:#28373c; font:bold 10px Arial,sans-serif; }
.wiring-diagram .breaker-lever-well { fill:#1e2528; stroke:#596265; stroke-width:1px; }
.wiring-diagram .device-lever { fill:#303b3f; stroke:#080f12; stroke-width:1px; }
.wiring-diagram .breaker-lever-ridge { fill:none; stroke:#687379; stroke-width:1px; }
.wiring-diagram .breaker-marking { fill:none; stroke:#59676b; stroke-width:.8px; }
.wiring-diagram .breaker-indicator { fill:#b4423d; }
.wiring-diagram .breaker-din-clip { fill:#6c7b80; stroke:#3f535b; stroke-width:1px; }
.wiring-diagram .wire-device.selected .rear-frame-metal,
.wiring-diagram .wire-device.selected .breaker-shell { stroke:#d48200; stroke-width:3px; }
