:root {
  --green: #22c670;
  --green-dark: #119655;
  --night: #061914;
  --ink: #122033;
  --cream: #f4fbf7;
  --mint: #e3f7ec;
  --line: #d4e9dd;
  --muted: #587065;
  --lime: #a3e635;
  --coral: #dc4c55;
  --coral-soft: #fff0f1;
  --gold: #f5c542;
  --gold-line: #d99f0b;
  --copper: #cc711f;
  --copper-dark: #8f4211;
  --scope: #071c16;
  --shadow: 0 22px 60px rgba(5, 50, 27, .13);
  --shadow-soft: 0 10px 26px rgba(34, 198, 112, .18);
  --radius: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 54% -12%, #def6e9 0%, rgba(222, 246, 233, 0) 62%),
    var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
input:disabled, select:disabled { cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid rgba(34, 198, 112, .42);
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 9px 13px;
  border-radius: 9px;
  color: #fff;
  background: var(--night);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(16px, 3vw, 32px);
}
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(5, 50, 27, .07);
}
.brand img { display: block; width: auto; height: 30px; object-fit: contain; }
.topbar-label {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green-dark);
  background: var(--mint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.shell {
  width: 100%;
  max-width: 1580px;
  flex: 1 0 auto;
  margin: 0 auto;
  padding: 4px clamp(14px, 2.5vw, 30px) 42px;
}
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin: 2px 0 17px;
}
.hero-copy { min-width: 0; }
.kicker, .eyebrow {
  margin: 0 0 5px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(31px, 4vw, 43px);
  line-height: 1.08;
  letter-spacing: -.025em;
}
.hero-copy > p:not(.kicker) { max-width: 78ch; margin: 0 0 11px; color: var(--muted); }
.spec-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.spec-chip, .status-chip, .ratio-chip, .warning-chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}
.spec-chip { color: var(--muted); background: #fff; }
.course-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 285px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(5, 50, 27, .08);
}
.course-switch button {
  display: grid;
  gap: 0;
  min-height: 52px;
  padding: 7px 14px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}
.course-switch button span { font-size: 14px; }
.course-switch button small { font-size: 10px; font-weight: 700; }
.course-switch button[aria-pressed="true"] { color: #fff; background: var(--green-dark); }

.workspace {
  display: grid;
  grid-template-columns: 326px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.lab-column { display: grid; gap: 14px; min-width: 0; }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 25px rgba(5, 50, 27, .055);
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.card h2 { margin: 0; font-size: 19px; line-height: 1.22; }
.controls {
  position: sticky;
  top: 12px;
  padding: 17px;
}
.status-chip { color: var(--green-dark); background: var(--mint); }
.warning-chip { border-color: #f4c7cb; color: #9b2d38; background: var(--coral-soft); }
.control-section {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.section-heading h3 { margin: 0; font-size: 13px; letter-spacing: .02em; }
.power-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  padding: 5px 9px;
  border: 1px solid #b8cfc3;
  border-radius: 999px;
  color: var(--muted);
  background: #f7faf8;
  font-size: 11px;
  font-weight: 800;
}
.power-button.is-on { border-color: #9ddcba; color: var(--green-dark); background: var(--mint); }
.power-light, .unit-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9aa9a3;
  box-shadow: 0 0 0 3px rgba(154, 169, 163, .14);
}
.power-button.is-on .power-light, .unit-light.is-on { background: var(--green); box-shadow: 0 0 0 3px rgba(34, 198, 112, .18), 0 0 10px rgba(34, 198, 112, .75); }
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: #edf5f0;
}
.segmented button {
  min-height: 37px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 850;
}
.segmented button[aria-pressed="true"] { color: var(--green-dark); background: #fff; box-shadow: 0 3px 10px rgba(5, 50, 27, .09); }
.slider-row { margin-top: 12px; }
.slider-row label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}
.slider-row output { color: var(--green-dark); font-size: 12px; font-weight: 850; text-align: right; }
input[type="range"] { width: 100%; accent-color: var(--green-dark); }
.range-hints { display: flex; justify-content: space-between; margin-top: -2px; color: #789087; font-size: 9px; }
.ratio-chip { min-height: 22px; color: var(--copper-dark); background: #fff5e8; border-color: #efd5b4; }
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 12px; }
.preset-row button, .secondary-action {
  min-height: 35px;
  padding: 6px 7px;
  border: 1px solid #b9d3c5;
  border-radius: 9px;
  color: var(--green-dark);
  background: #fff;
  font-size: 11px;
  font-weight: 800;
}
.preset-row button:hover, .secondary-action:hover { background: var(--mint); }
.switch-control { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 800; }
.switch-control input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; width: 32px; height: 18px; border-radius: 999px; background: #b9c7c0; transition: background .18s ease; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .18s ease; }
.switch-control input:checked + .switch-track { background: var(--green-dark); }
.switch-control input:checked + .switch-track::after { transform: translateX(14px); }
.switch-control input:focus-visible + .switch-track { outline: 3px solid rgba(34, 198, 112, .4); outline-offset: 2px; }
.control-note { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.scope-settings { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.scope-settings summary { color: var(--green-dark); font-size: 12px; font-weight: 850; cursor: pointer; }
.select-row { display: grid; grid-template-columns: 1fr 1.4fr; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; font-weight: 750; }
.select-row select, .manual-scales input {
  width: 100%;
  min-height: 35px;
  padding: 5px 7px;
  border: 1px solid #abc6b8;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 11px;
}
.manual-scales { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.manual-scales label { color: var(--muted); font-size: 10px; font-weight: 800; }
.manual-scales input { margin-top: 4px; }
.control-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.primary-action {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--green-dark);
  border-radius: 10px;
  color: #fff;
  background: var(--green-dark);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 6px 15px rgba(17, 150, 85, .17);
}
.primary-action:hover { background: #0d8048; }

.bench-card { min-width: 0; padding: 16px; overflow: hidden; }
.bench-head { align-items: center; margin-bottom: 12px; }
.bench-status { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.bench {
  --core-stress: 0;
  position: relative;
  display: grid;
  grid-template-columns: minmax(185px, 250px) minmax(310px, 1fr) minmax(185px, 250px);
  grid-template-areas: "primary transformer secondary";
  align-items: center;
  gap: clamp(9px, 1.2vw, 18px);
  min-height: 470px;
  padding: clamp(12px, 1.7vw, 22px);
  border: 1px solid #cfe4d8;
  border-radius: 15px;
  background:
    linear-gradient(rgba(255, 255, 255, .92), rgba(248, 253, 250, .94)),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(17, 150, 85, .035) 40px),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(17, 150, 85, .035) 40px);
  isolation: isolate;
}
.bench-wire { position: absolute; z-index: -1; left: 6%; right: 6%; top: 51%; height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--green-dark), var(--copper), var(--gold-line)); opacity: .55; }
.bench-wire::before, .bench-wire::after { content: ""; position: absolute; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.bench-wire::before { left: 0; color: var(--green-dark); }
.bench-wire::after { right: 0; color: var(--gold-line); }
.instrument-bay { display: grid; gap: 12px; min-width: 0; }
.primary-bay { grid-area: primary; }
.secondary-bay { grid-area: secondary; }
.primary-source-stack { display: grid; gap: 8px; min-width: 0; }
.supply-unit, .load-unit, .scope, .ammeter-unit {
  overflow: hidden;
  border: 1px solid #2e493f;
  border-radius: 12px;
  background: linear-gradient(145deg, #1c332b, #0a2119);
  box-shadow: 0 13px 25px rgba(6, 25, 20, .17);
}
.instrument-top, .scope-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-height: 30px;
  padding: 6px 9px;
  color: #cce3d8;
  background: #102920;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .08em;
}
.supply-face, .load-face { display: grid; justify-items: center; min-height: 91px; padding: 12px 9px 9px; }
.supply-face strong, .load-face strong { color: #f2fff8; font-size: 19px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.supply-face small, .load-face small { margin-top: 3px; color: #9bb9ab; font-size: 9px; text-align: center; }
.supply-symbol { color: var(--green); font-family: Georgia, serif; font-size: 27px; line-height: 1; filter: drop-shadow(0 0 7px rgba(34, 198, 112, .55)); }
.terminal-row { display: flex; justify-content: space-between; padding: 0 20px 9px; }
.terminal { width: 12px; height: 12px; border: 2px solid #80968c; border-radius: 50%; box-shadow: inset 0 0 0 2px #13261f; }
.terminal.red { background: #d44f4f; }
.terminal.black { background: #17211e; }
.load-state { color: #8ce7b6; letter-spacing: 0; }
.load-unit.is-open .load-state { color: #f6bf76; }
.resistor-icon { display: flex; align-items: stretch; width: 65px; height: 19px; margin-bottom: 7px; border: 3px solid #e7d0ac; border-radius: 3px; background: #cfb47b; }
.resistor-icon span { flex: 1; border-right: 3px solid; }
.resistor-icon span:nth-child(1) { border-color: #ba2f33; }
.resistor-icon span:nth-child(2) { border-color: #2a211d; }
.resistor-icon span:nth-child(3) { border-color: #ba2f33; }
.resistor-icon span:nth-child(4) { border-color: #d5a526; border-right: 0; }
.scope { padding-bottom: 7px; }
.scope canvas { display: block; width: calc(100% - 12px); height: 138px; margin: 6px; border: 1px solid #36594d; border-radius: 7px; background: var(--scope); }
.scope-readout { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 5px; padding: 0 8px; color: #98b6a8; font-size: 8px; }
.scope-readout strong { overflow: hidden; color: #e9fff4; font-size: 10px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.ammeter-unit .instrument-top { min-height: 25px; }
.meter-mode { color: #8ce7b6; letter-spacing: 0; }
.ammeter-face { display: grid; grid-template-columns: minmax(92px, 1fr) auto; align-items: center; gap: 3px; min-height: 78px; padding: 3px 8px 7px; }
.ammeter-dial { display: block; width: 100%; max-width: 125px; }
.meter-arc { fill: rgba(255, 255, 255, .035); stroke: #8fb4a3; stroke-width: 4; }
.meter-ticks path { fill: none; stroke: #b7d0c4; stroke-width: 2; }
.meter-ideal-mark { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; }
.ammeter-dial text { fill: #8fb4a3; font-size: 9px; font-weight: 800; }
.meter-needle { stroke: #ff765f; stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(255, 118, 95, .55)); transition: transform .2s ease; }
.meter-hub { fill: #d9e9e1; stroke: #263d34; stroke-width: 3; }
.ammeter-digital { display: grid; gap: 2px; min-width: 66px; text-align: center; }
.ammeter-digital strong { color: #f2fff8; font-size: 14px; font-variant-numeric: tabular-nums; }
.ammeter-digital small { max-width: 78px; color: #9bb9ab; font-size: 7px; line-height: 1.25; text-transform: uppercase; }
.bench.is-off .meter-needle { filter: none; }

.transformer-stage { position: relative; grid-area: transformer; min-width: 0; align-self: center; }
#transformer-svg { display: block; width: 100%; min-height: 360px; overflow: visible; filter: drop-shadow(0 18px 15px rgba(5, 34, 22, .13)); }
.core-shadow { fill: rgba(5, 29, 21, .17); transform: translateY(12px); }
.core { fill: url(#core-gradient); stroke: #19342b; stroke-width: 5; transition: filter .2s ease; }
.laminations path { fill: none; stroke: rgba(217, 237, 227, .25); stroke-width: 2.2; }
.flux-path { fill: none; stroke: var(--green); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 7 15; opacity: .78; filter: url(#soft-glow); animation: flux-flow 8s linear infinite; }
.flux-halo { stroke: var(--lime); stroke-width: 16; opacity: .07; stroke-dasharray: none; animation: none; }
.bench.is-off .flux-path { opacity: 0; }
.bench.is-dc .flux-path { animation: none; stroke-dasharray: none; opacity: calc(.18 + var(--core-stress) * .62); }
.bench.is-dc.is-powered .core { filter: sepia(calc(var(--core-stress) * .65)) saturate(calc(1 + var(--core-stress) * 1.5)); }
.bench.is-hot .core { stroke: var(--coral); filter: drop-shadow(0 0 12px rgba(220, 76, 85, .6)) sepia(.55) saturate(1.5); }
.bench.is-ac.has-loss .core { filter: drop-shadow(0 0 calc(3px + var(--loss-strength) * 12px) rgba(220, 76, 85, .32)); }
.coil path { fill: none; stroke: url(#copper-gradient); stroke-width: 9; stroke-linecap: round; filter: drop-shadow(0 3px 2px rgba(88, 41, 7, .26)); }
.lead { fill: none; stroke-width: 8; stroke-linecap: round; }
.primary-lead { stroke: var(--green-dark); }
.secondary-lead { stroke: var(--gold-line); }
.polarity-dot { fill: #fff; stroke: var(--night); stroke-width: 3; }
.svg-label { display: none; fill: var(--muted); font-size: 13px; font-weight: 850; letter-spacing: .13em; }
.core-label { fill: #dce9e3; font-size: 13px; font-weight: 800; letter-spacing: .11em; }
.winding-badge { position: absolute; top: 47%; display: grid; min-width: 65px; padding: 6px 8px; border: 1px solid #e7c48d; border-radius: 9px; background: rgba(255, 250, 241, .96); box-shadow: 0 6px 15px rgba(71, 37, 10, .13); text-align: center; transform: translateY(-50%); }
.winding-badge span { color: var(--copper-dark); font-size: 10px; font-weight: 800; }
.winding-badge strong { color: var(--night); font-size: 15px; }
.primary-badge { left: 2%; }
.secondary-badge { right: 2%; }
.core-state {
  position: absolute;
  left: 50%;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: max-content;
  max-width: 78%;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, .94);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  transform: translateX(-50%);
}
.core-state-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 7px rgba(34, 198, 112, .65); }
.bench.is-hot .core-state { border-color: #efb8bd; color: #9b2d38; background: #fff5f5; }
.bench.is-hot .core-state-dot { background: var(--coral); box-shadow: 0 0 7px rgba(220, 76, 85, .65); }
.bench-caption { margin: 10px 3px 0; color: var(--muted); font-size: 10px; text-align: center; }
@keyframes flux-flow { to { stroke-dashoffset: -44; } }

.readout-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(5, 50, 27, .045);
}
.readout { min-width: 0; min-height: 70px; padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.readout:nth-child(4n) { border-right: 0; }
.readout:nth-last-child(-n+4) { border-bottom: 0; }
.readout span { display: block; color: var(--muted); font-size: 10px; line-height: 1.25; }
.readout strong { display: block; margin-top: 4px; overflow-wrap: anywhere; color: var(--green-dark); font-size: 16px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.loss-readout strong { color: #a34822; }
.readout.is-na strong { color: #82948c; }

.equation-card {
  display: grid;
  grid-template-columns: minmax(150px, .75fr) minmax(260px, 1.2fr) minmax(240px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 15px 17px;
}
.equation { display: grid; gap: 3px; margin: 0; padding: 9px 12px; border-radius: 10px; background: var(--mint); text-align: center; }
.equation span { color: var(--green-dark); font-family: Georgia, serif; font-size: 17px; }
.equation strong { font-size: 11px; }
.equation-note { margin: 0; color: var(--muted); font-size: 11px; }

.activity-card { overflow: hidden; }
.activity-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px 12px; }
.activity-heading > span { color: var(--green-dark); font-size: 11px; font-weight: 850; }
.activity-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--line); }
.activity-nav button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 43px; padding: 7px; border: 0; color: var(--muted); background: #f9fcfa; font-size: 11px; font-weight: 800; }
.activity-nav button span { color: var(--green-dark); font-size: 9px; }
.activity-nav button[aria-pressed="true"] { color: #fff; background: var(--green-dark); }
.activity-nav button[aria-pressed="true"] span { color: #c7f0d9; }
.activity-body { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(220px, .85fr) auto; align-items: center; gap: 14px; padding: 15px 17px 17px; }
.activity-kicker { margin: 0 0 3px; color: var(--green-dark); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.activity-body h3 { margin: 0; font-size: 14px; line-height: 1.3; }
.activity-body h3 + p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.prediction-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.prediction-options button { min-height: 37px; padding: 5px; border: 1px solid #b9d3c5; border-radius: 8px; color: var(--muted); background: #fff; font-size: 10px; font-weight: 800; }
.prediction-options button[aria-pressed="true"] { border-color: var(--green-dark); color: #fff; background: var(--green-dark); }
.number-prediction { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 800; }
.number-prediction > span:last-child { display: flex; align-items: center; gap: 5px; }
.number-prediction input { width: 100%; min-height: 38px; padding: 6px 8px; border: 1px solid #abc6b8; border-radius: 8px; }
.check-activity { min-width: 130px; }
.activity-feedback { grid-column: 1 / -1; min-height: 22px; margin: -2px 0 0; padding: 7px 10px; border-radius: 8px; color: var(--muted); background: #f3f8f5; font-size: 10px; }
.activity-feedback.is-correct { color: #0e6f40; background: #e7f8ee; }
.activity-feedback.is-incorrect { color: #9b2d38; background: var(--coral-soft); }
.model-details { padding: 2px 4px; color: var(--muted); font-size: 10px; }
.model-details summary { color: var(--green-dark); font-weight: 850; cursor: pointer; }
.model-details p { max-width: 100ch; margin: 6px 0 0; }

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px clamp(16px, 3vw, 32px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, .55);
  font-size: 11px;
}
.footer a { color: var(--green-dark); font-weight: 800; text-decoration: none; }

@media (max-width: 1280px) {
  .workspace { grid-template-columns: 305px minmax(0, 1fr); }
  .bench { grid-template-columns: minmax(165px, 215px) minmax(280px, 1fr) minmax(165px, 215px); padding: 12px; }
  .scope canvas { height: 124px; }
  .activity-body { grid-template-columns: minmax(245px, 1fr) minmax(210px, .8fr); }
  .check-activity { justify-self: start; }
}

@media (max-width: 1040px) {
  .workspace { grid-template-columns: 1fr; }
  .controls { position: static; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
  .controls > .card-head, .controls > .scope-settings, .controls > .control-actions { grid-column: 1 / -1; }
  .control-section { margin-top: 10px; }
  .bench { grid-template-columns: minmax(180px, 230px) minmax(290px, 1fr) minmax(180px, 230px); }
}

@media (max-width: 820px) {
  .topbar-label { display: none; }
  .hero { align-items: stretch; flex-direction: column; gap: 12px; }
  .course-switch { width: 100%; min-width: 0; }
  .controls { grid-template-columns: 1fr; }
  .controls > * { grid-column: auto !important; }
  .bench { grid-template-columns: 1fr 1.25fr; grid-template-areas: "transformer transformer" "primary secondary"; min-height: 0; }
  .transformer-stage { width: min(620px, 100%); margin: 0 auto; }
  #transformer-svg { min-height: 330px; }
  .bench-wire { display: none; }
  .instrument-bay { align-self: stretch; }
  .readout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .readout:nth-child(4n) { border-right: 1px solid var(--line); }
  .readout:nth-child(2n) { border-right: 0; }
  .readout:nth-last-child(-n+4) { border-bottom: 1px solid var(--line); }
  .readout:nth-last-child(-n+2) { border-bottom: 0; }
  .equation-card { grid-template-columns: 1fr 1.4fr; }
  .equation-note { grid-column: 1 / -1; }
  .activity-nav { grid-template-columns: repeat(2, 1fr); }
  .activity-body { grid-template-columns: 1fr; }
  .check-activity { justify-self: stretch; }
}

@media (max-width: 560px) {
  .topbar { padding: 10px 12px; }
  .shell { padding: 0 10px 30px; }
  .hero h1 { font-size: 31px; }
  .spec-chip { max-width: 100%; }
  .bench-card { padding: 11px; }
  .bench-head { align-items: flex-start; flex-direction: column; }
  .bench-status { justify-content: flex-start; }
  .bench { grid-template-columns: 1fr; grid-template-areas: "primary" "transformer" "secondary"; padding: 10px; }
  .primary-bay { grid-template-columns: 1fr 1fr; align-items: stretch; }
  .primary-source-stack { display: contents; }
  .primary-bay .scope { grid-column: 1 / -1; }
  .secondary-bay { grid-template-columns: .82fr 1.18fr; align-items: stretch; }
  .supply-face, .load-face { min-height: 112px; }
  .scope canvas { height: 132px; }
  #transformer-svg { min-height: 300px; }
  .winding-badge { top: 45%; }
  .core-state { bottom: 14px; max-width: 88%; }
  .readout { padding: 9px; }
  .readout strong { font-size: 14px; }
  .equation-card { grid-template-columns: 1fr; }
  .equation-note { grid-column: auto; }
  .activity-nav button { font-size: 10px; }
  .footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 390px) {
  .primary-bay, .secondary-bay { grid-template-columns: 1fr; }
  .primary-bay .scope { grid-column: auto; }
  .scope canvas { height: 142px; }
  .control-actions { grid-template-columns: 1fr; }
  .activity-nav { grid-template-columns: 1fr 1fr; }
  .prediction-options { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
