:root{font-family:Tahoma,Arial,sans-serif;color:var(--ui-text-e4ecf7,#e4ecf7);background:var(--ui-bg-0c1422,#0c1422);font-size:14px;--muted:var(--ui-text-8193ac,#8193ac);--border:var(--ui-border-263246,#263246);--mint:var(--ui-accent-65ddbd,#65ddbd)}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer;color:inherit;background:var(--ui-bg-1b293c,#1b293c);border:1px solid var(--ui-border-304157,#304157);border-radius:9px;padding:10px 13px;min-height:42px;transition:background .15s}button:hover{background:var(--ui-bg-30455d,#30455d)}button.primary{background:var(--mint);border-color:var(--mint);color:#093b32;font-weight:bold}button.active{color:var(--mint);border-color:var(--ui-border-4d968d,#4d968d);background:var(--ui-bg-183934,#183934)}button.danger{color:var(--ui-text-ff9da5,#ff9da5)}input,select{color:var(--ui-text-edf3fd,#edf3fd);background:var(--ui-bg-0d192b,#0d192b);border:1px solid var(--ui-border-34445b,#34445b);border-radius:7px;padding:10px;max-width:100%;min-width:0}input[type=range]{accent-color:var(--mint);padding:0;width:100%}h1,h2,h3,p{margin-top:0}small,.muted{color:var(--muted)}.brand{display:flex;align-items:center;gap:12px}.logo{display:grid;place-items:center;background:var(--ui-bg-194a43,#194a43);color:var(--ui-text-79f4d7,#79f4d7);border:1px solid var(--ui-border-397b6b,#397b6b);width:43px;height:43px;border-radius:13px;font-size:24px}.brand strong{font-size:16px}.brand small{display:block;font-size:10px;margin-top:5px;letter-spacing:2px}.topbar{height:76px;padding:0 24px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border);background:var(--ui-bg-101b2c,#101b2c);gap:16px}.top-actions,.tools,.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.top-actions button{font-size:12px}.work{display:grid;grid-template-columns:228px 1fr 270px;height:calc(var(--official-view,100dvh) - 76px);direction:rtl}.library,.properties{background:var(--ui-bg-101b2b,#101b2b);overflow:auto;padding:22px 16px}.library{border-left:1px solid var(--border)}.properties{border-right:1px solid var(--border)}.eyebrow{color:var(--ui-text-66d7bb,#66d7bb);font-size:11px;letter-spacing:2px;margin-bottom:12px}.section-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;font-size:16px}.search{width:100%;margin-bottom:20px}.category{font-size:10px;color:var(--ui-text-7991ae,#7991ae);letter-spacing:1px;margin:20px 0 10px}.parts{display:grid;grid-template-columns:1fr 1fr;gap:8px}.part{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4px 2px 10px;background:var(--ui-bg-172437,#172437);border:1px solid var(--ui-border-293950,#293950);min-height:103px;font-size:11px}.part svg{width:76px;height:66px}.part span{margin-top:3px}.center{position:relative;display:flex;flex-direction:column;min-width:0;overflow:hidden;background:var(--ui-bg-0d1726,#0d1726)}.workspace-head{height:68px;display:flex;align-items:center;justify-content:space-between;padding:14px 23px;border-bottom:1px solid var(--ui-border-233146,#233146);gap:12px}.workspace-head input{border:0;background:none;font-weight:bold;width:180px;padding:0}.mode{display:flex;background:var(--ui-bg-101e31,#101e31);border:1px solid var(--ui-border-293950,#293950);border-radius:9px;padding:3px}.mode button{border:0;background:transparent;font-size:12px;padding:7px 12px;min-height:34px}.mode button.active{background:var(--ui-bg-294238,#294238);color:var(--ui-text-8ce7ce,#8ce7ce)}.canvas-wrap{flex:1;position:relative;min-height:220px;overflow:hidden}#board{width:100%;height:100%;touch-action:none;display:block;direction:ltr}.board-controls{position:absolute;bottom:18px;left:18px;display:flex;gap:5px}.board-controls button{background:var(--ui-bg-172537e8,#172537e8);min-width:42px}.workspace-note{position:absolute;top:18px;left:20px;font-size:11px;color:var(--ui-text-6f829c,#6f829c);pointer-events:none}.bottom-bar{min-height:44px;display:flex;justify-content:space-between;align-items:center;padding:10px 20px;border-top:1px solid var(--ui-border-243146,#243146);color:var(--ui-text-8fa4bd,#8fa4bd);font-size:11px;gap:12px}.status-dot{display:inline-block;width:6px;height:6px;background:#66d5b7;border-radius:50%;margin-left:5px}.selection{fill:transparent;stroke:transparent;stroke-dasharray:5 5}.selected .selection{fill:#63d5b608;stroke:#64dcbc}.component{cursor:grab}.pin{cursor:crosshair}.pin:hover circle:nth-child(2){fill:#78efce;stroke:white}.wire{fill:none;stroke-width:3;cursor:pointer}.wire:hover{stroke-width:7}.wire.selected{stroke-width:6;filter:brightness(1.5)}.current{fill:none;stroke:#dffff5;stroke-width:2;stroke-dasharray:3 24;animation:flow 1.2s linear infinite;pointer-events:none}.current.reverse{animation-direction:reverse}@keyframes flow{to{stroke-dashoffset:-54}}@keyframes spin{to{transform:rotate(360deg)}}.fan{animation:none}.prop-hero{height:135px;background:radial-gradient(ellipse,var(--ui-bg-294135,#294135),var(--ui-bg-152438,#152438) 65%);border:1px solid var(--ui-border-2b3c50,#2b3c50);border-radius:12px;display:grid;place-items:center;margin-bottom:18px}.prop-hero svg{width:150px;height:120px}.prop-label{font-size:11px;color:var(--ui-text-8399b4,#8399b4);margin-bottom:7px}.field{margin:16px 0}.field label{font-size:12px;color:var(--ui-text-9cb0ca,#9cb0ca);display:block;margin-bottom:8px}.field input:not([type=checkbox]),.field select{width:100%;direction:ltr}.reading-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:16px 0}.reading{padding:12px 10px;border:1px solid var(--ui-border-29384b,#29384b);border-radius:9px;background:var(--ui-bg-142236,#142236)}.reading small{font-size:10px;display:block;margin-bottom:7px}.reading strong{direction:ltr;display:block;color:var(--ui-text-e0f6ee,#e0f6ee);font-family:monospace;font-size:15px}.tag{display:inline-block;font-size:10px;color:var(--ui-text-6edec0,#6edec0);border:1px solid var(--ui-border-326a5d,#326a5d);background:var(--ui-bg-173b34,#173b34);padding:5px 8px;border-radius:6px}.tag.bad{color:var(--ui-text-ffaaaa,#ffaaaa);background:var(--ui-bg-4b282c,#4b282c);border-color:var(--ui-border-8b464e,#8b464e)}.help-box{line-height:1.9;font-size:11px;color:var(--ui-text-9dafc4,#9dafc4);background:var(--ui-bg-18283b,#18283b);padding:12px;border-radius:9px;margin-top:18px}.safe{color:var(--ui-text-bdac84,#bdac84);font-size:10px;line-height:1.7}.check{display:flex;gap:8px;align-items:center;margin:13px 0;color:var(--ui-text-9fb3ca,#9fb3ca);font-size:12px}.empty-props{text-align:center;padding-top:65px;line-height:2;color:var(--ui-text-8098b5,#8098b5)}.home{max-width:1120px;margin:auto;padding:45px 24px}.hero{display:grid;grid-template-columns:1.1fr 1fr;align-items:center;gap:60px;min-height:430px}.hero h1{font-size:48px;line-height:1.5;letter-spacing:-1px;margin:15px 0}.hero p{font-size:16px;line-height:2;color:var(--ui-text-91a5bf,#91a5bf);max-width:520px}.hero-art{height:345px;background:radial-gradient(ellipse at center,var(--ui-bg-1a3f3c,#1a3f3c),var(--ui-bg-101c2d,#101c2d) 70%);border:1px solid var(--ui-border-304555,#304555);border-radius:28px;position:relative;overflow:hidden}.hero-art svg{width:100%;height:100%}.hero .primary{padding:15px 28px;font-size:15px}.home-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin:28px 0}.home-card{background:var(--ui-bg-142236,#142236);border:1px solid var(--ui-border-29394e,#29394e);border-radius:15px;padding:25px;text-align:start;min-height:170px}.home-card strong{font-size:17px;display:block;margin:15px 0}.home-card p{color:var(--ui-text-8da3bf,#8da3bf);line-height:1.8;font-size:12px}.kicker{font-family:monospace;color:var(--ui-text-70d7bd,#70d7bd);font-size:12px}.home-footer{display:flex;justify-content:space-between;border-top:1px solid var(--ui-border-28374a,#28374a);padding-top:25px;margin-top:35px;color:var(--ui-text-8499b3,#8499b3);font-size:12px}dialog{background:var(--ui-bg-122034,#122034);color:var(--ui-text-e6effb,#e6effb);border:1px solid var(--ui-border-3a4a61,#3a4a61);border-radius:18px;padding:28px;width:min(650px,95vw);max-height:88dvh}dialog::backdrop{background:var(--ui-bg-050b17bd,#050b17bd);backdrop-filter:blur(5px)}dialog p{line-height:1.9;color:var(--ui-text-a7b9cf,#a7b9cf)}dialog pre{direction:ltr;text-align:left;white-space:pre-wrap;max-height:350px;overflow:auto;font-size:11px;color:var(--ui-text-a3dbc9,#a3dbc9)}.dialog-head{display:flex;justify-content:space-between;gap:12px;margin-bottom:20px}#toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);background:var(--ui-bg-29443d,#29443d);color:var(--ui-text-d7fff1,#d7fff1);border:1px solid var(--ui-border-579783,#579783);border-radius:10px;padding:13px 22px;z-index:30;display:none;max-width:90%;line-height:1.6}.mobile-only{display:none}.chart{width:100%;height:230px;background:var(--ui-bg-0c1728,#0c1728);border-radius:8px}.lesson-card{width:100%;text-align:start;margin-bottom:10px;display:flex;justify-content:space-between;gap:15px;padding:17px}.lesson-banner{background:var(--ui-bg-17332f,#17332f);color:var(--ui-text-a4e3d0,#a4e3d0);padding:12px 22px;font-size:12px;display:flex;justify-content:space-between;gap:10px}.danger-text{color:var(--ui-text-ff9eaa,#ff9eaa)}.wire-colors{display:flex;gap:7px}.wire-colors button{min-height:25px;width:25px;padding:0;border-radius:50%}.close-panel{display:none}body[dir=ltr] .work{direction:ltr}body[dir=ltr] .home-card{text-align:left}
@media(max-width:1100px){.work{grid-template-columns:180px 1fr 235px}.topbar{padding:0 14px}.top-actions button{padding:8px}.library,.properties{padding:18px 12px}.brand strong{font-size:14px}.parts{gap:6px}.part{font-size:10px}.workspace-head{padding:12px}.mode button{padding:7px}.hero{gap:20px}.hero h1{font-size:38px}}
@media(max-width:800px){.topbar{height:65px}.brand small{display:none}.top-actions .wide-only{display:none}.work{height:calc(var(--official-view,100dvh) - 65px);grid-template-columns:1fr}.library,.properties{position:fixed;z-index:15;box-shadow:0 -10px 40px #0008;display:none}.library.open{display:block;inset:auto 0 0;max-height:53dvh;border-radius:20px 20px 0 0;padding-bottom:30px}.properties.open{display:block;inset:65px 0 auto auto;width:min(320px,92vw);max-height:calc(var(--official-view,100dvh) - 65px)}.parts{grid-template-columns:repeat(4,1fr)}.close-panel,.mobile-only{display:block}.section-title{margin-bottom:12px}.library .category{margin:12px 0}.search{margin-bottom:6px}.workspace-head{height:60px}.workspace-head input{width:135px;font-size:12px}.mode button{font-size:10px}.bottom-bar{padding:8px 12px;min-height:64px;padding-bottom:max(8px,env(safe-area-inset-bottom))}.bottom-bar .wide-only{display:none}.board-controls{bottom:15px;left:10px}.hero{grid-template-columns:1fr;gap:25px}.hero h1{font-size:36px}.home{padding:28px 20px}.hero-art{height:250px;order:2}.home-grid{grid-template-columns:1fr}.home-card{min-height:120px}.home-footer{flex-direction:column;gap:14px}.lesson-banner{font-size:10px}.top-actions{gap:5px}.top-actions button{min-height:36px}.workspace-note{font-size:9px}.logo{width:36px;height:36px}.brand strong{font-size:12px}}
/* Readability and reduced-motion support. */
.part,.field label,.check,.mode button{font-size:14px}.help-box,.safe,.bottom-bar,.category,.prop-label,.reading small,.workspace-note{font-size:12px}.home-card p{font-size:14px}.home-card strong{line-height:1.6}.home-footer{font-size:13px}.search{font-size:14px}
@media(max-width:800px){.parts{grid-template-columns:repeat(3,1fr)}.part{font-size:13px}.mode button{font-size:12px}.workspace-note{font-size:11px}.brand strong{font-size:12px}}
@media(prefers-reduced-motion:reduce){.fan,.current{animation:none!important}*{transition:none!important}}
/* Canvas-first editor: drawers overlay the canvas and never reserve columns. */
.lab-header{height:54px;padding:0 14px;gap:8px}.lab-header .logo{width:34px;height:34px;min-height:34px;font-size:23px;border-radius:9px;padding:0}.lab-header .brand{gap:10px;min-width:0}.lab-header .brand strong{font-size:14px;white-space:nowrap}.lab-header #circuit-name{max-width:180px;min-width:60px;padding:7px 10px;font-size:13px;background:transparent;border-color:transparent;color:var(--ui-text-95afc9,#95afc9)}.lab-header .top-actions{flex-wrap:nowrap}.lab-header button{min-height:36px;padding:7px 12px}.focused-work{display:block;position:relative;height:calc(var(--official-view,100dvh) - 54px);direction:inherit;overflow:hidden}.focused-work>.center{height:100%;width:100%}.focused-work .workspace-head{height:52px;min-height:52px;padding:6px 14px;gap:10px}.edit-tools{display:flex;align-items:center;gap:12px;min-width:0}.segmented{display:flex;gap:2px;background:var(--ui-bg-101b2a,#101b2a);border:1px solid var(--ui-border-304157,#304157);border-radius:10px;padding:3px}.segmented button{border:0;background:transparent;border-radius:6px;min-height:34px;padding:6px 13px;white-space:nowrap}.segmented button.active{background:var(--ui-bg-214a42,#214a42);color:var(--ui-text-9bf1d9,#9bf1d9)}.segmented #tool-erase.active{background:var(--ui-bg-512b39,#512b39);color:var(--ui-text-ffb4be,#ffb4be)}.add-part{border-color:var(--ui-border-498f7e,#498f7e);background:var(--ui-bg-214638,#214638);color:var(--ui-text-a1f3da,#a1f3da);white-space:nowrap}.focused-work .mode{flex-shrink:0}.focused-work .mode button{min-height:32px;font-size:13px}.focused-work .canvas-wrap{min-height:0}.focused-work .bottom-bar{height:27px;min-height:27px;padding:4px 16px;font-size:11px;overflow:hidden}.focused-work #solver-status{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.focused-work .workspace-note{top:13px;left:18px;font-size:12px;opacity:.8}.focused-work .board-controls{bottom:12px;left:14px;gap:5px}.focused-work .board-controls button{min-width:36px;min-height:36px;padding:6px 8px;font-size:17px}.focused-work .library{display:none;position:absolute;z-index:20;inset:54px 12px auto 12px;max-height:min(48dvh,310px);width:auto;background:var(--ui-bg-132235f5,#132235f5);backdrop-filter:blur(14px);border:1px solid var(--ui-border-40556b,#40556b);border-radius:14px;box-shadow:0 16px 50px #0008;padding:12px 14px;overflow:auto}.focused-work .library.open{display:block}.focused-work .library .section-title{gap:12px;margin-bottom:8px;font-size:14px}.focused-work .library .search{width:180px;margin:0;margin-inline-start:auto;padding:7px 10px}.focused-work .library .parts{display:grid;grid-template-columns:repeat(auto-fill,minmax(94px,1fr));gap:7px}.focused-work .part{min-height:86px;font-size:12px;padding:4px 2px 7px}.focused-work .part svg{width:62px;height:48px}.focused-work .part span{line-height:1.5}.focused-work .library #close-library{min-height:34px;padding:6px 10px}.focused-work .properties{display:none;position:absolute;z-index:25;inset:54px 12px auto auto;width:300px;max-height:calc(100% - 68px);padding:16px;background:var(--ui-bg-122136fa,#122136fa);border:1px solid var(--ui-border-40536d,#40536d);border-radius:14px;box-shadow:0 14px 50px #0009;overflow:auto}.focused-work .properties.open{display:block}.focused-work .properties .close-panel{display:block;min-height:32px;padding:5px 10px}.focused-work .prop-hero{display:none}.focused-work .properties .section-title{font-size:14px;margin-bottom:12px}.focused-work .properties h3{font-size:16px}.focused-work .properties .field{margin:10px 0}.focused-work .properties .help-box{line-height:1.7}.quick-editor{position:absolute;z-index:10;width:272px;max-width:calc(100% - 16px);max-height:calc(100% - 16px);overflow:auto;padding:10px;background:var(--ui-bg-142438f7,#142438f7);border:1px solid var(--ui-border-5c897d,#5c897d);border-radius:13px;box-shadow:0 8px 28px #0009;backdrop-filter:blur(12px);font-size:13px}.quick-editor[hidden]{display:none!important}.quick-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:6px}.quick-top strong{font-size:13px}.quick-top button{border:0;background:transparent;min-height:28px;padding:2px 7px;font-size:14px}.quick-label{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--ui-text-aac0d7,#aac0d7);margin-bottom:6px}.value-stepper{display:flex;align-items:center;background:var(--ui-bg-0c192b,#0c192b);border:1px solid var(--ui-border-40586e,#40586e);border-radius:8px;overflow:hidden}.value-stepper input{width:100%;padding:6px 2px;appearance:textfield;-moz-appearance:textfield;text-align:center;font-family:monospace;font-size:18px;border:0;background:transparent;min-width:0;height:38px}.value-stepper input::-webkit-inner-spin-button{display:none}.value-stepper button{flex:0 0 37px;border:0;min-height:38px;border-radius:0;background:var(--ui-bg-20364a,#20364a);font-size:18px;padding:0}.value-stepper span{font-size:13px;color:var(--ui-text-78dabf,#78dabf);margin-right:9px;white-space:nowrap}.quick-editor #basic-presets{width:100%;margin-top:6px;min-height:31px;padding:5px 9px;font-size:12px}.quick-actions{display:flex;gap:5px;align-items:center;margin-top:6px;border-top:1px solid var(--ui-border-304557,#304557);padding-top:7px}.quick-actions button{min-height:34px;font-size:12px;padding:5px 9px;white-space:nowrap}.quick-actions #quick-advanced{flex:1}.quick-reading{font-family:monospace;font-size:12px;color:var(--ui-text-7be6c9,#7be6c9);min-height:17px;margin-top:7px;text-align:center;line-height:1.5}.quick-editor input[type=range]{min-height:30px}.led-colors{display:flex;gap:7px}.led-colors button{min-height:36px;width:40px;padding:7px;border-radius:8px}.led-colors button.chosen{border-color:#b1f3dc;background:var(--ui-bg-2a4a40,#2a4a40)}.led-colors i{display:block;width:17px;height:17px;border-radius:50%;background:var(--led-color);margin:auto}.meter-quick{display:flex;gap:8px}.meter-quick label{flex:1;font-size:12px;color:var(--ui-text-a7bfd9,#a7bfd9)}.meter-quick select{margin-top:6px;width:100%;font-size:13px;min-height:36px;padding:7px}.wire-hit{fill:none;stroke:transparent;stroke-width:24px;pointer-events:stroke;vector-effect:non-scaling-stroke;cursor:pointer}.wire,.current{pointer-events:none;stroke-linecap:round;stroke-linejoin:round}.wire.selected{stroke-width:5;filter:drop-shadow(0 0 3px #b9f6e8)}.selection{pointer-events:none}.component>text{pointer-events:none}.pin text{pointer-events:none}.pin circle:first-child{r:18px}.snap-target circle:nth-child(2){fill:#b0ffe6;stroke:#fff;stroke-width:4}.snap-target circle:first-child{fill:#80ffca33}#board[data-tool=move] .pin{cursor:grab}#board[data-tool=wire]{cursor:crosshair}#board[data-tool=wire] .component{cursor:default}#board[data-tool=wire] .pin circle:nth-child(2){stroke:#80e9ca;stroke-width:3}#board[data-tool=erase]{cursor:crosshair}#board[data-tool=erase] .component{pointer-events:none}#board[data-tool=erase] .wire-hit:hover+.wire{stroke:#ff737f;stroke-width:6}.focused-work .lesson-banner{padding:5px 15px;font-size:12px}.focused-work .lesson-banner button{min-height:25px;padding:3px 8px;font-size:12px}
@media(max-width:700px){.lab-header{height:48px;padding:0 8px}.lab-header .brand strong{font-size:12px}.lab-header #circuit-name{display:none}.lab-header .top-actions button{padding:6px 9px;min-height:34px;font-size:12px}.focused-work{height:calc(var(--official-view,100dvh) - 48px)}.focused-work .workspace-head{height:auto;min-height:50px;padding:6px 8px;gap:5px;flex-wrap:wrap}.edit-tools{gap:5px;flex:1}.segmented{flex:1;justify-content:center}.segmented button{padding:6px 7px;font-size:12px}.focused-work .mode{margin-inline-start:auto}.focused-work .mode button{padding:6px 9px;font-size:12px}.add-part{font-size:12px;padding:7px 10px;min-height:38px}.focused-work .library{inset:54px 8px auto 8px;max-height:56dvh;padding:10px}.focused-work .library .parts{grid-template-columns:repeat(auto-fill,minmax(80px,1fr))}.focused-work .library .search{width:120px}.focused-work .properties{right:8px;top:54px;max-width:calc(100% - 16px);width:300px}.focused-work .workspace-note{max-width:calc(100% - 30px);font-size:11px}.focused-work .bottom-bar{font-size:10px;padding:3px 8px}.focused-work .board-controls{left:8px;bottom:10px}.quick-editor{width:252px}.focused-work .board-controls button{min-width:34px;min-height:34px}}
@media(max-height:550px) and (min-width:600px){.lab-header{height:44px}.focused-work{height:calc(var(--official-view,100dvh) - 44px)}.focused-work .workspace-head{height:46px;min-height:46px;padding:3px 10px}.focused-work .bottom-bar{height:23px;min-height:23px}.focused-work .library,.focused-work .properties{top:48px;max-height:calc(100% - 65px)}.focused-work .workspace-note{top:8px;font-size:11px}.quick-editor{padding:8px}.quick-top{margin-bottom:3px}.quick-reading{margin-top:4px}.quick-actions{padding-top:5px;margin-top:4px}.lab-header .brand small{display:none}}
/* Disable browser text-selection/search gestures only on the circuit canvas. */
#board,#board *,.board-controls,.workspace-head,.part-card{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}#board text{pointer-events:none}input,textarea{user-select:text;-webkit-user-select:text}
.quick-editor{width:208px!important;padding:7px;border-radius:10px}.quick-top{margin:0 0 5px}.quick-top strong{font-size:12px}.quick-top button{min-height:26px;padding:0 6px}.quick-label{display:none}.quick-editor .value-stepper input{height:32px;font-size:16px}.quick-editor .value-stepper button{min-height:32px;flex-basis:31px}.quick-editor #basic-presets{display:none}.quick-editor .quick-reading{font-size:11px;margin-top:4px;min-height:14px}.quick-editor .quick-actions{gap:4px;padding-top:4px;margin-top:4px;justify-content:space-between}.quick-editor .quick-actions button{min-height:30px;padding:3px 9px;font-size:15px;flex:1}.quick-editor .meter-quick label{font-size:0}.quick-editor .meter-quick select{margin:0;min-height:33px;font-size:13px;padding:5px}.quick-editor .led-colors{gap:4px}.quick-editor .led-colors button{width:34px;min-height:31px;padding:4px}.quick-editor #basic-slider{min-height:26px}.quick-editor:has(#basic-slider) .quick-label{display:flex;font-size:11px}.part-card{border:1px solid var(--ui-border-31465e,#31465e);border-radius:10px;overflow:hidden;background:var(--ui-bg-16283b,#16283b)}.part-card.chosen{border-color:#78dfbc;background:var(--ui-bg-214137,#214137)}.focused-work .part-card .part{width:100%;border:0;border-radius:0;background:transparent;min-height:76px}.quantity{display:flex;align-items:center;justify-content:space-between;padding:0 5px 5px;gap:5px;direction:ltr}.quantity button{min-height:28px;width:28px;padding:1px;font-size:17px}.quantity strong{font-size:13px;color:var(--ui-text-9bf2d3,#9bf2d3)}.basket-bar{position:sticky;bottom:-12px;background:var(--ui-bg-132235,#132235);display:flex;align-items:center;gap:8px;padding:10px 0 4px;margin-top:8px;border-top:1px solid var(--ui-border-354a61,#354a61)}.basket-bar span{font-size:12px;color:var(--ui-text-96b1ca,#96b1ca);margin-inline-end:auto}.basket-bar button{min-height:34px;padding:6px 10px;font-size:13px}.basket-bar button:disabled{opacity:.4;cursor:default}.current{stroke:#c7ffed;stroke-width:3;stroke-dasharray:5 19;animation:flow 1.3s linear infinite}
@media(max-width:600px){.basket-bar span{display:none}.basket-bar #add-basket{flex:1}.quick-editor{width:196px!important}}
@keyframes current-flow{to{stroke-dashoffset:-24}}.current{animation-name:current-flow}
.quick-editor #value-slider{display:block;width:100%;min-height:24px;height:24px;margin:3px 0 0;padding:0;accent-color:var(--ui-text-79e2c2,#79e2c2)}.component-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}.component-actions button{min-height:36px;padding:6px;font-size:12px}.component-actions button:disabled{opacity:.35;cursor:default}.quick-editor .value-stepper input:focus{outline:1px solid #79e2c2;background:var(--ui-bg-21394b,#21394b)}

.unit-choices{display:flex;gap:4px;margin:3px 0 5px}.unit-choices button{flex:1;min-height:32px;padding:3px 6px;font-size:12px}.component-hit{pointer-events:all} .component{touch-action:none}
.book-banner{gap:6px;flex-wrap:wrap;padding:7px 12px;font-size:12px}.book-banner strong{flex:1;min-width:160px;font-size:13px}.book-banner button,.book-banner select{min-height:34px;padding:5px 9px;font-size:12px}.book-banner select{max-width:240px;min-width:0}.book-pages img{width:100%;height:auto;display:block;border-radius:8px}.book-pages figure{margin:16px 0}.book-pages figcaption{margin-bottom:6px;color:var(--ui-text-a5dacc,#a5dacc)}.book-note{padding:9px;border-bottom:1px solid var(--ui-border-294158,#294158)}.book-note summary{cursor:pointer}.book-note p{font-size:14px;line-height:1.8}.lesson-card small{display:block;color:var(--ui-text-89aaaf,#89aaaf);font-size:11px;margin-bottom:5px}.device-summary{font-size:12px;margin:4px 0}.fullscreen-icon{min-width:36px}
@media(max-width:600px){.book-banner strong{flex-basis:100%}.book-banner select{flex:1;max-width:none;width:80px}.book-banner button{font-size:11px;padding:4px 7px}.lab-header .brand strong{font-size:12px}.top-actions{gap:4px}}
/* School identity — home only */
.school-home{min-height:var(--official-view,100dvh);background:radial-gradient(ellipse at 90% 15%,var(--ui-bg-203d49,#203d49) 0,transparent 52%),var(--ui-bg-0b1726,#0b1726);color:var(--ui-text-edf4f5,#edf4f5)}.school-top{max-width:1320px;margin:auto;padding:24px 38px;display:flex;align-items:center;justify-content:space-between;gap:20px;border-bottom:1px solid #ffffff12}.school-wordmark{font-size:15px;font-weight:bold;color:var(--ui-text-b9cbd3,#b9cbd3)}.school-tools{display:flex;gap:8px}.school-tools button{background:transparent;border-color:#ffffff26;color:var(--ui-text-cfdae0,#cfdae0);font-size:13px}.school-main{max-width:1240px;margin:auto;display:grid;grid-template-columns:.85fr 1.15fr;align-items:center;gap:80px;padding:55px 38px 48px}.school-identity{text-align:center}.school-logo-frame{max-width:300px;margin:auto;border-radius:26px;padding:10px;background:#f6f5f2;box-shadow:0 22px 65px #0005,0 0 0 1px #d7bd8666}.school-logo-frame img{width:100%;height:auto;display:block;border-radius:18px}.school-department{font-size:23px;font-weight:bold;margin:25px 0 21px;color:var(--ui-text-f1e3bf,#f1e3bf)}.school-credit{border-top:1px solid #d9c28c40;padding-top:20px;max-width:310px;margin:auto}.school-credit span{display:block;color:var(--ui-text-b6c7d1,#b6c7d1);font-size:15px}.school-credit strong{display:block;color:var(--ui-text-f0d596,#f0d596);font-size:clamp(29px,3.1vw,39px);margin-top:10px;line-height:1.5}.school-overline{color:var(--ui-text-c8b279,#c8b279);font-size:12px;letter-spacing:1px}.school-heading h1{font-size:clamp(32px,3.8vw,49px);line-height:1.5;margin:12px 0 12px;letter-spacing:-1px}.school-heading p{font-size:16px;color:var(--ui-text-a9bec9,#a9bec9);line-height:1.8;margin-bottom:30px}.school-primary-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px}.school-home svg{width:24px;height:24px;flex-shrink:0}.school-primary-actions button{display:flex;align-items:center;justify-content:center;gap:10px;min-height:65px;font-size:16px;font-weight:bold;border-radius:13px;padding:14px}.school-primary-actions .school-start{background:#e0c68e;color:#142331;border:1px solid #f7e0a8}.school-primary-actions .school-start:hover{background:#f2dba8}.school-resume{background:#ffffff07;border-color:var(--ui-border-60747f,#60747f);color:var(--ui-text-deebef,#deebef)}.school-secondary-actions{display:grid;gap:12px;margin-top:18px}.school-secondary-actions > button{display:flex;align-items:center;text-align:start;gap:18px;padding:18px 22px;background:#ffffff04;border:1px solid #ffffff1a;border-radius:13px;min-height:81px}.school-secondary-actions > button:hover{background:var(--ui-bg-233b4c,#233b4c);border-color:var(--ui-border-a9986b,#a9986b)}.school-secondary-actions svg{color:var(--ui-text-d6bd85,#d6bd85)}.school-secondary-actions > button strong{font-size:17px;display:block}.school-secondary-actions > button small{display:block;margin-top:6px;color:var(--ui-text-99b0bc,#99b0bc);font-size:13px}.school-footer{max-width:1240px;margin:auto;border-top:1px solid #ffffff13;padding:22px 38px;display:flex;justify-content:space-between;gap:20px;color:var(--ui-text-8da7b5,#8da7b5);font-size:12px;line-height:1.8}.curriculum-options{display:grid;gap:14px;padding:15px 0}.curriculum-options button{display:flex;align-items:center;gap:20px;padding:23px;text-align:start}.curriculum-options span{font-size:26px;color:var(--ui-text-e0c68e,#e0c68e)}.curriculum-options strong{font-size:18px}.save-circuit-form{display:grid;gap:14px;padding-top:12px}.save-circuit-form label{font-size:16px}.save-circuit-form input{width:100%;min-height:50px}.save-circuit-form p{font-size:14px;color:var(--ui-text-9fb2c7,#9fb2c7);margin:0}.school-home button:focus-visible{outline:3px solid #f1d391;outline-offset:4px}@media(max-width:850px){.school-main{gap:32px;padding:35px 24px}.school-logo-frame{max-width:240px}.school-primary-actions{grid-template-columns:1fr}.school-heading h1{font-size:34px}}@media(max-width:600px){.school-top{padding:15px 17px;gap:10px}.school-wordmark{font-size:12px;max-width:145px;line-height:1.7}.school-tools button{font-size:12px;padding:8px}.school-main{display:flex;flex-direction:column;gap:30px;padding:28px 20px}.school-identity,.school-launch{width:100%}.school-logo-frame{max-width:205px;padding:7px;border-radius:20px}.school-department{font-size:21px;margin:18px 0 15px}.school-credit{padding-top:15px}.school-credit strong{font-size:31px;margin-top:5px}.school-heading{text-align:center}.school-heading h1{font-size:29px;margin:7px 0}.school-heading h1 br{display:none}.school-heading p{margin-bottom:20px;font-size:14px}.school-overline{display:none}.school-primary-actions{grid-template-columns:1fr 1fr;gap:9px}.school-primary-actions button{font-size:14px;flex-direction:column;gap:8px;min-height:87px;padding:12px 6px}.school-secondary-actions > button{padding:17px 20px;min-height:78px}.school-footer{padding:18px 20px;display:block;text-align:center}.school-footer span{display:block;margin:5px 0}}@media(prefers-reduced-motion:reduce){.school-home button{transition:none}}
/* Compact landscape workspaces preserve a useful canvas height. */
@media(orientation:landscape) and (max-height:600px){.lab-header{height:44px;padding:4px 12px}.lab-header .logo{width:33px;height:33px;font-size:21px}.lab-header .brand strong{font-size:12px}.lab-header .top-actions button{min-height:33px;padding:5px 10px}.focused-work{height:calc(var(--official-view,100dvh) - 44px)}.focused-work .workspace-head{height:42px;min-height:42px;padding:4px 9px}.focused-work .workspace-head button{min-height:31px;padding:4px 8px;font-size:11px}.focused-work .canvas-wrap{min-height:0}.focused-work .book-banner{flex-wrap:nowrap;padding:4px 8px;min-height:34px}.focused-work .book-banner strong{min-width:90px;font-size:10px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.focused-work .book-banner button,.focused-work .book-banner select{font-size:10px;min-height:29px;padding:4px 6px}.focused-work .bottom-bar{min-height:23px;padding:3px 10px;font-size:10px}.focused-work .board-controls{bottom:6px;left:8px}.focused-work .board-controls button{min-width:32px;min-height:32px;padding:4px}.focused-work .workspace-note{top:7px;font-size:10px}.focused-work .library,.focused-work .properties{max-height:calc(var(--official-view,100dvh) - 48px);top:44px}.school-top{padding:10px 24px}.school-main{display:grid;grid-template-columns:.7fr 1.3fr;gap:28px;padding:18px 28px}.school-logo-frame{max-width:165px}.school-department{font-size:17px;margin:12px 0}.school-credit{padding-top:10px}.school-credit span{font-size:12px}.school-credit strong{font-size:25px}.school-heading h1{font-size:25px;line-height:1.3;margin:5px 0}.school-heading p{font-size:13px;margin:8px 0 14px}.school-heading h1 br{display:none}.school-primary-actions{grid-template-columns:1fr 1fr}.school-primary-actions button{min-height:46px;padding:8px;font-size:13px}.school-secondary-actions{gap:7px;margin-top:9px}.school-secondary-actions > button{min-height:49px;padding:9px 15px}.school-secondary-actions > button strong{font-size:14px}.school-secondary-actions > button small{display:none}.school-footer{padding:8px 28px;font-size:10px}}

.school-primary-actions .school-arduino{background:linear-gradient(135deg,var(--ui-bg-234f50,#234f50),var(--ui-bg-163a42,#163a42));border:1px solid var(--ui-border-56978f,#56978f);color:var(--ui-text-e8fff7,#e8fff7);box-shadow:inset 0 1px 0 #ffffff10}.school-primary-actions .school-arduino svg{color:var(--ui-text-83e0c5,#83e0c5)}.school-primary-actions .school-arduino:hover{background:var(--ui-bg-2c605b,#2c605b);border-color:#87ddc4}

/* Grade 9: the guide's circuits on the existing laboratory engines. */
.g9-home{min-height:var(--official-view,100dvh);background:radial-gradient(ellipse at 75% 0,var(--ui-bg-183446,#183446) 0,transparent 45%),var(--ui-bg-0d1825,#0d1825);color:var(--ui-text-edf4f7,#edf4f7);padding:clamp(18px,3vw,48px);overflow:auto;font-size:16px}
.g9-top{max-width:1080px;margin:0 auto;display:flex;align-items:center;gap:24px;padding-bottom:28px;border-bottom:1px solid var(--ui-border-304352,#304352)}
.g9-top button,.g9-section-title button{border:1px solid var(--ui-border-3d5466,#3d5466);background:var(--ui-bg-1a2b3d,#1a2b3d);color:var(--ui-text-dfedf2,#dfedf2);border-radius:12px;padding:12px 20px;min-height:46px}
.g9-identity{display:flex;align-items:center;gap:18px;flex:1}.g9-identity svg{width:64px;height:64px;color:var(--ui-text-70dec3,#70dec3)}.g9-identity span{color:var(--ui-text-9bb5c4,#9bb5c4);font-size:14px}.g9-identity h1{font-size:clamp(23px,3vw,34px);margin:5px 0;font-weight:700;letter-spacing:0}.g9-grade{font-family:monospace;font-size:42px;color:var(--ui-text-769eac,#769eac)}
.g9-tabs{display:flex;width:min(100%,620px);margin:30px auto;gap:6px;background:var(--ui-bg-172837,#172837);padding:6px;border:1px solid var(--ui-border-314957,#314957);border-radius:16px}.g9-tabs button{flex:1;padding:14px 12px;border:0;border-radius:11px;color:var(--ui-text-bcd0db,#bcd0db);background:transparent;font-size:16px;min-height:50px}.g9-tabs button[aria-pressed=true]{background:#69d8bd;color:#102c30;font-weight:bold;box-shadow:0 4px 14px #0002}
.g9-content{max-width:980px;margin:auto}.g9-lesson-list{display:grid;gap:12px}.g9-lesson{display:flex;align-items:center;text-align:right;gap:22px;width:100%;padding:20px 24px;border:1px solid var(--ui-border-2e4759,#2e4759);border-radius:16px;background:linear-gradient(110deg,var(--ui-bg-152533,#152533),var(--ui-bg-1b3042,#1b3042));color:var(--ui-text-edf6f8,#edf6f8);transition:background .15s,border-color .15s}.g9-lesson:hover,.g9-application:hover{border-color:#79c8b8;background:var(--ui-bg-203e4c,#203e4c)}.g9-lesson-number{font:500 24px monospace;color:var(--ui-text-77cfbc,#77cfbc);border-left:1px solid var(--ui-border-45606b,#45606b);padding-left:22px}.g9-lesson-title{font-weight:600;font-size:19px;flex:1}.g9-lesson-count{font-size:14px;color:var(--ui-text-9cb8c7,#9cb8c7)}.g9-section-title{display:flex;gap:20px;align-items:center;margin-bottom:22px}.g9-section-title h2{font-size:24px;margin:0}.g9-apps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.g9-application{display:flex;flex-direction:column;align-items:flex-start;text-align:right;min-height:190px;gap:18px;padding:26px;border-radius:18px;border:1px solid var(--ui-border-365060,#365060);color:var(--ui-text-eaf3f7,#eaf3f7);background:linear-gradient(135deg,var(--ui-bg-1f394a,#1f394a),var(--ui-bg-152532,#152532))}.g9-app-number{font:18px monospace;color:var(--ui-text-82cbbb,#82cbbb)}.g9-application strong{font-size:20px;line-height:1.6}.g9-launch{margin-top:auto;color:var(--ui-text-88d9c8,#88d9c8);font-size:14px;display:flex;justify-content:space-between;width:100%}.g9-footer{padding:35px 10px 5px;text-align:center;color:var(--ui-text-9eb8c6,#9eb8c6);font-size:15px}.g9-footer strong{color:var(--ui-text-e5c680,#e5c680)}
.g9-experiment .al-toolbar{flex-wrap:wrap}.g9-experiment .al-body{display:flex;min-height:0}.g9-environment{width:285px;min-width:235px;padding:18px;background:var(--ui-bg-152c3d,#152c3d);border:1px solid var(--ui-border-355264,#355264);border-radius:18px;margin:12px;align-self:flex-start;max-height:calc(var(--official-view,100dvh) - 210px);overflow:auto;color:var(--ui-text-e3f0f5,#e3f0f5);box-sizing:border-box}.g9-env-hint{margin:0 0 14px;line-height:1.6;font-size:15px;color:var(--ui-text-c2dbe6,#c2dbe6)}.g9-env-scene{width:100%;height:auto;display:block;overflow:visible}.g9-control{display:grid;grid-template-columns:1fr auto;gap:10px;font-size:15px;margin:20px 0 8px}.g9-control input{grid-column:1/-1;width:100%;accent-color:var(--ui-text-72d9bf,#72d9bf);min-height:36px}.g9-control output{font:15px monospace;color:var(--ui-text-83e4c9,#83e4c9)}.g9-env-actions{display:flex;gap:8px;margin-top:16px}.g9-env-actions button{flex:1;min-height:44px;font-size:14px}.g9-press-buttons{display:flex;gap:20px;justify-content:center;padding:24px 0}.g9-push{display:flex;flex-direction:column;gap:20px;align-items:center;background:transparent!important;border:0!important}.g9-push span{display:block;border-radius:50%;width:66px;height:66px;border:6px solid var(--ui-border-293f4d,#293f4d);background:radial-gradient(circle at 40% 25%,#f18e82,#b74442);box-shadow:0 6px 0 #622e31,0 9px 18px #0006;transition:transform .08s,box-shadow .08s}.g9-push.pressed span{transform:translateY(5px);box-shadow:0 1px 0 #622e31}.g9-remote{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;background:var(--ui-bg-18242e,#18242e);padding:22px 16px;border-radius:24px;border:1px solid var(--ui-border-617481,#617481);box-shadow:0 7px 0 #07131d;direction:ltr}.g9-remote button{border-radius:50%;height:44px;min-width:0;padding:3px;font-size:14px;background:#d9e2e8;color:#233443;box-shadow:0 3px 0 #8a9fac}.g9-remote button:first-child{background:#de665a;color:var(--ui-text-ffffff,#fff)}.g9-remote button:active{transform:translateY(2px);box-shadow:none}.g9-sound-rings{border-radius:50%;width:130px;height:130px;margin:28px auto;background:var(--ui-bg-204c53,#204c53);display:grid;place-items:center;border:1px solid var(--ui-border-58a89b,#58a89b)}.g9-sound-rings button{border:0;background:#6cdbc1;color:#112e33;border-radius:50%;width:92px;height:92px;font-weight:bold}.g9-practical{grid-template-columns:minmax(0,1fr) 295px!important}.g9-practical .center{grid-column:1!important}.g9-practical>.g9-environment{grid-column:2;grid-row:1}.g9-practical .library{display:none}.g9-practical .book-banner{flex-wrap:wrap;font-size:14px}.g9-reference{width:min(1100px,95vw);max-height:90dvh;background:var(--ui-bg-132735,#132735);color:var(--ui-text-e1edf4,#e1edf4);border:1px solid var(--ui-border-527687,#527687);border-radius:18px;padding:20px;overflow:auto}.g9-reference header{display:flex;justify-content:space-between;gap:16px;align-items:center;position:sticky;top:0;background:var(--ui-bg-132735,#132735);padding:10px}.g9-reference img{width:100%;height:auto;margin:10px 0;border-radius:10px}.g9-reference::backdrop{background:var(--ui-bg-030a14ba,#030a14ba)}.g9-code-note{padding:12px;color:var(--ui-text-b8d3e0,#b8d3e0);font-size:14px}.g9-code-note p{line-height:1.6}
@media(max-width:800px){.g9-top{gap:12px}.g9-identity{gap:7px}.g9-identity svg{width:42px;height:42px}.g9-grade{display:none}.g9-top button{padding:10px 14px}.g9-apps{grid-template-columns:1fr}.g9-application{min-height:150px;padding:21px}.g9-lesson{padding:17px 15px;gap:13px}.g9-lesson-number{padding-left:12px;font-size:20px}.g9-lesson-title{font-size:17px}.g9-lesson-count{font-size:13px}.g9-experiment .al-body{flex-wrap:wrap;overflow:auto}.g9-experiment .al-stage{min-height:55dvh;width:100%;flex-basis:100%}.g9-environment{width:calc(100% - 24px);max-height:none;min-width:0;display:block;margin:12px}.g9-env-scene{max-height:210px}.g9-practical{display:flex!important;flex-direction:column;overflow:auto!important}.g9-practical .center{min-height:65dvh;flex:none}.g9-practical>.g9-environment{flex:none}.g9-experiment .al-editor{position:fixed;inset:0;z-index:100;max-width:none!important;width:100%!important}.g9-section-title h2{font-size:20px}}
@media(orientation:landscape) and (max-height:600px){.g9-experiment header{padding:7px 12px;min-height:54px}.g9-experiment header h1{font-size:17px}.g9-experiment header h1 small{display:none}.g9-experiment .al-toolbar{padding:5px 10px}.g9-experiment .al-toolbar button{min-height:38px;padding:7px 12px}.g9-experiment .al-body{flex-wrap:nowrap;overflow:hidden}.g9-experiment .al-stage{min-height:0;flex:1;flex-basis:auto}.g9-environment{width:240px;min-width:200px;max-height:calc(var(--official-view,100dvh) - 150px);overflow:auto;margin:7px;padding:12px}.g9-env-scene{max-height:135px}.g9-practical{display:grid!important}.g9-practical .center{min-height:0}.g9-control{margin-top:10px}.g9-env-hint{font-size:14px}}
.g9-remote-art{position:relative;max-width:220px;aspect-ratio:440/960;margin:0 auto;direction:ltr;overflow:hidden}.g9-remote-art img{position:absolute;max-width:none;width:227.3%;height:auto;left:-63.6%;top:-2.5%;pointer-events:none}.g9-remote-art button{position:absolute;width:22%;height:9%;transform:translate(-50%,-50%);border:2px solid transparent!important;border-radius:50%;background:transparent!important;padding:0;min-height:0;box-shadow:none}.g9-remote-art button:focus-visible,.g9-remote-art button:active{border-color:#74e5c9!important;background:#65dab733!important}.g9-practical:not(:has(>.g9-environment)){grid-template-columns:minmax(0,1fr)!important}

/* Grade 9: environmental controls occupy the physical left side. */
.g9-practical{direction:ltr;grid-template-columns:295px minmax(0,1fr)!important}.g9-practical .center{grid-column:2!important;direction:rtl}.g9-practical>.g9-environment{grid-column:1;direction:rtl}.g9-practical:not(:has(>.g9-environment)) .center{grid-column:1!important}
.g9-practical .brand #home{width:auto;min-width:76px;padding:8px 16px;font-size:16px;white-space:nowrap}

@media(orientation:landscape) and (max-height:600px){.g9-practical{grid-template-columns:240px minmax(0,1fr)!important}}

.g9-lessons-button{width:auto!important;min-width:76px;padding:8px 16px!important;font-size:16px!important;white-space:nowrap}.g9-circuit-switch{display:block;width:100%;margin-top:12px;min-height:44px}
/* Keep the practical environment in the visible workspace, not below a full-height canvas. */
.work.focused-work.g9-practical{display:grid!important;grid-template-columns:clamp(210px,24vw,295px) minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr);direction:ltr;overflow:hidden!important}
.work.focused-work.g9-practical>.center{grid-area:1 / 2;min-width:0;min-height:0;height:100%;width:100%;direction:rtl}
.work.focused-work.g9-practical>.g9-environment{grid-area:1 / 1;align-self:stretch;width:auto;min-width:0;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain;margin:10px 0 10px 10px;direction:rtl;padding:14px}
.work.focused-work.g9-practical:not(:has(>.g9-environment)){grid-template-columns:minmax(0,1fr)!important}
.work.focused-work.g9-practical:not(:has(>.g9-environment))>.center{grid-area:1 / 1}
.g9-environment-title{margin:0 0 10px;font-size:16px;color:var(--ui-text-e8f6f3,#e8f6f3)}
@media(max-width:600px) and (orientation:portrait){
 .work.focused-work.g9-practical{grid-template-columns:minmax(115px,30%) minmax(0,1fr)!important}
 .work.focused-work.g9-practical>.g9-environment{margin:6px 0 6px 6px;padding:8px;border-radius:13px}
 .g9-practical .g9-env-hint{font-size:11px;line-height:1.65}
 .g9-practical .g9-environment-title{font-size:13px}
 .g9-practical .g9-control{font-size:12px}
 .g9-practical .g9-circuit-switch{font-size:12px;padding:8px 5px}
 .g9-practical .workspace-head .edit-tools{flex-wrap:wrap}
 .g9-practical .workspace-head .segmented{flex-wrap:wrap}
 .g9-practical .book-banner{flex-wrap:wrap}
}
@media(orientation:landscape) and (max-height:600px){
 .work.focused-work.g9-practical{grid-template-columns:210px minmax(0,1fr)!important}
 .work.focused-work.g9-practical>.g9-environment{padding:10px;margin:6px 0 6px 6px}
}
.g8-application-title{font-size:14px;line-height:1.7;color:var(--ui-text-a8c8d8,#a8c8d8);margin:0 0 12px}.g8-environment .g9-control{display:flex;flex-wrap:wrap;gap:7px;margin:16px 0;font-size:14px}.g8-environment .g9-control input,.g8-environment .g9-control select{width:100%;min-width:0;min-height:36px}.g8-environment .g9-control output{margin-inline-start:auto;direction:ltr}.g8-environment .g9-circuit-switch{width:100%;min-height:44px}.g8-environment select{background:var(--ui-bg-172b40,#172b40);color:var(--ui-text-e1ecf4,#e1ecf4);border:1px solid var(--ui-border-486275,#486275);border-radius:8px;padding:8px}.g8-practical .book-banner select{max-width:100%}

@media(max-width:600px) and (orientation:portrait){.g8-application-title{font-size:12px}.g8-environment .g9-control{font-size:12px}.g8-environment .g9-control output{overflow-wrap:anywhere}.g8-practical .book-banner{gap:5px}.g8-practical .book-banner select{width:100%;min-width:0}}
.focused-work .workspace-head.compact-lesson-toolbar{height:auto;min-height:48px;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;gap:8px;padding:5px 8px}.compact-lesson-toolbar .edit-tools,.compact-lesson-toolbar .mode{flex:0 0 auto;flex-wrap:nowrap}.lesson-toolbar-actions{display:flex;align-items:center;gap:6px;flex:0 0 auto}.lesson-toolbar-actions button{white-space:nowrap;padding:7px 10px;min-height:38px;font-size:12px}.compact-lesson-toolbar .segmented{flex-wrap:nowrap!important}.compact-lesson-toolbar [hidden]{display:none!important}
/* The SVG viewport owns touch gestures; SVG groups alone do not prevent iOS scrolling. */
.g9-env-scene{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.g9-environment button{touch-action:manipulation}
.g9-control input[type=range]{touch-action:pan-y;direction:ltr;min-height:44px}

/* Furniture reference library: independent, measured plan symbols. */
.dc-furniture-picker{position:absolute;inset:12px;z-index:12;background:#f6f9fa;border:1px solid #91acae;border-radius:16px;box-shadow:0 12px 38px #0005;display:flex;flex-direction:column;overflow:hidden;direction:rtl;color:#193641}
.dc-furniture-picker[hidden]{display:none}
.dc-furniture-picker header{display:flex;justify-content:space-between;align-items:center;padding:14px 18px;border-bottom:1px solid #d3e0e4;gap:12px;background:#fff}
.dc-furniture-picker header small{display:block;color:#57717b;margin-top:4px;font-size:13px}
.dc-furniture-picker header button{background:#e5eff0;color:#21434c;border:0;border-radius:10px;min-width:44px;min-height:44px;font-size:24px}
.dc-furniture-list{padding:12px;display:grid;grid-template-columns:repeat(auto-fill,minmax(135px,1fr));gap:10px;overflow:auto;overscroll-behavior:contain;touch-action:pan-y}
.dc-furniture-option{display:flex;align-items:center;flex-direction:column;background:#ffffff!important;color:#213d46!important;border:1px solid #d2dfe2!important;border-radius:12px;padding:8px;min-height:150px;cursor:pointer}
.dc-furniture-option:hover,.dc-furniture-option:focus-visible{border-color:var(--ui-border-17888b,#17888b)!important;outline:2px solid #68b8b4}
.dc-furniture-option canvas{width:100%;height:100px;object-fit:contain;pointer-events:none}
.dc-furniture-option span{font-size:14px;font-weight:600}.dc-furniture-option small{color:#54717b;font-size:12px;margin-top:5px}
@media(max-width:600px){.dc-furniture-picker{inset:4px}.dc-furniture-list{grid-template-columns:repeat(2,minmax(0,1fr));padding:8px}.dc-furniture-picker header{padding:10px}.dc-furniture-option canvas{height:80px}}

/* Keep Arabic words and home descriptions comfortably separated on phones. */
.school-heading h1{letter-spacing:normal;word-spacing:normal}
.school-home .subject-buttons button{line-height:1.65;white-space:normal}
.school-home .subject-buttons small{display:block;line-height:1.8;margin-top:10px;font-weight:normal}
@media(max-width:600px){.school-home .school-heading h1 br{display:block}.school-heading h1{line-height:1.55}.school-home .school-heading p{line-height:1.9}.school-home .subject-buttons{gap:14px}.school-home .subject-buttons button{padding:20px 16px;height:auto;min-height:115px}.school-home .subject-buttons small{font-size:14px;line-height:1.85}}

/* Touch work surfaces: long presses never select lesson text or open callouts. */
html,body,body *{-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important}
img{-webkit-user-drag:none}
.numeric-keypad{position:fixed;z-index:2147483647;width:264px;box-sizing:border-box;padding:8px;background:var(--ui-bg-112e3c,#112e3c);border:1px solid var(--ui-border-6c9b9f,#6c9b9f);border-radius:16px;box-shadow:0 12px 42px #0008;color:var(--ui-text-e6f2f1,#e6f2f1);font:14px/1.3 Arial,sans-serif;touch-action:manipulation}
.numeric-keypad header{display:flex;gap:6px;align-items:center;justify-content:space-between;margin-bottom:5px}.numeric-keypad header span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:175px}.numeric-keypad button{min-width:0;min-height:36px;height:36px;padding:4px;border:1px solid var(--ui-border-3d6471,#3d6471);border-radius:8px;background:var(--ui-bg-1d4050,#1d4050);color:var(--ui-text-ffffff,#fff);font:18px Arial;cursor:pointer}.numeric-keypad header button{font-size:14px;min-width:58px;background:var(--ui-bg-317c71,#317c71)}.numeric-keypad output{display:block;height:25px;text-align:center;color:var(--ui-text-80e0ca,#80e0ca);font:20px monospace;margin:3px}.numeric-keys{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.numeric-keys button[data-key="0"]{grid-column:span 2}.numeric-keys button[data-key="."]{grid-column:span 2}.numeric-keys button[data-key="clear"]{font-size:13px}.numeric-keypad button:active{background:#58a997}.numeric-keypad button:focus-visible{outline:2px solid #efc56b}[data-keypad-active]{outline:2px solid #75d8c1!important}
@media(max-height:450px){.numeric-keypad{padding:6px}.numeric-keypad button{height:32px;min-height:32px}.numeric-keypad output{height:22px;font-size:18px}}
.theme-picker{display:flex;align-items:center;gap:5px;flex-wrap:wrap;border:1px solid var(--ui-border-345064,#345064);border-radius:12px;padding:4px 7px}.theme-picker>span{font-size:12px;margin-inline:5px;color:var(--ui-text-a9bdcb,#a9bdcb)}.theme-picker button{padding:7px 10px;min-height:36px}.theme-picker button[aria-pressed=true]{background:#65ddbd;color:#093b32;border-color:#65ddbd}
@media(max-width:600px){.school-top{flex-wrap:wrap;gap:10px}.school-tools{flex-wrap:wrap}.theme-picker>span{display:none}}

.chart-voltage{color:#64ddbb}.chart-current{color:#80acff}

/* Shared subject landing curriculum disclosure. */
.school-home .dc-home-grades{margin-top:16px}.school-home .dc-home-grades[hidden]{display:none}

/* Align both workshop headings to the same compact top edge. */
.school-main{align-items:start;padding-top:18px}.school-launch{align-self:start}.school-heading{margin-top:0}
@media(orientation:landscape) and (max-height:600px){.school-main{align-items:start;padding-top:14px}}

/* Application-specific scanned guide, shared by both workshops. */
.application-guide{color:var(--text,#e8f2f4);background:var(--bg,#0c202b);border:1px solid var(--border,#466471);border-radius:18px;padding:0;width:min(960px,96vw);max-width:96vw;max-height:92dvh;overflow:hidden}
.application-guide::backdrop{background:#061521b8}.application-guide header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px;border-bottom:1px solid var(--border,#466471)}
.application-guide header strong{font-size:1rem}.application-guide header button{flex-shrink:0;min-height:44px}.application-guide-pages{max-height:calc(92dvh - 82px);overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y pinch-zoom;padding:12px}.application-guide figure{margin:0 auto 20px;max-width:900px}.application-guide figcaption{padding:8px;font-size:1rem}.application-guide img{display:block;width:100%;height:auto;background:white;border-radius:6px}.application-guide p{padding:8px;line-height:1.7}
html[data-theme="light"] .application-guide{color:#203c4b;background:#f5f8fa;border-color:#9bb2c0}

.application-header-actions{display:flex;align-items:center;gap:6px;flex:none}.application-header-actions button{white-space:nowrap}

.awaiting-consent{overflow:hidden}
#entry-disclaimer{position:fixed;inset:0;margin:auto;box-sizing:border-box;width:min(560px,calc(100vw - 32px));max-height:calc(var(--official-view,100dvh) - 32px);overflow:auto;padding:clamp(22px,4vw,36px);border:1px solid #59717b;border-radius:20px;background:#142b39;color:#eef5f5;box-shadow:0 24px 80px #0008;text-align:center;z-index:10000}
#entry-disclaimer::backdrop{background:#07121be8}
#entry-disclaimer h2{margin:0 0 16px;font-size:clamp(23px,4vw,29px);color:#ecd49b}
#entry-disclaimer p{max-width:46ch;margin:0 auto 26px;text-align:center;font-size:17px;line-height:1.95}
#entry-disclaimer button{width:100%;min-height:48px;background:#80d6be;color:#12352e;border:1px solid #9ce8d2;font-size:18px;font-weight:bold}
#entry-disclaimer button:focus-visible{outline:3px solid #ecd49b;outline-offset:4px}
/* Explicit dimensions remain usable before min(), clamp(), inset and dvh support. */
#entry-disclaimer{top:50%;left:50%;right:auto;bottom:auto;transform:translate(-50%,-50%);margin:0;width:560px;max-width:calc(100% - 32px);max-height:calc(var(--official-view,100vh) - 32px);padding:28px;display:block;background:#142b39;color:#eef5f5}
#entry-disclaimer h2{font-size:26px}
.awaiting-consent #app{visibility:hidden;pointer-events:none}
dialog:not([open]){display:none}
/* Practical lesson shell: the circuit and its controls share one viewport. */
.lab-header.lesson-header{height:58px;min-height:58px;padding:6px 14px;gap:12px}
.lesson-header .brand{flex:1;overflow:hidden}
.lesson-header .brand strong{min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:16px;line-height:1.5}
.lesson-header #home.lesson-back{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:auto!important;height:44px;min-height:44px;min-width:90px;padding:8px 18px!important;font-size:16px!important;line-height:1.4;border-radius:10px;white-space:nowrap}
.lesson-header [hidden]{display:none!important}
.lesson-header .top-actions{flex-shrink:0;gap:6px}
.lesson-header .top-actions button{min-height:42px;font-size:13px}
.lesson-header+.focused-work{height:calc(var(--official-view,100vh) - 58px);height:calc(var(--official-view,100dvh) - 58px)}
.work.focused-work.g9-practical{grid-template-columns:clamp(230px,26vw,320px) minmax(0,1fr)!important}
.work.focused-work.g9-practical>.g9-environment{display:flex;flex-direction:column;overflow:hidden;gap:6px;padding:12px;margin:8px 0 8px 8px;background:linear-gradient(160deg,var(--ui-bg-152c3d,#173641),var(--ui-bg-101b2c,#102733));border:1px solid var(--ui-border-355264,#45616b);border-radius:15px}
.work.focused-work.g9-practical>.g9-environment[hidden]{display:none!important}
.g9-practical .g9-environment-title{font-size:16px;margin:0;line-height:1.5}
.lesson-control-help{align-self:flex-start;padding:2px 8px;min-height:28px;font-size:12px;border:0;color:var(--mint);background:transparent}
.lesson-control-pages{flex:1;min-height:0;display:flex;flex-direction:column;gap:8px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.lesson-control-pages>[hidden],.lesson-control-nav[hidden]{display:none!important}
.lesson-control-pages>*{flex:0 0 auto;margin:0!important;max-width:100%}
.lesson-control-pages.is-measuring>*{flex-shrink:0!important}
.lesson-control-pages .g9-control{font-size:14px;gap:4px;margin:0!important}
.lesson-control-pages .g9-control input{height:32px;min-height:32px}
.lesson-control-pages .g9-circuit-switch{min-height:42px;font-size:14px}
.lesson-control-pages .g9-env-scene{width:100%;height:clamp(60px,20vh,145px);max-height:45%;object-fit:contain;flex-shrink:1}
.lesson-control-pages .g9-remote-art{height:240px;height:min(240px,100%);aspect-ratio:440/960;width:auto;align-self:center;min-height:0}
.lesson-control-pages .g9-sound-rings{width:84px;height:84px;align-self:center}.lesson-control-pages .g9-sound-rings button{width:70px;height:70px}
.lesson-control-pages .g9-press-buttons{padding:8px;gap:10px}
.lesson-control-pages .g9-push{gap:8px}.lesson-control-pages .g9-push span{width:48px;height:48px}
.lesson-control-nav{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;gap:8px;padding-top:5px;border-top:1px solid var(--ui-border-355264,#36505b)}
.lesson-control-nav button{min-height:34px;min-width:44px;padding:3px 8px}.lesson-control-nav output{direction:ltr;font-size:12px;font-variant-numeric:tabular-nums;color:var(--muted)}
.lesson-help-dialog{direction:rtl}.lesson-help-dialog .g9-env-hint{color:inherit;font-size:16px;line-height:1.9}
.work.focused-work.g9-practical.lesson-no-environment,.work.focused-work.g9-practical.lesson-tools-closed{grid-template-columns:minmax(0,1fr)!important}
.work.focused-work.g9-practical.lesson-no-environment>.center,.work.focused-work.g9-practical.lesson-tools-closed>.center{grid-area:1/1}
.work.focused-work.g9-practical.lesson-tools-closed>.g9-environment{display:none}
.lab-results{display:flex;align-items:center;gap:6px;overflow-x:auto;overflow-y:hidden;flex-shrink:0;padding:6px 12px;min-height:45px;background:var(--ui-bg-101b2c,#0d222d);border-bottom:1px solid var(--ui-border-355264,#2d4553);scrollbar-width:thin}
.lab-results>span{font-size:12px;color:var(--muted)}
.lab-results .lesson-result{display:flex;align-items:center;gap:8px;flex-shrink:0;padding:5px 10px;border:1px solid var(--ui-border-355264,#354e5a);border-radius:8px;background:var(--ui-bg-142236,#142d39);font-size:12px}
.lab-results .lesson-result output{direction:rtl;font-variant-numeric:tabular-nums;color:var(--ui-text-e4ecf7,#d8e4e7)}.lab-results .lesson-result.is-active{border-color:var(--ui-border-4d968d,#62b9a5);background:var(--ui-bg-17332f,#163d3c)}.lab-results .lesson-result.is-active output{color:var(--ui-text-a4e3d0,#9cf2d5)}
.lab-results .lesson-result span{color:var(--ui-text-9cb0ca,#a9c5cb)}
.focused-work .workspace-head.compact-lesson-toolbar{flex-shrink:0;min-height:48px}
.focused-work .bottom-bar{flex-shrink:0}
#board .component>text{paint-order:stroke;stroke:var(--ui-bg-0d1726,#0d1b29);stroke-width:4px;stroke-linejoin:round}
#board .component .pin text{paint-order:stroke;stroke:var(--ui-bg-0d1726,#0d1b29);stroke-width:3px}
button:focus-visible{outline:2px solid var(--mint);outline-offset:3px}
@media(max-width:700px){
 .lab-header.lesson-header{height:54px;min-height:54px;padding:5px 8px;gap:6px}
 .lesson-header #home.lesson-back{min-width:76px;height:42px;min-height:42px;font-size:14px!important;padding:6px 12px!important}
 .lesson-header .brand{gap:8px}.lesson-header .brand strong{font-size:13px}
 .lesson-header .top-actions button{padding:6px 8px;min-height:40px;font-size:12px}
 .lesson-header+.focused-work{height:calc(var(--official-view,100vh) - 54px);height:calc(var(--official-view,100dvh) - 54px)}
}
@media(max-width:600px) and (orientation:portrait){
 /* Keep the application name on its own line while the navigation stays reachable. */
 .lab-header.lesson-header{position:relative;height:80px;min-height:80px;padding-bottom:31px}
 .lesson-header .brand{overflow:visible}
 .lesson-header .brand strong{display:block;position:absolute;left:12px;right:12px;bottom:5px;height:22px;line-height:22px;font-size:14px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .lesson-header+.focused-work{height:calc(var(--official-view,100vh) - 80px);height:calc(var(--official-view,100dvh) - 80px)}
 .work.focused-work.g9-practical{grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr) minmax(155px,30%)}
 .work.focused-work.g9-practical>.center{grid-area:1/1!important;min-height:0;flex:none}
 .work.focused-work.g9-practical>.g9-environment{grid-area:2/1;max-height:none;margin:0 8px 6px;padding:8px 10px;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto minmax(0,1fr);gap:5px 10px}
 .g9-practical .g9-environment-title{font-size:13px}.lesson-control-help{grid-column:2;grid-row:1;min-height:24px;padding:0 4px}
 .lesson-control-pages{grid-row:2;grid-column:1;align-self:stretch}.lesson-control-nav{grid-row:2;grid-column:2;flex-direction:column;justify-content:center;padding:0 0 0 5px;border:0;border-inline-start:1px solid var(--ui-border-355264,#36505b)}
 .lesson-control-pages .g9-env-scene{height:80px;max-height:none}
 .lesson-control-pages .g9-remote-art{height:100%;min-height:0;max-height:135px}
 .lesson-control-pages .g9-control{font-size:13px;line-height:1.35}
 .lesson-control-pages .g9-control input{min-height:28px;height:28px}
 .work.focused-work.g9-practical.lesson-tools-closed,.work.focused-work.g9-practical.lesson-no-environment{grid-template-rows:minmax(0,1fr)}
 .focused-work .workspace-head.compact-lesson-toolbar{gap:6px;padding:4px 6px}
 .lesson-toolbar-actions button{font-size:12px;padding:6px 8px}
 .lab-results{padding:5px 8px;min-height:42px}
}
@media(orientation:landscape) and (max-height:600px){
 .lab-header.lesson-header{height:46px;min-height:46px;padding-block:2px}
 .lesson-header #home.lesson-back{height:40px;min-height:40px;min-width:80px;font-size:14px!important;padding-block:4px!important}
 .lesson-header .top-actions button{min-height:38px}
 .lesson-header+.focused-work{height:calc(var(--official-view,100vh) - 46px);height:calc(var(--official-view,100dvh) - 46px)}
 .work.focused-work.g9-practical{grid-template-columns:230px minmax(0,1fr)!important}
 .work.focused-work.g9-practical>.g9-environment{padding:8px;margin:5px 0 5px 5px;gap:4px}
 .lesson-control-pages .g9-env-scene{height:90px}.lesson-control-pages .g9-control{font-size:13px}
 .g9-practical .g9-environment-title{font-size:14px}.lab-results{min-height:36px;padding:3px 8px}
 .focused-work .workspace-head.compact-lesson-toolbar{min-height:42px;padding-block:2px}
}
dialog.legacy-modal{position:fixed;top:50%;left:50%;right:auto;bottom:auto;transform:translate(-50%,-50%);margin:0;z-index:10000;max-height:90vh;overflow:auto;box-shadow:0 0 0 100vmax rgba(7,18,27,.92)}

.school-home #subject-traffic{grid-column:1/-1;min-height:115px;border-color:var(--ui-border-486371,#486371);background:linear-gradient(135deg,var(--ui-bg-214754,#214754),var(--ui-bg-112535,#112535));}.school-home #subject-traffic small{margin-top:6px}

/* Persistent IR remote: lives beside/below the circuit, with responsive touch keys. */
.g9-environment.has-inline-remote>.lesson-control-pages:empty{display:none}
.g9-environment.has-inline-remote .lesson-remote-inline{position:relative;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(8,minmax(30px,1fr));gap:5px;flex:1;min-height:0;max-width:260px;width:100%;height:auto;aspect-ratio:auto;align-self:center;box-sizing:border-box;padding:10px;border:1px solid #516779;border-radius:24px;background:linear-gradient(145deg,#233648,#101c2a);box-shadow:inset 0 1px 0 #8296a333;overflow:auto;direction:ltr}
.g9-environment.has-inline-remote .lesson-remote-inline>img{display:none}
.g9-environment.has-inline-remote .lesson-remote-inline>button{position:static;transform:none;width:auto;height:auto;min-height:30px;min-width:0;padding:2px;border:1px solid #506679!important;border-radius:9px;background:#30475a!important;color:#eef8fa;box-shadow:0 2px 0 #071422;font:600 13px system-ui;touch-action:manipulation}
.g9-environment.has-inline-remote .lesson-remote-inline>button:first-of-type{background:#974c49!important;border-color:#d88c83!important}
.g9-environment.has-inline-remote .lesson-remote-inline>button:active{background:#257563!important;box-shadow:none}
@media(orientation:landscape) and (max-height:600px){
 .g9-environment.has-inline-remote .lesson-remote-inline{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(6,minmax(28px,1fr));padding:7px;gap:4px;border-radius:17px}
 .g9-environment.has-inline-remote .lesson-remote-inline>button{min-height:28px;font-size:12px}
}
@media(max-width:600px) and (orientation:portrait){
 .work.focused-work.g9-practical.has-inline-remote{grid-template-rows:minmax(0,1fr) minmax(230px,37%)}
 .g9-environment.has-inline-remote .lesson-remote-inline{grid-column:1/-1;grid-row:2;grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:repeat(4,minmax(36px,1fr));max-width:none;align-self:stretch;min-height:0;padding:7px;gap:5px;border-radius:17px}
 .g9-environment.has-inline-remote .lesson-remote-inline>button{min-height:36px;font-size:12px}
}

.lesson-tools-toggle[hidden]{display:none!important}
/* Clear home target and a consistent teacher-guide reader. */
.lab-header .brand .lab-home{width:auto;min-width:78px;height:auto;min-height:44px;padding:8px 14px;border-radius:14px;font-size:1rem;white-space:nowrap}
.application-guide{width:min(1100px,96vw);height:94vh;height:94dvh;max-height:94vh;max-height:94dvh;display:flex;flex-direction:column}
.application-guide:not([open]){display:none}
.application-guide header{flex:none}.application-guide header>div{display:flex;flex-direction:column;gap:4px}.application-guide header small{color:var(--muted)}
.application-guide-navigation{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;padding:10px 12px;border-bottom:1px solid var(--line);flex:none}
.application-guide-navigation button{min-height:42px;white-space:nowrap}.application-guide-navigation label{display:flex;align-items:center;gap:8px}.application-guide-navigation select{max-width:260px;min-height:42px}
.application-guide-navigation [data-guide-return]{color:var(--accent);border-color:var(--accent)}
.guide-zoom{display:flex;gap:4px}.guide-availability{margin:0;padding:6px 14px;font-size:.82rem;color:var(--muted)}.guide-note{padding:6px 14px;flex:none}.guide-note p{margin:8px 0}
.application-guide .application-guide-pages{flex:1;min-height:0;max-height:none;background:#dce3e5;direction:ltr;overflow:auto;touch-action:pan-x pan-y pinch-zoom}
.application-guide figure{margin:0 auto 12px;background:white;color:#213a43}.application-guide figcaption{direction:rtl;padding:8px;text-align:center}.application-guide figure img{display:block;width:100%;height:auto}
.g7-toolhead{flex-wrap:wrap}.g7-toolhead [data-command="undo"]{white-space:nowrap}
@media(max-width:600px){.application-guide header{padding:8px;gap:8px}.application-guide header strong{font-size:.88rem}.application-guide header button{font-size:.82rem;padding:8px}.application-guide-navigation{gap:5px;padding:6px}.application-guide-navigation button{font-size:.8rem;padding:7px}.application-guide-navigation select{max-width:170px;font-size:.82rem}.application-guide-pages{padding:5px}.application-header-actions button{padding:8px 10px;font-size:.9rem}}

/* Continuous tool lists; stage geometry never depends on status text. */
.lab-control-stack{display:flex!important;flex-direction:column!important;flex-wrap:nowrap!important;gap:14px!important;overflow-y:auto!important;overflow-x:hidden!important;min-height:0;scroll-behavior:smooth;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:16px!important;align-items:stretch!important}.lab-control-stack>*{flex:0 0 auto!important;min-width:0;max-width:100%;box-sizing:border-box}.lab-control-stack input[type=range]{width:100%}.lab-control-stack label{line-height:1.6}.lab-control-stack button{white-space:normal;min-height:44px}
.g7-stage{position:relative}.g7-stage .g7-notice{position:absolute;z-index:5;top:48px;left:12px;right:12px;margin:0;padding:10px 16px;border-radius:12px;background:#412c25f2;color:#ffe5c6;border:1px solid #ba8a65;box-shadow:0 4px 16px #0002;pointer-events:none;font-size:14px;line-height:1.5}.g7-stage .g7-notice:empty{display:none}
.g7-guide-card{max-width:680px;margin:8vh auto;padding:36px;background:#17343e;border:1px solid #41626b;border-radius:24px;text-align:center;line-height:1.9}.g7-guide-card button{margin-top:20px;padding:14px 36px;background:#69d3ba;color:#123b36;border-radius:14px}
.work .g9-environment.lesson-scroll-tools{overflow-y:auto!important;overflow-x:hidden!important;display:flex!important;flex-direction:column!important;gap:12px;scroll-behavior:smooth;-webkit-overflow-scrolling:touch}.lesson-scroll-tools>*{flex-shrink:0}.lesson-scroll-tools .lesson-control-pages{flex:none!important;overflow:visible!important;max-height:none!important;padding:0!important;display:flex!important;gap:14px!important}.lesson-scroll-tools .real-interaction{position:static}.lesson-scroll-tools .lesson-remote-inline{flex-shrink:0}

.g7-stage .g7-hint{min-height:44px;box-sizing:border-box}.g7-stage .g7-notice{top:0;left:0;right:0;max-height:44px;overflow:auto;box-sizing:border-box;padding:8px 14px;font-size:13px;border-radius:14px 14px 0 0;pointer-events:auto}

.al-display-settings{border:1px solid #557e80;border-radius:20px;background:#17343e;color:#e9f5f2;padding:26px;min-width:260px;direction:rtl}.al-display-settings label{display:flex;gap:12px;padding:18px 0;align-items:center}.al-display-settings input{width:20px;height:20px;accent-color:#69d3ba}.al-display-settings button{width:100%;margin-top:16px;padding:12px}.al-display-settings::backdrop{background:#06131cab}.al-properties #al-reading[hidden]{display:none!important}

/* One bounded picker: fixed header/actions with a touch-scrollable component grid. */
.work.focused-work .library{inset:54px 8px 8px;max-height:none;padding:10px;overflow:hidden;min-height:0}
.work.focused-work .library.open{display:flex;flex-direction:column;gap:8px}
.work.focused-work .library .section-title{flex:none;display:flex;align-items:center;gap:8px;margin:0;min-width:0}
.work.focused-work .library .section-title strong{white-space:nowrap;font-size:14px}
.work.focused-work .library .search{flex:1;min-width:0;width:auto;max-width:260px;margin:0;margin-inline-start:auto}
.work.focused-work .library #close-library{flex:none;min-height:40px;min-width:40px}
.work.focused-work #catalog{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.work.focused-work .library .parts{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));grid-auto-rows:max-content;align-content:start;gap:8px;padding:2px 2px 10px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}
.work.focused-work .part-card{min-width:0;display:flex;flex-direction:column}
.work.focused-work .part-card .part{flex:1;min-height:94px;font-size:12px;line-height:1.5;padding:6px}
.work.focused-work .part-card .part svg{width:64px;height:52px;flex:none;pointer-events:none}
.work.focused-work .part-card .part span{overflow-wrap:anywhere}
.work.focused-work .quantity{padding:4px;gap:4px;flex:none}
.work.focused-work .quantity button{width:36px;min-width:36px;min-height:36px;touch-action:manipulation}
.work.focused-work .basket-bar{position:static;flex:none;margin:0;padding:8px 0 0;min-height:48px}
.work.focused-work .basket-bar button{min-height:40px}
@media(max-width:440px){.work.focused-work .library .parts{grid-template-columns:repeat(2,minmax(0,1fr))}.work.focused-work .library .section-title strong{font-size:12px}.work.focused-work .library .search{font-size:12px}}
@media(orientation:landscape) and (max-height:600px){.work.focused-work .library{top:48px;bottom:5px;padding:7px}.work.focused-work .part-card .part{min-height:78px}.work.focused-work .part-card .part svg{height:40px}.work.focused-work .library .parts{grid-template-columns:repeat(auto-fill,minmax(116px,1fr))}}
/* Tools share one scrolling surface, including sensor sensitivity and calibration. */
.g7-toolhead{flex:none}
.g7-experience .g7-controls.lab-control-stack{flex:1;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;padding:10px;gap:12px}
.g7-controls.lab-control-stack>*{flex:none;min-width:0;width:100%;max-width:100%}
.work .g9-environment.lesson-scroll-tools{min-width:0;overscroll-behavior:contain}
.lesson-scroll-tools .lesson-control-pages .g9-env-scene{flex:none;max-height:none}
.lesson-scroll-tools .real-interaction{flex:none;width:100%;margin:0}
.component-caption,.al-component-label,.al-component-value{pointer-events:none}
.component-value,.al-component-value,.lesson-result bdi{direction:ltr;unicode-bidi:isolate}
/* Long text must not enlarge the sole grid column on narrow phones. */
.g7-experience{grid-template-columns:minmax(0,1fr)}
.g7-experience>.g7-header,.g7-experience>.g7-foot,.g7-experience>.g7-workspace{min-width:0;max-width:100%}
.g7-experience .g7-toolbox,.g7-experience .g7-toolhead{min-width:0}

/* Shared typography and spacing for Grade 7 and Grade 8 reference lessons. */
.reference-lesson-page .dc-directory>p{font-size:20px;line-height:1.8}
.reference-lesson-page .g9-section-title h2{font-size:clamp(26px,3vw,38px);line-height:1.55}
.reference-lesson-page .g9-section-title{flex-wrap:wrap;align-items:center}
.reference-lesson-page .reference-lesson-content{align-items:stretch;gap:24px}
.reference-lesson-page .reference-lesson-content p{margin:0;font-size:22px;line-height:1.95;color:var(--ui-text-9eb8c6,#9eb8c6)}
.reference-lesson-page .reference-lesson-content>button{font-size:22px;line-height:1.6;min-height:108px;padding:24px;border-radius:16px}
.reference-lesson-page .g9-section-title button{font-size:20px}
.reference-lesson-page .g9-footer{font-size:18px;line-height:1.8}
@media(max-width:600px){.reference-lesson-page .reference-lesson-content p{font-size:20px}.reference-lesson-page .reference-lesson-content>button{min-height:72px}.reference-lesson-page .g9-section-title{gap:16px}}

.lesson-time-speed{display:flex;align-items:center;gap:8px;white-space:nowrap;font-size:12px}.lesson-time-speed input{width:110px;min-width:65px;accent-color:var(--mint)}.lesson-time-speed output{min-width:42px}.g9-practical .bottom-bar{flex-wrap:wrap;gap:6px}.g9-practical .library.open{z-index:60}
/* Resistor studio — shared site theme, native scalable illustration. */
.rc{max-width:1200px;margin:auto;padding:24px;color:var(--ui-text-e4ecf7,#e4ecf7);height:var(--official-view,100dvh);overflow:auto;box-sizing:border-box}.rc *{box-sizing:border-box}.rc header{display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--border);padding-bottom:20px}.rc h1{font-size:24px;margin:6px 0}.rc header small,.rc-eyebrow{color:var(--mint)}.rc button{min-height:44px}.rc-welcome{text-align:center;max-width:850px;margin:44px auto}.rc-welcome h2{font-size:clamp(28px,4vw,44px);margin:16px 0}.rc-welcome p{color:var(--muted);line-height:1.8}.rc-resistor{display:block;width:100%;max-height:290px;margin:auto;overflow:visible}.rc-choices{display:grid;grid-template-columns:1fr 1fr;gap:20px}.rc-choices button{padding:30px;border:1px solid var(--mint);text-align:right;border-radius:22px}.rc-choices b{display:block;font-size:25px;margin-bottom:12px}.rc-choices span{color:var(--muted)}.rc-toolbar{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:22px 0}.rc-toolbar h2{margin:0 auto 0 0;font-size:21px}.rc-segment{display:flex;gap:6px}.rc button[aria-pressed=true]{border-color:var(--mint);box-shadow:inset 0 0 0 1px var(--mint)}.rc-stage{border:1px solid var(--border);border-radius:24px;padding:20px;background:var(--ui-bg-17303c,#17303c)}.rc-stage-top{display:flex;justify-content:space-between;gap:12px;color:var(--muted);font-size:14px}.rc-reading{text-align:center;display:grid;gap:8px;padding-bottom:8px}.rc-reading strong{font-size:clamp(32px,5vw,48px);color:var(--mint);font-weight:500}.rc-reading span{color:var(--muted)}.rc-controls{max-width:850px;margin:24px auto}.rc-controls>p{text-align:center;line-height:1.8;color:var(--muted)}.rc-band-tabs{display:flex;justify-content:center;gap:10px}.rc-band-tabs button{display:flex;align-items:center;gap:10px;padding:10px 15px}.rc-band-tabs i{display:inline-block;width:12px;height:28px;border:1px solid #9996;border-radius:3px}.rc-band-tabs span{font-size:14px}.rc-color-name{text-align:center;margin:20px 0 10px}.rc-color-slider{appearance:none;-webkit-appearance:none;width:100%;height:22px;border-radius:14px;background:var(--rc-strip);touch-action:pan-y;cursor:ew-resize;direction:ltr}.rc-color-slider::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;background:#fff;width:28px;height:36px;border:3px solid #315b60;border-radius:10px;box-shadow:0 2px 9px #0005}.rc-color-slider::-moz-range-thumb{background:#fff;width:24px;height:32px;border:3px solid #315b60;border-radius:10px}.rc-swatches{display:grid;grid-template-columns:repeat(12,1fr);gap:5px;margin-top:14px}.rc-swatches button{padding:6px 2px;min-width:0;border-radius:10px;font-size:11px}.rc-swatches i{display:block;background:var(--swatch);width:25px;height:25px;border-radius:50%;border:1px solid #8887;margin:0 auto 6px}.rc-swatches span{display:block}.rc-form{display:grid;justify-content:center;gap:12px;margin-top:25px;text-align:center}.rc-entry{display:flex;gap:8px;max-width:100%;align-items:center}.rc-entry input{width:200px;min-width:0;font-size:23px;text-align:center;padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--ui-bg-0c1422,#0c1422);color:inherit}.rc-entry select,.rc-quiz-settings select{padding:12px;border-radius:12px;font-size:18px;background:var(--ui-bg-0c1422,#0c1422);color:inherit;border:1px solid var(--border)}.rc-entry button,.rc-quiz-settings button{background:var(--mint);color:#12352f}.rc-message{min-height:32px;text-align:center;color:var(--mint);line-height:1.8}.rc-quiz-settings{display:flex;justify-content:center;align-items:center;gap:20px}.rc-clock{max-width:500px;margin:0 auto;text-align:center;font-size:26px;color:var(--mint)}.rc-clock progress{display:block;width:100%;height:7px;margin-top:14px;accent-color:var(--mint)}.rc-chart{border-top:1px solid var(--border);margin-top:25px;padding-top:15px}.rc-table-wrap{overflow:auto}.rc-chart table{width:100%;border-collapse:collapse;text-align:center}.rc-chart th,.rc-chart td{padding:12px;border-bottom:1px solid var(--border)}.rc-chart tbody th{text-align:right}.rc-chart i{display:inline-block;vertical-align:middle;width:19px;height:19px;border-radius:50%;border:1px solid #9997;margin-left:12px}.rc-chart p{color:var(--muted);line-height:1.8}.rc button:focus-visible,.rc input:focus-visible,.rc select:focus-visible{outline:3px solid var(--mint);outline-offset:3px}.rc [hidden]{display:none!important}#resistor-lab{width:100%}#resistor-lab small{display:block;margin-top:6px;color:var(--muted)}
@media(max-width:600px){.rc{padding:14px}.rc header{gap:8px}.rc h1{font-size:18px}.rc header small{font-size:11px}.rc header button{padding:8px 12px}.rc-welcome{margin:30px auto}.rc-choices{grid-template-columns:1fr;gap:12px}.rc-choices button{padding:22px}.rc-toolbar{gap:10px}.rc-toolbar h2{width:100%;font-size:20px}.rc-stage{padding:14px 8px}.rc-stage-top{font-size:11px}.rc-resistor{min-height:130px}.rc-band-tabs{gap:5px}.rc-band-tabs button{padding:8px;gap:5px}.rc-band-tabs span{font-size:11px}.rc-swatches{grid-template-columns:repeat(6,1fr);gap:7px}.rc-swatches button{font-size:12px}.rc-entry input{width:130px}.rc-entry select{padding:10px}.rc-quiz-settings{gap:10px;font-size:14px}.rc-quiz-settings select{font-size:14px}.rc-chart td,.rc-chart th{padding:10px 5px;font-size:14px}}
/* Compact resistor activity with direct vertical band dragging. */
.rc.rc-compact{position:fixed;inset:0;width:100%;height:var(--official-view,100vh);height:var(--official-view,100dvh);padding:14px 24px;overflow:hidden;display:flex;flex-direction:column;gap:10px;background:var(--ui-bg-0c1422,#0c1422)}
.rc-compact header{flex:none;padding-bottom:10px}.rc-compact header small{display:none}.rc-compact h1{font-size:21px;margin:0}.rc-compact .rc-toolbar{flex:none;padding:0;gap:10px}.rc-compact .rc-toolbar h2{font-size:18px}.rc-compact .rc-stage{flex:1;min-height:0;padding:12px;display:flex;flex-direction:column;justify-content:center}.rc-compact [data-art]{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;touch-action:none;user-select:none;-webkit-user-select:none}.rc-compact .rc-resistor{width:min(100%,740px);height:100%;min-height:0;max-height:220px}.rc-compact .rc-stage-top{flex:none;font-size:12px}.rc-compact .rc-reading{flex:none;gap:3px;padding:0}.rc-compact .rc-reading strong{font-size:32px}.rc-compact .rc-reading span{font-size:13px}.rc-compact .rc-controls{flex:none;width:100%;margin:0 auto}.rc-compact .rc-controls>p{margin:0;font-size:14px}.rc-current-band{height:22px;text-align:center;font-size:13px;color:var(--mint)}.rc-compact .rc-form{margin-top:4px;gap:5px}.rc-compact .rc-form label{font-size:14px}.rc-compact .rc-entry input{font-size:20px;padding:8px}.rc-compact .rc-entry select{padding:8px}.rc-compact .rc-message{flex:none;font-size:13px;margin:0;min-height:24px;line-height:1.5}.rc-compact [data-band-hit]{cursor:ns-resize;touch-action:none}.rc-compact [data-band-hit]:focus{stroke:var(--mint);stroke-width:2;outline:none}.rc-dragging{cursor:ns-resize}.rc-compact .rc-clock{font-size:22px;width:100%;flex:none}.rc-compact .rc-clock progress{margin-top:5px}.rc-compact .rc-chart{position:absolute;inset:12px;z-index:10;border:1px solid var(--border);border-radius:20px;background:var(--ui-bg-0c1422,#0c1422);padding:14px 20px;margin:0;display:flex;flex-direction:column;box-shadow:0 15px 60px #0006}.rc-chart-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.rc-chart-head h2{font-size:20px;margin:0}.rc-compact .rc-table-wrap{flex:1;min-height:0;overflow:auto}.rc-compact .rc-chart table{height:100%;font-size:14px}.rc-compact .rc-chart td,.rc-compact .rc-chart th{padding:3px 10px}.rc-compact .rc-chart p{font-size:12px;margin:5px 0}.rc-compact .rc-welcome{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center;gap:12px;width:100%;margin:0 auto}.rc-compact .rc-welcome h2,.rc-compact .rc-welcome p{margin:0}.rc-compact .rc-welcome .rc-resistor{flex:1;min-height:0;max-height:200px}.rc-compact .rc-choices button{padding:18px}.rc-compact .rc-choices b{font-size:22px;margin-bottom:5px}
@media(max-width:600px){.rc.rc-compact{padding:10px;gap:8px}.rc-compact h1{font-size:17px}.rc-compact .rc-toolbar h2{display:none}.rc-compact .rc-toolbar{justify-content:space-between}.rc-compact .rc-stage-top{font-size:10px}.rc-compact .rc-controls>p{font-size:12px}.rc-compact .rc-reading strong{font-size:28px}.rc-compact .rc-entry input{width:120px}.rc-compact .rc-choices{gap:10px}.rc-compact .rc-choices button{padding:16px}.rc-compact .rc-welcome h2{font-size:28px}}
@media(max-height:520px) and (min-width:601px){.rc.rc-compact{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(260px,1fr);grid-template-rows:44px 44px minmax(0,1fr) 32px;gap:6px 18px;padding:8px 18px}.rc-compact header,.rc-compact .rc-toolbar,.rc-compact .rc-message{grid-column:1/-1}.rc-compact header{padding-bottom:5px}.rc-compact .rc-stage{grid-column:1;grid-row:3}.rc-compact .rc-controls{grid-column:2;grid-row:3;align-self:center}.rc-compact .rc-reading strong{font-size:26px}.rc-compact .rc-stage-top{font-size:10px}.rc-compact .rc-quiz-settings{gap:8px;flex-wrap:wrap}.rc-compact .rc-form{margin-top:8px}.rc-compact .rc-resistor{max-height:150px}.rc-compact .rc-chart td,.rc-compact .rc-chart th{font-size:11px;padding:1px 8px}.rc-compact .rc-chart i{width:12px;height:12px}.rc-compact .rc-chart-head h2{font-size:16px}.rc-compact .rc-chart-head button{min-height:30px;padding:5px 12px}.rc-compact.rc-home{display:flex}.rc-compact .rc-welcome{gap:5px}.rc-compact .rc-welcome h2{font-size:24px}.rc-compact .rc-welcome p{font-size:13px}.rc-compact .rc-choices button{padding:10px}.rc-compact .rc-choices b{font-size:18px}}
/* Readable resistor instructions at tablet viewing distance. */
.rc-compact .rc-stage-top{font-size:18px;line-height:1.5;color:var(--ui-text-e4ecf7,#e4ecf7)}
.rc-compact .rc-controls>p,.rc-compact .rc-reading span,.rc-compact .rc-form label{font-size:19px;line-height:1.5;color:var(--ui-text-e4ecf7,#e4ecf7)}
.rc-compact .rc-current-band{font-size:18px;line-height:1.5;height:28px}
.rc-compact .rc-message{font-size:17px;min-height:28px}
.rc-compact .rc-reading strong{font-size:38px}
.rc-compact button{font-size:18px}
.rc-compact .rc-entry input,.rc-compact .rc-entry select{font-size:22px}
@media(max-width:600px){.rc-compact .rc-stage-top{font-size:14px;gap:10px}.rc-compact .rc-stage-top span:last-child{text-align:left}.rc-compact .rc-controls>p,.rc-compact .rc-reading span,.rc-compact .rc-form label{font-size:16px}.rc-compact .rc-current-band,.rc-compact .rc-message{font-size:16px}.rc-compact .rc-reading strong{font-size:34px}.rc-compact button{font-size:16px}.rc-compact .rc-entry input,.rc-compact .rc-entry select{font-size:20px}}
@media(max-height:520px) and (min-width:601px){.rc-compact .rc-stage-top{font-size:15px}.rc-compact .rc-controls>p,.rc-compact .rc-reading span,.rc-compact .rc-form label,.rc-compact .rc-current-band,.rc-compact .rc-message{font-size:16px}.rc-compact .rc-reading strong{font-size:30px}.rc-compact button{font-size:16px}.rc-compact .rc-current-band{height:24px}}

/* Display names independently from component values and live readings. */
#board.hide-component-names .component-name{display:none}

/* Keep the simulation speed footer inside the viewport during fullscreen changes. */
.lesson-viewport{position:fixed;inset:0;display:flex;flex-direction:column;height:var(--official-view,100vh);height:var(--lesson-viewport-height,var(--official-view,100dvh));min-height:0;overflow:hidden}
.lesson-viewport>.lab-header{flex:0 0 auto}
.lesson-viewport>.work.focused-work{flex:1 1 0;height:auto!important;min-height:0;overflow:hidden}
.lesson-viewport .center{min-height:0}
.lesson-viewport .canvas-wrap{flex:1 1 0;min-height:0}
.lesson-viewport .bottom-bar{height:auto;min-height:34px;flex:0 0 auto;padding-bottom:max(5px,env(safe-area-inset-bottom));flex-wrap:wrap;gap:5px 12px}
.lesson-viewport .lesson-time-speed{flex:0 0 auto;margin-inline-start:auto}
.lesson-viewport #solver-status{min-width:0;flex:1 1 100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:650px){.lesson-viewport .bottom-bar>.wide-only{display:none}.lesson-viewport .lesson-time-speed{font-size:10px;gap:5px}.lesson-viewport .lesson-time-speed input{width:85px}}

/* Keep the reference chart readable on tablets; short screens scroll its rows. */
.rc .rc-chart table,.rc-compact .rc-chart table{font-size:clamp(18px,1.7vw,24px);line-height:1.5}
.rc .rc-chart :is(th,td),.rc-compact .rc-chart :is(th,td){font-size:inherit;padding:8px 10px;white-space:nowrap}
.rc .rc-chart-head h2{font-size:clamp(22px,2vw,28px)}
.rc .rc-chart p{font-size:16px}
.rc .rc-chart i{width:22px;height:22px}

.pot-resistance-label{text-align:center;font-size:12px;line-height:1.5;margin:3px 0;color:inherit}

/* Dedicated curriculum chooser, shared by electricity and decor. */
.curriculum-page{display:flex;flex-direction:column;min-height:var(--official-view,100dvh)}
.curriculum-page .school-top,.curriculum-page .school-footer{width:100%;box-sizing:border-box}
.curriculum-page .school-top{flex-wrap:wrap}
.curriculum-page .school-tools{flex-wrap:wrap;align-items:center}
.curriculum-page #curriculum-back{min-height:44px;background:var(--ui-bg-172b3a,#172b3a);color:var(--ui-text-edf4f5,#edf4f5);border-color:var(--ui-border-60747f,#60747f)}
.curriculum-main{width:100%;max-width:1040px;box-sizing:border-box;margin:auto;padding:44px 32px 56px}
.curriculum-heading{text-align:center;margin-bottom:32px}
.curriculum-heading h1{font-size:clamp(28px,4vw,42px);line-height:1.5;margin:8px 0}
.curriculum-heading p{color:var(--ui-text-a9bec9,#a9bec9);font-size:16px;line-height:1.8;margin:0}
.curriculum-page .school-overline{display:inline-block}
.curriculum-grade-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.curriculum-page .curriculum-grade-card{display:flex;align-items:center;gap:22px;text-align:start;min-width:0;min-height:160px;padding:26px;border-radius:20px;border:1px solid var(--ui-border-60747f,#60747f);background:var(--ui-bg-172b3a,#172b3a);color:var(--ui-text-edf4f5,#edf4f5);box-shadow:0 8px 22px #00000012;transition:transform .15s ease,border-color .15s ease}
.curriculum-page .curriculum-grade-card:hover{transform:translateY(-3px);border-color:var(--ui-text-e0c68e,#e0c68e)}
.curriculum-grade-number{display:grid;place-items:center;flex:0 0 64px;height:72px;border-radius:16px;background:var(--ui-bg-0b1726,#0b1726);color:var(--ui-text-e0c68e,#e0c68e);font-size:40px;font-weight:700}
.curriculum-grade-copy{display:grid;gap:8px;min-width:0}
.curriculum-grade-copy strong{font-size:24px;line-height:1.5}
.curriculum-grade-copy small{font-size:14px;line-height:1.7;color:var(--ui-text-a9bec9,#a9bec9)}
.curriculum-grade-arrow{margin-inline-start:auto;font-size:24px;color:var(--ui-text-e0c68e,#e0c68e)}
.curriculum-page button:focus-visible{outline:3px solid var(--ui-text-e0c68e,#e0c68e);outline-offset:4px}
@media(max-width:600px){.curriculum-page .school-top{justify-content:center;padding:16px}.curriculum-page .school-tools{justify-content:center}.curriculum-main{padding:26px 18px 32px}.curriculum-heading{margin-bottom:24px}.curriculum-grade-grid{grid-template-columns:1fr;gap:12px}.curriculum-page .curriculum-grade-card{min-height:112px;padding:18px;gap:18px}.curriculum-grade-number{flex-basis:56px;height:64px;font-size:34px}.curriculum-grade-copy strong{font-size:21px}}
@media(max-height:500px) and (min-width:601px){.curriculum-main{padding:20px 28px}.curriculum-heading{margin-bottom:18px}.curriculum-page .curriculum-grade-card{min-height:112px;padding:18px}.curriculum-grade-grid{gap:12px}.curriculum-grade-number{height:60px}}
@media(prefers-reduced-motion:reduce){.curriculum-page .curriculum-grade-card{transition:none}.curriculum-page .curriculum-grade-card:hover{transform:none}}
/* Subject navigation stays at the physical right edge in both workshops. */
.school-top.school-subject-header{display:grid;grid-template-columns:auto minmax(0,1fr) auto;direction:rtl;width:100%;box-sizing:border-box}
.school-subject-header .school-subject-back{grid-column:1;grid-row:1;min-height:44px;white-space:nowrap}
.school-subject-header .school-wordmark{grid-column:2;grid-row:1;max-width:none}
.school-subject-header .school-tools{grid-column:3;grid-row:1;justify-content:flex-end;flex-wrap:wrap}
@media(max-width:600px){.school-top.school-subject-header{grid-template-columns:auto minmax(0,1fr);gap:12px}.school-subject-header .school-wordmark{text-align:left}.school-subject-header .school-tools{grid-column:1/-1;grid-row:2;justify-self:end}}

.cap-chart{position:fixed;inset:20px;z-index:200;margin:0;padding:24px;border:1px solid var(--border);border-radius:20px;background:var(--ui-bg-0c1422,#0c1422);overflow:auto;overscroll-behavior:contain;box-shadow:0 12px 80px #0008}.cap-chart[hidden]{display:none}.cap-chart-grid{display:grid;grid-template-columns:minmax(230px,1fr) minmax(320px,2fr);gap:24px}.cap-chart table{width:100%;border-collapse:collapse;text-align:center}.cap-chart td,.cap-chart th{padding:9px;border-bottom:1px solid var(--border)}.cap-chart thead{color:var(--mint)}.cap-chart tbody tr:nth-child(even){background:#78979912}.cap-chart p{line-height:1.8}.cap-code-example{display:flex;align-items:center;justify-content:center;gap:22px;flex-wrap:wrap;padding:18px;border:1px solid var(--border);border-radius:14px}.cap-code-example b{font-size:34px;color:var(--mint)}@media(max-width:650px){.cap-chart{inset:8px;padding:14px}.cap-chart-grid{grid-template-columns:minmax(0,1fr)}.cap-chart-head h2{font-size:18px}.cap-chart td,.cap-chart th{padding:7px 4px}.capacitor .rc-choices{grid-template-columns:1fr 1fr;gap:8px}.capacitor .rc-choices button{padding:15px}.capacitor .rc-choices b{font-size:20px}}

/* Keep calculator back and home together at every screen width. */
.rc header .calculator-navigation{display:flex;align-items:center;gap:8px;flex:none}
.rc header .calculator-navigation button{margin:0;flex:none}
.rc header:has(.calculator-navigation)>h1,.rc header:has(.calculator-navigation)>div:not(.calculator-navigation){flex:1;text-align:center;min-width:0}
