/* Construction tools share the same circuit and physical grid as the 3D bench. */
.bench-mode{position:absolute;top:14px;right:16px;z-index:7;display:flex;gap:3px;padding:4px;border:1px solid var(--border-strong);border-radius:8px;background:var(--surface);box-shadow:0 2px 8px #0000000a}
.bench-mode button{height:29px;padding:0 12px;border:0;border-radius:5px;background:transparent;color:var(--muted);font-size:11px;font-weight:550}.bench-mode button[aria-pressed=true]{background:var(--accent-soft);color:var(--accent)}
.stage .status-pill{left:78px;transform:none;max-width:calc(100% - 260px)}.stage .status-pill span{display:none}.stage .tool-rail{top:72px}
.build-editor{position:absolute;inset:0;z-index:2;background:var(--surface-2);overflow:hidden}.build-mode .stage-overlay{visibility:hidden}.build-mode .stage-canvas{visibility:hidden}.build-mode .view-rail,.build-mode .hint{display:none}
.build-controls{position:absolute;top:66px;left:76px;right:16px;z-index:3;display:flex;align-items:center;gap:5px}.build-controls .btn{font-size:11px;height:32px;border-radius:6px;background:var(--surface)}.build-controls .icon-btn{width:30px;height:32px;background:var(--surface);border:1px solid var(--border);border-radius:6px}.build-controls span{margin-left:6px;font-size:10px;color:var(--muted)}
.build-board{position:absolute;top:108px;left:0;width:100%;height:calc(100% - 158px);touch-action:none;user-select:none}.build-readout{position:absolute;bottom:0;left:0;right:0;min-height:42px;max-height:55px;overflow:auto;padding:12px 18px;background:var(--surface);border-top:1px solid var(--border);font-size:11px;color:var(--text-2)}
.editor-ground{fill:var(--surface-2)}.breadboard-base>rect{fill:#f6f3e9;stroke:#c9c9bd;stroke-width:2}.rail-line{fill:none;stroke:#376dd1;stroke-width:1.5}.rail-positive{stroke:#cc4745}.board-channel{stroke:#d3cfc4;stroke-width:9}.board-labels{fill:#686654;font:9px var(--mono)}.board-labels>text:last-child{font-size:8px}.hole-hit,.pin-hit{fill:transparent;pointer-events:all}.hole-dot{fill:#77776c;pointer-events:none}.build-hole{cursor:crosshair}.strip-highlight .hole-dot{fill:#168d68;stroke:#94e8c5;stroke-width:3}.pin-dot{fill:#246c55;stroke:#f2fff9;stroke-width:1;pointer-events:none}.build-pin{cursor:crosshair}.build-pin:hover .pin-dot{fill:#e6a63d;stroke:#fcdf9e;stroke-width:2}
.build-instrument>rect{fill:var(--surface);stroke:var(--border-strong);stroke-width:1.5}.instrument-name{fill:var(--text);font:600 12px var(--font)}.instrument-value{fill:var(--accent);font:11px var(--mono)}.pin-name{fill:var(--text-2);font:9px var(--mono)}.trainer-controls rect{fill:var(--accent-soft);stroke:var(--border-strong)}.trainer-controls text{fill:var(--text);font:9px var(--mono)}.trainer-controls g{cursor:pointer}
.wire-hit{fill:none;stroke:transparent;stroke-width:14;pointer-events:stroke}.wire-body{fill:none;stroke-width:3;stroke-linecap:round;pointer-events:none;filter:drop-shadow(0 1px 1px #ffffff70)}.build-wire{cursor:pointer}.build-wire.selected .wire-body{stroke-width:5;filter:drop-shadow(0 0 2px #68d8ad)}.wire-flow{fill:none;stroke:#fff7cf;stroke-width:1.8;stroke-dasharray:2 14;pointer-events:none;opacity:0}.wire-flow.flowing{opacity:.9;animation:wire-flow 1s linear infinite}.wire-handle,.wire-end{fill:#fff9e9;stroke:#c28719;stroke-width:2;cursor:grab}.wire-end{fill:#e9f8ef;stroke:#167453}.wire-preview{stroke:#cf9b26;stroke-width:2;stroke-dasharray:6 4;pointer-events:none}
.terminal-reading{fill:var(--text-2);font:8px var(--mono);pointer-events:none}.terminal-reading.is-high{fill:var(--accent);font-weight:700}.logic-high .pin-dot{fill:#dbad29;stroke:#f8e3a3}.trainer-controls [aria-pressed=true] rect{fill:var(--accent)}.trainer-controls [aria-pressed=true] text{fill:var(--accent-ink)}
.part-hit{fill:transparent;stroke:transparent;pointer-events:all}.build-part{cursor:grab}.build-part.selected .part-hit{fill:#1674530a;stroke:#167453;stroke-width:1.2;stroke-dasharray:3 2}.part-lead{fill:none;stroke:#a4aaa7;stroke-width:2}.part-name{fill:#334c3c;font:600 10px var(--font)}.part-name tspan{fill:#526f5c;font:9px var(--mono)}.chip-body{fill:#202823;stroke:#090e0b;stroke-width:1}.chip-notch{fill:#0a100d}.chip-label{fill:#edf6ef;font:8px var(--mono)}.chip-pin-number{fill:#405845;font:8px var(--mono)}.ghost-part{opacity:.6;pointer-events:none}.placement-ok .part-hit{fill:#23a06d33;stroke:#167453}.placement-bad .part-hit{fill:#e2434344;stroke:#d52c2c}.build-ghost{pointer-events:none}.build-part.led-on>svg{filter:drop-shadow(0 0 4px #ff5d5d)}
.panel.right>.tabs{padding:0 8px;gap:0}.panel.right>.tabs button{flex:1;justify-content:center;padding:0 4px;font-size:10px;gap:4px}.panel.right>.tabs button .ic{width:12px;height:12px}
.connection-builder h3,.wire-routing h3{font-size:14px;font-weight:600;margin:0 0 8px}.connection-builder p,.wire-routing p,.chip-power-help p{font-size:11px;line-height:1.8;color:var(--muted)}.connection-builder form{display:flex;flex-direction:column;gap:7px;margin-top:14px}.connection-builder label,.wire-routing label{font-size:11px;color:var(--text-2);font-weight:500}.connection-builder input,.project-form input{width:100%;height:38px;padding:0 10px;border:1px solid var(--border-strong);border-radius:6px;background:var(--surface);font-size:12px}.connection-builder .btn{margin-top:7px!important;min-height:36px!important;font-size:12px!important}.connection-builder input+label{margin-top:7px}.wire-routing{margin:24px 0}.wire-routing label{display:flex;justify-content:space-between;gap:8px}.wire-routing output{color:var(--muted);font:10px var(--mono)}.wire-routing input[type=range]{width:100%;accent-color:var(--accent);margin:12px 0}.connection-reference{margin-top:20px}.connection-point-list{display:flex;flex-direction:column;gap:4px;padding:8px}.connection-point-list button{display:flex;flex-direction:column;gap:4px;align-items:flex-start;padding:9px;background:var(--surface);border:1px solid var(--border);border-radius:5px;text-align:left}.connection-point-list strong{font:11px var(--mono);color:var(--accent)}.connection-point-list small{font-size:10px;color:var(--muted)}.chip-power-help{margin-top:20px}
.project-form{display:flex;flex-direction:column;gap:10px}.project-form label{font-size:13px;font-weight:550}.project-form p{font-size:12px;color:var(--muted);line-height:1.8}.project-form>div{display:flex;gap:8px;flex-wrap:wrap}.project-library-head{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:26px}.project-library-head h2{font-size:18px;letter-spacing:-.4px;font-weight:600;margin:0 0 8px}.project-library-head p{font-size:12px;color:var(--muted);line-height:1.8;margin:0}.project-library-head>div:last-child{display:flex;gap:8px;flex-wrap:wrap}.project-library-head .btn{font-size:12px}.project-card{min-height:170px}.project-card .card-foot{margin-top:auto}#projectLibrary .library-empty{grid-column:1/-1}
.connection-map-title strong{font-size:13px;font-weight:550}.connection-map-title p,.connection-map-empty{font-size:11px;line-height:1.8;color:var(--muted)}.connection-map-scroll{overflow-x:auto;border:1px solid var(--border);border-radius:7px;background:var(--surface-2)}.connection-map{display:block;min-width:590px;width:100%;height:auto}.net-map-edge{fill:none;stroke:var(--accent);stroke-width:1.5;opacity:.5}.net-map-node{fill:var(--accent-soft);stroke:var(--border-strong)}.net-map-part{fill:var(--surface);stroke:var(--border-strong)}.net-map-part.is-selected{stroke:var(--accent);stroke-width:2}.connection-map [data-label]{cursor:pointer}.net-map-part-title,.net-map-node-title{fill:var(--text);font:600 14px var(--font)}.net-map-detail{fill:var(--text-2);font:12px var(--mono)}.net-map-pin{fill:var(--muted);font:10px var(--mono)}
.study-stage-filter{display:flex;align-items:center;gap:12px;margin:0 0 24px;padding:12px 14px;border:1px solid var(--border);border-radius:7px;background:var(--surface)}.study-stage-filter label{font-size:11px;font-weight:550;white-space:nowrap}.study-stage-filter select{height:32px;max-width:195px;padding:0 8px;border:1px solid var(--border-strong);border-radius:5px;background:var(--surface-2);font-size:11px}.study-stage-filter p{margin:0 0 0 auto;max-width:490px;color:var(--muted);font-size:11px;line-height:1.7}
@keyframes wire-flow{to{stroke-dashoffset:-32}}
@media(max-width:1280px){.build-controls span{display:none}.project-library-head{flex-direction:column;align-items:flex-start}.study-stage-filter{flex-wrap:wrap}.study-stage-filter p{max-width:none;margin:0}}
@media(max-width:760px){.library-sidebar>nav:first-of-type{overflow-x:auto;scrollbar-width:thin;flex-wrap:nowrap}.library-sidebar .library-nav{flex:none}.project-library-head .btn{font-size:11px}.study-stage-filter{gap:8px}.study-stage-filter label{font-size:11px}.study-stage-filter select{flex:1}.bench-mode{right:12px;top:12px}.bench-mode button{font-size:10px;padding:0 10px}.stage .status-pill{left:12px;top:15px;max-width:calc(100% - 170px);font-size:10px}.stage .tool-rail{top:64px;left:10px}.build-controls{top:65px;left:62px;right:10px}.build-controls .btn{padding:0 8px;font-size:10px}.build-readout{font-size:10px;padding:10px 12px}.build-board{top:108px;height:calc(100% - 163px)}.project-library-head>div:last-child{width:100%}.project-library-head>div:last-child .btn{flex:1}#projectSave .txt{display:none}.topbar #projectSave{padding:0 7px}}
@media(prefers-reduced-motion:reduce){.wire-flow.flowing{animation:none}}
