/* Modular instrument workspace. Existing worksheet and calculation styles stay local. */
#instrument-bench{--bench-accent:#ef9c43;background:#17232c;border:1px solid #344753;border-radius:18px;padding:22px;margin:24px 0;color:#eaf1f3;box-shadow:0 16px 38px #17232c24}
.bench-toolbar{display:grid;grid-template-columns:1fr minmax(250px,.9fr);gap:18px 28px;align-items:center}
.bench-title h2{font-size:1.65rem;letter-spacing:-.025em;margin:5px 0 8px;color:#fff}
.bench-title h2:focus{outline:none}
.bench-title p{margin:0;color:#a9bec9;font-size:.9rem}
.bench-title .bench-eyebrow{color:#efad60;font-size:.67rem;font-weight:800;letter-spacing:.12em}
.bench-selector label{display:block;color:#d5e1e8;font-size:.75rem;font-weight:750;margin-bottom:8px}
.bench-selector select{width:100%;border:1px solid #647b88;background:#243641;color:white;border-radius:8px;padding:11px 13px;font:600 .94rem system-ui;min-height:44px}
.bench-selector select:disabled{opacity:.8}
#dut-model-note{margin:7px 0 0;min-height:2.3em;color:#b8cad3;font-size:.74rem;line-height:1.4}
.bench-view-switch{grid-column:1/-1;display:flex;gap:7px;flex-wrap:wrap}
.bench-view-switch button,.instrument-open{background:#253944;color:#d8e8f0;border:1px solid #547180;border-radius:7px;padding:10px 16px;font:700 .8rem system-ui;min-height:42px}
.bench-view-switch button[aria-pressed=true]{background:#efab59;color:#251b10;border-color:#efab59}
.bench-reading-strip{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:#354c59;border:1px solid #354c59;border-radius:10px;margin:20px 0;overflow:hidden}
.bench-reading-strip>div{display:grid;gap:7px;padding:15px 18px;background:#0b1820;min-width:0}
.bench-reading-strip span{font-size:.62rem;letter-spacing:.09em;color:#91b0bf;font-weight:750}
.bench-reading-strip strong{font:500 clamp(1.1rem,2.6vw,1.9rem) ui-monospace,Consolas,monospace;color:#baf3e0;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.bench-reading-strip small{font-size:.67rem;color:#b6c9d3}
.bench-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px;align-items:start}
.bench-slot{min-width:0}
.instrument-open{width:100%;text-align:left;margin-bottom:8px;display:flex;justify-content:space-between}
.instrument-open::after{content:'↗';color:#efad60;font-size:1rem}
.bench-slot .instrument{margin:0;width:100%;background:linear-gradient(145deg,#d9e4e8,#adc2cb);border-color:#6b8b9a}
.bench-slot .instrument-top{font-size:.7rem;letter-spacing:.02em;padding-bottom:10px}
.bench-slot .instrument-top .version{font-size:.62rem}
.bench-slot .reset-button{font-size:.7rem;padding:7px 10px;min-height:36px}
.bench-slot .dut-instrument{margin:0;width:100%;max-width:none}
.bench-slot .pin-button{display:none}
.bench-slot .instrument .status{font-size:.75rem}
.bench-slot .source-spec{display:none}
#instrument-bench:not([data-view=source]) .instrument .panel{grid-template-columns:125px minmax(0,1fr);gap:10px}
#instrument-bench:not([data-view=source]) .instrument .key-bay,#instrument-bench:not([data-view=source]) .instrument .range,#instrument-bench:not([data-view=source]) .instrument .controls,#instrument-bench:not([data-view=source]) .instrument .source-instructions{display:none}
#instrument-bench:not([data-view=source]) .instrument .bay{padding:10px}
#instrument-bench:not([data-view=source]) .instrument .terminal-grid{gap:6px 2px;margin:0}
#instrument-bench:not([data-view=source]) .instrument .terminal-pair{font-size:.58rem;margin:4px 0 0}
#instrument-bench:not([data-view=source]) .instrument .terminal{font-size:.56rem;min-height:58px;padding:3px 0}
#instrument-bench:not([data-view=source]) .instrument .jack{width:34px;height:34px;border-width:5px;margin-bottom:5px}
#instrument-bench:not([data-view=source]) .instrument .terminals h2{font-size:.63rem;margin-bottom:9px}
#instrument-bench:not([data-view=source]) .instrument .screen{min-height:230px;border-width:5px;padding:12px}
#instrument-bench:not([data-view=source]) .instrument .screen-value{font-size:clamp(1.5rem,2.7vw,2.3rem)}
#instrument-bench:not([data-view=source]) .instrument .screen-top,#instrument-bench:not([data-view=source]) .instrument .screen-detail{font-size:.63rem;flex-wrap:wrap}
#instrument-bench:not([data-view=dut]) #dut-instrument .dut-face{display:flex;flex-direction:column;gap:12px}
#instrument-bench:not([data-view=dut]) #dut-instrument .dut-display{order:0;min-height:105px;margin:0;width:100%;font-size:.8rem}
#instrument-bench:not([data-view=dut]) #dut-instrument .dut-value{font-size:clamp(1.7rem,3vw,2.5rem)}
#instrument-bench:not([data-view=dut]) #dut-instrument .dut-inputs{order:1;width:100%}
#instrument-bench:not([data-view=dut]) #dut-instrument .dut-terminals{max-width:none;margin:0}
#instrument-bench:not([data-view=dut]) #dut-instrument .dut-face>.settings,#instrument-bench:not([data-view=dut]) #dut-instrument .dut-control-pad,#instrument-bench:not([data-view=dut]) #dut-instrument>.settings,#instrument-bench:not([data-view=dut]) #dut-instrument .handheld-face,#instrument-bench:not([data-view=dut]) #dut-instrument .dut-face>.small-label{display:none}
#instrument-bench #dut-instrument.basic-dut{max-width:350px;margin:auto}
#instrument-bench #dut-instrument label[for=dut-family],#instrument-bench #dut-instrument label[for=dut-variation]{display:none}
#instrument-bench[data-view=source] .bench-grid,#instrument-bench[data-view=dut] .bench-grid{grid-template-columns:minmax(0,1fr) 265px}
.focused-instrument{order:-1}
.companion-instrument .instrument .panel{display:block!important}
.companion-instrument .instrument .terminals,.companion-instrument .instrument .top-actions,.companion-instrument .instrument #status{display:none!important}
.companion-instrument #dut-instrument .dut-inputs,.companion-instrument #dut-instrument .dut-reset,.companion-instrument #dut-reset{display:none!important}
.companion-instrument .dut-heading h2{font-size:.7rem}
.companion-instrument .dut-instrument,.companion-instrument .instrument{padding:10px;border-width:2px}
.companion-instrument #dut-instrument .dut-face{padding:8px;gap:0}
.companion-instrument .instrument .screen{min-height:120px!important}
.companion-instrument .instrument .screen-value,.companion-instrument #dut-instrument .dut-value{font-size:1.4rem!important}
.focused-instrument .instrument .panel{grid-template-columns:135px minmax(240px,1.3fr) minmax(205px,1fr);gap:10px}
.focused-instrument .instrument .bay{padding:12px}
.focused-instrument .instrument .jack{width:45px;height:45px;border-width:7px}
.focused-instrument .instrument .terminal{font-size:.68rem;min-height:76px}
.focused-instrument .instrument .screen{min-height:240px;padding:15px}
.focused-instrument .instrument .screen-value{font-size:clamp(2rem,3vw,3rem)}
.focused-instrument #dut-instrument:not(.basic-dut) .dut-face{grid-template-columns:185px minmax(0,1fr);gap:14px}
.focused-instrument #dut-instrument:not(.basic-dut) .dut-control-pad{grid-column:1;grid-row:3;transform:none;height:auto}
.focused-instrument #dut-instrument:not(.basic-dut) .dut-face>.settings{grid-column:2;grid-row:2/span 2}
.focused-instrument #dut-instrument.basic-dut{max-width:400px}
.bench-connections{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px;font-size:.67rem;color:#d1e0e7}
.bench-connections span{background:#233742;border:1px solid #4d6673;padding:7px 9px;border-radius:20px}
.bench-connections span::before{content:'●';margin-right:6px;color:#e9ab64}
.bench-connections .connection-complete::before{color:#7dd6b0}
.bench-footnote{font-size:.67rem;color:#a3bbc8;margin:12px 0 0;line-height:1.4}
.bench-slot .screen,.bench-slot .dut-display{cursor:zoom-in}
.focused-instrument .screen,.focused-instrument .dut-display{cursor:default}
body[data-bench-view=source] #bench-cables,body[data-bench-view=dut] #bench-cables{display:none}
@media(max-width:1100px){#instrument-bench[data-view=source] .bench-grid,#instrument-bench[data-view=dut] .bench-grid{grid-template-columns:minmax(0,1fr) 210px}.focused-instrument .instrument .panel{grid-template-columns:120px minmax(0,1fr)}.focused-instrument .instrument .key-bay{grid-column:1/-1}.focused-instrument .instrument .keypad{grid-template-columns:repeat(4,minmax(0,1fr))}.focused-instrument .instrument .key-bay .units{margin-top:14px}.focused-instrument .instrument .keypad button{min-height:44px}}
@media(max-width:850px){#instrument-bench{padding:14px}.bench-toolbar{grid-template-columns:1fr}.bench-view-switch{grid-column:1}.bench-grid,#instrument-bench[data-view=source] .bench-grid,#instrument-bench[data-view=dut] .bench-grid{grid-template-columns:minmax(0,1fr)}.companion-instrument{order:-2}.companion-instrument .instrument-open{margin-bottom:5px}.companion-instrument .instrument .screen,.companion-instrument #dut-instrument .dut-display{min-height:80px!important}.companion-instrument .dut-instrument,.companion-instrument .instrument{max-width:none!important}.bench-reading-strip>div{padding:12px 9px}.focused-instrument #dut-instrument:not(.basic-dut) .dut-face{display:flex;flex-direction:column}.focused-instrument .instrument .panel{grid-template-columns:110px minmax(0,1fr)}}
@media(max-width:440px){.bench-reading-strip{grid-template-columns:1fr}.bench-title h2{font-size:1.4rem}.bench-view-switch button{padding:8px 10px;font-size:.7rem}#instrument-bench:not([data-view=source]) .instrument .panel,.focused-instrument .instrument .panel{grid-template-columns:minmax(0,1fr)}#instrument-bench .instrument .terminal-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));max-width:none}#instrument-bench .instrument .terminal-pair{grid-column:1/-1}.bench-slot .dut-instrument{padding:12px}.bench-slot .dut-instrument .dut-face{padding:10px}}

#take-readings{margin-left:auto;border-color:#efab59;color:#efbd7b}#take-readings[aria-pressed=true]{color:#251b10}
#instrument-bench[data-view=readings] .bench-grid{display:none}
.reading-output-controls{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.reading-output-controls>span{margin-right:auto;font-size:.9rem;font-weight:800}
.reading-output-controls button{font:750 .75rem system-ui;padding:10px 15px;min-height:42px;border-radius:7px;border:1px solid #6b9c8c;background:#285a4b;color:#d9ffea}
#reading-standby{border-color:#be965e;background:#705027;color:#fff0da}
body[data-bench-view]:not([data-bench-view=readings]) #work,body[data-bench-view]:not([data-bench-view=readings]) .bottom-tools{display:none!important}
body[data-bench-view=readings] #bench-cables{display:none}
.calculation-tools,.uncertainty-tools{border:1px solid #bfd0d8;padding:16px;border-radius:10px;margin:18px 0}
.calculation-tools>summary,.uncertainty-tools>summary{font-weight:800;cursor:pointer;color:#2b4c5c}
.calculation-tools[open]>summary,.uncertainty-tools[open]>summary{margin-bottom:18px}
body[data-bench-view]>.training-disclaimer{font-size:.8rem}
@media(max-width:520px){#take-readings{margin-left:0}}

/* Bench-scale workspace: drawings approach the same retained instrument panels. */
#instrument-bench{padding:0;overflow:hidden;border-radius:14px;background:#233139;box-shadow:0 18px 42px #14232b1c}
.bench-toolbar{padding:19px 22px 16px;gap:12px 26px;border-bottom:1px solid #495a61;background:#28373e}
.bench-title h2{font-size:1.25rem;margin:6px 0 0;letter-spacing:-.015em}.bench-title .bench-eyebrow{font-size:.62rem;color:#a7c3cf}.bench-title>p:last-child{display:none}
.bench-selector{display:grid;grid-template-columns:auto minmax(160px,1fr);gap:8px 12px;align-items:center}.bench-selector label{margin:0;font-size:.76rem;font-weight:500}.bench-selector select{background:#1c2b32;border-color:#51636b;min-height:40px;padding:8px 11px;font-size:.82rem}.bench-selector #dut-model-note{grid-column:1/-1;min-height:0;margin:0;font-size:.67rem;color:#b8cbd3}
.bench-view-switch{gap:7px}.bench-view-switch button{font-size:.74rem;min-height:38px;padding:8px 12px}.bench-view-switch button[aria-pressed=true]{background:#405f63;border-color:#769697;color:#edf9f4}
#bench-leads{margin-left:auto;background:#26383f}#take-readings{margin-left:0;background:#2e464c;color:#e7f0ec;border-color:#668183}
#instrument-bench[data-view=overview] .bench-view-switch [data-bench-view=source],#instrument-bench[data-view=overview] .bench-view-switch [data-bench-view=dut]{display:none}
#instrument-bench[data-view=overview] .bench-reading-strip{display:none}
.bench-scene{position:relative;isolation:isolate;min-height:410px;height:clamp(360px,34vw,470px);padding:48px 26px 62px;background:linear-gradient(180deg,#313f45 0%,#313f45 24%,#536966 24.2%,#738780 100%);overflow:hidden}
.bench-scene::before{content:'';position:absolute;inset:24% 0 auto;height:35px;background:linear-gradient(#132d3038,transparent);z-index:-1}
.bench-scene::after{content:'';position:absolute;inset:auto 0 0;height:14px;background:linear-gradient(#2e4848,#294044);box-shadow:0 -1px #aac2b83b}
.scene-instruments{position:absolute;inset:auto 24px 50px;display:grid;grid-template-columns:1.04fr 1fr;gap:25px;align-items:end;z-index:2}
.scene-instruments::before{content:'';position:absolute;z-index:-1;inset:-18px -12px -21px;border:1px solid #c4dcd02d;border-radius:10px;background:#526f6b14;box-shadow:inset 0 0 25px #173b3612}
.scene-instrument{display:flex;flex-direction:column;align-items:center;justify-content:end;min-width:0;width:100%;margin:0;padding:0;border:0;border-radius:4px;background:none;box-shadow:none;color:inherit;font-family:inherit;cursor:zoom-in}
.scene-instrument:hover{filter:brightness(1.04)}.scene-instrument:focus-visible{outline:3px solid #f3ba73;outline-offset:8px}.scene-instrument>svg{display:block;width:100%;height:auto;overflow:visible;filter:drop-shadow(0 8px 5px #142b2a50)}
.scene-instrument>svg text{font-family:Arial,system-ui,sans-serif;font-weight:600;letter-spacing:.3px;fill:#36514f;pointer-events:none}
.scene-instrument>svg .scene-model-name{font-size:8px;letter-spacing:1px;fill:#375552}
.scene-instrument>svg .scene-fine{font-size:5.8px;fill:#57706a;letter-spacing:.55px}
.scene-instrument>svg .scene-key-label{font-size:6.5px;fill:#405853;letter-spacing:0}
.scene-instrument>svg .scene-display-detail{font-size:6.3px;fill:#a6d8d3;letter-spacing:.4px}
.scene-instrument>svg .scene-display-value{fill:#b3ebe6;font:500 22px ui-monospace,Consolas,monospace;letter-spacing:.5px}
.scene-instrument>svg .dut-number{font-size:20px}
.scene-instrument .scene-port>text{font-size:5.5px;letter-spacing:.1px}
.scene-instrument .port-connected{fill:none;stroke:#71b6c3;stroke-width:2;opacity:0}.scene-instrument .scene-port.connected .port-connected{opacity:1}
.scene-caption{font-size:.68rem;font-weight:600;background:#1b3638cc;color:#d6e9e3;border:1px solid #6d929254;border-radius:4px;padding:7px 10px;margin-top:9px;max-width:100%;line-height:1.2;text-align:center}
.scene-view-note,.scene-training-label{position:absolute;color:#c2d6d4;font-size:.63rem;letter-spacing:.04em}.scene-view-note{top:18px;left:22px}.scene-training-label{right:20px;bottom:17px;font-size:.56rem;z-index:5;color:#bdd1c9}.scene-scales{fill:#b6c9c4}
.scene-cables{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:4;overflow:visible;filter:drop-shadow(0 1px 1px #14242466)}
.scene-instruments .scene-handheld-panel{display:none}.scene-instruments .scene-dut.is-handheld .scene-dmm-panel{display:none}.scene-instruments .scene-dut.is-handheld .scene-handheld-panel{display:block}
.scene-dut.is-handheld{width:41%;max-width:155px;justify-self:center}.scene-dut.is-handheld .scene-caption{white-space:nowrap;max-width:240px}
.scene-handheld-panel .handheld-number{font:500 15px ui-monospace,Consolas,monospace;fill:#b5e7d9;letter-spacing:0}.scene-handheld-panel .scene-handheld-brand{font-size:12px;letter-spacing:1px;fill:#eef4e9}.scene-handheld-panel .scene-handheld-fine{font-size:5.7px;fill:#c7d5cd}.scene-handheld-panel .handheld-dial-label{fill:#e5e8d7;font-size:9px}.scene-handheld-panel .scene-port>text{fill:#e2e8dc;font-size:5.5px}
.bench-accessories{margin:18px 20px;padding:16px;background:#1b2d35;border:1px solid #49606a;border-radius:8px}.bench-accessories h3{font-size:1rem;margin:0 0 8px}.bench-accessories p{font-size:.8rem;color:#bed0d7;margin:0 0 12px}.accessory-actions{display:flex;flex-wrap:wrap;gap:8px}.accessory-actions button{font:600 .75rem system-ui;border:1px solid #5f7d88;background:#304b55;color:#eaf4f4;padding:10px 13px;border-radius:6px;min-height:40px}
.bench-grid{margin:20px}.bench-reading-strip{margin:18px 20px}.bench-reading-strip strong{font-size:1.35rem}.reading-output-controls{padding:0 20px 18px}.bench-connections{margin:12px 20px 10px}.bench-footnote{margin:0 20px 15px;font-size:.63rem}
#instrument-bench .bench-slot .dut-instrument:not(.basic-dut){background:linear-gradient(145deg,#e3e8e2,#bfcac7);border-color:#7b9391;box-shadow:0 6px 15px #0a1c2728}
#instrument-bench .dut-instrument:not(.basic-dut) h2{color:#2e4d4b}#instrument-bench .dut-instrument:not(.basic-dut) .dut-face{background:#dae3dc;border-color:#95aba3}
#instrument-bench[data-view=dut] #dut-instrument:not(.basic-dut) .dut-display{min-height:100px;padding:14px;border-width:5px}#instrument-bench[data-view=dut] #dut-instrument:not(.basic-dut) .dut-value{font-size:2.1rem}
#bench-cables{display:none!important}
body[data-bench-view]:not(.bench-assigned)>main>h1,body[data-bench-view]:not(.bench-assigned)>main>.intro{display:none}
@media(min-width:1000px){.scene-dut.is-handheld{width:36%;max-width:160px}.bench-scene{min-height:430px}}
@media(max-width:850px){.bench-toolbar{padding:16px}.bench-selector{grid-template-columns:auto minmax(0,1fr)}.bench-scene{min-height:350px;height:390px}.scene-instruments{inset:auto 19px 50px;gap:18px}.bench-grid{margin:14px}.bench-reading-strip{margin:14px}.scene-dut.is-handheld{width:45%;max-width:145px}}
@media(max-width:600px){.bench-toolbar{gap:12px}.bench-title h2{font-size:1.15rem}.bench-view-switch{gap:6px}.bench-view-switch button{padding:8px 9px;font-size:.68rem}#bench-leads{margin-left:0}.bench-scene{min-height:510px;height:545px;padding-top:40px}.scene-instruments{inset:55px 23px 52px;grid-template-columns:1fr;grid-template-rows:1fr 1fr;gap:18px;align-items:end}.scene-instrument{max-width:430px;justify-self:center}.scene-dut.is-handheld{height:225px;width:auto;max-width:150px}.scene-dut.is-handheld>svg{height:180px;width:auto}.scene-caption{font-size:.61rem;padding:6px 8px}.scene-view-note{font-size:.54rem;left:15px;right:15px}.bench-reading-strip strong{font-size:1.2rem}.bench-accessories{margin:14px;padding:12px}.bench-footnote{font-size:.6rem}}
