/* The loose-leaf wiring bench sits inside the existing workbook. */
body.free-mode .workspace{grid-template-rows:76px minmax(0,1fr)}
body.free-mode .work-area,body.free-mode .lesson-bar,body.free-mode .mast .progress{display:none}
#free-lab[hidden],#free-lab [hidden]{display:none}
#free-lab{min-width:0;min-height:0;display:flex;flex-direction:column;gap:15px;padding:4px 0 2px;--free-edge:#cbbda5;--free-green:#286e5e;--free-muted:#625d4e}
.free-heading,.free-sheet-head,.free-board-foot,.free-edit-tools,.free-value-label,.free-meter-ranges{display:flex;align-items:center}
.free-heading{justify-content:space-between;gap:12px;padding:3px 3px 0}
.free-heading h2,.free-sheet h3,.free-side h3{margin:0;font-family:"Songti SC","STSong","Noto Serif CJK SC",serif;color:var(--ink);line-height:1.25}
.free-heading h2{font-size:clamp(25px,2.65vw,39px);letter-spacing:.05em}
.free-heading h2:focus:not(:focus-visible){outline:0}
.free-heading p,.free-box>p,.free-inspector p{margin:5px 0 0;color:var(--free-muted);font-size:14px;line-height:1.55}
.free-heading>button,.free-edit-tools button,.free-remove,.free-range-choices button,.free-text{border-radius:5px;min-height:34px;padding:5px 10px;font-size:13px;line-height:1.35;font-weight:600}
.free-heading>button,.free-edit-tools button{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--free-edge);background:#fbf6e9;color:#424c42}
.free-heading>button svg,.free-edit-tools button svg{width:16px;height:16px}
.free-layout{min-height:0;flex:1;display:grid;grid-template-columns:minmax(0,1fr) clamp(250px,23vw,335px);gap:14px}
.free-sheet,.free-box,.free-inspector{border:1px solid var(--free-edge);border-radius:9px;background:#faf5e9}
.free-sheet{min-width:0;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden}
.free-sheet-head{padding:10px 14px;justify-content:space-between;gap:8px;background:#f5eddc;border-bottom:1px solid var(--free-edge)}
.free-sheet-head h3,.free-side h3{font-size:20px}
.free-edit-tools{gap:5px}
.free-edit-tools button{border-color:transparent;background:transparent;padding:5px 7px}
.free-edit-tools button:not(:disabled):hover{border-color:var(--free-edge);background:#fff9ed}
.free-edit-tools button:disabled{opacity:.44}
.free-stage{min-height:0;position:relative;background:#f6efdf}
#free-board{position:absolute;inset:0}
.free-render-surface{width:100%;height:100%}
.free-view-picker{display:flex;gap:2px;padding:2px;border:1px solid var(--free-edge);border-radius:6px;background:#fbf5e9}
.free-view-picker button{border-radius:4px;padding:5px 10px;font-size:13px;font-weight:650;line-height:1.45;white-space:nowrap}
.free-view-picker button[aria-pressed=true]{background:#315f52;color:#fff9ec}
@media(max-width:420px){.free-view-picker button{padding:5px 6px;font-size:12px}.free-edit-tools button{gap:3px}}
@media(max-width:345px){.free-edit-tools button svg{display:none}}
.free-board-foot{gap:10px;padding:10px 14px;min-height:48px;border-top:1px solid var(--free-edge);font-size:13px;line-height:1.45;color:#575d50}
.free-state{flex-shrink:0;display:inline-flex;align-items:center;gap:6px;color:#405643}
.free-state i{width:9px;height:9px;border:1px solid #71836b;border-radius:50%;background:#d1d7bf}
[data-circuit-status=closed] .free-state i{background:#448369;border-color:#316751}
:is([data-circuit-status=short],[data-circuit-status=conflict]) .free-state{color:#913d2d}
:is([data-circuit-status=short],[data-circuit-status=conflict]) .free-state i{background:#ae5a46;border-color:#7b3d2e}
#free-count{margin-left:auto;font-size:12px;white-space:nowrap;color:#606455}
.free-empty{position:absolute;inset:0;display:grid;place-items:center;padding:20px;pointer-events:none}
.free-start{text-align:center;padding:22px 28px 25px;background:#fbf6e9f2;border:1px solid #cbbda5;border-radius:7px;max-width:335px}
.free-sketch{display:block;width:80px;height:50px;margin:0 auto 10px}
.free-sketch svg{width:100%;height:100%}
.free-start h3{font-size:23px}
.free-start p{max-width:22em;font-size:14px;color:var(--free-muted);margin:8px 0 16px}
.free-start>div{display:flex;justify-content:center;gap:7px}
.free-start button{pointer-events:auto}
.free-primary{padding:7px 13px;border:1px solid #285e4f;border-radius:4px;background:#306e5f;color:#fffaf0;font-size:14px;font-weight:650;line-height:1.4}
.free-primary:hover:not(:disabled){background:#245b50;color:white}
.free-text,.free-remove,.free-range-choices button{background:#fcf7eb;border:1px solid var(--free-edge)}
.free-text,.free-range-choices button{color:#375b4d}
.free-side{min-height:0;display:flex;flex-direction:column;gap:12px;overflow:auto;scrollbar-width:thin}
.free-box,.free-inspector{padding:clamp(13px,1.15vw,20px)}
.free-box>p,.free-inspector p{font-size:13px}
.free-palette{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:14px}
.free-palette>button{display:flex;align-items:center;text-align:left;gap:5px;min-width:0;min-height:56px;padding:5px;border:1px solid #d4c9b4;border-radius:5px;background:#fffaf0;color:#354438;cursor:grab}
.free-palette>button:hover{border-color:#55806c;background:#f2f3e6}
.free-palette>button:active{cursor:grabbing}
.free-palette-icon{display:block;width:35px;flex:0 0 35px}
.free-palette-icon svg{width:100%;height:35px}
.free-palette b,.free-palette small{display:block;line-height:1.4}
.free-palette b{font-size:13px}
.free-palette small{color:#6a6758;font-size:11px}
.free-inspector ol{padding-left:1.4em;margin:10px 0 0;font-size:13px;color:var(--free-muted);line-height:1.7}
.free-inspector li+li{margin-top:5px}
.free-inspect-controls{margin-top:12px;display:grid;gap:9px;justify-items:start}
.free-value-label{width:100%;justify-content:space-between;gap:6px;font-size:13px}
.free-value-label>span{font-family:var(--mono);white-space:nowrap}
.free-value-label input{width:5em;padding:4px 6px;border:1px solid #bbae99;background:#fffbf1;border-radius:3px;font-size:14px;font-family:inherit}
.free-slider{width:100%;accent-color:#376e59}
.free-remove{margin-top:10px;color:#784e3b;padding:4px 8px}
.free-observation:empty{display:none}
.free-range-choices{display:flex;gap:5px}
.free-range-choices button[aria-pressed=true]{background:#e2ebdc;border-color:#6a947e;color:#245e49}
#free-meter{width:min(530px,calc(100vw - 24px));max-height:90svh;padding:0;border:1px solid #a99c86;background:#faf3e6;color:var(--ink);border-radius:10px}
#free-meter::backdrop{background:#272a2670}
#free-meter .dialog-head{padding:12px 16px}
#free-meter .dialog-head h2{font-size:21px}
.free-meter-content{padding:12px 16px 16px}
.free-meter-ranges{gap:12px;margin-top:12px;font-size:14px}
@media(max-width:1000px){body.free-mode .workspace{grid-template-rows:66px minmax(0,1fr)}.free-layout{grid-template-columns:minmax(0,1fr) 252px;gap:9px}.free-box,.free-inspector{padding:12px}}
@media(max-width:720px),(max-width:900px) and (orientation:portrait){
 body.free-mode .workspace{grid-template-rows:auto auto;gap:4px}
 body.free-mode .rail-mark{display:grid}body.free-mode .settings-trigger{display:none}
 #free-lab{gap:10px;padding-top:0}
 .free-heading{padding:3px 2px}.free-heading h2{font-size:26px}.free-heading p{font-size:13px}
 .free-layout{display:flex;flex-direction:column;gap:9px}
 .free-side{display:contents}.free-sheet{order:0}.free-box{order:1}.free-inspector{order:2}
 .free-sheet-head{padding:5px 9px}.free-sheet-head h3,.free-side h3{font-size:18px}
 .free-edit-tools button{gap:4px;padding:4px 6px}
 .free-stage{height:clamp(290px,44svh,440px)}
 .free-board-foot{flex-wrap:wrap;gap:3px 8px;padding:7px 9px;min-height:44px}
 #free-message{flex:1;font-size:12px}#free-count{font-size:11px}
 .free-box,.free-inspector{padding:11px}
 .free-palette{grid-template-columns:repeat(auto-fit,minmax(81px,1fr));gap:5px;margin-top:8px}
 .free-palette>button{align-items:center;flex-direction:column;text-align:center;justify-content:center;gap:0;padding:3px;min-height:60px}
 .free-palette-icon,.free-palette-icon svg{width:32px;height:22px}.free-palette-icon{flex:0 0 auto}
 .free-palette b{font-size:12px}.free-palette small{font-size:10px}
 .free-box>p{margin-top:3px;font-size:12px}
 .free-start{max-width:285px;padding:14px 16px}.free-start p{font-size:12px;margin:5px 0 10px}.free-start h3{font-size:20px}.free-sketch{width:60px;height:36px;margin-bottom:4px}
 .free-inspector ol{margin:6px 0 0}
}
@media(max-width:360px){.mast .head-right{gap:0}.mast .subject-switch button{padding:5px 4px}.mast .wordmark h1{font-size:18px}.free-heading p{max-width:17em}}
@media(pointer:coarse){.free-edit-tools button,.free-heading>button,.free-range-choices button,.free-remove,.free-start button,.free-inspect-controls .free-primary{min-height:40px}}
[data-view-mode="solid"] .free-sprite{background-image:url("free-equipment.webp");background-repeat:no-repeat;background-size:800% 100%;background-position:calc(var(--item) * 100% / 7) center}
[data-view-mode="solid"] .free-sprite svg{visibility:hidden}
[data-view-mode="solid"] .free-sketch{width:145px;height:96.7px;margin:0 auto 5px}
[data-view-mode="solid"] .free-palette-icon{width:48px;height:32px;flex:0 0 48px}
@media(max-width:720px),(max-width:900px) and (orientation:portrait){
 [data-view-mode="solid"] .free-palette-icon{width:42px;height:28px;flex:0 0 auto}
 [data-view-mode="solid"] .free-sketch{width:108px;height:72px}
}
