:root{font-family:-apple-system,BlinkMacSystemFont,"Noto Sans TC","Microsoft JhengHei",sans-serif;color:#173142;background:#edf2f5;font-size:16px}*{box-sizing:border-box}body{margin:0}button,select{font:inherit}button,select{min-height:44px;border:1px solid #c7d3dc;border-radius:8px;background:white;color:#173142;padding:8px 12px}button{cursor:pointer;font-weight:600}button:hover{background:#e4f1f4}button:focus-visible,select:focus-visible{outline:3px solid #f4a63a;outline-offset:2px}button:disabled{opacity:.45;cursor:default}.primary{background:#076d76;color:white;border-color:#076d76}.primary:hover{background:#08555e}header{height:70px;background:#102b3d;color:#fff;display:flex;align-items:center;padding:0 28px;gap:22px}.brand{font-size:20px;font-weight:700;letter-spacing:.06em}.brand b{background:#bce8e3;color:#173c45;margin-left:8px;padding:4px 8px;border-radius:4px}.topic{color:#c1d2df;font-size:14px}.subtle{margin-left:auto;background:transparent;color:#fff;border-color:#5d7686}main{max-width:1800px;margin:0 auto;padding:24px;display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:20px}.work,aside{background:#fff;border:1px solid #d8e1e8;border-radius:12px;overflow:hidden}aside{align-self:start;padding:20px}.topline{padding:22px;display:flex;justify-content:space-between;gap:16px;align-items:center}h1{font-size:22px;margin:0 0 8px}p{line-height:1.6}.topline p{margin:0;color:#607281;font-size:14px}.tools{padding:10px 16px;border-top:1px solid #e3e9ee;background:#f7fafb;display:flex;gap:8px;align-items:center;flex-wrap:wrap}.tools label{display:flex;gap:8px;align-items:center;font-size:14px}.zoom{display:flex;gap:3px}.zoom button{padding:8px 10px}.toggle{cursor:pointer}input[type=checkbox]{width:18px;height:18px;accent-color:#076d76}#selection{padding:9px 18px;background:#e9f6f3;border-block:1px solid #cae3df;display:flex;align-items:center;justify-content:space-between;min-height:54px;font-size:14px;font-weight:600}#cancel{min-height:34px;padding:4px 10px}#boardWrap{height:min(66vh,760px);min-height:390px;position:relative;background:#d9d3c2;overflow:hidden}#board{display:block;width:100%;height:100%;touch-action:none;cursor:grab}#board.dragging{cursor:grabbing}.wire{fill:none;stroke-width:3;stroke-linejoin:round;stroke-linecap:round;opacity:.92;pointer-events:none}.wire.bad{stroke-width:5}.terminal{cursor:pointer}.terminal .dot{fill:#edfdf7;stroke:#007b72;stroke-width:1.7}.terminal.selected .dot{fill:#ffdc7c;stroke:#9d5800;stroke-width:3}.terminal.highlight .dot{fill:#ffe294;stroke:#ad5d00;stroke-width:3}.terminal text{font-size:11px;fill:#102b3d;paint-order:stroke;stroke:#fff;stroke-width:3px;stroke-linejoin:round;font-weight:bold;pointer-events:none}.legend{position:absolute;bottom:10px;left:10px;background:#ffffffea;padding:7px 10px;border-radius:6px;font-size:12px;pointer-events:none;display:flex;align-items:center;gap:7px}.legend i{width:9px;height:9px;border:2px solid #007b72;border-radius:50%}.wirekey{margin-left:8px;width:18px;height:3px;background:#1379ba}.bottomrow{padding:10px 16px;display:flex;align-items:center;gap:12px;font-size:14px}#saveStatus{color:#71818b;font-size:12px;margin-right:auto}.bottomrow button{font-size:14px}.picker{display:flex;gap:8px;flex-wrap:wrap;padding:10px 16px;background:#f6f9fb}.picker label{font-size:14px;display:flex;align-items:center;gap:7px}.picker select{max-width:260px}.mapping-note{font-size:12px;color:#65747e;padding:0 16px;margin:12px 0 16px}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:8px}h2{font-size:18px;margin:0}#badge{font-size:12px;padding:5px 8px;border-radius:6px;background:#eaf0f4;white-space:nowrap}#badge.good{background:#ddf5e9;color:#146342}#badge.bad{background:#ffe8e8;color:#a52431}#result{padding:24px 0 12px}#result h3{font-size:17px;margin:10px 0}#result p{font-size:14px;color:#5e7280}.empty-icon{font-size:48px;color:#8da8b8}.metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.metrics div{padding:12px 4px;text-align:center;border:1px solid #e1e8ed;border-radius:8px;font-size:12px}.metrics b{display:block;font-size:25px;margin-bottom:6px}.metrics .red{color:#b02638}.result-section{margin-top:20px}.result-section h3{font-size:14px!important}.issue{display:block;width:100%;text-align:left;font-size:13px;font-weight:400;margin:6px 0;line-height:1.5;overflow-wrap:anywhere}.issue b{display:block;font-size:13px}.actions{display:flex;flex-direction:column;gap:8px;margin:8px 0 20px}details{border-top:1px solid #dde5eb;padding:15px 0;font-size:13px;line-height:1.7}summary{cursor:pointer;font-size:14px;font-weight:600}details li{margin-bottom:7px}details ul{padding-left:20px}a{color:#096c80}dialog{border:1px solid #d5e0e7;border-radius:14px;padding:24px;max-width:min(560px,calc(100vw - 28px));max-height:85vh;color:#173142}dialog::backdrop{background:#09243799}dialog h2{margin-bottom:16px}dialog li{line-height:1.8;margin-bottom:8px}dialog p{font-size:14px}.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:20px}.dialog-actions{display:flex;gap:10px;justify-content:flex-end}.listrow{border-top:1px solid #e0e6ed;padding:10px 0;display:flex;gap:10px;align-items:center;font-size:14px}.listrow span{flex:1;overflow-wrap:anywhere}.listrow button{color:#b02638;font-size:13px}#toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);background:#102b3d;color:white;max-width:90vw;padding:12px 18px;border-radius:8px;font-size:14px;pointer-events:none;opacity:0;transition:opacity .15s;z-index:10}#toast.visible{opacity:1}.pass{color:#126340}.fail{color:#ac2839}@media(max-width:1050px){main{grid-template-columns:1fr;padding:12px}aside{width:100%}.actions{flex-direction:row}.actions button{flex:1}#result{padding-top:12px}}@media(max-width:600px){header{height:60px;padding:0 14px;gap:12px}.brand{font-size:17px}.topic{display:none}main{padding:8px;gap:10px}.topline{padding:16px 12px;align-items:flex-start}h1{font-size:18px}.topline p{font-size:13px}.topline .primary{white-space:nowrap;font-size:14px;padding:8px 10px}.tools{padding:8px;gap:6px}.tools select{max-width:170px}.tools button{font-size:14px;padding:7px 9px}.tools .toggle{font-size:13px}#boardWrap{height:51vh;min-height:360px}.bottomrow{padding:8px;font-size:12px;gap:6px}.bottomrow button{font-size:12px;padding:6px 8px}#saveStatus{font-size:11px}.picker{padding:8px;gap:6px}.picker select{font-size:13px;max-width:170px}.picker label{font-size:12px}.mapping-note{font-size:12px}aside{padding:16px}.tools label{font-size:13px}}
/* Practical board revision: terminals stay red in both wire-color modes. */
.tray-outer{stroke:#aab7bf;stroke-width:38;fill:none;stroke-linecap:square}.tray-inner{stroke:#d7dfe4;stroke-width:30;fill:none;stroke-linecap:square}.terminal .dot{fill:#e32232;stroke:#fff;stroke-width:1.8}.terminal.selected .dot{fill:#a9001b;stroke:#ffd400;stroke-width:3}.terminal.highlight .dot{fill:#ed2333;stroke:#ffb000;stroke-width:3}.terminal text{font-size:10px;font-weight:750;fill:#152f42;paint-order:stroke;stroke:#fff;stroke-width:3px;stroke-linejoin:round;pointer-events:none}.wire{stroke-width:2.8;fill:none;stroke-linejoin:miter;stroke-linecap:butt;opacity:.94;pointer-events:none}.wire.bad{stroke-dasharray:7 4;stroke-width:4;filter:drop-shadow(0 0 2px #d10b24)}.wire.duplicate{stroke-dasharray:2 4}.legend i{background:#e32232}.wirekey{background:linear-gradient(90deg,#0056bc,#d52f9a,#f5b100,#009e73)}#colorMode[aria-pressed=true]{background:#ffd400;color:#263038;border-color:#c6a600}#partsLayer{pointer-events:none}.mapping-note{font-size:12px;line-height:1.65}#boardWrap{background:#edf1f3}#board{min-height:440px}@media(max-width:600px){#board{min-height:390px}.tools{gap:7px}.tools button{min-height:42px}.topline h1{font-size:21px}.topline p{font-size:12px}}

.terminal[data-id^="MC"] text{font-size:8px}

.prewired{fill:none;stroke:#14191e;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;pointer-events:none}.tray-outer{stroke-width:54}.tray-inner{stroke-width:46}.terminal[data-id^="TB"] text{font-size:9px}#prewiredCount{color:#152d3e;font-size:12px}#fixedLayer{pointer-events:none}

.wire{pointer-events:stroke;cursor:pointer}.wire.selected-wire{stroke-width:6;filter:drop-shadow(0 0 2px #fff)}#deleteWire{background:#b72032;color:white;border-color:#b72032}#notes[aria-pressed=true]{background:#782093;color:white;border-color:#782093}#noteLayer{pointer-events:none}#noteText{display:block;width:100%;font:inherit;padding:12px;border:1px solid #a9bac6;border-radius:8px;margin:12px 0;box-sizing:border-box}#noteOptions[hidden],button[hidden]{display:none!important}#selection{gap:8px;flex-wrap:wrap}#selectedText{flex:1;min-width:170px}#noteOptions{display:flex;align-items:center;gap:6px}.wire:focus{outline:none;filter:drop-shadow(0 0 3px #f1c800)}

.wire.muted-wire{opacity:.15}.wire.selected-wire{stroke-width:4!important;opacity:1}.wire.bad{stroke-width:3!important}

.modebar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px 16px;background:#eff6f9;border-top:1px solid #d8e1e8}.modebar button[aria-pressed=true]{background:#076d76;color:white;border-color:#076d76}#examClock{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:14px}#examClock[hidden]{display:none}#elapsed{font-variant-numeric:tabular-nums;font-size:23px;font-weight:700;color:#123c55}#circuitDialog{width:1100px;max-width:96vw;max-height:94vh;padding:16px}.wire.selected-wire{stroke-width:3!important}

main{grid-template-columns:minmax(0,1fr) clamp(360px,30vw,520px)}.clock-help{font-size:14px;color:#415c6d}.circuit-panel{border-top:1px solid #dbe4ea;padding-top:18px;margin-top:6px}.circuit-panel h2{margin-bottom:10px}.circuit-preview{display:block;width:100%;padding:0;border:0;border-radius:0;background:white}.circuit-preview img{display:block;width:100%;height:auto}.circuit-preview span{display:block;padding:8px;font-size:14px;color:#456b7d}.circuit-preview:hover{background:#f0f7f9}#toast.error-notice{font-size:clamp(20px,2vw,25px);font-weight:700;line-height:1.55;max-width:min(850px,94vw);width:max-content;padding:20px 24px;background:#8f1426;border:2px solid #ffd3da;box-shadow:0 8px 30px #102b3d55;bottom:30px}.terminal[data-id^="MC"] text{font-size:9px}@media(max-width:1050px){main{grid-template-columns:1fr}.circuit-panel{max-width:900px;margin-inline:auto}}

/* Compact mobile controls and clear selected terminal. */
.tools[hidden]{display:none!important}.topline{align-items:flex-start}.topline>div{min-width:0;flex:1}.topline h1{margin-bottom:10px}.modebar{padding:0;border:0;background:transparent;gap:6px}.modebar button{font-size:14px;padding:6px 9px;min-height:40px}.mc-name{font-size:15px;font-weight:800;fill:#152f42;paint-order:stroke;stroke:white;stroke-width:3px;pointer-events:none}.terminal.selected .dot{fill:#ffd400;stroke:#704d00;stroke-width:2.5}.terminal.selected.highlight .dot{fill:#ffd400}.terminal[data-id^="MC"] text{font-size:8px}#examClock{width:100%}@media(max-width:600px){.topline{padding:12px 10px;gap:7px}.topline h1{font-size:18px}.modebar button{font-size:13px;min-height:36px;padding:5px 7px}.topline .primary{font-size:13px;padding:8px;min-height:42px}#boardWrap{height:60vh}}

/* Larger trays, readable conductors and phase names on the white MC body. */
.tray-outer{stroke-width:70}.tray-inner{stroke-width:62}.mc-name{font-size:18px;fill:#143747;stroke:none;font-weight:800}.wire.selected-wire{stroke-width:4.5!important}.wire.bad{stroke-width:4!important}#resetView{position:absolute;top:10px;right:10px;background:#fffffff2;box-shadow:0 2px 8px #102b3d20;font-size:14px;padding:6px 10px;min-height:38px}

/* Shorter wiring viewport brings the lower controls into reach. */
#boardWrap{height:min(56vh,640px);min-height:340px}#board{min-height:0;height:100%}@media(max-width:600px){#boardWrap{height:44vh;height:44svh;min-height:300px;max-height:460px}#board{min-height:0}.bottomrow{flex-wrap:wrap}.bottomrow #showList{margin-left:auto}}

.simbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:9px 16px;background:#f8fbfc;border-bottom:1px solid #d0dce2;font-size:14px}.simbar button{font-size:13px;padding:7px 10px;min-height:36px}.simbar #simStatus{font-weight:750;color:#126674}.simbar .sim-fault{color:#a51d34!important}.ac-flow-note{color:#556c7c;font-size:12px;margin-right:auto}.sim-tr{display:flex;align-items:center;gap:6px;white-space:nowrap}.sim-tr select{font:14px sans-serif;padding:5px;background:white;border:1px solid #90a4b3;border-radius:4px}.sim-button{cursor:pointer;touch-action:none;user-select:none;-webkit-user-select:none}.sim-button rect{fill:#00836b;stroke:#006450;stroke-width:2}.sim-button text{fill:white;font:700 13px sans-serif;pointer-events:none}.sim-button.stop rect{fill:#bf243b;stroke:#8c1a2c}.sim-button.nfb rect{fill:white;stroke:#375468}.sim-button.nfb text{fill:#283c49;font-size:12px}.sim-button.nfb[aria-pressed=true] rect{fill:#006e77}.sim-button.nfb[aria-pressed=true] text{fill:white}.sim-button.trip rect{fill:#fff1da;stroke:#b48b41}.sim-button.trip text{fill:#70440c}.sim-button.trip[aria-pressed=true] rect{fill:#a52135}.sim-button.trip[aria-pressed=true] text{fill:white}.sim-button.start[aria-pressed=true] rect,.sim-button.stop[aria-pressed=true] rect{fill:#163f45}.sim-button:focus-visible rect{stroke:#ffbd35;stroke-width:4}.sim-motor-state{font:700 18px sans-serif;paint-order:stroke;stroke:#edf1f3;stroke-width:3px;pointer-events:none}.sim-output-text{font:700 28px sans-serif;paint-order:stroke;stroke:#fff;stroke-width:3px;stroke-linejoin:round}.sim-device-state{font:700 13px sans-serif;fill:#105562;paint-order:stroke;stroke:#edf1f3;stroke-width:3px;pointer-events:none}.sim-flow-track{fill:none;stroke-width:4;opacity:.17;pointer-events:none}.sim-flow-dot{stroke:#fff;stroke-width:1;filter:drop-shadow(0 0 3px #ffe66a);pointer-events:none}.sim-lamp-glow{filter:drop-shadow(0 0 7px currentColor)}#simControls button:focus-visible{outline:3px solid #ffbd35;outline-offset:-4px}@media(max-width:600px){.simbar{padding:7px 10px;gap:6px}.simbar .ac-flow-note{order:4;width:100%}}

/* Native page zoom stays available outside the board, which owns its pinch and drag. */
html{touch-action:auto}#board{touch-action:none}.tools .simbar{flex-basis:100%;width:100%;padding:8px 0 0;border-bottom:0;border-top:1px solid #d0dce2;background:transparent}.tools .simbar .ac-flow-note{order:4;width:100%}

#circuitDialog{width:min(1200px,96vw);max-width:96vw}.circuit-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0}.circuit-tools span{font-size:14px;color:#526b79}#circuitViewer{display:block;width:100%;height:60vh;height:60svh;min-height:240px;max-height:660px;background:#fff;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab;border:1px solid #d6e0e7}

header #reportBug{margin-left:auto}header #helpBtn{margin-left:0}#bugDialog{width:min(600px,94vw)}#bugForm label{display:block;font-size:16px;font-weight:600;margin-bottom:14px}#bugForm textarea{display:block;width:100%;font:inherit;font-weight:400;margin-top:6px;padding:10px;border:1px solid #afc2ce;border-radius:8px;resize:vertical}#bugResult{font-size:16px;overflow-wrap:anywhere}#bugResult.error{color:#a21c31}#bugResult.success{color:#11684d}.bug-info{color:#526b79}@media(max-width:600px){header{gap:8px}header #reportBug,header #helpBtn{padding:6px 8px;font-size:13px}}

.terminal text{stroke-width:2px;letter-spacing:0;font-family:Arial,"Noto Sans TC",sans-serif}

#questionNav{display:flex;gap:6px;overflow-x:auto;flex-shrink:0}#questionNav a{padding:8px 11px;border:1px solid #748b99;border-radius:5px;color:#e9f6fc;text-decoration:none;font-size:16px;font-weight:700}#questionNav a[aria-current]{background:#bfe8e6;color:#102b3d;border-color:#bfe8e6}@media(max-width:780px){header{flex-wrap:wrap;gap:10px}#questionNav{order:5;width:100%;flex-shrink:1}.topic{display:none}}

.question-scope{padding:12px 18px;margin:0;background:#f4f8fa;color:#3d5969;font-size:14px}.simbar[hidden]{display:none!important}


#boardRecovery{display:none;position:fixed;z-index:40;transform-origin:top left;background:#ffffffed;padding:5px;border:1px solid #aabac5;border-radius:9px;box-shadow:0 2px 10px #17314230;gap:5px}#boardRecovery[hidden]{display:none!important}#boardRecovery button{font-size:14px;min-height:40px;padding:6px 10px;touch-action:manipulation}@media(max-width:700px){#boardRecovery{display:flex}}

/* Keep every question link inside the header, including narrow phone screens. */
header{height:auto;min-height:70px;display:grid;grid-template-columns:1fr auto auto;gap:10px;padding:52px 14px 12px;align-items:center}
header .brand{grid-column:1;grid-row:1;white-space:nowrap}header .topic{display:none}#reportBug{grid-column:2;grid-row:1}#helpBtn{grid-column:3;grid-row:1}header .subtle{margin:0;font-size:14px;padding:6px 10px;min-height:38px}
#questionNav{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));width:100%;max-width:640px;gap:6px;overflow:visible;justify-self:center}
#questionNav a{display:flex;align-items:center;justify-content:center;padding:5px 6px;min-height:32px;font-size:14px;line-height:20px}
#boardRecovery{display:flex;transform-origin:top right;padding:3px;gap:3px;border-radius:7px}#boardRecovery button{font-size:13px;padding:5px 9px;min-height:36px}
@media(max-width:600px){header{padding:48px 10px 10px;gap:8px}.brand{font-size:17px}header .subtle{font-size:13px;padding:5px 8px;min-height:36px}#questionNav{grid-template-columns:repeat(4,minmax(0,1fr));max-width:none;gap:5px}#questionNav a{font-size:14px;min-height:30px;padding:4px 6px}}

/* Q3 full-board operation: use the available width and keep device controls legible. */
body.q3-overview main{max-width:none;padding:12px;gap:12px;grid-template-columns:minmax(0,1fr) 320px}
body.q3-overview header{padding:10px 18px;grid-template-columns:auto minmax(240px,640px) 1fr auto auto;min-height:60px}
body.q3-overview #questionNav{grid-column:2;grid-row:1;max-width:640px}
body.q3-overview #reportBug{grid-column:4}body.q3-overview #helpBtn{grid-column:5}
body.q3-overview .topline{padding:12px 16px}body.q3-overview h1{font-size:20px;margin-bottom:5px}
body.q3-overview .modebar{padding:0;background:transparent;border:0}
body.q3-overview #selection{min-height:42px;padding:6px 16px}
body.q3-overview #boardWrap{height:calc(100svh - 180px);min-height:600px;max-height:940px}
body.q3-overview #board{min-height:0}
body.q3-overview #simControls .sim-button text{font-size:44px;font-weight:700}
body.q3-overview #simControls .sim-button rect{stroke-width:3}
body.q3-overview #simOutputs text{font-family:Arial,"Microsoft JhengHei",sans-serif}
body.q3-overview .bottomrow{padding:7px 14px}
body.q3-overview #result{padding-top:12px}
@media(max-width:1250px){body.q3-overview main{grid-template-columns:1fr}body.q3-overview aside{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}body.q3-overview aside .panel-head{grid-column:1}body.q3-overview #result{grid-column:1;grid-row:2}body.q3-overview .circuit-panel{grid-column:2;grid-row:1/4;margin:0}body.q3-overview #boardWrap{height:calc(100svh - 180px)}}
@media(max-width:700px){body.q3-overview header{padding:48px 10px 10px;grid-template-columns:1fr auto auto}body.q3-overview #questionNav{grid-column:1/-1;grid-row:2}body.q3-overview #reportBug{grid-column:2}body.q3-overview #helpBtn{grid-column:3}body.q3-overview main{padding:8px}body.q3-overview .topline{padding:10px}body.q3-overview #boardWrap{height:60svh;min-height:360px}body.q3-overview aside{display:block}}

.tools .wiring-summary{display:flex;flex-basis:100%;flex-wrap:wrap;align-items:center;gap:8px 16px;font-size:14px;color:#526875;padding-top:6px}
.tools .wiring-summary #prewiredCount,.tools .wiring-summary #saveStatus{font-size:14px}

/* Device feedback stays in document flow, outside the zoomable wiring diagram. */
.sim-start-notice{padding:12px 16px;background:#fff0f2;color:#a21e32;border-bottom:1px solid #efc8cf;font-size:18px;font-weight:700;line-height:1.55;overflow-wrap:anywhere}
.sim-start-notice[hidden]{display:none!important}

.q5-palette{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:12px 16px;background:#eef7f7;border-top:1px solid #cadddd}.q5-palette button{min-height:44px}.q5-palette button[aria-pressed="true"]{background:#d0edef;outline:2px solid #087680}.q5-settings{display:flex;flex-wrap:wrap;gap:14px;padding-top:12px}.q5-settings label{font-size:16px}.q5-settings input{padding:8px;border:1px solid #9cabb3;border-radius:6px}

/* First-question mobile interface. */

.mobile-device-dialog{box-sizing:border-box;position:fixed;inset:0;margin:0;width:100vw;max-width:none;height:100dvh;max-height:none;border:0;border-radius:0;padding:calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));background:#edf1f3;color:#153746;overflow:hidden;touch-action:none;overscroll-behavior:contain}
.mobile-device-dialog[open]{display:grid;grid-template-columns:1fr auto;grid-template-rows:auto auto minmax(0,1fr);gap:8px}
.mobile-device-dialog::backdrop{background:#edf1f3}
.mobile-device-dialog h2{font-size:26px;margin:0;align-self:center;text-align:left}
.mobile-close{min-height:44px;padding:8px 14px;font-size:16px}
.mobile-sheet-status{grid-column:1/-1;font-size:15px;line-height:1.4;margin:0;min-height:21px;color:#42626d}
.mobile-part-figure{display:block;grid-column:1/-1;width:100%;height:100%;min-height:0;overflow:hidden;touch-action:none}
.mobile-part-art{pointer-events:none}.mobile-part-art text{display:none}.mobile-part-art text.mobile-contact-mark{display:inline}
.mobile-terminal-label{font-family:Arial,"Microsoft JhengHei",sans-serif;font-weight:700;fill:#163746;paint-order:stroke;stroke:#edf1f3;stroke-width:3;stroke-linejoin:round;pointer-events:none}
.mobile-dot{cursor:pointer;touch-action:manipulation}.mobile-dot:focus{outline:none}.mobile-dot:focus circle:last-child{stroke:#00786b;stroke-width:3}
#mobileDeviceLayer rect:focus{outline:none;stroke:#00897b;stroke-width:3}

/* Connected terminals remain visible in the overview and apparatus close-up. */
.terminal.connected .dot{fill:#ffd400;stroke:#775500;stroke-width:2}
body.q1-interface .terminal.selected .dot{fill:#008c7c;stroke:white;stroke-width:2.5}
.terminal.connected.highlight .dot{stroke:#b41e37;stroke-width:3}
.legend i.connected-key{background:#ffd400;border-color:#775500}
.mobile-pin-dialog{box-sizing:border-box;width:min(420px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:22px;border-radius:18px;overflow:auto;box-shadow:0 16px 60px #102b3d40}
.mobile-pin-dialog::backdrop{background:#102b3d88}
.mobile-pin-dialog h2{font-size:22px;margin:0 0 10px;overflow-wrap:anywhere}
.mobile-pin-dialog p{font-size:16px;line-height:1.6;margin:0 0 16px}
.mobile-pin-dialog button{display:block;width:100%;min-height:50px;margin-top:10px;font-size:17px;line-height:1.4;padding:12px;white-space:normal;overflow-wrap:anywhere;touch-action:manipulation}
.mobile-pin-dialog .mobile-remove-wire{color:#a91930;border-color:#d69ba4;background:#fff5f6}
.mobile-pin-dialog button:disabled{opacity:.5;cursor:not-allowed}
.pin-connections{margin:0 0 16px;padding:12px;border:1px solid #bed5d8;border-radius:10px;background:#f3faf9;overflow-wrap:anywhere}
.pin-connections h3{margin:0 0 10px;font-size:16px;color:#173e46}
.pin-connections-list{margin:0;padding-left:24px}
.pin-connections-list li{padding:0 0 10px 3px;line-height:1.5}
.pin-connections-list li:last-child{padding-bottom:0}
.pin-connections-list strong,.pin-connections-list small,.pin-connection-source{display:block}
.pin-connections-list strong{font-size:16px;color:#163746}
.pin-connection-source,.pin-connections-list small{font-size:13px;color:#4b626a}
.mobile-pin-dialog .pin-connections-note{margin:10px 0 0;font-size:12px;line-height:1.5;color:#52666d}
.mobile-pin-dialog .pin-connections-empty{margin:0;font-size:15px}


/* Simulation controls stay readable above the board at every zoom level. */
#selection.mobile-control-bar{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:6px;padding:7px;min-height:0;align-items:center}
#selection .mobile-control{width:auto;min-width:0;min-height:40px;font-size:14px;line-height:1.3;padding:6px 9px;touch-action:manipulation;border-radius:8px}
#selection .start-control{background:#008371;border-color:#006555;color:white}
#selection .stop-control{background:#b91e3c;border-color:#991731;color:white}
#selection .nfb-control[aria-pressed=true]{background:#086d76;border-color:#06565e;color:white}
#selection .trip-control{background:#fff6df;border-color:#c7a159;color:#74531b}
#selection .trip-control[aria-pressed=true]{background:#b56713;border-color:#894b09;color:white}
#selection .start-control[aria-pressed=true],#selection .stop-control[aria-pressed=true]{box-shadow:inset 0 0 0 3px #ffd400;filter:brightness(.86)}
body[data-interface="mobile"] #simControls{display:none}
.wiring-selection-tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px;width:100%;font-size:14px}
.wiring-selection-tools #selectedText{flex:1;min-width:180px}
@media(max-width:600px){#selection .mobile-control{font-size:13px;min-height:36px;padding:5px 7px}}

/* Readable feedback when the complete board is fitted on a phone. */
body.q1-interface #simOutputs .sim-motor-state{font-size:40px;font-weight:800;stroke-width:4px}
body.q1-interface #simOutputs .sim-motor-direction{font-size:30px;font-weight:750;fill:#087461;paint-order:stroke;stroke:#edf1f3;stroke-width:4px;pointer-events:none}
body.q1-interface #simOutputs .sim-output-text{font-size:50px;font-weight:800;stroke-width:4px}

.interface-mode-switch{display:inline-flex;flex-wrap:nowrap;gap:4px}
.modebar .interface-mode-switch button[aria-pressed=true]{background:#008371;border-color:#006555;color:white}
#selection[hidden],#desktopSelection[hidden]{display:none!important}
#desktopSelection{padding:9px 18px;background:#e9f6f3;border-block:1px solid #cae3df;min-height:54px;font-size:14px;font-weight:600}
body[data-interface="desktop"] #mobileDeviceLayer{display:none}

/* Overview taps open the complete apparatus; selection colors belong to the close-up. */
body[data-interface="mobile"] #pointLayer .terminal .dot{fill:#d92843;stroke:white;stroke-width:1.7}

.legend .desktop-terminal-key{display:inline-flex;align-items:center;gap:7px}.legend .mobile-terminal-key{display:none}
body[data-interface="mobile"] .legend .desktop-terminal-key{display:none}
body[data-interface="mobile"] .legend .mobile-terminal-key{display:inline-flex;align-items:center;gap:7px}
body[data-interface="mobile"] .legend i{background:#d92843;border-color:white}

body[data-interface="mobile"] #boardRecovery{display:none!important}

/* The help dialog contains the slow, large-caption walkthrough only. */
#mobileHelp.gif-help{width:min(664px,calc(100vw - 20px));max-width:none;max-height:calc(100dvh - 20px);padding:10px;background:#edf3f6;overflow:hidden}
#mobileHelp.gif-help[open]{display:flex;flex-direction:column;gap:8px;align-items:center}
#mobileHelp .help-actions{display:flex;justify-content:flex-end;width:100%;flex-shrink:0}
#helpGuide{display:block;width:100%;height:auto;max-height:calc(100dvh - 98px);min-height:0;object-fit:contain;border-radius:6px}

.interface-mode-switch[hidden]{display:none!important}


/* Third-question mobile controls from the approved phone test. */
#selection .mode-control[aria-pressed=true],#selection .water-control[aria-pressed=true]{background:#008371;color:white;border-color:#006555}
body[data-interface="mobile"].q3-overview #selection{padding:7px;gap:6px;min-height:0}
@media(max-width:700px){body[data-interface="mobile"].q3-overview .mobile-control-bar .mobile-control{font-size:13px;min-height:36px;padding:5px 7px}}
.mobile-q3-feedback{flex-basis:100%;font-size:13px;line-height:1.7;color:#264959;font-weight:650;padding:2px 3px}

.tutorial-entry{margin:10px 16px;border:2px solid #087880;color:#075b64;background:#e9f8f3;font-weight:750}.tutorial-entry[hidden],.tutorial-banner[hidden]{display:none!important}.tutorial-banner{position:sticky;top:0;z-index:15;padding:14px 18px;background:#fff8d9;border-block:2px solid #d7a731;color:#563f0a}.tutorial-banner strong{font-size:19px}.tutorial-banner p{margin:6px 0}.tutorial-banner button{padding:6px 12px;min-height:36px;font-size:14px}#tutorialDialog{width:min(460px,calc(100vw - 32px));box-sizing:border-box;padding:24px;border-radius:18px}#tutorialDialog h2{font-size:25px;margin-top:0}#tutorialDialog p{line-height:1.7}#tutorialActions{display:grid;gap:10px}#tutorialActions button{white-space:normal}#tutorialActions button:first-child{background:#087880;color:white;border-color:#087880}.terminal.tutorial-target .dot,.mobile-dot.tutorial-target circle:last-child{fill:#ffd600!important;stroke:#b57a00!important;stroke-width:4!important;animation:tutorial-pin-blink 1.2s ease-in-out infinite;filter:drop-shadow(0 0 6px #ffcf00)}.tutorial-device{stroke:#ffca00;stroke-width:6;vector-effect:non-scaling-stroke;stroke-dasharray:none;animation:tutorial-frame-blink 1.2s ease-in-out infinite;filter:drop-shadow(0 0 4px #d89a00)}.mobile-sheet-status{color:#8a250a;font-weight:700}

@keyframes tutorial-pin-blink{0%,100%{opacity:1}50%{opacity:.3}}
@keyframes tutorial-frame-blink{0%,100%{stroke-opacity:1}50%{stroke-opacity:.18}}
@media(prefers-reduced-motion:reduce){.terminal.tutorial-target .dot,.mobile-dot.tutorial-target circle:last-child,.tutorial-device{animation:none}}

/* Beginner flow: controls occupy their own row and never cover page actions. */
#boardRecovery{position:static;transform:none!important;display:flex;justify-content:flex-end;border:0;border-top:1px solid #d8e1e8;border-radius:0;box-shadow:none;background:#f7fafb;padding:6px 12px;gap:6px}
#boardRecovery button{min-height:40px}
#badge.pending,.metrics .pending{color:#765b18;background:#fff8e3}
#desktopSelection .wiring-selection-tools{gap:8px}
#selectedText{line-height:1.5;overflow-wrap:anywhere}
body[data-interface="mobile"] .work{overflow:clip}
body[data-interface="mobile"] #desktopSelection{position:sticky;top:0;z-index:16;padding:8px 10px;min-height:0;box-shadow:0 2px 5px #17314218}
body[data-interface="mobile"] #desktopSelection[data-has-selection="true"]{background:#fff5ce;border-color:#e3bd55}
body[data-interface="mobile"] #desktopSelection #cancel{min-height:42px;flex-shrink:0}
body[data-interface="mobile"] .tutorial-banner{position:static}
@media(max-width:600px){.wiring-selection-tools #selectedText{min-width:180px;font-size:13px}.tutorial-banner strong{font-size:16px}.tutorial-banner{padding:10px 12px}}

/* Q5 phone operation uses the existing circuit and one shared settings form. */
#selection.q5-mobile-controls .mobile-control{min-height:44px;font-size:14px;padding:8px 10px}
#selection .q5-settings{width:100%;padding:3px 4px;gap:8px 12px;align-items:center}
#selection .q5-settings label{display:flex;align-items:center;gap:6px;font-size:13px}
.q5-settings input{font:inherit;min-height:44px;max-width:90px}
.q5-settings small{display:block;width:100%;font-size:12px;color:#536b78;font-weight:400}
.q5-counter-readout{box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto auto;gap:2px 16px;width:100%;padding:10px 16px;border:2px solid #263e46;border-radius:12px;background:#bbceaa;color:#193629;font-variant-numeric:tabular-nums}
.q5-counter-readout[hidden]{display:none!important}
.q5-counter-readout span{font-size:13px;grid-row:1;align-self:end}
.q5-counter-readout strong{font-family:monospace;font-size:40px;line-height:1.1;letter-spacing:1px;grid-row:2;white-space:nowrap}
.q5-counter-readout strong:last-child{font-size:28px;align-self:center}
.mobile-device-dialog[data-counter-readout="true"]{grid-template-rows:auto auto auto minmax(0,1fr)}
.mobile-device-dialog .q5-counter-readout{grid-column:1/-1;grid-row:3;max-width:560px;justify-self:center}
.mobile-device-dialog[data-counter-readout="true"] .mobile-part-figure{grid-row:4}

.mobile-bank-nav{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px;justify-content:center}
.mobile-bank-nav[hidden]{display:none!important}
.mobile-bank-nav button{min-height:44px;flex:1;min-width:70px;padding:8px 5px;font-size:15px}
.mobile-bank-nav button[aria-pressed="true"]{background:#087880;color:white;border-color:#087880}

/* Q6: the main/PE helper stays with the wiring tools, not between timers. */
.q6-complete-power{background:#e1f5ef;border-color:#078477;color:#07584f;min-height:44px}.q6-large-terminals .terminal .dot{stroke-width:2.2}.q6-large-terminals .terminal-hit{pointer-events:all}

/* Q6 phone controls are a separate readable work area, not a reduced desktop. */
#selection.q6-mobile-controls{display:flex;gap:8px;padding:10px;align-items:stretch}
#selection.q6-mobile-controls .mobile-control{min-height:44px;font-size:14px;padding:8px;white-space:normal;flex:1}
.q6-power-controls,.q6-door-controls,.q6-limit-controls{display:flex;gap:7px;width:100%}
.q6-phone-door{width:100%;border:1px solid #b9ccd6;border-radius:12px;background:#f8fcff;overflow:hidden}
.q6-phone-door summary,.q6-mobile-advanced summary{cursor:pointer;padding:11px 10px;font-size:15px;font-weight:750;min-height:44px;box-sizing:border-box}
.q6-mobile-status{float:right;font-size:14px;color:#126b6b;max-width:70%;text-align:right;overflow-wrap:anywhere}
.q6-mobile-status[data-warning="true"]{color:#b5263e}
.q6-mobile-lamps{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:0 9px 6px}
.q6-mobile-lamp{display:flex;align-items:center;gap:6px;padding:6px;border-radius:7px;background:#edf3f6;font-size:13px;color:#476373}
.q6-mobile-lamp i{width:12px;height:12px;border-radius:50%;background:#b9c5cc;flex-shrink:0;border:1px solid #8ca2ae}
.q6-mobile-lamp>span:last-child{margin-left:auto;font-weight:750}
.q6-mobile-lamp[data-lit="true"]{background:#fff2cf;color:#6c5000}.q6-mobile-lamp[data-lit="true"] i{background:#edb931;border-color:#936500}
.q6-mobile-lamp[data-color="R"][data-lit="true"]{background:#ffe6e9;color:#a21e32}.q6-mobile-lamp[data-color="R"][data-lit="true"] i{background:#df3f4b;border-color:#8e2337}
#mobileQ6Door{display:block;width:100%;max-height:220px;background:#f8fcff}
.q6-door-controls{padding:4px 9px;box-sizing:border-box}
.q6-mobile-help{margin:5px 8px 9px;text-align:center;font-size:12px;color:#597481}
.q6-mobile-advanced{width:100%;border:1px solid #c8d5dc;border-radius:9px;background:#f2f6f8}
.q6-limit-controls{flex-wrap:wrap;padding:0 8px 8px;box-sizing:border-box}.q6-limit-controls button:last-child{flex-basis:100%!important}
#selection .q6-settings{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:0 8px 10px;width:100%;box-sizing:border-box}
#selection .q6-settings label{display:flex;flex-wrap:wrap;align-items:center;gap:5px;font-size:13px}
#selection .q6-settings input{min-height:44px;box-sizing:border-box;font-size:16px;min-width:65px}
#selection .q6-settings small{grid-column:1/-1;line-height:1.5;font-size:12px;color:#597481}
.q6-circuit-shortcut{min-height:44px;font-size:14px;width:100%;background:#e5f2f3;border-color:#90bec2;color:#075e65}
#selection .sensor-control[aria-pressed="true"]{background:#fff0c2;border-color:#be9424;color:#6d4d00}
body[data-interface="mobile"].q6-large-terminals #board [data-output="Q6_DOOR_DIAGRAM"],body[data-interface="mobile"].q6-large-terminals #board [data-output="Q6_DOOR_CONTROL_PANEL"]{visibility:hidden}
body[data-interface="mobile"].q6-large-terminals .mobile-device-dialog h2{font-size:22px}
@media(max-width:380px){.q6-mobile-lamp{font-size:12px;gap:4px}.q6-mobile-status{font-size:13px}}

/* Repair feedback is an ordinary reserved row, never an overlay on terminals. */
#toast,#toast.error-notice{position:static;inset:auto;transform:none;display:flex;align-items:flex-start;gap:10px;width:auto;max-width:none;min-height:44px;max-height:140px;margin:0;padding:8px 12px;border:0;border-block:1px solid #d5e1e7;border-radius:0;background:#eff6f9;box-shadow:none;color:#173142;font-size:14px;font-weight:600;line-height:1.5;overflow:auto;overflow-wrap:anywhere;opacity:0;visibility:hidden;pointer-events:none;z-index:auto}
#toast.visible{opacity:1;visibility:visible;pointer-events:auto}
#toast.error-notice{background:#fff0f2;color:#94182c;border-color:#e9b8c1}
#toast:not(.visible) #toastText{display:none}
#toastText{flex:1;min-width:0;padding:3px 0}
#toastDismiss{flex:none;min-height:36px;padding:5px 10px;font-size:13px}
#primaryTools{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:6px 12px;background:#f7fafb;border-top:1px solid #d8e1e8}
#primaryTools button{min-height:40px;padding:6px 10px;font-size:14px}

/* A compact Q1 desktop frame fits the whole initial board, including TB/PE. */
body.q1-interface header{min-height:60px;padding:10px 14px;grid-template-columns:auto minmax(240px,640px) 1fr auto auto}
body.q1-interface #questionNav{grid-column:2;grid-row:1;max-width:640px}
body.q1-interface #reportBug{grid-column:4}
body.q1-interface #helpBtn{grid-column:5}
body.q1-interface main{padding:12px;gap:12px;grid-template-columns:minmax(0,1fr) 320px}
body.q1-interface .topline{padding:12px 14px;gap:10px}
body.q1-interface .topline h1{font-size:20px;margin-bottom:7px}
body.q1-interface #desktopSelection{padding:7px 12px;min-height:42px}
body.q1-interface .tutorial-entry{align-self:flex-start;margin:6px 12px;min-height:40px;padding:6px 10px;font-size:14px}
@media(min-width:1051px) and (min-height:650px){
 body.q1-interface[data-interface="desktop"] .work{height:calc(100svh - 84px);display:flex;flex-direction:column;min-height:0}
 body.q1-interface[data-interface="desktop"] .work>*{flex-shrink:0}
 body.q1-interface[data-interface="desktop"] #boardWrap{flex:1 1 auto;height:auto;min-height:220px;max-height:none}
 body.q1-interface[data-interface="desktop"] .work:has(#extraTools:not([hidden])){height:auto}
 body.q1-interface[data-interface="desktop"] .work:has(#extraTools:not([hidden])) #boardWrap{height:56svh;flex:none}
}
@media(max-width:1050px){
 body.q1-interface main{grid-template-columns:1fr}
 body.q1-interface header{grid-template-columns:1fr auto auto}
 body.q1-interface #questionNav{grid-column:1/-1;grid-row:2}
 body.q1-interface #reportBug{grid-column:2}
 body.q1-interface #helpBtn{grid-column:3}
}
@media(max-width:600px){
 body.q1-interface header{padding:10px;gap:8px}
 body.q1-interface main{padding:8px}
 body.q1-interface .topline{padding:10px;gap:8px}
 body.q1-interface .topline h1{font-size:18px}
 #primaryTools{padding:6px 8px}
 #primaryTools button{font-size:13px}
 #toast,#toast.error-notice{padding:6px 8px;font-size:13px;max-height:150px}
}

/* Close-ups retain physical geometry at a minimum usable scale. Dense devices
   scroll within this stage; the heading, status, banks and close button stay put. */
.mobile-device-dialog{touch-action:pan-x pan-y}
.mobile-device-dialog[open]{grid-template-columns:minmax(0,1fr) auto}
.mobile-device-dialog h2{min-width:0;font-size:22px;overflow-wrap:anywhere}
.mobile-sheet-status{min-width:0;overflow-wrap:anywhere;font-size:14px}
.mobile-device-stage{grid-column:1/-1;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y;scrollbar-gutter:stable;border:1px solid #c4d2d9;border-radius:8px;background:#edf1f3}
.mobile-part-figure{grid-column:auto;display:block;max-width:none;max-height:none;margin-inline:auto;touch-action:pan-x pan-y;overflow:hidden}
.mobile-device-dialog[data-counter-readout="true"] .mobile-device-stage{grid-row:4}
#mobileDeviceLayer .chassis-device-target{fill:#007c7110;stroke:#007c71;stroke-width:2;stroke-dasharray:5 3;vector-effect:non-scaling-stroke}

/* Q1 review: the legend has its own row, never covers the apparatus. */
body.mobile-fit-interface .legend{position:static;flex-shrink:0;margin:0;padding:5px 12px;border-radius:0;min-height:26px;background:#f7fafb;flex-wrap:wrap}
/* Wrapped side labels fit the full contactor at its accessible scale. Preserve
   image/terminal positions; reserve the scrollbar gutter before sizing the SVG. */
.mobile-device-dialog[data-question="1"][data-device^="MC"] .mobile-device-stage{scrollbar-gutter:stable}
@media(orientation:landscape) and (max-height:600px){
 body.mobile-fit-interface[data-interface="mobile"] #desktopSelection{position:static;box-shadow:none;padding:4px 8px;min-height:0}
 body.mobile-fit-interface:not(.q1-interface)[data-interface="mobile"] #desktopSelection:not([data-has-selection="true"]){display:none}
 body.mobile-fit-interface[data-interface="mobile"] .tutorial-banner{position:static;padding:4px 8px}
 body.mobile-fit-interface[data-interface="mobile"] #boardWrap{height:calc(100dvh - 104px);min-height:0;max-height:none;scroll-margin-top:0}
 body.mobile-fit-interface[data-interface="mobile"] #board{min-height:0}
 /* A reserved bottom notification band leaves the full fitted board above it.
    A connection returns the overview to its top, rather than centering it under
    an offscreen static alert or sticky selection banner. */
 body.mobile-fit-interface[data-interface="mobile"] #toast,
 body.mobile-fit-interface[data-interface="mobile"] #toast.error-notice{position:fixed;top:auto;bottom:0;left:0;right:0;width:100%;max-height:96px;min-height:44px;z-index:30;margin:0;padding:6px 12px;box-shadow:0 -2px 8px #17314220}
 body.mobile-fit-interface[data-interface="mobile"] #toast:not(.visible){display:none}
}
/* Q1 contactors: reclaim the side padding so even a native scrollbar leaves
   enough width for the 44px-target drawing at narrow portrait sizes. */
.mobile-device-dialog[data-question="1"][data-device^="MC"]{padding-left:max(4px,env(safe-area-inset-left));padding-right:max(4px,env(safe-area-inset-right))}

/* Existing mobile contactors share the narrow portrait frame; Q6 banks remain unchanged. */
.mobile-device-dialog[data-question="3"][data-device^="MS"],
.mobile-device-dialog[data-question="4"][data-device^="MS"],
.mobile-device-dialog[data-question="5"][data-device^="MC"]{padding-left:max(4px,env(safe-area-inset-left));padding-right:max(4px,env(safe-area-inset-right))}

/* Q2/7/8 phone controls remain separate from the apparatus and use one simulator. */
#selection.q2-mobile-controls,#selection.q7-mobile-controls,#selection.q8-mobile-controls{display:flex;flex-wrap:wrap;align-items:stretch;gap:8px;padding:10px}
#selection:is(.q2-mobile-controls,.q7-mobile-controls,.q8-mobile-controls) .mobile-control{min-height:44px;flex:1 1 125px;white-space:normal;font-size:14px;padding:8px}
.q278-mobile-advanced,.q2-mobile-advanced,.q7-mobile-advanced,.q8-mobile-advanced{width:100%;border:1px solid #c8d5dc;border-radius:9px;background:#f2f6f8}
.q278-mobile-advanced summary,.q2-mobile-advanced summary,.q7-mobile-advanced summary,.q8-mobile-advanced summary{min-height:44px;padding:11px 10px;font-size:15px;cursor:pointer}
#selection :is(.q2-settings,.q7-settings,.q8-settings){display:flex;flex-wrap:wrap;gap:8px;padding:8px;width:100%}
#selection :is(.q2-settings,.q7-settings,.q8-settings) label{display:flex;flex-wrap:wrap;gap:6px;align-items:center;font-size:14px}
#selection :is(.q2-settings,.q7-settings,.q8-settings) input{min-height:44px;font-size:16px}

/* Q1 mobile full tutorial: real controls stay visible and remain tappable. */
body.q1-interface[data-interface="mobile"] .tutorial-control-target{outline:4px solid #f3b900;outline-offset:3px;box-shadow:0 0 0 7px #fff2a3;position:relative;z-index:19;scroll-margin-block:90px;animation:q1-tutorial-control-blink 1.2s ease-in-out infinite}
body.q1-interface[data-interface="mobile"] .q1-full-tutorial{border:2px solid #d7a731;border-radius:10px;margin:6px 8px;padding:9px 10px;background:#fff8d9;overflow-wrap:anywhere}
body.q1-interface[data-interface="mobile"] .q1-full-tutorial strong{font-size:15px;line-height:1.45}
body.q1-interface[data-interface="mobile"] .q1-full-tutorial p{font-size:13px;line-height:1.4;margin:5px 0}
body.q1-interface[data-interface="mobile"] #tutorialDialog{max-height:calc(100dvh - 24px);overflow-y:auto;padding:20px;overscroll-behavior:contain}
body.q1-interface[data-interface="mobile"] #tutorialDialog h2{font-size:21px;line-height:1.4}
body.q1-interface[data-interface="mobile"] #tutorialDialog p{font-size:16px;line-height:1.65;overflow-wrap:anywhere}
body.q1-interface[data-interface="mobile"] #tutorialActions button{min-height:46px;line-height:1.4}
@media(orientation:landscape) and (max-height:600px){
 body.q1-interface[data-interface="mobile"] #tutorialDialog{width:min(620px,calc(100vw - 24px));padding:12px 18px}
 body.q1-interface[data-interface="mobile"] #tutorialDialog h2{margin:0 0 6px;font-size:19px}
 body.q1-interface[data-interface="mobile"] #tutorialDialog p{margin:6px 0;font-size:14px;line-height:1.5}
 body.q1-interface[data-interface="mobile"] #tutorialActions{grid-template-columns:1fr 1fr;gap:8px}
}
body.q1-interface.q1-tutorial-active[data-interface="mobile"]{padding-bottom:150px}
body.q1-interface.q1-tutorial-active[data-interface="mobile"] .q1-full-tutorial{position:fixed;top:auto;bottom:max(6px,env(safe-area-inset-bottom));left:8px;right:8px;z-index:35;margin:0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;max-height:138px;overflow:auto;box-shadow:0 -3px 20px #17314226}
body.q1-interface.q1-tutorial-active[data-interface="mobile"] .q1-full-tutorial strong{grid-column:1;grid-row:1}
body.q1-interface.q1-tutorial-active[data-interface="mobile"] .q1-full-tutorial p{grid-column:1;grid-row:2;margin:0}
body.q1-interface.q1-tutorial-active[data-interface="mobile"] .q1-full-tutorial #tutorialExit{grid-column:2;grid-row:1/3;align-self:center;min-height:44px;padding:6px 9px;white-space:nowrap}
body.q1-interface.q1-tutorial-active[data-interface="mobile"] #boardWrap{scroll-margin-bottom:150px}
body.q1-interface.q1-tutorial-active[data-interface="mobile"] #toast{bottom:150px;max-height:76px}
@media(orientation:landscape) and (max-height:600px){
 body.q1-interface.q1-tutorial-active[data-interface="mobile"]{padding-bottom:104px}
 body.q1-interface.q1-tutorial-active[data-interface="mobile"] .q1-full-tutorial{max-height:96px;padding:6px 10px}
 body.q1-interface.q1-tutorial-active[data-interface="mobile"] .q1-full-tutorial p{font-size:12px}
 body.q1-interface.q1-tutorial-active[data-interface="mobile"] #boardWrap{height:calc(100dvh - 110px);scroll-margin-bottom:110px}
 body.q1-interface.q1-tutorial-active[data-interface="mobile"] #toast{bottom:104px;max-height:58px}
}
body.q1-interface.q1-tutorial-active[data-interface="mobile"] #result #tutorialTourNext{display:block;min-height:44px;margin:10px 0 16px;background:#087880;color:#fff;border-color:#087880;white-space:normal}
body.q1-interface[data-interface="mobile"] #tutorialTourNext[hidden]{display:none!important}
/* Keep Q1 close-up guidance on exactly one terminal, never the dialog itself.
   Overview device frames remain yellow; saved connected pins retain their usual
   non-blinking appearance instead of inheriting a frame stroke. */
body.q1-interface.q1-tutorial-active[data-interface="mobile"] #mobileDeviceDialog.tutorial-device{stroke:none!important;stroke-width:0!important;animation:none!important;filter:none!important}
body.q1-interface.q1-tutorial-active[data-interface="mobile"] #mobileDeviceDialog .mobile-dot:not(.tutorial-target){animation:none!important;filter:none!important}
body.q1-interface.q1-tutorial-active[data-interface="mobile"] #mobileDeviceDialog .mobile-dot:not(.tutorial-target) circle{animation:none!important;filter:none!important}
body.q1-interface.q1-tutorial-active[data-interface="mobile"] #mobileDeviceDialog .mobile-dot.tutorial-target circle:last-child{fill:#ffd600!important;stroke:#b57a00!important;stroke-width:4!important;animation:tutorial-pin-blink 1.2s ease-in-out infinite;filter:drop-shadow(0 0 6px #ffcf00)}
@media(prefers-reduced-motion:reduce){body.q1-interface.q1-tutorial-active[data-interface="mobile"] #mobileDeviceDialog .mobile-dot.tutorial-target circle:last-child{animation:none}}

/* Blink only the guidance frame, not the button text or its descendants. */
@keyframes q1-tutorial-control-blink{0%,100%{outline-color:#f3b900;box-shadow:0 0 0 7px #fff2a3}50%{outline-color:transparent;box-shadow:0 0 0 7px transparent}}
@media(prefers-reduced-motion:reduce){body.q1-interface[data-interface="mobile"] .tutorial-control-target{animation:none}}

/* Q1 mobile keeps the real board indicators and actions without the redundant
   status/instruction text. Desktop and all other question layouts are unchanged. */
body.q1-interface[data-interface="mobile"] #simStatus,
body.q1-interface[data-interface="mobile"] #selectedText{display:none!important}


/* Six compact, non-interactive Q1 phone indicators; no secondary text panel. */
#mobileStatusIcons[hidden]{display:none!important}
body.q1-interface[data-interface="mobile"] #mobileStatusIcons{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px;margin:0;padding:5px 7px;background:#f4f8f8;border-bottom:1px solid #d3dfe2}
body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-status-icon]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-width:0;min-height:43px;padding:2px;border:1px solid #d6e0e3;border-radius:7px;background:#fff;color:#7b8a91;font-size:10px;font-weight:700;line-height:1.2;text-align:center;white-space:nowrap}
body.q1-interface[data-interface="mobile"] #mobileStatusIcons svg{display:block;width:25px;height:25px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-status-icon="nfb"][data-state="on"],
body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-status-icon="motor"][data-state="forward"]{color:#06735f;background:#eaf7f1;border-color:#70bba9}
body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-status-icon="motor"][data-state="reverse"]{color:#1b65a2;background:#ebf4fc;border-color:#86b5db}
body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-status-icon="thry"][data-state="normal"]{color:#45665b}
body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-status-icon="thry"][data-state="tripped"]{color:#b52038;background:#fff0ed;border-color:#d88991}
body.q1-interface[data-interface="mobile"] #mobileStatusIcons .motor-arrow-forward,
body.q1-interface[data-interface="mobile"] #mobileStatusIcons .motor-arrow-reverse{display:none}
body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-state="forward"] .motor-arrow-forward,
body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-state="reverse"] .motor-arrow-reverse{display:block}
body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-status-icon="y"][data-state="on"]{color:#9c6d00;background:#fff9d8;border-color:#d9b644}
body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-status-icon="r"][data-state="on"]{color:#cc2642;background:#fff0f2;border-color:#dd8796}
body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-status-icon="g"][data-state="on"]{color:#0b8652;background:#e6faef;border-color:#66b38b}
body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-state="on"] .status-lamp-bulb{fill:currentColor;stroke:currentColor}
body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-state="off"] .status-lamp-bulb{fill:#e4e9ec;stroke:#94a2a9}
/* Keep the phone mode switches together and fit the primary tools tightly. */
body.q1-interface[data-interface="mobile"] .modebar{gap:4px;flex-wrap:wrap}
body.q1-interface[data-interface="mobile"] .modebar button{font-size:12px;padding:5px 6px;min-height:36px}
body.q1-interface[data-interface="mobile"] #q1MobileViewTools{display:inline-flex;gap:4px;flex-wrap:nowrap;align-items:center}
body.q1-interface[data-interface="mobile"] #q1MobileViewTools #interfaceModeSwitch{display:inline-flex;gap:4px;flex-wrap:nowrap}
body.q1-interface[data-interface="mobile"] #primaryTools{gap:4px;flex-wrap:wrap}
body.q1-interface[data-interface="mobile"] #primaryTools button{font-size:12px;padding:4px 6px;min-height:36px}
body.q1-interface[data-interface="mobile"] #primaryTools #tutorialEntry{margin:0;font-size:12px;padding:4px 6px;min-height:36px;white-space:nowrap}
@media(orientation:landscape) and (max-height:600px){body.q1-interface[data-interface="mobile"] #mobileStatusIcons{padding-block:4px}body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-status-icon]{min-height:40px}body.q1-interface[data-interface="mobile"] #mobileStatusIcons svg{width:23px;height:23px}}
/* State shapes stay distinguishable without relying on color. */
body.q1-interface[data-interface="mobile"] #mobileStatusIcons .nfb-open,
body.q1-interface[data-interface="mobile"] #mobileStatusIcons .nfb-closed,
body.q1-interface[data-interface="mobile"] #mobileStatusIcons .thry-normal,
body.q1-interface[data-interface="mobile"] #mobileStatusIcons .thry-tripped{display:none}
body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-status-icon="nfb"][data-state="off"] .nfb-open,
body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-status-icon="nfb"][data-state="on"] .nfb-closed,
body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-status-icon="thry"][data-state="normal"] .thry-normal,
body.q1-interface[data-interface="mobile"] #mobileStatusIcons [data-status-icon="thry"][data-state="tripped"] .thry-tripped{display:block}
/* The mobile mode row spans the whole header, not the title's leftover column. */
body.q1-interface[data-interface="mobile"] .topline{display:grid;grid-template-columns:minmax(0,1fr) auto}
body.q1-interface[data-interface="mobile"] .topline>div{display:contents}
body.q1-interface[data-interface="mobile"] .topline h1{grid-column:1;grid-row:1;min-width:0}
body.q1-interface[data-interface="mobile"] .topline #check{grid-column:2;grid-row:1}
body.q1-interface[data-interface="mobile"] .topline #modeSlot{grid-column:1/-1;grid-row:2;width:100%;min-width:0}

/* Q1 mobile keeps common actions outside the optional tools. */
body.q1-interface[data-interface="mobile"] header{grid-template-columns:minmax(0,1fr) auto;gap:7px}
body.q1-interface[data-interface="mobile"] header .brand{font-size:14px;letter-spacing:0}
body.q1-interface[data-interface="mobile"] #q1MobileHeaderActions{grid-column:2;grid-row:1;display:flex;align-items:center;gap:5px;flex-wrap:nowrap}
body.q1-interface[data-interface="mobile"] #q1MobileHeaderActions button{margin:0;padding:5px 6px;font-size:11px;min-height:36px;white-space:nowrap}
body.q1-interface[data-interface="mobile"] #q1MobileHeaderActions #tutorialEntry{color:#124b51;background:#e7f8f4;border-color:#7bc6ba}
body.q1-interface[data-interface="mobile"] #questionNav{grid-column:1/-1;grid-row:2;max-width:none}
body.q1-interface[data-interface="mobile"] #showList,
body.q1-interface[data-interface="mobile"] #listDialog{display:none!important}

/* Q1 mobile: pending wire start stays distinguishable from red overview dots.
   Animate only the selected dot, never its SVG/group or enlarged picker. */
body.q1-interface[data-interface="mobile"] #pointLayer .terminal.selected .dot{
 fill:#ffd400;stroke:#805400;stroke-width:3;
 animation:q1-selected-terminal-pulse 1s ease-in-out infinite;
 filter:drop-shadow(0 0 5px #ffc400);
}
@keyframes q1-selected-terminal-pulse{
 0%,100%{opacity:1;stroke-width:3;filter:drop-shadow(0 0 3px #ffc400)}
 50%{opacity:.5;stroke-width:5;filter:drop-shadow(0 0 8px #ffb700)}
}
@media(prefers-reduced-motion:reduce){
 body.q1-interface[data-interface="mobile"] #pointLayer .terminal.selected .dot{animation:none}
}

/* Q1 desktop parity: direct-terminal board, spacious shared controls. */
body.q1-interface[data-interface="desktop"] #mobileStatusIcons{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px;margin:0;padding:5px 7px;background:#f4f8f8;border-bottom:1px solid #d3dfe2}
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-status-icon]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-width:0;min-height:43px;padding:2px;border:1px solid #d6e0e3;border-radius:7px;background:#fff;color:#7b8a91;font-size:10px;font-weight:700;line-height:1.2;text-align:center;white-space:nowrap}
body.q1-interface[data-interface="desktop"] #mobileStatusIcons svg{display:block;width:25px;height:25px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-status-icon="nfb"][data-state="on"],
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-status-icon="motor"][data-state="forward"]{color:#06735f;background:#eaf7f1;border-color:#70bba9}
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-status-icon="motor"][data-state="reverse"]{color:#1b65a2;background:#ebf4fc;border-color:#86b5db}
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-status-icon="thry"][data-state="normal"]{color:#45665b}
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-status-icon="thry"][data-state="tripped"]{color:#b52038;background:#fff0ed;border-color:#d88991}
body.q1-interface[data-interface="desktop"] #mobileStatusIcons .motor-arrow-forward,
body.q1-interface[data-interface="desktop"] #mobileStatusIcons .motor-arrow-reverse{display:none}
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-state="forward"] .motor-arrow-forward,
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-state="reverse"] .motor-arrow-reverse{display:block}
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-status-icon="y"][data-state="on"]{color:#9c6d00;background:#fff9d8;border-color:#d9b644}
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-status-icon="r"][data-state="on"]{color:#cc2642;background:#fff0f2;border-color:#dd8796}
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-status-icon="g"][data-state="on"]{color:#0b8652;background:#e6faef;border-color:#66b38b}
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-state="on"] .status-lamp-bulb{fill:currentColor;stroke:currentColor}
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-state="off"] .status-lamp-bulb{fill:#e4e9ec;stroke:#94a2a9}

/* State shapes stay distinguishable without relying on color. */
body.q1-interface[data-interface="desktop"] #mobileStatusIcons .nfb-open,
body.q1-interface[data-interface="desktop"] #mobileStatusIcons .nfb-closed,
body.q1-interface[data-interface="desktop"] #mobileStatusIcons .thry-normal,
body.q1-interface[data-interface="desktop"] #mobileStatusIcons .thry-tripped{display:none}
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-status-icon="nfb"][data-state="off"] .nfb-open,
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-status-icon="nfb"][data-state="on"] .nfb-closed,
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-status-icon="thry"][data-state="normal"] .thry-normal,
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-status-icon="thry"][data-state="tripped"] .thry-tripped{display:block}

body.q1-interface[data-interface="desktop"] #pointLayer .terminal.selected .dot{
 fill:#ffd400;stroke:#805400;stroke-width:3;
 animation:q1-selected-terminal-pulse 1s ease-in-out infinite;
 filter:drop-shadow(0 0 5px #ffc400);
}

body.q1-interface[data-interface="desktop"] header{height:auto;min-height:64px;gap:18px;flex-wrap:wrap;padding:12px 24px}
body.q1-interface[data-interface="desktop"] #q1MobileHeaderActions{display:flex;gap:8px;align-items:center;margin-left:auto}
body.q1-interface[data-interface="desktop"] #q1MobileHeaderActions button{margin:0;white-space:nowrap}
body.q1-interface[data-interface="desktop"] #q1MobileViewTools{display:inline-flex;gap:8px;align-items:center;flex-wrap:wrap}
body.q1-interface[data-interface="desktop"] .modebar{gap:10px}
body.q1-interface[data-interface="desktop"] #primaryTools{gap:8px;padding:10px 16px;flex-wrap:wrap}
body.q1-interface[data-interface="desktop"] #selection{padding:10px 16px;gap:8px}
body.q1-interface[data-interface="desktop"] #selection .mobile-control{font-size:15px;min-height:42px;padding:8px 16px}
body.q1-interface[data-interface="desktop"] #mobileStatusIcons{grid-template-columns:repeat(6,minmax(52px,82px));justify-content:start;gap:8px;padding:8px 16px}
body.q1-interface[data-interface="desktop"] #mobileStatusIcons [data-status-icon]{min-height:48px;font-size:11px}
body.q1-interface[data-interface="desktop"] #simStatus,
body.q1-interface[data-interface="desktop"] #selectedText,
body.q1-interface[data-interface="desktop"] #showList,
body.q1-interface[data-interface="desktop"] #listDialog{display:none!important}

body.q1-interface[data-interface="desktop"] .tutorial-control-target{outline:4px solid #f3b900;outline-offset:3px;position:relative;z-index:19;scroll-margin-block:90px;animation:q1-tutorial-control-blink 1.2s ease-in-out infinite}
body.q1-interface.q1-tutorial-active[data-interface="desktop"]{padding-bottom:150px}
body.q1-interface.q1-tutorial-active[data-interface="desktop"] .q1-full-tutorial{position:fixed;top:auto;bottom:12px;left:24px;right:24px;z-index:35;margin:0 auto;max-width:1000px;max-height:132px;overflow:auto;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 20px;padding:14px 20px;border:2px solid #d7a731;border-radius:12px;background:#fff8d9;box-shadow:0 -3px 20px #17314226}
body.q1-interface[data-interface="desktop"] .q1-full-tutorial strong{grid-column:1;font-size:18px;line-height:1.4}
body.q1-interface[data-interface="desktop"] .q1-full-tutorial p{grid-column:1;margin:0;font-size:15px;line-height:1.5}
body.q1-interface[data-interface="desktop"] .q1-full-tutorial #tutorialExit{grid-column:2;grid-row:1/3;align-self:center}
body.q1-interface[data-interface="desktop"] #tutorialDialog{max-height:calc(100dvh - 40px);overflow:auto}
body.q1-interface[data-interface="desktop"] #result #tutorialTourNext{display:block;min-height:44px;margin:10px 0 16px;background:#087880;color:white;border-color:#087880}
body.q1-interface[data-interface="desktop"] #tutorialTourNext[hidden]{display:none!important}
@media(prefers-reduced-motion:reduce){body.q1-interface[data-interface="desktop"] #pointLayer .terminal.selected .dot,body.q1-interface[data-interface="desktop"] .tutorial-control-target{animation:none}}
/* Keep the wiring workspace readable after adding desktop control/status rows. */
body.q1-interface[data-interface="desktop"] .work{height:auto;min-height:0}
body.q1-interface[data-interface="desktop"] #boardWrap,
body.q1-interface[data-interface="desktop"] .work:has(#extraTools:not([hidden])) #boardWrap{flex:none;height:clamp(460px,65vh,760px);min-height:460px;max-height:none}


.power-earth-review{margin-top:14px;border:1px solid #c9d7d2;border-radius:10px;padding:12px;background:#f7faf8}.power-earth-review summary{cursor:pointer;font-weight:700}.power-earth-review p{font-size:13px;line-height:1.7}.power-earth-review h3{font-size:14px;margin:16px 0 6px}.power-earth-review button{display:block;width:100%;margin:6px 0;text-align:left;overflow-wrap:anywhere}

.ground-correction-review{max-width:1100px;margin:16px auto;padding:16px;border:2px solid #b57b22;border-radius:12px;background:#fff9eb;color:#342b1b;overflow-wrap:anywhere}.ground-correction-review h2{font-size:18px;margin:0 0 8px}.ground-correction-review p,.ground-correction-review li{font-size:14px;line-height:1.55}.ground-correction-review details{margin:12px 0}.ground-correction-review ol{max-height:250px;overflow:auto}.ground-correction-review button{margin-top:8px;min-height:44px}

/* Q1 same-origin motor measurement. The host circuit remains mounted. */
.q1-motor-entry {cursor:pointer;touch-action:manipulation}.q1-motor-entry rect{fill:#08786d;stroke:white;stroke-width:2}.q1-motor-entry text{fill:white;font-size:18px;font-weight:700;pointer-events:none}.q1-motor-entry:focus rect{stroke:#e9b728;stroke-width:5}
.q1-motor-dialog{width:min(1120px,100%);height:96dvh;max-width:100%;box-sizing:border-box;max-height:100dvh;padding:0;border:0;border-radius:12px;background:#f5f7f2;overflow:hidden}.q1-motor-dialog::backdrop{background:#132b36b8}.q1-motor-dialog[open]{display:flex;flex-direction:column}.q1-motor-dialog-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;background:white;border-bottom:1px solid #ccd6d0}.q1-motor-dialog-bar button{min-height:44px}.q1-motor-dialog iframe{border:0;width:100%;flex:1;min-height:0}.q1-motor-picker-entry{margin:0 0 10px;width:100%;min-height:44px;background:#08786d;color:white;font-weight:700}
@media(max-width:600px){.q1-motor-dialog{height:100dvh;border-radius:0}.q1-motor-dialog-bar{font-size:12px}.q1-motor-dialog-bar button{font-size:12px}}
.mobile-device-dialog[data-question="1"][data-device="TB2"]{grid-template-rows:auto auto minmax(0,1fr) 44px}
.mobile-device-dialog[data-question="1"][data-device="TB2"] .q1-motor-picker-entry{grid-column:1/-1;grid-row:4;align-self:start;height:44px;min-height:44px;margin:0;padding:6px 10px;background:#08786d;color:#fff;font-size:14px;line-height:1.25;border:1px solid #065c54}
.mobile-device-dialog[data-question="1"][data-device="TB2"] .q1-motor-picker-entry:hover{background:#065c54;color:#fff}
.mobile-device-dialog[data-question="1"][data-device="TB2"] .mobile-device-stage{grid-row:3}

/* Q1 manual wire type and gauge; shared original nodes in both interfaces. */
.q1-wire-modes{display:inline-flex;align-items:center;flex-wrap:wrap;gap:6px}.q1-wire-mode-status{font-size:12px;flex-basis:100%;color:#37515d}.q1-wire-modes button[aria-pressed="true"]{background:#126d38;color:#fff;border-color:#126d38}.q1-wire-size-dialog{width:min(440px,calc(100vw - 24px));max-height:90dvh;overflow:auto;border:1px solid #c7d3dc;border-radius:12px;padding:18px}.q1-wire-size-dialog h2{margin-top:0;font-size:21px}.q1-wire-size-choices{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:16px 0}.q1-wire-size-choices button{min-height:54px;font-weight:700}.q1-wire-size-dialog::backdrop{background:#17314299}
body.q1-interface[data-interface="mobile"] #primaryTools .q1-wire-modes button{min-height:44px;white-space:nowrap}.q1-wire-modes button:hover[aria-pressed="true"]{filter:brightness(1.15)}
.wire.q1-spec-wire.selected-wire{stroke-width:var(--q1-wire-width)!important}
.wire.q1-spec-wire.bad{stroke-width:var(--q1-wire-width)!important}
/* Polarity-test modal: readable outer controls on desktop and phone. */
.q1-motor-dialog-bar{font-size:18px;line-height:1.4}.q1-motor-dialog-bar button{font-size:16px;min-height:48px;line-height:1.3}
@media(max-width:600px){.q1-motor-dialog-bar{font-size:16px;padding:8px;align-items:center}.q1-motor-dialog-bar strong{min-width:0;flex:1}.q1-motor-dialog-bar button{font-size:15px;max-width:48%;white-space:normal}}
.q1-persistence-status{position:sticky;top:0;z-index:20;display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:12px 14px;margin:8px;background:#fff1d2;border:2px solid #ac6613;border-radius:8px;color:#593000;font-size:16px;line-height:1.5}.q1-persistence-status[hidden]{display:none}.q1-persistence-status span{flex:1 1 260px}.q1-persistence-status button{min-height:44px}.q1-motor-storage-warning{padding:10px 14px;background:#fff1d2;border-block:2px solid #ac6613;color:#593000;display:flex;gap:10px;align-items:center;flex-wrap:wrap;font-size:16px;line-height:1.4}.q1-motor-storage-warning[hidden]{display:none}.q1-motor-storage-warning span{flex:1 1 260px}.q1-motor-storage-warning button{min-height:44px}
/* Keep both host actions together and readable above the embedded lab. */
.q1-motor-dialog-bar{flex-wrap:wrap}.q1-motor-dialog-bar strong{flex:1;min-width:0}#q1MotorClearNotes{margin-left:auto;flex:0 0 auto}
@media(max-width:600px){.q1-motor-dialog-bar strong{flex:1 0 100%}.q1-motor-dialog-bar button{flex-shrink:0}}

/* Keep the board stationary while selecting endpoints: reserve the same row
   before, during and after a connection, including narrow/landscape layouts. */
body.q1-interface[data-interface] #desktopSelection{position:relative;display:block;height:48px;min-height:48px;padding:1px 12px;overflow:hidden}
body.q1-interface #desktopSelection .wiring-selection-tools{height:44px;flex-wrap:nowrap;min-width:0}
body.q1-interface #desktopSelection #selectedText{display:block!important;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.q1-interface #desktopSelection button{height:44px;min-height:44px;flex-shrink:0;white-space:nowrap}

/* Feedback is before the SVG too: changing its text/visibility must not move
   a zoomed terminal away from the pointer. Long messages scroll within it. */
body.q1-interface #desktopSelection #toast,body.q1-interface #desktopSelection #toast.error-notice{position:absolute;inset:0;bottom:auto;height:46px;min-height:46px;max-height:46px;width:100%;margin:0;padding:4px 12px;z-index:1;box-shadow:none}

/* Q1 compact workspace: disclosures save space, not smaller touch targets. */
body.q1-interface main{width:100%;max-width:1800px;min-width:0;grid-template-columns:minmax(0,1fr) minmax(0,300px);padding:8px;gap:10px}
body.q1-interface .work,body.q1-interface aside{min-width:0;max-width:100%}
body.q1-interface .work{overflow:visible;height:auto!important;min-height:0;border-radius:10px}
body.q1-interface header{display:flex!important;flex-wrap:wrap;min-height:52px;height:auto;gap:6px 12px;padding:4px 12px}
body.q1-interface #questionNav{flex:1 1 280px;min-width:0;max-width:100%;width:auto}
body.q1-interface #q1MobileHeaderActions{flex:0 1 auto;min-width:0;max-width:100%;margin-left:auto}
body.q1-interface .topline{padding:5px 10px;align-items:center}
body.q1-interface .topline h1{font-size:18px;line-height:1.3;margin:0;min-width:0}
body.q1-interface .topline #modeSlot:empty{display:none}
body.q1-interface .q1-workspace-disclosure{margin:0;padding:0;border:0;border-block:1px solid #d6e2e5;background:#f6fafb;min-width:0;font-size:14px}
body.q1-interface .q1-workspace-disclosure>summary{min-height:44px;display:flex;align-items:center;gap:8px;padding:5px 10px;list-style:none;font-size:15px}
body.q1-interface .q1-workspace-disclosure>summary::before{content:'▸';flex:none}
body.q1-interface .q1-workspace-disclosure[open]>summary::before{content:'▾'}
body.q1-interface .q1-settings-body{padding:6px 10px;display:grid;gap:8px;min-width:0;max-width:100%;border-block:1px solid #d6e2e5;background:#f6fafb}
body.q1-interface .q1-settings-actions button{max-width:100%;white-space:normal;overflow-wrap:anywhere}
body.q1-interface .q1-settings-actions{display:flex;flex-wrap:wrap;gap:6px;min-width:0}
body.q1-interface .q1-settings-body .modebar{display:flex;flex-wrap:wrap;min-width:0;width:100%;gap:6px}
body.q1-interface #q1MobileViewTools,body.q1-interface #interfaceModeSwitch{min-width:0;max-width:100%;flex-wrap:wrap!important}
body.q1-interface #primaryTools{padding:5px 10px;min-width:0}
body.q1-interface #q1WireModes{min-width:0;max-width:100%;flex-wrap:wrap}
body.q1-interface #q1WireModeStatus{flex-basis:100%;font-size:12px;line-height:1.3;margin:0}
body.q1-interface #q1RunDock{position:sticky;top:0;z-index:18;background:#edf8f4;box-shadow:0 2px 5px #163c4620}
body.q1-interface #q1RunDock>summary{font-size:14px;gap:5px}
body.q1-interface #q1RunDock #mobileStatusIcons{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));flex:1;min-width:0;gap:3px;margin:0;padding:0;border:0;background:transparent}
body.q1-interface #q1RunDock #mobileStatusIcons [data-status-icon]{min-height:36px;padding:1px;font-size:10px;min-width:0}
body.q1-interface #q1RunDock #mobileStatusIcons svg{width:22px;height:22px}
body.q1-interface #q1RunDock #selection{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:6px;padding:5px 10px}
body.q1-interface #boardRecovery{padding:3px 8px;min-width:0}
body.q1-interface[data-interface] #boardWrap,body.q1-interface[data-interface] .work:has(#extraTools:not([hidden])) #boardWrap{height:clamp(380px,58svh,650px);min-height:380px;max-height:none;flex:none}
body.q1-interface[data-interface] button,body.q1-interface[data-interface] select,body.q1-interface[data-interface] #primaryTools button,body.q1-interface[data-interface] #q1MobileHeaderActions button,body.q1-interface[data-interface] #selection .mobile-control{min-width:44px;min-height:44px;padding:7px 9px}
body.q1-interface[data-interface] #questionNav a{min-height:44px;display:inline-flex;align-items:center;justify-content:center}
body.q1-interface #extraTools{min-width:0;max-width:100%}
body.q1-interface #extraTools>*{max-width:100%;min-width:0}
body.q1-interface #extraTools button{min-width:44px}
body.q1-interface aside{overflow-wrap:anywhere}
@media(max-width:1050px){body.q1-interface main{grid-template-columns:minmax(0,1fr)}body.q1-interface aside{width:auto}}
@media(max-width:600px){
 body.q1-interface main{padding:5px;gap:8px}
 body.q1-interface header{padding:4px 6px;gap:4px}
 body.q1-interface header .brand{font-size:13px}
 body.q1-interface #q1MobileHeaderActions{gap:3px}
 body.q1-interface #q1MobileHeaderActions button{font-size:12px;white-space:normal}
 body.q1-interface #questionNav{order:3;flex-basis:100%}
 body.q1-interface .topline h1{font-size:15px}
 body.q1-interface .topline #check{font-size:14px}
 body.q1-interface #primaryTools{padding:4px 6px}
 body.q1-interface #q1WireModes{gap:4px}
 body.q1-interface #q1RunDock #selection{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:4px 6px}
 body.q1-interface[data-interface] #boardWrap{height:48svh;min-height:320px}
 body.q1-interface #q1RunDock>summary{padding:4px 6px;font-size:12px}
}
@media(orientation:landscape) and (max-height:500px){
 body.q1-interface header{position:static}
 body.q1-interface[data-interface] #boardWrap{height:65svh;min-height:240px}
 body.q1-interface #q1RunDock #selection{display:flex}
}
/* One scrollable question row, not two rows of shrunken targets. */
body.q1-interface #questionNav{display:flex;flex-wrap:nowrap;order:0;overflow-x:auto;overflow-y:hidden;gap:3px;justify-content:flex-start;scrollbar-width:thin}
body.q1-interface[data-interface] #questionNav a{flex:0 0 44px;min-width:44px;padding:5px 4px}
@media(max-width:600px){body.q1-interface #questionNav{order:3}}
body.q1-interface #q1RunDock>summary{flex-wrap:wrap}
body.q1-interface[data-interface] #q1RunDock #simStatus{display:block!important;flex:1 0 100%;min-width:0;margin:0;font-size:13px;font-weight:700;line-height:1.25;white-space:normal;overflow-wrap:anywhere}
/* Keep the existing desktop zoom buttons in the reserved selection row. */
body.q1-interface #desktopSelection #boardRecovery{position:static;flex:none;padding:0;gap:3px;border:0;background:transparent;min-width:0}
body.q1-interface #desktopSelection #boardRecovery button{padding-inline:6px;font-size:13px}
body.q1-interface[data-interface="mobile"] #desktopSelection #boardRecovery{display:none!important}
body.q1-interface .topline h1{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
body.q1-interface #q1BoardRegion{min-width:0;position:relative}
@media(max-width:1050px){
 body.q1-interface #q1WireModes{gap:3px}
 body.q1-interface #primaryTools #q1WireModes button{font-size:12px;padding-inline:5px}
}
@media(orientation:landscape) and (max-height:500px){
 body.q1-interface .work{position:relative}
 body.q1-interface .topline{position:absolute;right:4px;top:0;z-index:3;padding:0;display:block}
 body.q1-interface .topline>div{display:none!important}
 body.q1-interface .topline #check{height:44px;font-size:13px;margin:0}
 body.q1-interface #primaryTools{padding-right:102px}
 body.q1-interface #q1BoardRegion{display:grid;grid-template-columns:minmax(0,1fr) 164px;gap:4px;align-items:start}
 body.q1-interface #q1BoardRegion #boardWrap{grid-column:1;grid-row:1;width:100%;min-width:0;height:65svh;min-height:240px}
 body.q1-interface #q1RunDock{grid-column:2;grid-row:1;position:sticky;top:0;max-height:calc(100svh - 24px);overflow:auto;overscroll-behavior:contain}
 body.q1-interface #q1RunDock>summary{gap:3px;padding:4px}
 body.q1-interface #q1RunDock #mobileStatusIcons{flex-basis:100%;grid-template-columns:repeat(3,minmax(0,1fr))}
 body.q1-interface #q1RunDock #selection{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:4px;gap:4px}
 body.q1-interface #q1RunDock #selection button{font-size:12px;padding-inline:3px}
 body.q1-interface.q1-tutorial-active #q1RunDock{max-height:calc(100svh - 145px)}
}

/* Q1 mode status is noninteractive; only the exam shows elapsed time. */
body.q1-interface #q1ModeStatus{display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:5px 9px;font-size:13px;background:#e9f6f3;border:1px solid #a8d4c9;border-radius:8px;white-space:nowrap}
body.q1-interface #q1ModeStatus #elapsed{font-size:16px;line-height:1.2;font-variant-numeric:tabular-nums}
body.q1-interface #q1ModeStatus[data-mode="practice"] #elapsed{display:none}
body.q1-interface #modeSlot{margin-top:3px}
body.q1-interface #q1RunDock .q1-run-disclosure-hint{font-size:12px;text-decoration:underline;text-underline-offset:2px;color:#096c64;white-space:nowrap}
body.q1-interface[data-interface] .q1-settings-body .modebar{gap:8px}
body.q1-interface[data-interface] #q1MobileViewTools,body.q1-interface[data-interface] #interfaceModeSwitch{gap:8px}
body.q1-interface[data-interface] .modebar #practiceMode,body.q1-interface[data-interface] .modebar #examMode,body.q1-interface[data-interface] .modebar #toggleTools,body.q1-interface[data-interface] .modebar #mobileVersion,body.q1-interface[data-interface] .modebar #desktopVersion{min-height:44px;min-width:44px;padding:7px 9px}
body.q1-interface .legend{font-size:12px;line-height:1.3}
body.q1-interface .topline h1{white-space:normal;text-overflow:clip;overflow:visible}
body.q1-interface #desktopSelection #selectedText{white-space:normal;text-overflow:clip;overflow-wrap:anywhere;line-height:1.3;font-size:13px;max-height:44px;overflow:auto}
@media(max-width:600px){
 body.q1-interface .topline{gap:6px}
 body.q1-interface .topline h1{font-size:14px;line-height:1.3}
 body.q1-interface #desktopSelection{padding-inline:6px}
 body.q1-interface #desktopSelection #selectedText{font-size:12px}
 body.q1-interface #q1RunDock>summary{column-gap:5px}
}
@media(orientation:landscape) and (max-height:500px){
 body.q1-interface .topline{position:static;display:flex;padding:2px 6px;gap:5px;min-height:44px}
 body.q1-interface .topline>div{display:block!important}
 body.q1-interface .topline h1{display:none}
 body.q1-interface #modeSlot{margin:0}
 body.q1-interface #primaryTools{padding-right:6px}
}
/* Only the main overview uses the responsive foreground captions; apparatus
   picker crops continue to use the unmodified source labels. */
#board[data-q1-readable-labels="true"] #partsLayer [data-q1-original-name],#board[data-q1-readable-labels="true"] #partsLayer [data-q1-device-caption],#board[data-q1-readable-labels="true"] #q1DeviceNameLayer>[data-q1-original-name]{visibility:hidden}
body.q1-interface[data-interface] .topline>div{display:flex;align-items:center;gap:8px}
body.q1-interface[data-interface] .topline #modeSlot{flex:none;margin:0}
@media(max-width:600px) and (orientation:portrait){
 body.q1-interface[data-interface] .topline{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 6px;padding:4px 6px}
 body.q1-interface[data-interface] .topline>div{display:contents}
 body.q1-interface[data-interface] .topline h1{grid-column:1/-1;grid-row:1}
 body.q1-interface[data-interface] .topline #modeSlot{grid-column:1;grid-row:2}
 body.q1-interface[data-interface] .topline #check{grid-column:2;grid-row:2}
}
@media(orientation:landscape) and (max-height:500px){
 body.q1-interface[data-interface] .topline{position:static;display:flex;padding:2px 6px;gap:4px}
 body.q1-interface[data-interface] .topline>div{display:block!important;flex:none}
 body.q1-interface #primaryTools{padding-right:6px}
 body.q1-interface #q1ModeStatus{font-size:12px;padding-inline:6px}
 body.q1-interface #q1ModeStatus #elapsed{font-size:13px}
}

body.q1-interface[data-interface] #q1MobileViewTools #interfaceModeSwitch{gap:8px}

/* Equal minimal motor repairs are a joint review, not a convicted wire. */
.wire.review-wire{stroke:#627b8a!important;stroke-dasharray:3 4}.issue.motor-conflict{border-color:#8ca3b0;background:#f2f6f8;color:#304d60}

/* Q1: explain the single motor terminal strip beside the official drawing. */
.q1-tb2-circuit-note{margin:10px 12px;font-size:14px;line-height:1.55;color:#334b60;white-space:normal;overflow-wrap:anywhere}
#circuitDialog .q1-tb2-circuit-note{flex:none;max-width:100%;box-sizing:border-box}

/* Phone coaching: full-width copy, visible exit, no hidden normal-size lines. */
body.q1-interface.q1-tutorial-active[data-interface="mobile"] .q1-full-tutorial{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto minmax(0,1fr) auto;align-items:start;max-height:min(260px,45dvh);overflow:hidden;gap:4px 8px}
body.q1-interface.q1-tutorial-active[data-interface="mobile"] .q1-full-tutorial strong{align-self:center}
body.q1-interface.q1-tutorial-active[data-interface="mobile"] .q1-full-tutorial #tutorialExit{grid-row:1;align-self:start}
body.q1-interface.q1-tutorial-active[data-interface="mobile"] .q1-full-tutorial #tutorialFeedback{grid-column:1/-1;grid-row:2;align-self:stretch;min-height:0;max-height:100%;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;touch-action:pan-y}
body.q1-interface.q1-tutorial-active[data-interface="mobile"] #tutorialScrollHint{grid-column:1/-1;grid-row:3;font-size:12px;line-height:1.4;font-weight:600;color:#735513}
body.q1-interface #tutorialScrollHint[hidden]{display:none!important}
@media(orientation:landscape) and (max-height:600px){body.q1-interface.q1-tutorial-active[data-interface="mobile"] .q1-full-tutorial{max-height:45dvh}body.q1-interface.q1-tutorial-active[data-interface="mobile"] .q1-full-tutorial p{font-size:13px}}
body.q1-interface.q1-tutorial-active[data-interface="mobile"]{padding-bottom:calc(min(260px,45dvh) + 12px)}
body.q1-interface.q1-tutorial-active[data-interface="mobile"] #boardWrap{scroll-margin-bottom:calc(min(260px,45dvh) + 12px)}

/* Q2–8 share workspace ergonomics, not Q1 electrical behavior. */
/* Keep the board stationary while selecting endpoints: reserve the same row
   before, during and after a connection, including narrow/landscape layouts. */
body.question-workspace[data-interface] #desktopSelection{position:relative;display:block;height:48px;min-height:48px;padding:1px 12px;overflow:hidden}
body.question-workspace #desktopSelection .wiring-selection-tools{height:44px;flex-wrap:nowrap;min-width:0}
body.question-workspace #desktopSelection #selectedText{display:block!important;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.question-workspace #desktopSelection button{height:44px;min-height:44px;flex-shrink:0;white-space:nowrap}

/* Feedback is before the SVG too: changing its text/visibility must not move
   a zoomed terminal away from the pointer. Long messages scroll within it. */
body.question-workspace #desktopSelection #toast,body.question-workspace #desktopSelection #toast.error-notice{position:absolute;inset:0;bottom:auto;height:46px;min-height:46px;max-height:46px;width:100%;margin:0;padding:4px 12px;z-index:1;box-shadow:none}

/* Q1 compact workspace: disclosures save space, not smaller touch targets. */
body.question-workspace main{width:100%;max-width:1800px;min-width:0;grid-template-columns:minmax(0,1fr) minmax(0,300px);padding:8px;gap:10px}
body.question-workspace .work,body.question-workspace aside{min-width:0;max-width:100%}
body.question-workspace .work{overflow:visible;height:auto!important;min-height:0;border-radius:10px}
body.question-workspace header{display:flex!important;flex-wrap:wrap;min-height:52px;height:auto;gap:6px 12px;padding:4px 12px}
body.question-workspace #questionNav{flex:1 1 280px;min-width:0;max-width:100%;width:auto}
body.question-workspace #q1MobileHeaderActions{flex:0 1 auto;min-width:0;max-width:100%;margin-left:auto}
body.question-workspace .topline{padding:5px 10px;align-items:center}
body.question-workspace .topline h1{font-size:18px;line-height:1.3;margin:0;min-width:0}
body.question-workspace .topline #modeSlot:empty{display:none}
body.question-workspace .q1-workspace-disclosure{margin:0;padding:0;border:0;border-block:1px solid #d6e2e5;background:#f6fafb;min-width:0;font-size:14px}
body.question-workspace .q1-workspace-disclosure>summary{min-height:44px;display:flex;align-items:center;gap:8px;padding:5px 10px;list-style:none;font-size:15px}
body.question-workspace .q1-workspace-disclosure>summary::before{content:'▸';flex:none}
body.question-workspace .q1-workspace-disclosure[open]>summary::before{content:'▾'}
body.question-workspace .q1-settings-body{padding:6px 10px;display:grid;gap:8px;min-width:0;max-width:100%;border-block:1px solid #d6e2e5;background:#f6fafb}
body.question-workspace .q1-settings-actions button{max-width:100%;white-space:normal;overflow-wrap:anywhere}
body.question-workspace .q1-settings-actions{display:flex;flex-wrap:wrap;gap:6px;min-width:0}
body.question-workspace .q1-settings-body .modebar{display:flex;flex-wrap:wrap;min-width:0;width:100%;gap:6px}
body.question-workspace #q1MobileViewTools,body.question-workspace #interfaceModeSwitch{min-width:0;max-width:100%;flex-wrap:wrap!important}
body.question-workspace #primaryTools{padding:5px 10px;min-width:0}
body.question-workspace #q1WireModes{min-width:0;max-width:100%;flex-wrap:wrap}
body.question-workspace #q1WireModeStatus{flex-basis:100%;font-size:12px;line-height:1.3;margin:0}
body.question-workspace #q1RunDock{position:sticky;top:0;z-index:18;background:#edf8f4;box-shadow:0 2px 5px #163c4620}
body.question-workspace #q1RunDock>summary{font-size:14px;gap:5px}
body.question-workspace #q1RunDock #mobileStatusIcons{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));flex:1;min-width:0;gap:3px;margin:0;padding:0;border:0;background:transparent}
body.question-workspace #q1RunDock #mobileStatusIcons [data-status-icon]{min-height:36px;padding:1px;font-size:10px;min-width:0}
body.question-workspace #q1RunDock #mobileStatusIcons svg{width:22px;height:22px}
body.question-workspace #q1RunDock #selection{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:6px;padding:5px 10px}
body.question-workspace #boardRecovery{padding:3px 8px;min-width:0}
body.question-workspace[data-interface] #boardWrap,body.question-workspace[data-interface] .work:has(#extraTools:not([hidden])) #boardWrap{height:clamp(380px,58svh,650px);min-height:380px;max-height:none;flex:none}
body.question-workspace[data-interface] button,body.question-workspace[data-interface] select,body.question-workspace[data-interface] #primaryTools button,body.question-workspace[data-interface] #q1MobileHeaderActions button,body.question-workspace[data-interface] #selection .mobile-control{min-width:44px;min-height:44px;padding:7px 9px}
body.question-workspace[data-interface] #questionNav a{min-height:44px;display:inline-flex;align-items:center;justify-content:center}
body.question-workspace #extraTools{min-width:0;max-width:100%}
body.question-workspace #extraTools>*{max-width:100%;min-width:0}
body.question-workspace #extraTools button{min-width:44px}
body.question-workspace aside{overflow-wrap:anywhere}
@media(max-width:1050px){body.question-workspace main{grid-template-columns:minmax(0,1fr)}body.question-workspace aside{width:auto}}
@media(max-width:600px){
 body.question-workspace main{padding:5px;gap:8px}
 body.question-workspace header{padding:4px 6px;gap:4px}
 body.question-workspace header .brand{font-size:13px}
 body.question-workspace #q1MobileHeaderActions{gap:3px}
 body.question-workspace #q1MobileHeaderActions button{font-size:12px;white-space:normal}
 body.question-workspace #questionNav{order:3;flex-basis:100%}
 body.question-workspace .topline h1{font-size:15px}
 body.question-workspace .topline #check{font-size:14px}
 body.question-workspace #primaryTools{padding:4px 6px}
 body.question-workspace #q1WireModes{gap:4px}
 body.question-workspace #q1RunDock #selection{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:4px 6px}
 body.question-workspace[data-interface] #boardWrap{height:48svh;min-height:320px}
 body.question-workspace #q1RunDock>summary{padding:4px 6px;font-size:12px}
}
@media(orientation:landscape) and (max-height:500px){
 body.question-workspace header{position:static}
 body.question-workspace[data-interface] #boardWrap{height:65svh;min-height:240px}
 body.question-workspace #q1RunDock #selection{display:flex}
}
/* One scrollable question row, not two rows of shrunken targets. */
body.question-workspace #questionNav{display:flex;flex-wrap:nowrap;order:0;overflow-x:auto;overflow-y:hidden;gap:3px;justify-content:flex-start;scrollbar-width:thin}
body.question-workspace[data-interface] #questionNav a{flex:0 0 44px;min-width:44px;padding:5px 4px}
@media(max-width:600px){body.question-workspace #questionNav{order:3}}
body.question-workspace #q1RunDock>summary{flex-wrap:wrap}
body.question-workspace[data-interface] #q1RunDock #simStatus{display:block!important;flex:1 0 100%;min-width:0;margin:0;font-size:13px;font-weight:700;line-height:1.25;white-space:normal;overflow-wrap:anywhere}
/* Keep the existing desktop zoom buttons in the reserved selection row. */
body.question-workspace #desktopSelection #boardRecovery{position:static;flex:none;padding:0;gap:3px;border:0;background:transparent;min-width:0}
body.question-workspace #desktopSelection #boardRecovery button{padding-inline:6px;font-size:13px}
body.question-workspace[data-interface="mobile"] #desktopSelection #boardRecovery{display:none!important}
body.question-workspace .topline h1{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
body.question-workspace #q1BoardRegion{min-width:0;position:relative}
@media(max-width:1050px){
 body.question-workspace #q1WireModes{gap:3px}
 body.question-workspace #primaryTools #q1WireModes button{font-size:12px;padding-inline:5px}
}
@media(orientation:landscape) and (max-height:500px){
 body.question-workspace .work{position:relative}
 body.question-workspace .topline{position:absolute;right:4px;top:0;z-index:3;padding:0;display:block}
 body.question-workspace .topline>div{display:none!important}
 body.question-workspace .topline #check{height:44px;font-size:13px;margin:0}
 body.question-workspace #primaryTools{padding-right:102px}
 body.question-workspace #q1BoardRegion{display:grid;grid-template-columns:minmax(0,1fr) 164px;gap:4px;align-items:start}
 body.question-workspace #q1BoardRegion #boardWrap{grid-column:1;grid-row:1;width:100%;min-width:0;height:65svh;min-height:240px}
 body.question-workspace #q1RunDock{grid-column:2;grid-row:1;position:sticky;top:0;max-height:calc(100svh - 24px);overflow:auto;overscroll-behavior:contain}
 body.question-workspace #q1RunDock>summary{gap:3px;padding:4px}
 body.question-workspace #q1RunDock #mobileStatusIcons{flex-basis:100%;grid-template-columns:repeat(3,minmax(0,1fr))}
 body.question-workspace #q1RunDock #selection{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:4px;gap:4px}
 body.question-workspace #q1RunDock #selection button{font-size:12px;padding-inline:3px}
 body.question-workspace.q1-tutorial-active #q1RunDock{max-height:calc(100svh - 145px)}
}

/* Q1 mode status is noninteractive; only the exam shows elapsed time. */
body.question-workspace #q1ModeStatus{display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:5px 9px;font-size:13px;background:#e9f6f3;border:1px solid #a8d4c9;border-radius:8px;white-space:nowrap}
body.question-workspace #q1ModeStatus #elapsed{font-size:16px;line-height:1.2;font-variant-numeric:tabular-nums}
body.question-workspace #q1ModeStatus[data-mode="practice"] #elapsed{display:none}
body.question-workspace #modeSlot{margin-top:3px}
body.question-workspace #q1RunDock .q1-run-disclosure-hint{font-size:12px;text-decoration:underline;text-underline-offset:2px;color:#096c64;white-space:nowrap}
body.question-workspace[data-interface] .q1-settings-body .modebar{gap:8px}
body.question-workspace[data-interface] #q1MobileViewTools,body.question-workspace[data-interface] #interfaceModeSwitch{gap:8px}
body.question-workspace[data-interface] .modebar #practiceMode,body.question-workspace[data-interface] .modebar #examMode,body.question-workspace[data-interface] .modebar #toggleTools,body.question-workspace[data-interface] .modebar #mobileVersion,body.question-workspace[data-interface] .modebar #desktopVersion{min-height:44px;min-width:44px;padding:7px 9px}
body.question-workspace .legend{font-size:12px;line-height:1.3}
body.question-workspace .topline h1{white-space:normal;text-overflow:clip;overflow:visible}
body.question-workspace #desktopSelection #selectedText{white-space:normal;text-overflow:clip;overflow-wrap:anywhere;line-height:1.3;font-size:13px;max-height:44px;overflow:auto}
@media(max-width:600px){
 body.question-workspace .topline{gap:6px}
 body.question-workspace .topline h1{font-size:14px;line-height:1.3}
 body.question-workspace #desktopSelection{padding-inline:6px}
 body.question-workspace #desktopSelection #selectedText{font-size:12px}
 body.question-workspace #q1RunDock>summary{column-gap:5px}
}
@media(orientation:landscape) and (max-height:500px){
 body.question-workspace .topline{position:static;display:flex;padding:2px 6px;gap:5px;min-height:44px}
 body.question-workspace .topline>div{display:block!important}
 body.question-workspace .topline h1{display:none}
 body.question-workspace #modeSlot{margin:0}
 body.question-workspace #primaryTools{padding-right:6px}
}
/* Only the main overview uses the responsive foreground captions; apparatus
   picker crops continue to use the unmodified source labels. */
#board[data-q1-readable-labels="true"] #partsLayer [data-q1-original-name],#board[data-q1-readable-labels="true"] #partsLayer [data-q1-device-caption],#board[data-q1-readable-labels="true"] #q1DeviceNameLayer>[data-q1-original-name]{visibility:hidden}
body.question-workspace[data-interface] .topline>div{display:flex;align-items:center;gap:8px}
body.question-workspace[data-interface] .topline #modeSlot{flex:none;margin:0}
@media(max-width:600px) and (orientation:portrait){
 body.question-workspace[data-interface] .topline{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 6px;padding:4px 6px}
 body.question-workspace[data-interface] .topline>div{display:contents}
 body.question-workspace[data-interface] .topline h1{grid-column:1/-1;grid-row:1}
 body.question-workspace[data-interface] .topline #modeSlot{grid-column:1;grid-row:2}
 body.question-workspace[data-interface] .topline #check{grid-column:2;grid-row:2}
}
@media(orientation:landscape) and (max-height:500px){
 body.question-workspace[data-interface] .topline{position:static;display:flex;padding:2px 6px;gap:4px}
 body.question-workspace[data-interface] .topline>div{display:block!important;flex:none}
 body.question-workspace #primaryTools{padding-right:6px}
 body.question-workspace #q1ModeStatus{font-size:12px;padding-inline:6px}
 body.question-workspace #q1ModeStatus #elapsed{font-size:13px}
}

body.question-workspace[data-interface] #q1MobileViewTools #interfaceModeSwitch{gap:8px}

/* Equal minimal motor repairs are a joint review, not a convicted wire. */
.wire.review-wire{stroke:#627b8a!important;stroke-dasharray:3 4}.issue.motor-conflict{border-color:#8ca3b0;background:#f2f6f8;color:#304d60}

/* Q1: explain the single motor terminal strip beside the official drawing. */
.q1-tb2-circuit-note{margin:10px 12px;font-size:14px;line-height:1.55;color:#334b60;white-space:normal;overflow-wrap:anywhere}
#circuitDialog .q1-tb2-circuit-note{flex:none;max-width:100%;box-sizing:border-box}

/* Q1 mobile continuation keeps its optional management action in the reserved row. */
body.question-workspace #desktopSelection #mobileManagePin{min-width:44px;min-height:44px;padding:4px 7px;font-size:12px;flex-shrink:0}

/* Q1 phone landscape: retain the existing 48px slot while keeping its actions
   in the visible viewport. Never float a duplicate bar over a guided target.
   The toast remains inside this same slot; modal dialogs stay in the top layer. */
@media(orientation:landscape) and (max-height:600px){
 body.question-workspace[data-interface="mobile"]:not(.question-tutorial-active) #desktopSelection{
  position:sticky;
  top:calc(var(--q1-selection-viewport-top,0px) + env(safe-area-inset-top,0px));
  left:calc(var(--q1-selection-viewport-left,0px) + env(safe-area-inset-left,0px));
  max-width:calc(var(--q1-selection-viewport-width,100vw) - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px));
  padding-inline:max(6px,env(safe-area-inset-left,0px)) max(6px,env(safe-area-inset-right,0px));
  background:#fff;z-index:16;
 }
 body.question-workspace[data-interface="mobile"]:not(.question-tutorial-active) #desktopSelection[data-has-selection="true"]{background:#fff5ce}
 body.question-workspace[data-interface="mobile"]:not(.question-tutorial-active) #desktopSelection .wiring-selection-tools{overflow-x:auto}
 body.question-workspace[data-interface="mobile"]:not(.question-tutorial-active) #boardWrap{
  scroll-margin-top:calc(48px + var(--q1-selection-viewport-top,0px) + env(safe-area-inset-top,0px));
 }
}

/* Q1 long-press is armed: steady high-contrast halo, never a flashing signal. */
#mobileDeviceDialog .mobile-dot.mobile-pin-ready .mobile-pin-dot{fill:#fff16a!important;stroke:#302600!important;stroke-width:3!important;animation:none!important;filter:drop-shadow(0 0 2px #fff) drop-shadow(0 0 7px #ffd400) drop-shadow(0 0 12px #ffd400)!important}

body.question-workspace #simControls{display:none!important}
body.question-workspace #desktopSelection{display:block!important}
/* Q2–8 keep the wire list available in both interfaces; Q1 retains its own controls. */
body.question-workspace #showList:not([hidden]){display:inline-flex!important}
body.question-workspace #listDialog[open]{display:block!important;width:min(720px,calc(100vw - 24px));max-height:85dvh;overflow:auto}
body.question-workspace #listDialog .dialog-head{position:sticky;top:-24px;background:#fff;padding:10px 0;z-index:1}
body.question-workspace #listDialog .listrow button{flex-shrink:0}
body.question-workspace #listDialog .wire-list-select{color:#096c80}
@media(max-width:600px){body.question-workspace #listDialog{padding:14px}body.question-workspace #listDialog .dialog-head{top:-14px}body.question-workspace #listDialog .listrow{flex-wrap:wrap}body.question-workspace #listDialog .listrow span{flex-basis:100%}}
body.question-workspace #q1MobileHeaderActions{display:flex;align-items:center;gap:6px}
body.question-workspace #q1MobileViewTools{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}
body.question-workspace #q1RunDock #selection>.mobile-q3-feedback,body.question-workspace #q1RunDock #selection>.mobile-advanced-settings{flex-basis:100%;grid-column:1/-1}
body.question-workspace #q1RunDock #selection{max-width:100%;min-width:0}
body.question-workspace #q1RunDock #selection>*{min-width:0;max-width:100%}
body.question-workspace #pointLayer .terminal.selected .dot{fill:#ffd400;stroke:#805400;stroke-width:3;filter:drop-shadow(0 0 5px #ffc400)}

/* Q1 complete tutorial: persistent yellow/dark contrast, with a gentle halo
   rather than disappearing frames. Never animate the target's text. */
body.q1-interface.q1-tutorial-active .tutorial-control-target{
 outline:5px solid #ffdc00;outline-offset:3px;
 box-shadow:0 0 0 9px #243341,0 0 0 12px #fff4a3;
 animation:q1-tutorial-halo 2.4s ease-in-out infinite;
}
body.q1-interface.q1-tutorial-active .tutorial-device{
 stroke:#ffdc00;stroke-width:8;stroke-opacity:1;
 filter:drop-shadow(0 0 2px #172b38) drop-shadow(0 0 5px #ffdc00);
 animation:q1-tutorial-target-pulse 2.4s ease-in-out infinite;
}
body.q1-interface.q1-tutorial-active .terminal.tutorial-target .dot,
body.q1-interface.q1-tutorial-active[data-interface="mobile"] #mobileDeviceDialog .mobile-dot.tutorial-target circle:last-child{
 fill:#ffdc00!important;stroke:#243341!important;stroke-width:4!important;
 filter:drop-shadow(0 0 3px #ffdc00);
 animation:q1-tutorial-target-pulse 2.4s ease-in-out infinite;
}
@keyframes q1-tutorial-halo{
 0%,100%{box-shadow:0 0 0 9px #243341,0 0 0 12px #fff4a3}
 50%{box-shadow:0 0 0 9px #243341,0 0 0 15px #ffdc00}
}
@keyframes q1-tutorial-target-pulse{0%,100%{opacity:1}50%{opacity:.8}}
@media(prefers-reduced-motion:reduce){
 body.q1-interface.q1-tutorial-active .tutorial-control-target,
 body.q1-interface.q1-tutorial-active .tutorial-device,
 body.q1-interface.q1-tutorial-active .terminal.tutorial-target .dot,
 body.q1-interface.q1-tutorial-active[data-interface="mobile"] #mobileDeviceDialog .mobile-dot.tutorial-target circle:last-child{animation:none}
}

/* Q1 mobile continuation keeps its optional management action in the reserved row. */
body.q1-interface #desktopSelection #mobileManagePin{min-width:44px;min-height:44px;padding:4px 7px;font-size:12px;flex-shrink:0}

/* Q1 phone landscape: retain the existing 48px slot while keeping its actions
   in the visible viewport. Never float a duplicate bar over a guided target.
   The toast remains inside this same slot; modal dialogs stay in the top layer. */
@media(orientation:landscape) and (max-height:600px){
 body.q1-interface[data-interface="mobile"]:not(.q1-tutorial-active) #desktopSelection{
  position:sticky;
  top:calc(var(--q1-selection-viewport-top,0px) + env(safe-area-inset-top,0px));
  left:calc(var(--q1-selection-viewport-left,0px) + env(safe-area-inset-left,0px));
  max-width:calc(var(--q1-selection-viewport-width,100vw) - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px));
  padding-inline:max(6px,env(safe-area-inset-left,0px)) max(6px,env(safe-area-inset-right,0px));
  background:#fff;z-index:16;
 }
 body.q1-interface[data-interface="mobile"]:not(.q1-tutorial-active) #desktopSelection[data-has-selection="true"]{background:#fff5ce}
 body.q1-interface[data-interface="mobile"]:not(.q1-tutorial-active) #desktopSelection .wiring-selection-tools{overflow-x:auto}
 body.q1-interface[data-interface="mobile"]:not(.q1-tutorial-active) #boardWrap{
  scroll-margin-top:calc(48px + var(--q1-selection-viewport-top,0px) + env(safe-area-inset-top,0px));
 }
}

/* Q1 long-press is armed: steady high-contrast halo, never a flashing signal. */
#mobileDeviceDialog[data-question="1"] .mobile-dot.mobile-pin-ready .mobile-pin-dot{fill:#fff16a!important;stroke:#302600!important;stroke-width:3!important;animation:none!important;filter:drop-shadow(0 0 2px #fff) drop-shadow(0 0 7px #ffd400) drop-shadow(0 0 12px #ffd400)!important}

/* Shared desktop workspace has one readable sidebar column, including when
   older question overview rules would otherwise split the 300px sidebar. */
body.question-workspace[data-interface="desktop"] aside{grid-template-columns:minmax(0,1fr)}
body.question-workspace[data-interface="desktop"] aside>*{min-width:0;max-width:100%;grid-column:1/-1;grid-row:auto}
body.question-workspace[data-interface="desktop"] aside #result,
body.question-workspace[data-interface="desktop"] aside .panel-head,
body.question-workspace[data-interface="desktop"] aside .circuit-panel{grid-column:1/-1;grid-row:auto}

/* Q3 only: keep every essential control visible, but remove wasted gutters.
   Dense overview devices also have a named, minimum-44px enlargement selector. */
body.q3-workspace #q3DeviceSelect{min-height:44px;min-width:112px;max-width:170px;font-size:13px;flex:0 1 170px}
body.q3-workspace #wiringSelectionTools{gap:4px}
body.q3-workspace #q3DeviceSelect:focus-visible{outline:3px solid #087e72;outline-offset:2px}
@media(max-width:600px){
 body.q3-workspace main{padding:2px;gap:4px}
 body.q3-workspace header{padding:0 4px;gap:0 4px;min-height:44px}
 body.q3-workspace header .brand{font-size:11px}
 body.q3-workspace #questionNav{gap:2px;margin:0}
 body.q3-workspace #questionNav a{padding:0 6px;font-size:12px}
 body.q3-workspace[data-interface] .topline{display:flex;gap:4px;padding:0 4px;min-height:44px}
 body.q3-workspace[data-interface] .topline>div{display:flex;flex:1;gap:3px;min-width:0}
 body.q3-workspace .topline h1{font-size:12px;line-height:1.15;flex:1}
 body.q3-workspace #q1ModeStatus{padding:2px;font-size:11px}
 body.q3-workspace .q1-settings-body{padding:0 4px;gap:0}
 body.q3-workspace[data-interface] .q1-settings-body .modebar{gap:2px;flex-wrap:nowrap;padding:0;margin:0}
 body.q3-workspace[data-interface] #interfaceModeSwitch{gap:2px;flex-wrap:nowrap!important}
 body.q3-workspace[data-interface] .modebar #practiceMode,body.q3-workspace[data-interface] .modebar #examMode,body.q3-workspace[data-interface] .modebar #toggleTools,body.q3-workspace[data-interface] .modebar #mobileVersion,body.q3-workspace[data-interface] .modebar #desktopVersion{padding:4px 5px;font-size:12px;white-space:nowrap}
 body.q3-workspace .q1-settings-actions{gap:2px;flex-wrap:nowrap}
 body.q3-workspace[data-interface] .q1-settings-actions button{font-size:12px;padding:4px 5px;white-space:nowrap;flex:1}
 body.q3-workspace #primaryTools{padding:0 4px}
 body.q3-workspace #q1WireModes{gap:2px}
 body.q3-workspace #q1WireModeStatus{font-size:11px;line-height:1.15}
 body.q3-workspace #desktopSelection{padding:0 4px}
 body.q3-workspace #q1RunDock>summary{padding:0 4px;min-height:44px}
 body.q3-workspace #q1RunDock .q1-run-disclosure-hint{font-size:11px}
 body.q3-workspace #q3DeviceSelect{max-width:125px;font-size:12px;padding:3px}
}

/* Q1 v184: visible desktop settings and phone quick rail. All rules scoped. */
body.shared-settings-layout .q1-settings-sidebar[hidden],body.shared-settings-layout .q1-quick-tools[hidden],body.shared-settings-layout .q1-settings-panel[hidden],body.shared-settings-layout .q1-settings-shade[hidden],body.shared-settings-layout .q1-settings-hint[hidden]{display:none!important}
body.q1-settings-wide #q1WorkspaceControls,body.q1-settings-mobile #q1WorkspaceControls{display:none!important}
body.q1-settings-wide main{grid-template-columns:minmax(0,1fr) 216px minmax(230px,280px);gap:8px}
body.q1-settings-wide .q1-settings-sidebar{position:sticky;top:8px;max-height:calc(100dvh - 16px);overflow:auto;align-self:start;width:216px;min-width:0;padding:10px 8px;background:#f7fbfc;border:1px solid #d2e2e6;border-radius:10px;scrollbar-width:thin}
body.shared-settings-layout .q1-settings-sidebar h2{font-size:16px;margin:0 0 8px}
body.shared-settings-layout .q1-settings-sidebar h3,body.shared-settings-layout .q1-settings-panel h3{font-size:13px;color:#526d79;margin:10px 0 6px;line-height:1.3}
body.q1-settings-wide #q1SettingsWireSection #primaryTools{padding:0;border:0;background:transparent}
body.q1-settings-wide #q1SettingsWireSection #q1WireModes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;gap:3px}
body.q1-settings-wide #q1SettingsWireSection #q1WireModes button{font-size:12px;padding:4px 2px;min-width:0;white-space:normal;line-height:1.3}
body.q1-settings-wide #q1SettingsWireSection #q1WireModeStatus{grid-column:1/-1;font-size:11px;line-height:1.45;white-space:normal}
body.shared-settings-layout .q1-settings-segment{display:grid;grid-template-columns:1fr 1fr;gap:0;margin:5px 0;border:1px solid #08717b;border-radius:7px;overflow:hidden}
body.shared-settings-layout .q1-settings-segment button{border:0;border-radius:0;font-size:13px;padding:5px;min-width:0}
body.shared-settings-layout .q1-settings-segment button[aria-pressed=true]{background:#076d76;color:white}
body.shared-settings-layout .q1-setting-switch{width:100%;display:flex;align-items:center;justify-content:space-between;gap:6px;border:0;border-bottom:1px solid #e2ebee;border-radius:0;padding:6px 0;background:transparent;text-align:left}
body.shared-settings-layout .q1-setting-copy{min-width:0;display:flex;flex-direction:column;gap:2px}
body.shared-settings-layout .q1-setting-copy strong{font-size:13px;line-height:1.3}
body.shared-settings-layout .q1-setting-copy small{font-size:11px;font-weight:400;line-height:1.3;color:#59727f}
body.shared-settings-layout .q1-switch-track{flex:none;width:32px;height:20px;border-radius:20px;background:#cbd9de;padding:2px;transition:background .12s}
body.shared-settings-layout .q1-switch-track::before{content:'';display:block;width:16px;height:16px;border-radius:50%;background:white;box-shadow:0 1px 3px #0003;transition:transform .12s}
body.shared-settings-layout .q1-setting-switch[aria-checked=true] .q1-switch-track{background:#08717b}
body.shared-settings-layout .q1-setting-switch[aria-checked=true] .q1-switch-track::before{transform:translateX(12px)}
body.shared-settings-layout .q1-settings-delay{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:13px;margin-top:6px}
body.shared-settings-layout .q1-settings-delay select{font-size:13px;min-width:64px;padding:5px}
body.shared-settings-layout .q1-settings-action{display:block;width:100%;min-height:44px;margin:5px 0;text-align:left;font-size:13px;padding:6px}
body.shared-settings-layout .q1-settings-danger{color:#ac2435}
body.shared-settings-layout .q1-settings-summary{font-size:11px;color:#607985;line-height:1.5;margin:10px 0 0}
body.q1-settings-mobile{padding-bottom:calc(60px + env(safe-area-inset-bottom,0px))}
body.q1-settings-mobile main{grid-template-columns:minmax(0,1fr)}
body.q1-settings-mobile #primaryTools{padding:4px 6px}
body.q1-settings-mobile #primaryTools #q1WireModes{display:flex;flex-wrap:nowrap;width:100%;gap:4px}
body.q1-settings-mobile #primaryTools #q1WireModes button{flex:none;padding:5px!important;font-size:12px;min-width:0;max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.q1-settings-mobile #primaryTools #q1WireModeStatus{flex:1 1 0;min-width:0;max-width:none;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.q1-settings-mobile .q1-quick-tools{position:fixed;z-index:22;left:0;right:0;bottom:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;padding:3px 4px calc(3px + env(safe-area-inset-bottom,0px));background:#fff;border-top:1px solid #c5dadd;box-shadow:0 -2px 8px #17314212}
body.q1-settings-mobile .q1-quick-tools button{min-width:0;min-height:52px;padding:2px!important;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;border-color:transparent;border-radius:7px;background:#fff}
body.q1-settings-mobile .q1-quick-tools strong{font-size:12px;line-height:1.25;white-space:nowrap}
body.q1-settings-mobile .q1-quick-icon{font-size:18px;line-height:18px}
body.q1-settings-mobile .q1-quick-state{font-size:10px;line-height:12px;min-height:12px;white-space:nowrap}
body.q1-settings-mobile .q1-quick-tools button[aria-pressed=true]{background:#076d76;color:white}
body.q1-settings-mobile #q1Quick-settings{background:#e7f5f4;color:#086974;border:1px solid #16818a}
body.shared-settings-layout .q1-settings-shade{position:fixed;inset:0;z-index:30;background:#09243777}
body.shared-settings-layout .q1-settings-panel{position:fixed;z-index:31;left:0;right:0;bottom:0;max-height:78vh;max-height:78dvh;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;background:#fff;border:1px solid #d5e2e6;border-radius:16px 16px 0 0;padding:8px 16px calc(16px + env(safe-area-inset-bottom,0px));box-shadow:0 -6px 30px #14344326;animation:q1-settings-rise .16s ease-out}
body.shared-settings-layout .q1-settings-panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
body.shared-settings-layout .q1-settings-panel-head h2{font-size:20px;margin:0}
body.shared-settings-layout .q1-settings-panel-head button{font-size:14px}
body.shared-settings-layout .q1-settings-panel .q1-settings-group{margin-top:12px}
body.shared-settings-layout .q1-settings-panel .q1-settings-group h3{font-size:15px}
body.shared-settings-layout .q1-settings-panel .q1-setting-switch{min-height:54px;padding:7px 0}
body.shared-settings-layout .q1-settings-panel .q1-setting-copy strong{font-size:16px}
body.shared-settings-layout .q1-settings-panel .q1-setting-copy small{font-size:12px}
body.shared-settings-layout .q1-settings-panel .q1-settings-segment button,body.shared-settings-layout .q1-settings-panel .q1-settings-action{font-size:15px;min-height:44px}
body.shared-settings-layout .q1-settings-handle{width:42px;height:5px;border-radius:4px;background:#cadbe1;margin:0 auto 8px;touch-action:none}
body.shared-settings-layout .q1-settings-hint{position:fixed;z-index:24;right:8px;bottom:calc(66px + env(safe-area-inset-bottom,0px));background:#153d48;color:#fff;border-radius:8px;padding:9px 12px;font-size:13px;pointer-events:none}
body.q1-settings-mobile.q1-tutorial-active #tutorialBanner{bottom:calc(62px + env(safe-area-inset-bottom,0px));z-index:35}
body.q1-interface.q1-settings-mobile.q1-tutorial-active[data-interface="mobile"]{padding-bottom:calc(min(260px,45dvh) + 76px + env(safe-area-inset-bottom,0px))}
body.q1-settings-mobile.q1-tutorial-active .q1-settings-panel{bottom:calc(min(260px,45dvh) + 70px);max-height:calc(100dvh - min(260px,45dvh) - 82px);border-radius:16px}
@keyframes q1-settings-rise{from{transform:translateY(24px);opacity:.5}to{transform:none;opacity:1}}
@media(orientation:landscape) and (max-height:500px){
 body.q1-settings-mobile{padding-bottom:0;padding-right:calc(78px + env(safe-area-inset-right,0px))}
 body.q1-settings-mobile .q1-quick-tools{top:0;bottom:0;left:auto;right:0;width:calc(76px + env(safe-area-inset-right,0px));height:100dvh;grid-template-columns:1fr;grid-template-rows:repeat(5,minmax(0,1fr));padding:3px calc(3px + env(safe-area-inset-right,0px)) 3px 3px;border-top:0;border-left:1px solid #c5dadd}
 body.q1-settings-mobile .q1-quick-tools button{height:100%;min-height:52px}
 body.q1-settings-mobile .q1-settings-panel{top:0;bottom:0;left:auto;right:calc(78px + env(safe-area-inset-right,0px));width:min(360px,calc(100vw - 90px));height:100dvh;max-height:100dvh;border-radius:16px 0 0 16px;padding-bottom:16px}
 body.q1-settings-mobile .q1-settings-hint{right:calc(84px + env(safe-area-inset-right,0px));bottom:12px}
 body.q1-settings-mobile.q1-tutorial-active #tutorialBanner{right:calc(84px + env(safe-area-inset-right,0px));bottom:6px;max-height:38dvh}
 body.q1-settings-mobile.q1-tutorial-active .q1-settings-panel{bottom:calc(38dvh + 12px);height:calc(62dvh - 12px);max-height:calc(62dvh - 12px)}
 body.q1-interface.q1-settings-mobile.q1-tutorial-active[data-interface="mobile"]{padding-bottom:calc(38dvh + 16px)}
 body.q1-settings-mobile #q1BoardRegion{grid-template-columns:minmax(0,1fr) 150px}
 body.q1-settings-mobile #desktopSelection{max-width:100%!important}
}
@media(prefers-reduced-motion:reduce){body.shared-settings-layout .q1-settings-panel{animation:none}}
/* Phone interface is also selectable on a wide desktop viewport. */
body.q1-settings-mobile[data-interface="mobile"] .topline{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 6px}
body.q1-settings-mobile[data-interface="mobile"] .topline>div{display:contents!important}
body.q1-settings-mobile[data-interface="mobile"] .topline h1{grid-column:1/-1;grid-row:1;min-width:0}
body.q1-settings-mobile[data-interface="mobile"] .topline #modeSlot{grid-column:1;grid-row:2;width:auto;min-width:0}
body.q1-settings-mobile[data-interface="mobile"] .topline #check{grid-column:2;grid-row:2}
@media(orientation:landscape) and (max-height:500px){body.q1-settings-mobile[data-interface="mobile"] .topline h1{display:block;font-size:12px;line-height:1.25;margin:0}body.q1-settings-mobile[data-interface="mobile"] .topline #modeSlot,body.q1-settings-mobile[data-interface="mobile"] .topline #check{grid-row:2}}

/* Factory-bridged strips: visible side legend, separate from compact screw labels. */
.mobile-device-dialog .mobile-panel-caption{display:block;margin-top:4px;font-size:14px;line-height:1.35;font-weight:600;color:#365966;overflow-wrap:anywhere}

/* Preserve special question controls rather than leaving them in the hidden old row. */
body.shared-settings-layout:is(.q1-settings-wide,.q1-settings-mobile) #q1SettingsContent #extraTools{width:100%;padding:4px 0;gap:4px;flex-wrap:wrap}
body.shared-settings-layout:is(.q1-settings-wide,.q1-settings-mobile) #q1SettingsContent #extraTools[hidden]{display:none!important}
body.shared-settings-layout:is(.q1-settings-wide,.q1-settings-mobile) #q1SettingsContent #extraTools>.toggle,
body.shared-settings-layout:is(.q1-settings-wide,.q1-settings-mobile) #q1SettingsContent #extraTools>.wiring-summary,
body.shared-settings-layout:is(.q1-settings-wide,.q1-settings-mobile) #q1SettingsContent #simSound{display:none!important}
body.shared-settings-layout #q1SettingsContent .simbar{display:flex;flex-wrap:wrap;width:100%;padding:0}
body.shared-settings-layout #q1SettingsContent .simbar>div{display:flex;flex-wrap:wrap;gap:6px;width:100%}
body.shared-settings-layout #q1SettingsContent .simbar label{white-space:normal;font-size:12px}
body.shared-settings-layout #q1SettingsContent button,body.shared-settings-layout #q1SettingsContent input{min-height:44px}
body.shared-settings-layout .topline h1{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere}
body.shared-settings-layout.q1-settings-mobile #primaryTools #q1WireModes{flex-wrap:wrap}
body.shared-settings-layout.q1-settings-mobile #primaryTools #q1WireModeStatus{flex:1 1 90px}
@media(orientation:landscape) and (max-height:500px){
 body.shared-settings-layout.q1-settings-mobile .topline{position:static;padding:2px 6px}
 body.shared-settings-layout.q1-settings-mobile .topline h1{grid-column:1;grid-row:1;font-size:12px;line-height:1.25}
 body.shared-settings-layout.q1-settings-mobile .topline #check{grid-column:2;grid-row:1}
 body.shared-settings-layout.q1-settings-mobile .topline #modeSlot{grid-column:1/-1;grid-row:2}
 body.shared-settings-layout.q1-settings-mobile #primaryTools{padding-right:6px}
}
body.shared-settings-layout .q1-settings-hint{pointer-events:auto;cursor:pointer}
body.shared-settings-layout:is(.q1-settings-wide,.q1-settings-mobile) #q1BoardRegion{display:flex;flex-direction:column;min-width:0}
body.shared-settings-layout:is(.q1-settings-wide,.q1-settings-mobile) #q1BoardRegion #boardWrap{order:0}
body.shared-settings-layout:is(.q1-settings-wide,.q1-settings-mobile) #q1RunDock{order:1;position:static}
body.shared-settings-layout:is(.q1-settings-wide,.q1-settings-mobile) #q1RunDock>summary{cursor:default}
body.shared-settings-layout:is(.q1-settings-wide,.q1-settings-mobile) #q1RunDock>summary::before{display:none}
body.shared-settings-layout:is(.q1-settings-wide,.q1-settings-mobile) #q1RunDock .q1-run-disclosure-hint{display:none}
body.shared-settings-layout:is(.q1-settings-wide,.q1-settings-mobile) #mobileQ2Advanced{display:none}
body.shared-settings-layout #q1SettingsContent>.q1-settings-group>.q5-settings{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
body.shared-settings-layout #q1SettingsContent>.q1-settings-group>.q5-settings label{font-size:13px;width:100%;white-space:normal}
@media(orientation:landscape) and (max-height:500px){
 body.shared-settings-layout.q1-settings-mobile #q1BoardRegion{display:grid;grid-template-columns:minmax(0,1fr) 150px}
 body.shared-settings-layout.q1-settings-mobile #q1RunDock{grid-column:2;grid-row:1;max-height:65svh;overflow:auto;position:sticky;top:0}
}
body.shared-settings-layout .q1-settings-action[aria-pressed=true]{background:#076d76;color:#fff}
body.shared-settings-layout .q1-settings-group[hidden]{display:none!important}
/* A single compact heading row keeps landscape board access without hiding title or exam time. */
@media(orientation:landscape) and (max-height:500px){
 body.shared-settings-layout.q1-settings-mobile[data-interface="mobile"] .topline{grid-template-columns:minmax(0,1fr) auto auto;gap:3px 5px;align-items:center}
 body.shared-settings-layout.q1-settings-mobile[data-interface="mobile"] .topline h1{grid-column:1;grid-row:1}
 body.shared-settings-layout.q1-settings-mobile[data-interface="mobile"] .topline #modeSlot{grid-column:2;grid-row:1;margin:0}
 body.shared-settings-layout.q1-settings-mobile[data-interface="mobile"] .topline #check{grid-column:3;grid-row:1}
 body.shared-settings-layout.q1-settings-mobile #q1ModeStatus{min-height:0;padding:3px 5px;gap:3px;flex-wrap:wrap;max-width:105px;font-size:11px}
 body.shared-settings-layout.q1-settings-mobile #q1ModeStatus #elapsed{font-size:12px}
}

/* Q1 timer screws are only 13.3 units apart. Keep the painted dot, including
   selected/tutorial outlines, inside its disjoint target at every zoom. */
body.q1-interface #pointLayer .terminal[data-id^="TR1."] .dot{stroke-width:2!important}

/* Desktop equipment close-ups use the established Q3 selector and 44px targets. */
body[data-interface] #wiringSelectionTools .device-zoom-select{min-height:44px;min-width:112px;max-width:170px;font-size:13px;flex:0 1 170px}
body[data-interface] #wiringSelectionTools .device-zoom-select:focus-visible{outline:3px solid #087e72;outline-offset:2px}
body[data-interface="desktop"] #desktopSelection .wiring-selection-tools{overflow-x:auto}
@media(max-width:600px){body[data-interface] #wiringSelectionTools .device-zoom-select{max-width:125px;font-size:12px;padding:3px}}

/* Report 6 A1: Q6's nested door panel must not become a narrow grid cell.
   Scope the repair to phone widths; keep the wide desktop arrangement intact. */
@media(max-width:900px){
 body.question-workspace #q1RunDock #selection.q6-mobile-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:8px;padding:8px}
 body.question-workspace #q1RunDock #selection.q6-mobile-controls>div,
 body.question-workspace #q1RunDock #selection.q6-mobile-controls>details,
 body.question-workspace #q1RunDock #selection.q6-mobile-controls>.q6-circuit-shortcut{grid-column:1/-1;width:100%;min-width:0}
 body.question-workspace #q1RunDock #selection.q6-mobile-controls .q6-power-controls,
 body.question-workspace #q1RunDock #selection.q6-mobile-controls .q6-door-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:8px}
 body.question-workspace #q1RunDock #selection.q6-mobile-controls .mobile-control{height:44px;min-height:44px;max-height:60px;min-width:0;width:100%;padding:6px;font-size:14px;line-height:1.25;white-space:normal;overflow-wrap:normal;word-break:normal}
 body.question-workspace #q1RunDock #mobileQ6-ems{grid-column:1/-1}
 body.question-workspace #q1RunDock .q6-mobile-lamps{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 body.question-workspace #q1RunDock .q6-mobile-lamp{min-width:0;gap:4px;font-size:13px;padding:6px 4px;white-space:nowrap;word-break:normal}
 body.question-workspace #q1RunDock .q6-mobile-lamp>span{white-space:nowrap}
 body.question-workspace #q1RunDock .q6-phone-door>summary{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 8px}
 body.question-workspace #q1RunDock .q6-mobile-status{float:none;max-width:100%;overflow-wrap:normal;word-break:normal}
}
/* A 150px landscape rail cannot fit two readable lamp labels. Q6 keeps its
   entire operating area below the board instead of squeezing the door panel. */
@media(max-width:900px) and (orientation:landscape) and (max-height:500px){
 body.question-workspace.shared-settings-layout.q1-settings-mobile:has(#mobileQ6DoorPanel) #q1BoardRegion{display:flex;flex-direction:column}
 body.question-workspace.shared-settings-layout.q1-settings-mobile:has(#mobileQ6DoorPanel) #q1RunDock{width:100%;max-height:none;overflow:visible;position:static}
}

/* Q5/Q8: the active wire's size and color remain fully readable on phones. */
body.shared-settings-layout.q1-settings-mobile #primaryTools #q1WireModes[data-multiple-wire-colors="true"] #q1WireModeStatus{
 flex:0 0 100%;width:100%;min-width:0;max-width:100%;font-size:12px;line-height:1.4;
 white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:break-word;
}

/* Narrow desktop: selected-terminal instructions own a full row, above tools. */
@media(max-width:1279.98px){
 body:is(.q1-interface,.question-workspace)[data-interface="desktop"] #desktopSelection{
  height:auto;min-height:48px;overflow:visible;padding-block:5px;
 }
 body:is(.q1-interface,.question-workspace)[data-interface="desktop"] #desktopSelection .wiring-selection-tools{
  height:auto;flex-wrap:wrap;overflow:visible;row-gap:5px;
 }
 body:is(.q1-interface,.question-workspace)[data-interface="desktop"] #desktopSelection #selectedText{
  order:-1;flex:0 0 100%;width:100%;min-width:0;max-height:none;
  white-space:normal;overflow:visible;text-overflow:clip;line-height:1.4;
 }
}
.q8-apparatus-note{font-size:13px;line-height:1.5;overflow-wrap:break-word}

/* Q5/Q8 short landscape: share one row with the wire-mode buttons without
   truncating the active size/color. Portrait keeps its full-width status row. */
@media(orientation:landscape) and (max-height:430px){
 body.shared-settings-layout.q1-settings-mobile #primaryTools #q1WireModes[data-multiple-wire-colors="true"]{flex-wrap:nowrap;align-items:center}
 body.shared-settings-layout.q1-settings-mobile #primaryTools #q1WireModes[data-multiple-wire-colors="true"] button{white-space:normal;overflow:visible;text-overflow:clip;line-height:1.3}
 body.shared-settings-layout.q1-settings-mobile #primaryTools #q1WireModes[data-multiple-wire-colors="true"] #q1WireModeStatus{flex:1 1 0;width:auto;max-width:none;min-width:0;white-space:normal;overflow:visible;text-overflow:clip}
}

/* Q1–Q4 portrait: the active wire mode owns a full row, so the complete
   size and return-to-control instruction never collapse to an ellipsis. */
@media(max-width:430px) and (orientation:portrait){
 body.shared-settings-layout.q1-settings-mobile #primaryTools #q1WireModes:is([data-question-id="1"],[data-question-id="2"],[data-question-id="3"],[data-question-id="4"]){flex-wrap:wrap}
 body.shared-settings-layout.q1-settings-mobile #primaryTools #q1WireModes:is([data-question-id="1"],[data-question-id="2"],[data-question-id="3"],[data-question-id="4"]) #q1WireModeStatus{
  flex:0 0 100%;width:100%;min-width:0;max-width:100%;font-size:12px;line-height:1.4;
  white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:break-word;
 }
}

/* The real board entrance remains the only operational polarity control. */
body.q1-interface.q1-tutorial-active #q1MotorLabEntry.tutorial-control-target rect{fill:#ffdc00;stroke:#172b38;stroke-width:4}
body.q1-interface.q1-tutorial-active #q1MotorLabEntry.tutorial-control-target text{fill:#172b38;font-weight:800}

/* One compact release marker, with check timing beside results only after a check. */
.site-version{display:inline-block;font-size:12px;font-weight:600;letter-spacing:0;vertical-align:middle;padding:3px 6px;border:1px solid #76919e;border-radius:5px;white-space:nowrap}.check-timing{font-size:12px;color:#607281;margin:0 0 16px;line-height:1.5}

/* Q2–Q8 reuse Q1's read-only status cards, driven by their own simulators. */
body.question-workspace #q1RunDock #mobileStatusIcons[data-question-status-icons]{flex:1 0 100%;grid-template-columns:repeat(auto-fit,minmax(52px,1fr));gap:4px}
body.question-workspace #mobileStatusIcons[data-question-status-icons] [data-status-icon]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-height:36px;padding:2px;border:1px solid #d6e0e3;border-radius:7px;background:#fff;color:#7b8a91;font-size:10px;font-weight:700;line-height:1.2;text-align:center;white-space:nowrap}
body.question-workspace #mobileStatusIcons[data-question-status-icons] svg{display:block;width:22px;height:22px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
body.question-workspace #mobileStatusIcons[data-question-status-icons] [data-tone="green"]{color:#06735f;background:#eaf7f1;border-color:#70bba9}
body.question-workspace #mobileStatusIcons[data-question-status-icons] [data-tone="blue"]{color:#1b65a2;background:#ebf4fc;border-color:#86b5db}
body.question-workspace #mobileStatusIcons[data-question-status-icons] [data-tone="normal"]{color:#45665b}
body.question-workspace #mobileStatusIcons[data-question-status-icons] [data-tone="red"]{color:#b52038;background:#fff0ed;border-color:#d88991}
body.question-workspace #mobileStatusIcons[data-question-status-icons] [data-tone="yellow"]{color:#9c6d00;background:#fff9d8;border-color:#d9b644}
body.question-workspace #mobileStatusIcons[data-question-status-icons] [data-tone="white"]{color:#304e60;background:#fff;border-color:#708a9b}
body.question-workspace #mobileStatusIcons .motor-arrow-forward,body.question-workspace #mobileStatusIcons .motor-arrow-reverse,body.question-workspace #mobileStatusIcons .motor-brake,body.question-workspace #mobileStatusIcons .nfb-open,body.question-workspace #mobileStatusIcons .nfb-closed,body.question-workspace #mobileStatusIcons .thry-normal,body.question-workspace #mobileStatusIcons .thry-tripped,body.question-workspace #mobileStatusIcons .sensor-blocked{display:none}
body.question-workspace #mobileStatusIcons [data-state="forward"] .motor-arrow-forward,body.question-workspace #mobileStatusIcons [data-state="reverse"] .motor-arrow-reverse,body.question-workspace #mobileStatusIcons [data-state="braking"] .motor-brake,body.question-workspace #mobileStatusIcons [data-state="off"] .nfb-open,body.question-workspace #mobileStatusIcons [data-state="on"] .nfb-closed,body.question-workspace #mobileStatusIcons [data-state="normal"] .thry-normal,body.question-workspace #mobileStatusIcons [data-state="tripped"] .thry-tripped,body.question-workspace #mobileStatusIcons [data-state="blocked"] .sensor-blocked{display:block}
body.question-workspace #mobileStatusIcons [data-state="on"] .status-lamp-bulb{fill:currentColor;stroke:currentColor}
body.question-workspace #mobileStatusIcons [data-state="off"] .status-lamp-bulb{fill:#e4e9ec;stroke:#94a2a9}
@media(max-width:600px){body.question-workspace #q1RunDock #mobileStatusIcons[data-question-status-icons]{grid-template-columns:repeat(6,minmax(0,1fr))}body.question-workspace #mobileStatusIcons[data-question-status-icons] small{font-size:9px}}
@media(orientation:landscape) and (max-height:500px){body.question-workspace #q1RunDock #mobileStatusIcons[data-question-status-icons]{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Q1 only: floating selection feedback has no layout footprint. */
body.q1-interface:not(.q1-tutorial-active) #desktopSelection{
 position:fixed!important;top:auto!important;
 left:calc(var(--q1-selection-viewport-left,0px) + 8px)!important;right:auto!important;bottom:var(--q1-float-bottom,8px)!important;
 width:calc(var(--q1-selection-viewport-width,100vw) - 16px - var(--q1-float-rail,0px))!important;max-width:960px!important;
 height:auto!important;min-height:48px!important;max-height:110px!important;margin:0!important;
 z-index:32;border:1px solid #b8cbd0;border-radius:10px;background:#fff9e5;box-shadow:0 4px 18px #172b3826;
}
body.q1-interface:not(.q1-tutorial-active) #desktopSelection .wiring-selection-tools{flex-wrap:nowrap!important;overflow-x:auto;min-height:46px}
body.q1-interface:not(.q1-tutorial-active) #desktopSelection #selectedText{flex:1 0 160px!important;order:0!important;width:auto!important;max-height:76px;overflow:auto}
#q1QuickStart{box-sizing:border-box;width:min(440px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:20px;border:0;border-radius:16px;color:#172b38;box-shadow:0 12px 60px #0004}
#q1QuickStart::backdrop{background:#172b3870}
#q1QuickStart h2{font-size:21px;margin:12px 0 18px;clear:both}
#q1QuickStart ol{padding-left:24px}#q1QuickStart li{padding-left:4px;margin:14px 0}
#q1QuickStart p{font-size:15px;line-height:1.6;margin:5px 0}
#q1QuickStart button{min-height:44px;touch-action:manipulation}
#q1QuickClose{float:right}#q1QuickDone{display:block;width:100%;margin-top:12px;background:#087e72;color:white}
#q1QuickStart .q1-quick-choice{display:flex;align-items:center;gap:10px;min-height:44px}
#q1QuickHide{width:22px;height:22px}
#q1QuickReport{display:block;width:100%;margin-top:10px;background:#fff;color:#086974;border:1px solid #16818a}
/* Q1 guided tour: readable action strip, clear apparatus/pin emphasis. */
body.q1-interface.q1-tutorial-active .q1-full-tutorial{
 bottom:var(--q1-float-bottom,8px)!important;left:8px!important;right:auto!important;
 width:calc(var(--q1-selection-viewport-width,100vw) - 16px - var(--q1-float-rail,0px));
 box-sizing:border-box;max-width:1000px;max-height:38dvh!important;padding:12px 16px!important;
 background:#fff0a6!important;border:4px solid #e8b100!important;box-shadow:0 0 0 3px #fff,0 4px 24px #172b3840;
}
body.q1-interface.q1-tutorial-active .q1-full-tutorial #tutorialStep{font-size:22px!important;line-height:1.4;font-weight:900}
body.q1-interface.q1-tutorial-active .q1-full-tutorial #tutorialFeedback{font-size:18px!important;line-height:1.55;overflow-y:auto;max-height:20dvh}
body.q1-interface.q1-tutorial-active #tutorialTourNext{grid-column:1/-1;min-height:48px;font-size:18px;font-weight:800;margin:8px 0}
body.q1-interface.q1-tutorial-active #mobileDeviceDialog .mobile-sheet-status{background:#fff0a6;border:3px solid #e8b100;border-radius:8px;padding:10px;font-size:20px!important;line-height:1.5}
body.q1-interface.q1-tutorial-active .tutorial-device{stroke-width:9!important}
body.q1-interface.q1-tutorial-active .terminal.tutorial-target .dot{stroke-width:5!important;filter:drop-shadow(0 0 7px #ffdc00)}
@media(max-height:500px){body.q1-interface.q1-tutorial-active .q1-full-tutorial #tutorialStep{font-size:19px!important}body.q1-interface.q1-tutorial-active .q1-full-tutorial #tutorialFeedback{font-size:16px!important}}

/* Q1 orientation is part of the same tutorial; red never covers the board. */
#q1BoardOrientation{position:relative;z-index:10000}
#q1BoardOrientation [hidden]{display:none!important}
.q1-orientation-frame,.q1-orientation-scroll{position:fixed;pointer-events:none;border-radius:10px;box-sizing:border-box}
.q1-orientation-frame{border:4px solid #f5c400;z-index:10000}
#q1BoardOrientation[data-stage="1"] .q1-orientation-frame{background:repeating-linear-gradient(135deg,#75818d35 0 2px,#f7f9fa75 2px 10px)}
.q1-orientation-scroll{border:5px solid #ee4436;background:#ee443610;z-index:10000;display:flex;align-items:center;justify-content:center}
.q1-orientation-scroll span{background:#fff2ef;color:#a72720;border:1px solid #ee4436;border-radius:20px;padding:8px 12px;font-size:18px;font-weight:800;box-shadow:0 2px 10px #0002}
.q1-orientation-card{position:fixed;z-index:10001;top:max(8px,env(safe-area-inset-top));bottom:auto;left:10px;right:10px;max-width:780px;margin:0 auto;background:#fff3b0;color:#173142;border:3px solid #dfb100;border-radius:14px;padding:12px;box-shadow:0 4px 24px #0003;max-height:42dvh;overflow:auto}
.q1-orientation-heading{display:flex;align-items:center;justify-content:space-between;gap:6px}
.q1-orientation-heading strong{font-size:clamp(20px,2.6vw,26px);line-height:1.3}
.q1-orientation-card p{font-size:16px;line-height:1.5;margin:8px 0}
.q1-orientation-card button{min-height:44px;touch-action:manipulation}
.q1-orientation-exit{font-size:14px;white-space:nowrap;padding:5px 9px;flex:none}
.q1-orientation-next{width:100%;font-size:17px}
#q1BoardOrientation[data-stage="2"] .q1-orientation-card{top:auto;bottom:max(8px,env(safe-area-inset-bottom))}
/* Show both the complete board and a useful page-scroll area during the introduction. */
body.q1-interface.q1-orientation-active[data-interface] #q1BoardRegion #boardWrap,
body.q1-interface.q1-orientation-active[data-interface] #boardWrap{height:clamp(220px,43dvh,480px);min-height:220px;max-height:none;scroll-margin:0}
/* Existing coach graphics must not show a wiring target before stage 3. */
body.q1-orientation-active #q1GuideDeviceFrame,
body.q1-orientation-active #tutorialDirectionArrow,
body.q1-orientation-active #tutorialBanner{display:none!important}
@media(orientation:landscape) and (max-height:500px){
 .q1-orientation-card{max-width:none;right:auto;width:42vw;max-height:calc(100dvh - 16px)}
 .q1-orientation-heading{align-items:flex-start}
 .q1-orientation-heading strong{font-size:18px}
 .q1-orientation-card p{font-size:14px}
 body.q1-interface.q1-orientation-active[data-interface] #boardWrap{height:60dvh}
}
/* Desktop coaching stays within the wiring workspace, clear of Settings/results. */
body.q1-interface.q1-tutorial-active[data-interface="desktop"] .q1-full-tutorial{
 left:var(--q1-coach-desktop-left,8px)!important;
 width:var(--q1-coach-desktop-width,calc(100vw - 16px))!important;
}
body.q1-interface.q1-tutorial-active[data-interface="desktop"] .q1-full-tutorial #tutorialFeedback{
 font-size:16px!important;line-height:1.5
}
body.q1-interface[data-interface="desktop"] .q1-orientation-card{
 left:var(--q1-orientation-left,10px);right:auto;
 width:var(--q1-orientation-width,min(780px,calc(100vw - 20px)));
}
/* Keep device labels readable while leaving a page-scroll target below the board. */
body.q1-interface.q1-orientation-active[data-interface="desktop"] #q1BoardRegion #boardWrap,
body.q1-interface.q1-orientation-active[data-interface="desktop"] #boardWrap{
 height:clamp(260px,54dvh,520px);min-height:260px
}

/* BUG reports: device-local identity, server-stored reports and owner replies. */
#bugDialog{max-height:90dvh;overflow-y:auto}
#bugDialog>.dialog-head{position:sticky;top:0;z-index:2;background:#fff;padding-block:4px}
#bugDialog .bug-tabs{display:flex;gap:8px;margin:12px 0 18px;border-bottom:1px solid #ccdcdf;padding-bottom:10px}
#bugDialog .bug-tabs button{flex:1;min-height:44px;white-space:normal}
#bugDialog .bug-tabs [aria-selected="true"]{background:#087580;color:#fff;border-color:#087580}
#bugDialog #bugForm[hidden],#bugDialog #bugHistoryPanel[hidden]{display:none!important}
.bug-history-head{display:flex;gap:10px;align-items:center;justify-content:space-between}
.bug-history-head h3{font-size:19px;margin:4px 0}.bug-history-head button{min-height:44px}
.bug-history-card{border:1px solid #bfd5d8;background:#f7fbfb;border-radius:12px;padding:14px;margin:14px 0;overflow-wrap:anywhere}
.bug-history-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.bug-status{padding:3px 8px;border-radius:7px;background:#e3f0ed;font-size:13px;font-weight:700}
.bug-new-reply{background:#fff1b8;color:#6f5400;font-weight:750;border-radius:6px;padding:3px 8px;font-size:13px}
.bug-history-description{white-space:pre-wrap;line-height:1.6;margin:10px 0}.bug-history-date{font-size:12px;color:#536a76;line-height:1.5}
.bug-history-card h4{font-size:16px;margin:18px 0 10px}.bug-owner-reply{border-left:3px solid #087580;padding:3px 12px;background:white;margin:10px 0}
#bugHistoryStatus.error{color:#a21c31}#bugHistoryMore{width:100%;min-height:44px}.bug-history-empty{padding:18px;background:#f1f6f6;border-radius:10px;line-height:1.6}
/* Selected motor repair survives edits; only its unfinished leads pulse. */
.wire.repair-pending-wire{stroke:#b85a00!important;stroke-width:calc(var(--q1-wire-width,3px) + 2px)!important;stroke-dasharray:9 4;opacity:1;filter:drop-shadow(0 0 3px #ffc400);animation:repair-guidance-pulse 1.4s ease-in-out infinite}
.repair-target-wire{fill:none;stroke:#b85a00;stroke-width:3;stroke-dasharray:5 7;opacity:1;animation:repair-guidance-pulse 1.4s ease-in-out infinite}
.terminal.repair-target .dot,.mobile-dot.repair-target circle:last-child{stroke:#a95b00!important;stroke-width:4!important;filter:drop-shadow(0 0 3px #ffd400);animation:repair-guidance-pulse 1.4s ease-in-out infinite}
@keyframes repair-guidance-pulse{0%,100%{opacity:1}50%{opacity:.28}}
.repair-progress{margin:12px 0;padding:12px;border:2px solid #bd7900;border-radius:9px;background:#fff8e3;overflow-wrap:anywhere}
#result .repair-progress p{margin:8px 0;color:#634615;font-size:13px}.repair-progress .repair-step-done{color:#19633b!important}.repair-actions{display:flex;gap:6px;flex-wrap:wrap}.repair-actions button{font-size:13px;padding:6px 8px;flex:1}.issue.motor-repair-choice[aria-pressed=true]{border:2px solid #bd7900;background:#fff5d5}.result-stale-notice{padding:10px;border:1px solid #c18418;background:#fff6df;color:#69480c!important}.retained-check-result{border-top:1px solid #d3dce2;margin-top:14px;padding-top:8px}.retained-check-result button:disabled{opacity:.78;cursor:default}.retained-check-result .repair-progress{display:none}
@media(prefers-reduced-motion:reduce){.wire.repair-pending-wire,.repair-target-wire,.terminal.repair-target .dot,.mobile-dot.repair-target circle:last-child{animation:none}}
.issue.circuit-repair-choice[aria-pressed=true]{border:2px solid #bd7900;background:#fff5d5}.circuit-repair-section{overflow-wrap:anywhere}.circuit-repair-section .issue{white-space:normal}
/* Repair phases never paint an old physical lead as a planned connection. */
.wire.repair-removal-wire{stroke:#c73535!important;stroke-dasharray:none!important;filter:drop-shadow(0 0 3px #f5a0a0)!important;animation:repair-guidance-pulse 1.4s ease-in-out infinite}
.repair-target-wire{stroke:#1267bb;stroke-dasharray:5 7;animation:none;opacity:.85;filter:drop-shadow(0 0 2px #d8eaff)}
.terminal.repair-remove-point .dot,.mobile-dot.repair-remove-point .mobile-pin-dot{stroke:#be3030!important;stroke-width:4!important;filter:none!important;animation:none!important}
.terminal.repair-origin .dot,.mobile-dot.repair-origin .mobile-pin-dot{stroke:#1267bb!important;stroke-width:4!important;filter:none}
.terminal.repair-destination .dot,.mobile-dot.repair-destination .mobile-pin-dot{stroke:#087d66!important;stroke-width:4!important;filter:none}
.terminal.repair-target .dot,.mobile-dot.repair-target .mobile-pin-dot{fill:#d7edff!important;stroke:#1267bb!important;stroke-width:5!important;filter:drop-shadow(0 0 4px #98c8ff)!important;animation:repair-guidance-pulse 1.4s ease-in-out infinite}
.repair-point-label{font-size:11px;font-weight:800;fill:#084c90;paint-order:stroke;stroke:#fff;stroke-width:4px;stroke-linejoin:round}
.repair-stage-notice{padding:10px;border:2px solid #1267bb;border-radius:6px;background:#f2f8ff}.repair-stage-notice.remove{border-color:#bd3434;background:#fff3f3}.repair-stage-notice strong{display:block}.repair-stage-notice .repair-actual-state{padding:7px;background:#fff;border-left:4px solid #bd3434;color:#7b2020!important}.repair-stage-notice .repair-planned-target{padding:7px;background:#edf5ff;border-left:4px dashed #1267bb;color:#144a7c!important}.repair-stage-notice button{width:100%;white-space:normal;padding:8px;font-weight:700}.repair-stage-notice.done{display:none}
@media(prefers-reduced-motion:reduce){.wire.repair-removal-wire,.terminal.repair-target .dot,.mobile-dot.repair-target .mobile-pin-dot{animation:none!important}}
/* The selected starting terminal stays steady; only the next click target pulses. */
.terminal.repair-origin:not(.repair-target) .dot,.terminal.repair-destination:not(.repair-target) .dot,.mobile-dot.repair-origin:not(.repair-target) .mobile-pin-dot,.mobile-dot.repair-destination:not(.repair-target) .mobile-pin-dot{animation:none!important}
body.repair-guide-active #pointLayer .terminal.selected:not(.repair-target) .dot{animation:none!important}

/* Q4 uses one level input on desktop and phone, with independent up/down steps. */
body.question-workspace #q1RunDock #selection.q4-mobile-controls{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;padding:7px}
body.question-workspace #selection.q4-mobile-controls .mobile-control{width:100%;min-width:0;font-size:14px;white-space:normal;line-height:1.3}
#selection.q4-mobile-controls .water-control{color:#075c81;background:#e4f3fa;border-color:#7fb3ca}
#selection.q4-mobile-controls .water-control:disabled,.q4-float-controls button:disabled{opacity:.45;cursor:default}
.q4-float-controls{grid-column:1/-1;grid-row:4;align-self:start;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:4px 0}
.q4-float-controls>svg{grid-column:1/-1;display:block;width:100%;height:auto;max-height:300px}
#mobileDeviceDialog[data-question="4"][data-device="FLOAT"][open]{grid-template-rows:auto auto minmax(140px,210px) auto;align-content:start;overflow-y:auto}
#mobileDeviceDialog[data-question="4"][data-device="FLOAT"] .mobile-device-stage{grid-row:3;max-height:210px;min-height:140px}
.q4-float-controls[hidden]{display:none}
.q4-float-controls button{flex:1;min-height:44px;background:#e4f3fa;border:1px solid #7fb3ca;color:#075c81;font-weight:700}
#q4-waterUp[aria-disabled=true],#q4-waterDown[aria-disabled=true]{opacity:.45}
@media(max-width:600px){
 body.question-workspace #q1RunDock #selection.q4-mobile-controls{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:4px 6px}
 body.question-workspace #selection.q4-mobile-controls .mobile-control{font-size:13px;padding:6px 3px}
 #selection.q4-mobile-controls #mobileQ4-waterUp{grid-column:3;grid-row:3}
 #selection.q4-mobile-controls #mobileQ4-waterDown{grid-column:3;grid-row:4}
 #selection.q4-mobile-controls #mobileQ4-ON2{grid-column:1;grid-row:4}
 #selection.q4-mobile-controls #mobileQ4-OFF2{grid-column:2;grid-row:4}
}

/* Q8 only: show the complete main-wire action and selected size, even in the
   narrow settings rail. Other questions keep their existing button layout. */
body.shared-settings-layout #primaryTools #q1WireModes[data-question-id="8"]{display:flex;flex-wrap:wrap;width:100%}
body.shared-settings-layout #primaryTools #q1WireModes[data-question-id="8"] button{
 flex:0 1 auto;min-width:max-content;max-width:none;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:normal;line-height:1.35;
}

/* v231: settings overlay stays above the floating wiring hint; dialogs use the top layer. */
body.shared-settings-layout .q1-settings-shade{z-index:60}
body.shared-settings-layout .q1-settings-panel{z-index:61}
body.q1-settings-open #desktopSelection{pointer-events:none}

/* v241: Q8 keeps the wiring board first, controls compact, detail opt-in. */
.q8-compact-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:6px 12px;background:#edf5f6;border-bottom:1px solid #bfd1d8}
.q8-compact-toolbar[hidden]{display:none!important}.q8-compact-toolbar>label{display:flex;gap:5px;align-items:center;font-weight:700}
.q8-compact-toolbar button,.q8-compact-toolbar select{min-height:44px;font:inherit;padding:6px 12px;border:1px solid #819ca8;border-radius:7px;background:white}
#q8Advanced{margin-left:auto}#q8Advanced>summary{min-height:44px;display:flex;align-items:center;cursor:pointer;padding:0 8px}
#q8Advanced[open]{flex-basis:100%}#q8Advanced[open]>summary{justify-content:flex-end}.q8-settings p{flex-basis:100%;margin:4px 0;line-height:1.5}
#selection.q8-mobile-controls .q8-phone-control-row{width:100%}#selection.q8-mobile-controls .mobile-q3-feedback{margin:2px 0;font-size:13px}
body.question-workspace.shared-settings-layout:has(.q8-mobile-controls) #q1BoardRegion{display:flex;flex-direction:column}
body.question-workspace:has(.q8-mobile-controls) #q1RunDock{order:-1;position:static;width:100%;max-height:none;overflow:visible}
body.question-workspace #q1RunDock:has(.q8-mobile-controls)>details>summary{min-height:30px;padding:4px 10px}
body.question-workspace #q1RunDock #selection.q8-mobile-controls{display:flex;gap:4px;padding:5px 8px}
body.question-workspace #selection.q8-mobile-controls .q8-phone-control-row{width:auto;flex:1 1 300px;flex-wrap:nowrap!important}
body.question-workspace #selection.q8-mobile-controls .q8-settings-host{display:none}
body.question-workspace #selection.q8-mobile-controls>.mobile-q3-feedback{flex:1 0 100%;order:3;font-size:12px}
body.question-workspace #selection.q8-mobile-controls>#mobileQ8Advanced{width:auto;flex:0 1 auto;border:0}
body.question-workspace #selection.q8-mobile-controls>#mobileQ8Advanced>summary{min-height:44px;padding:10px 8px;font-size:13px}
body.question-workspace #selection.q8-mobile-controls>#mobileQ8Advanced[open]{flex-basis:100%}
body.question-workspace #q1RunDock:has(.q8-mobile-controls)>summary{display:flex;align-items:center;flex-wrap:nowrap;gap:10px;min-height:30px;padding:4px 10px}
body.question-workspace #q1RunDock:has(.q8-mobile-controls)>summary #simStatus{width:auto;flex:1;font-size:12px}
body.question-workspace #q1RunDock #selection.q8-mobile-controls .mobile-control{height:44px;min-height:44px;max-height:44px;padding:6px 10px;font-size:14px}
#mobileQ8Feedback[data-warning="false"]{display:none}
body.question-workspace #selection.q8-mobile-controls>#mobileQ8Advanced:not([open]){align-self:flex-start;height:44px}
body.question-workspace #selection.q8-mobile-controls>#mobileQ8Advanced:not([open])>summary{box-sizing:border-box;height:44px;max-height:44px}

/* v242: readable safety caption outside the zoomed SVG at narrow widths. */
#selection.q8-mobile-controls .q8-switch-caption{flex:1 0 100%;margin:2px 0;font-size:12px;line-height:1.5;white-space:normal;overflow-wrap:break-word;word-break:normal;order:4;min-width:0;max-width:100%}

/* Q1 only: factory wiring is visually distinct from black learner power wires. */
#board:has(#q1DeviceNameLayer) .prewired{stroke:#75818c;stroke-dasharray:8 5;opacity:.85}
#q1DeviceNameLayer [data-q1-readable-name] rect{fill:none;stroke:none}

/* Relocated Q1 captions on the mobile overview only; apparatus crop stays original. */
#board[data-q1-mobile-labels="true"] #partsLayer [data-q1-mobile-relocated="true"]{visibility:hidden}

#board #partsLayer [data-q1-html-legend="true"]{display:none}
#q1WireLegend{font-size:13px;line-height:1.6;padding:8px 12px;color:#294353;background:#f5f8fa;white-space:normal;overflow-wrap:anywhere}

/* Q2 only: equivalent screen weight to Q1 on its double-size board. */
body.q2-diagram-style #board .prewired{stroke:#75818c;stroke-dasharray:16 10;opacity:.85}
body.q2-diagram-style #boardWrap > .legend{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center}
body.q2-diagram-style #boardWrap > .legend > span{display:inline-flex;align-items:center;gap:5px}
body.q2-diagram-style .legend i{display:inline-block;width:22px;height:0;border:0;border-top:3px solid;vertical-align:middle;background:none;border-radius:0;margin:0}
body.q2-diagram-style .legend .terminal-key{width:8px;height:8px;border:0;border-radius:50%;background:#c43a3a}
body.q2-diagram-style .legend .factory-key{border-top:3px dashed #75818c}
body.q2-diagram-style .legend .main-key{border-top:4px solid #151b20}
body.q2-diagram-style .legend .control-key{border-color:#d5a700}
body.q2-diagram-style .legend .earth-key{border-top:4px solid #12833f}
body.q2-diagram-style .q2-diagram-note{width:100%;margin:2px 0 0;font-size:12px;line-height:1.5;color:#526371}

body.q3-diagram-style #board .prewired{stroke:#75818c;stroke-dasharray:16 10;opacity:.85}
body.q3-diagram-style #boardWrap > .legend{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center}
body.q3-diagram-style #boardWrap > .legend > span{display:inline-flex;align-items:center;gap:5px}
body.q3-diagram-style .legend i{display:inline-block;width:22px;height:0;border:0;border-top:3px solid;vertical-align:middle;background:none;border-radius:0;margin:0}
body.q3-diagram-style .legend .terminal-key{width:8px;height:8px;border:0;border-radius:50%;background:#c43a3a}
body.q3-diagram-style .legend .factory-key{border-top:3px dashed #75818c}
body.q3-diagram-style .legend .main-key{border-top:4px solid #151b20}
body.q3-diagram-style .legend .control-key{border-color:#d5a700}
body.q3-diagram-style .legend .earth-key{border-top:4px solid #12833f}
body.q3-diagram-style .q3-diagram-note{width:100%;margin:2px 0 0;font-size:12px;line-height:1.5;color:#526371}
body.q3-diagram-style #questionDeviceNameLayer rect{fill:none}
body.q3-diagram-style #questionDeviceNameLayer text{stroke:#fff;stroke-width:2px;paint-order:stroke}
/* Q3 labels have transparent backgrounds and fine halos, not solid white cards. */
body.q3-diagram-style #pointLayer > text,
body.q3-diagram-style #pointLayer .terminal text{paint-order:stroke;stroke:#edf1f3;stroke-width:1.2px;stroke-linejoin:round}
body.q3-diagram-style #simStatus{white-space:normal;line-height:1.5}

/* Q4 shares the Q1 visual vocabulary, not its electrical rules. */
body.q4-diagram-style #board .prewired{stroke:#75818c;stroke-dasharray:16 10;opacity:.85}
body.q4-diagram-style #boardWrap > .legend{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center}
body.q4-diagram-style #boardWrap > .legend > span{display:inline-flex;align-items:center;gap:5px}
body.q4-diagram-style .legend i{display:inline-block;width:22px;height:0;border:0;border-top:3px solid;vertical-align:middle;background:none;border-radius:0;margin:0}
body.q4-diagram-style .legend .terminal-key{width:8px;height:8px;border:0;border-radius:50%;background:#c43a3a}
body.q4-diagram-style .legend .factory-key{border-top:3px dashed #75818c}
body.q4-diagram-style .legend .main-key{border-top:4px solid #151b20}
body.q4-diagram-style .legend .control-key{border-color:#d5a700}
body.q4-diagram-style .legend .earth-key{border-top:4px solid #12833f}
body.q4-diagram-style .q4-diagram-note{width:100%;margin:2px 0 0;font-size:12px;line-height:1.5;color:#526371}


body.q4-diagram-style #questionDeviceNameLayer rect{fill:none}
body.q4-diagram-style #questionDeviceNameLayer text{paint-order:stroke;stroke:#edf1f3;stroke-width:2px;stroke-linejoin:round}

/* Shared Q1 presentation for Q5–Q8; endpoints and hit targets unchanged. */
body.common-diagram-style #board .prewired{stroke:#75818c;stroke-dasharray:8 5;opacity:.85}
body.common-diagram-style #questionDeviceNameLayer rect{fill:none}
body.common-diagram-style #questionDeviceNameLayer text{fill:#111;paint-order:stroke;stroke:#edf1f3;stroke-width:1px;stroke-linejoin:round}
body.common-diagram-style #boardWrap > .legend{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center}
body.common-diagram-style .legend>span{display:inline-flex;align-items:center;gap:5px}
body.common-diagram-style .legend i{width:22px;height:0;border:0;border-top:2px solid;background:none;border-radius:0}
body.common-diagram-style .legend .factory-key{border-top:2px dashed #75818c}
body.common-diagram-style .legend .main-key{border-top:4px solid #151b20}
body.common-diagram-style .legend .control-key{border-color:#d5a700}
body.common-diagram-style .legend .earth-key{border-top:4px solid #12833f}
body.common-diagram-style .legend .terminal-key{width:8px;height:8px;border:0;border-radius:50%;background:#c43a3a}
body.common-diagram-style .legend>p{width:100%;font-size:12px;color:#526371}

body.common-diagram-style #board .prewired{opacity:1}
body.common-diagram-style .legend .meter-key{border-color:#b92929}
/* Lamp state is already available in the simulation dock; do not overprint names. */
body[data-diagram-question="5"] #board [data-status="BZ1"],
body[data-diagram-question="5"] #board [data-status="Y1"],
body[data-diagram-question="5"] #board [data-status="R1"],
body[data-diagram-question="6"] #board [data-status="Y1"],
body[data-diagram-question="6"] #board [data-status="Y2"],
body[data-diagram-question="6"] #board [data-status="R1"],
body[data-diagram-question="6"] #board [data-status="R2"],
body[data-diagram-question="7"] #board [data-status="Y1"],
body[data-diagram-question="7"] #board [data-status="R"],
body[data-diagram-question="7"] #board [data-status="W"]{display:none}

/* Version metadata stays readable without changing the circuit canvas. */
.site-version { white-space:normal; line-height:1.5; }
@media(max-width:600px){ .site-version { display:block; font-size:12px; } }

/* Q1 uses one 12-unit terminal radius. Keep the old hint colors and glow,
   but cap their solid outline so closely spaced screws stay separate. */
body.q1-interface #pointLayer .terminal:is(.tutorial-target,.repair-target,.repair-remove-point,.repair-origin,.repair-destination) .dot,
body.q1-interface .mobile-device-dialog .mobile-dot:is(.repair-target,.repair-remove-point,.repair-origin,.repair-destination) .mobile-pin-dot{stroke-width:3px!important}

/* Wiring surfaces are drawn diagrams, not text to select while panning or
   tapping endpoints. Keep selection and copy available in the surrounding UI. */
body.q1-interface #board,
body.q1-interface #board :is(text,tspan,textPath),
#mobileDeviceDialog[data-question="1"] .mobile-part-figure,
#mobileDeviceDialog[data-question="1"] .mobile-part-figure :is(text,tspan,textPath){
 -webkit-user-select:none;
 user-select:none;
 -webkit-touch-callout:none;
}
