.circuit-simulator{color:#173047;background:#f4f8fc;border:1px solid #c9d8e6;border-radius:16px;padding:clamp(.8rem,2vw,1.5rem);font-family:system-ui,sans-serif;color-scheme:light}
.circuit-simulator [hidden]{display:none!important}.cs-title{text-align:center;margin:0;font-size:clamp(1.3rem,2.5vw,2.3rem)}.cs-subtitle{text-align:center;color:#526477;margin:.2rem 0}.cs-diagram{position:relative;max-width:850px;margin:auto}.cs-diagram svg{display:block;width:100%;height:clamp(180px,36vh,380px)}.cs-wire,.cs-switch-fixed,.cs-switch-arm{fill:none;stroke:#2563eb;stroke-width:10;stroke-linecap:round;stroke-linejoin:round}.cs-battery{fill:none;stroke:#f59e0b;stroke-width:7}.cs-resistor{fill:#fff7ed;stroke:#c2410c;stroke-width:7}.cs-switch-dot{fill:#2563eb}.cs-label{font-size:24px;fill:#334155;font-weight:650}.cs-plus,.cs-minus{font-size:30px;fill:#c2410c;font-weight:700}.cs-diagram .is-open .cs-switch-arm{transform:rotate(-38deg);transform-origin:330px 95px}.cs-flow{position:absolute;top:45%;left:30%;right:25%;display:flex;justify-content:space-between;color:#0284c7;font-size:2.2rem;pointer-events:none}.cs-flow span{animation:cs-pulse 1.45s infinite}.cs-diagram:not(.is-flowing) .cs-flow{opacity:.12;animation:none}.cs-diagram:not(.is-flowing) .cs-flow span{animation:none}@keyframes cs-pulse{0%,100%{opacity:.15;transform:scale(.8)}50%{opacity:1;transform:scale(1.2)}}.cs-values{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.65rem;margin:.45rem 0}.cs-value{background:#fff;border:1px solid #cbd5e1;border-radius:12px;text-align:center;padding:.7rem;font-size:clamp(.95rem,1.8vw,1.5rem);font-weight:700}.cs-current{background:#dff4ff;border-color:#7dd3fc;color:#075985;font-size:clamp(1.1rem,2.2vw,1.9rem)}.cs-formula{text-align:center;font-size:clamp(1.2rem,2.5vw,2.2rem);font-weight:750;color:#075985;min-height:1.4em}.cs-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin:.7rem 0}.cs-controls label{font-weight:650}.cs-controls input[type=number]{width:6rem;margin-left:.5rem}.circuit-simulator input[type=number]{border:1px solid #94a3b8;border-radius:8px;padding:.4rem;background:#fff;color:#173047;min-height:42px}.cs-controls input[type=range]{display:block;width:100%;margin-top:.3rem;accent-color:#0284c7}.cs-actions,.cs-teacher-actions{display:flex;align-items:center;justify-content:center;gap:.5rem;flex-wrap:wrap;margin:.5rem 0}.circuit-simulator button{border:1px solid #8ba5b9;border-radius:8px;background:#fff;color:#075985;font:inherit;font-weight:650;padding:.55rem .8rem;min-height:44px}.circuit-simulator button:disabled{opacity:.5}.circuit-simulator .cs-return{background:#0369a1;color:#fff}.cs-permission{padding:.4rem}.cs-permission input{width:20px;height:20px;vertical-align:middle}.cs-note{text-align:center;color:#64748b;font-size:.8rem;margin:.45rem 0}.cs-feedback{min-height:1.2em;color:#64748b;font-size:.8rem;margin:0}.cs-board-shell{width:100%;height:100%;min-height:0;overflow:auto}.cs-board-source{text-align:center;font-size:.85rem;color:#94a3b8}.cs-board-shell>.circuit-simulator{max-width:1200px;min-height:100%;margin:auto}.pdf-active #stage:has(.cs-board-shell){gap:.4rem}
@media(max-width:600px){.cs-values,.cs-controls{grid-template-columns:1fr}.cs-diagram svg{height:180px}.cs-label{font-size:19px}.cs-flow{font-size:1.3rem}.cs-board-shell .cs-value{padding:.4rem}}
.cs-current-flow{fill:none;stroke:#38bdf8;stroke-width:6;stroke-linecap:round;stroke-dasharray:1 30;opacity:0;pointer-events:none}
.cs-diagram.is-flowing .cs-current-flow{opacity:1;animation:cs-travel 1.8s linear infinite}
@keyframes cs-travel{to{stroke-dashoffset:-155}}
@media(prefers-reduced-motion:reduce){.cs-diagram.is-flowing .cs-current-flow{animation:none}}
.cs-board-shell>.circuit-simulator{display:flex;flex-direction:column;height:100%;gap:clamp(.15rem,.5vh,.5rem);padding:clamp(.5rem,1vh,1rem)}
.cs-board-shell .cs-title,.cs-board-shell .cs-subtitle,.cs-board-shell .cs-values,.cs-board-shell .cs-formula,.cs-board-shell .cs-controls,.cs-board-shell .cs-actions,.cs-board-shell .cs-note{flex:0 0 auto;margin:0}
.cs-board-shell .cs-diagram{flex:1 1 140px;min-height:140px;width:100%}.cs-board-shell .cs-diagram svg{height:100%;max-height:100%}
.cs-board-shell .cs-values{gap:.4rem}.cs-board-shell .cs-value{padding:.4rem}
.cs-board-shell .cs-controls{gap:.4rem}.cs-board-shell .cs-controls input[type=range]{margin:0}
.cs-board-shell .cs-feedback{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@media(max-width:700px){.cs-board-shell>.circuit-simulator{height:auto;min-height:100%}.cs-board-shell .cs-diagram{flex:auto;height:200px}.cs-board-shell .cs-note{font-size:.72rem}}
