.electricity-hub-hero {
  background-image:
    linear-gradient(
      90deg,
      rgb(255 255 255 / 97%) 0%,
      rgb(255 255 255 / 89%) 48%,
      rgb(255 255 255 / 18%) 78%
    ),
    url("../images/topics/physics/electricity-and-circuits.jpg");
}

.electricity-hub-hero .topic-hub-copy h1 {
  max-width: 12ch;
  font-size: clamp(2.7rem, 6vw, 5.3rem);
}

.electricity-material-grid {
  width: min(540px, 100%);
  grid-template-columns: minmax(0, 1fr);
}

.topic-library-note {
  margin: 1.2rem 0 0;
  color: var(--navy-650);
  font-size: 0.82rem;
}

.circuit-learning-page {
  background:
    radial-gradient(circle at 8% 22%, rgb(255 215 97 / 20%), transparent 28rem),
    radial-gradient(circle at 92% 82%, rgb(116 213 223 / 14%), transparent 26rem),
    var(--paper);
}

.learning-breadcrumb,
.learning-hero,
.learning-tool,
.learning-summary {
  width: min(1180px, calc(100% - 2rem));
  margin-right: auto;
  margin-left: auto;
}

.learning-breadcrumb {
  margin-top: 1.35rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--navy-650);
  font-size: 0.78rem;
  font-weight: 750;
}

.learning-breadcrumb a {
  color: var(--navy-800);
  text-underline-offset: 0.2em;
}

.learning-hero {
  padding: clamp(2.25rem, 5vw, 4.5rem) 0 clamp(1.75rem, 4vw, 3rem);
}

.learning-hero h1 {
  max-width: none;
  margin: 0 0 1rem;
  font-size: clamp(2.7rem, 5vw, 4.15rem);
  letter-spacing: -0.065em;
}

.learning-intro {
  max-width: none;
  margin-bottom: 0;
  color: var(--navy-650);
  font-size: clamp(1rem, 2vw, 1.14rem);
}

.learning-tool {
  overflow: hidden;
  border: 1px solid rgb(11 30 45 / 9%);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: 0 24px 70px rgb(11 30 45 / 12%);
}

.circuit-builder {
  --circuit-blue: #287f91;
  --circuit-blue-pale: #e8f6f8;
  --circuit-yellow-pale: #fff8dc;
  --circuit-success: #23734b;
  --circuit-danger: #b6494e;
  overflow: visible;
}

.circuit-level-tabs {
  padding: 0.8rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  border-bottom: 1px solid var(--line);
  background: var(--circuit-yellow-pale);
}

.circuit-level-tab,
.circuit-toolbar button,
.component-choice,
.inspector-actions button,
.inspector-control button {
  font: inherit;
  cursor: pointer;
}

.circuit-level-tab {
  min-height: 3.25rem;
  padding: 0.65rem 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid transparent;
  border-radius: 0.9rem;
  color: var(--navy-650);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 850;
}

.circuit-level-tab > span {
  width: 1.65rem;
  height: 1.65rem;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--yellow-deep);
  background: #ffedb1;
  font-size: 0.68rem;
}

.circuit-level-tab:hover {
  color: var(--navy-950);
  background: rgb(255 255 255 / 72%);
}

.circuit-level-tab[aria-selected="true"] {
  border-color: rgb(166 107 0 / 18%);
  color: var(--navy-950);
  background: var(--surface);
  box-shadow: 0 5px 18px rgb(11 30 45 / 8%);
}

.circuit-level-tab[aria-selected="true"] > span {
  color: var(--navy-950);
  background: var(--yellow);
}

.circuit-toolbar {
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  background: #f7fafb;
}

.circuit-toolbar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.circuit-toolbar button,
.inspector-actions button,
.inspector-control button {
  min-height: 2.35rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  color: var(--navy-650);
  background: var(--surface);
  font-size: 0.75rem;
  font-weight: 800;
}

.circuit-toolbar button:hover,
.inspector-actions button:hover,
.inspector-control button:hover {
  border-color: var(--circuit-blue);
  color: var(--navy-950);
}

.circuit-toolbar button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.circuit-toolbar .test-circuit-button {
  min-width: 8.5rem;
  border-color: var(--navy-950);
  color: white;
  background: var(--navy-950);
}

.circuit-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 230px;
  min-height: 560px;
}

.component-tray,
.circuit-results {
  min-width: 0;
  padding: 1rem;
  background: var(--surface);
}

.component-tray {
  border-right: 1px solid var(--line);
}

.circuit-results {
  border-left: 1px solid var(--line);
}

.circuit-panel-heading {
  margin-bottom: 0.85rem;
}

.circuit-panel-heading h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.component-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.component-choice {
  min-width: 0;
  min-height: 5.15rem;
  padding: 0.55rem 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  color: var(--navy-650);
  background: #fbfdfd;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.component-choice:hover,
.component-choice[aria-pressed="true"] {
  border-color: var(--circuit-blue);
  color: var(--navy-950);
  background: var(--circuit-blue-pale);
}

.component-choice[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1px var(--circuit-blue);
}

.component-choice-icon {
  width: 2.2rem;
  height: 2rem;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--navy-950);
  font-size: 0.66rem;
  font-weight: 900;
}

.choice-cell::before,
.choice-cell::after {
  position: absolute;
  top: 50%;
  width: 2px;
  content: "";
  background: var(--navy-950);
  transform: translateY(-50%);
}

.choice-cell::before { left: 0.78rem; height: 1.7rem; }
.choice-cell::after { right: 0.78rem; height: 1rem; }

.choice-wire::before {
  width: 2rem;
  height: 0.9rem;
  border-top: 2px solid var(--navy-950);
  border-right: 2px solid var(--navy-950);
  content: "";
}

.choice-lamp {
  border: 2px solid var(--navy-950);
  border-radius: 50%;
}

.choice-lamp::before,
.choice-lamp::after {
  width: 1.4rem;
  height: 2px;
  position: absolute;
  content: "";
  background: var(--navy-950);
}

.choice-lamp::before { transform: rotate(45deg); }
.choice-lamp::after { transform: rotate(-45deg); }

.choice-switch {
  width: 2.5rem;
  height: 1.3rem;
  background:
    linear-gradient(var(--navy-950), var(--navy-950)) left center / 0.72rem 2px no-repeat,
    linear-gradient(var(--navy-950), var(--navy-950)) right center / 0.72rem 2px no-repeat;
}

.choice-switch::before {
  width: 0.34rem;
  height: 0.34rem;
  position: absolute;
  left: 0.67rem;
  top: 50%;
  content: "";
  border: 2px solid var(--navy-950);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 1.16rem 0 0 -2px var(--surface), 1.16rem 0 0 0 var(--navy-950);
  transform: translateY(-50%);
}

.choice-switch::after {
  width: 1.25rem;
  height: 2px;
  position: absolute;
  left: 0.95rem;
  top: calc(50% - 1px);
  content: "";
  background: var(--navy-950);
  transform: rotate(-24deg);
  transform-origin: left center;
}

.choice-meter,
.choice-sensor {
  border: 2px solid var(--navy-950);
  border-radius: 50%;
}

.choice-resistor,
.choice-variable {
  width: 2rem;
  height: 0.78rem;
  border: 2px solid var(--navy-950);
}

.choice-variable::after {
  width: 1.4rem;
  height: 2px;
  position: absolute;
  content: "";
  background: var(--navy-950);
  transform: rotate(-45deg);
}

.choice-led {
  border: 2px solid var(--navy-950);
  border-radius: 50%;
  background: #fff3ad;
}

.choice-diode::before {
  width: 0;
  height: 0;
  border-top: 0.7rem solid transparent;
  border-bottom: 0.7rem solid transparent;
  border-left: 1rem solid var(--navy-950);
  content: "";
}

.choice-diode::after {
  width: 2px;
  height: 1.6rem;
  content: "";
  background: var(--navy-950);
}

.choice-buzzer {
  border: 2px solid var(--navy-950);
  border-radius: 0.85rem 0.85rem 0.25rem 0.25rem;
}

.choice-fuse::before {
  width: 2rem;
  height: 0.65rem;
  border: 2px solid var(--navy-950);
  border-radius: 999px;
  content: "";
}

.circuit-workspace-column {
  min-width: 0;
  padding: 1rem;
  background:
    linear-gradient(rgb(11 30 45 / 2.2%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(11 30 45 / 2.2%) 1px, transparent 1px),
    #f7fafb;
  background-size: 28px 28px;
}

.workspace-status-row {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: rgb(255 255 255 / 88%);
}

.workspace-status-row p {
  margin: 0;
  color: var(--navy-650);
  font-size: 0.75rem;
}

.circuit-state-chip {
  padding: 0.3rem 0.55rem;
  flex: 0 0 auto;
  border-radius: 999px;
  color: var(--navy-650);
  background: #edf3f5;
  font-size: 0.65rem;
  font-weight: 900;
}

.circuit-state-chip.is-working {
  color: #155d3a;
  background: #dff3e7;
}

.circuit-state-chip.is-warning {
  color: #975025;
  background: #fff0df;
}

.circuit-state-chip.is-danger {
  color: #9e383d;
  background: #ffe7e6;
}

.circuit-workspace {
  min-height: 520px;
  position: relative;
  overflow: hidden;
  border: 1px solid #cddde2;
  border-radius: var(--radius-medium);
  background:
    linear-gradient(rgb(40 127 145 / 8%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(40 127 145 / 8%) 1px, transparent 1px),
    rgb(255 255 255 / 94%);
  background-size: 24px 24px;
  touch-action: none;
}

.circuit-workspace.is-placing {
  cursor: crosshair;
}

.circuit-workspace.is-wiring {
  cursor: cell;
}

.circuit-workspace:focus-visible {
  outline: 3px solid var(--circuit-blue);
  outline-offset: 3px;
}

.circuit-wires,
.circuit-components {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.circuit-wires {
  z-index: 1;
  overflow: visible;
  pointer-events: none;
}

.circuit-components {
  z-index: 2;
  pointer-events: none;
}

.circuit-wire-visible,
.circuit-wire-hit {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.circuit-wire-visible {
  stroke: var(--navy-800);
  stroke-width: 3;
}

.circuit-current-arrow {
  fill: var(--aqua-deep);
  stroke: white;
  stroke-width: 1.5;
  stroke-linejoin: round;
  pointer-events: none;
}

.circuit-wire-hit {
  stroke: transparent;
  stroke-width: 18;
  pointer-events: stroke;
  cursor: pointer;
}

.circuit-wire-hit:hover + .circuit-wire-visible,
.circuit-wire-group:hover .circuit-wire-visible,
.circuit-wire-group.is-selected .circuit-wire-visible {
  stroke: var(--circuit-blue);
  stroke-width: 5;
}

.circuit-wire-group.is-selected .circuit-wire-visible {
  filter: drop-shadow(0 0 3px rgb(40 127 145 / 42%));
}

.circuit-component {
  width: 7rem;
  min-height: 4.4rem;
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-950);
  transform: translate(-50%, -50%) rotate(var(--component-rotation, 0deg));
  transform-origin: center;
  pointer-events: auto;
  touch-action: none;
}

.circuit-component-body {
  width: 7rem;
  min-height: 4rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.7rem;
  color: var(--navy-950);
  background: transparent;
  box-shadow: none;
  cursor: grab;
  user-select: none;
}

.circuit-component.is-selected .circuit-component-body {
  background: rgb(40 127 145 / 8%);
  box-shadow: 0 0 0 3px rgb(40 127 145 / 22%);
}

.circuit-component.is-active[data-type="lamp"] .symbol-lamp-circle {
  color: #8b6200;
  background: #fff7c8;
  box-shadow: 0 0 26px rgb(255 215 97 / 82%);
}

.circuit-component.is-active[data-type="led"] .workspace-symbol-led {
  color: #8b6200;
  filter: drop-shadow(0 0 8px rgb(255 215 97 / 88%));
}

.circuit-component.is-active[data-type="buzzer"] .symbol-buzzer-body {
  filter: drop-shadow(0 0 6px rgb(116 213 223 / 80%));
}

.circuit-component.is-blown .symbol-fuse-box {
  border-color: var(--circuit-danger);
  color: var(--circuit-danger);
  background: #fff0ef;
}

.component-symbol {
  display: block;
  font-style: normal;
}

.workspace-symbol {
  width: 7rem;
  height: 4.2rem;
  position: relative;
  display: block;
}

.workspace-symbol::before,
.workspace-symbol::after {
  width: 2.2rem;
  height: 3px;
  position: absolute;
  top: 50%;
  content: "";
  background: currentColor;
  transform: translateY(-50%);
}

.workspace-symbol::before { left: 0; }
.workspace-symbol::after { right: 0; }

.workspace-symbol-cell::before,
.workspace-symbol-cell::after {
  width: 3.2rem;
}

.cell-plate {
  width: 4px;
  position: absolute;
  top: 50%;
  z-index: 2;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.cell-plate-long {
  width: 4px;
  height: 4.05rem;
  left: 3.2rem;
}

.cell-plate-short {
  width: 7px;
  height: 1.65rem;
  left: 3.8rem;
}

.symbol-circle {
  width: 2.75rem;
  height: 2.75rem;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 3px solid currentColor;
  border-radius: 50%;
  background: var(--surface);
  font-size: 1rem;
  font-style: normal;
  font-weight: 900;
  transform: translate(-50%, -50%);
}

.lamp-cross {
  width: 2.55rem;
  height: 3px;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  background: currentColor;
  transform-origin: center;
}

.lamp-cross-one { transform: translate(-50%, -50%) rotate(45deg); }
.lamp-cross-two { transform: translate(-50%, -50%) rotate(-45deg); }

.switch-component-symbol::before,
.switch-component-symbol::after {
  width: 2.25rem;
}

.switch-contact {
  width: 0.55rem;
  height: 0.55rem;
  position: absolute;
  top: 50%;
  z-index: 2;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: var(--surface);
  transform: translateY(-50%);
}

.switch-contact-left { left: 1.95rem; }
.switch-contact-right { right: 1.95rem; }

.switch-blade {
  width: 2.25rem;
  height: 3px;
  position: absolute;
  top: calc(50% - 1px);
  left: 2.42rem;
  z-index: 1;
  background: currentColor;
  transform: rotate(-25deg);
  transform-origin: left center;
  transition: transform 150ms ease;
}

.switch-component-symbol.is-closed .switch-blade {
  transform: rotate(0deg);
}

.symbol-resistor-box {
  width: 2.7rem;
  height: 1.05rem;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  border: 3px solid currentColor;
  background: var(--surface);
  transform: translate(-50%, -50%);
}

.symbol-diagonal-arrow,
.symbol-thermistor-line {
  width: 3.1rem;
  height: 3px;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(-42deg);
}

.symbol-thermistor-foot {
  width: 0.95rem;
  height: 3px;
  position: absolute;
  top: calc(50% + 1.08rem);
  left: 1.88rem;
  z-index: 3;
  background: currentColor;
}

.symbol-diagonal-arrow::after {
  width: 0.55rem;
  height: 0.55rem;
  position: absolute;
  top: -0.22rem;
  right: -0.05rem;
  content: "";
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
  transform: rotate(45deg);
}

.workspace-symbol-ldr::before,
.workspace-symbol-ldr::after {
  width: 1.75rem;
}

.symbol-sensor-circle {
  width: 3.5rem;
  height: 3.5rem;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  border: 2px solid currentColor;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.ldr-ray,
.led-ray {
  width: 0.8rem;
  height: 2px;
  position: absolute;
  z-index: 4;
  background: currentColor;
  transform: rotate(45deg);
}

.ldr-ray::after,
.led-ray::after {
  width: 0.34rem;
  height: 0.34rem;
  position: absolute;
  right: -0.02rem;
  bottom: -0.12rem;
  content: "";
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.ldr-ray-one { top: 0.32rem; right: 1.28rem; }
.ldr-ray-two { top: 0.72rem; right: 0.85rem; }

.workspace-symbol-diode::before,
.workspace-symbol-led::before { width: 2.6rem; }
.workspace-symbol-diode::after,
.workspace-symbol-led::after { width: 2.72rem; }

.symbol-diode-circle {
  width: 3.35rem;
  height: 3.35rem;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  border: 3px solid currentColor;
  border-radius: 50%;
  background: var(--surface);
  transform: translate(-50%, -50%);
}

.symbol-diode-triangle {
  width: 0;
  height: 0;
  position: absolute;
  top: 50%;
  left: 2.6rem;
  z-index: 3;
  border-top: 0.82rem solid transparent;
  border-bottom: 0.82rem solid transparent;
  border-left: 1.45rem solid currentColor;
  transform: translateY(-50%);
}

.symbol-diode-triangle::after {
  width: 0;
  height: 0;
  position: absolute;
  top: -0.62rem;
  left: -1.34rem;
  content: "";
  border-top: 0.62rem solid transparent;
  border-bottom: 0.62rem solid transparent;
  border-left: 1.08rem solid var(--surface);
}

.symbol-diode-bar {
  width: 3px;
  height: 1.85rem;
  position: absolute;
  top: 50%;
  left: 4.1rem;
  z-index: 3;
  background: currentColor;
  transform: translateY(-50%);
}

.led-ray-one { top: 0.25rem; right: 1.55rem; transform: rotate(-45deg); }
.led-ray-two { top: 0.7rem; right: 1.1rem; transform: rotate(-45deg); }

.symbol-fuse-box {
  width: 2.45rem;
  height: 0.86rem;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  border: 3px solid currentColor;
  background: var(--surface);
  transform: translate(-50%, -50%);
}

.symbol-fuse-box::after {
  width: 100%;
  height: 3px;
  position: absolute;
  top: 50%;
  left: 0;
  content: "";
  background: currentColor;
  transform: translateY(-50%);
}

.symbol-buzzer-body {
  width: 2.3rem;
  height: 1.35rem;
  position: absolute;
  top: 0.42rem;
  left: 50%;
  z-index: 3;
  border: 3px solid currentColor;
  border-top: 0;
  border-radius: 0 0 1.2rem 1.2rem;
  background: var(--surface);
  transform: translateX(-50%);
}

.symbol-buzzer-body::before {
  width: 2.3rem;
  height: 3px;
  position: absolute;
  top: 0;
  left: -3px;
  content: "";
  background: currentColor;
}

.symbol-buzzer-terminal {
  width: 3px;
  height: 1.28rem;
  position: absolute;
  top: 1.7rem;
  z-index: 3;
  background: currentColor;
}

.symbol-buzzer-terminal::after {
  width: 0.72rem;
  height: 3px;
  position: absolute;
  bottom: 0;
  content: "";
  background: currentColor;
}

.symbol-buzzer-terminal-one { left: 3.08rem; }
.symbol-buzzer-terminal-one::after { right: 0; }
.symbol-buzzer-terminal-two { right: 3.08rem; }
.symbol-buzzer-terminal-two::after { left: 0; }

.palette-workspace-symbol {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.42);
  transform-origin: center;
}

.circuit-component[data-type="switch"] .circuit-component-body {
  cursor: pointer;
}

.component-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.component-terminal,
.wire-junction {
  width: 1rem;
  height: 1rem;
  position: absolute;
  z-index: 4;
  padding: 0;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--circuit-blue);
  box-shadow: 0 0 0 1px var(--navy-800);
  cursor: crosshair;
  pointer-events: auto;
}

.component-terminal.terminal-left { left: 0; top: 50%; transform: translate(-50%, -50%); }
.component-terminal.terminal-right { right: 0; top: 50%; transform: translate(50%, -50%); }

.component-terminal.is-pending,
.wire-junction.is-pending {
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgb(166 107 0 / 24%);
}

.wire-junction {
  z-index: 5;
  transform: translate(-50%, -50%);
}

.workspace-empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  color: var(--navy-650);
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.workspace-empty-state strong {
  color: var(--navy-800);
  font-size: 1.05rem;
}

.workspace-empty-state span {
  margin-top: 0.25rem;
  font-size: 0.72rem;
}

.workspace-key {
  margin-top: 0.7rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  color: var(--navy-650);
  font-size: 0.65rem;
  font-weight: 750;
}

.workspace-key span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.key-terminal {
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--circuit-blue);
  box-shadow: 0 0 0 1px var(--navy-800);
}

.key-current {
  width: 1.8rem;
  height: 3px;
  position: relative;
  background: var(--aqua-deep);
}

.key-current::after {
  width: 0;
  height: 0;
  position: absolute;
  top: 50%;
  right: -0.1rem;
  content: "";
  border-top: 0.3rem solid transparent;
  border-bottom: 0.3rem solid transparent;
  border-left: 0.5rem solid var(--aqua-deep);
  transform: translateY(-50%);
}

.circuit-feedback {
  margin-bottom: 0.8rem;
  padding: 0.85rem;
  border-left: 4px solid var(--circuit-blue);
  border-radius: 0 0.7rem 0.7rem 0;
  background: var(--circuit-blue-pale);
}

.circuit-results-section {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.circuit-results-heading {
  margin-bottom: 0.85rem;
}

.circuit-feedback.is-working {
  border-left-color: var(--circuit-success);
  background: #e8f6ed;
}

.circuit-feedback.is-warning {
  border-left-color: #d97b39;
  background: #fff3e5;
}

.circuit-feedback.is-danger {
  border-left-color: var(--circuit-danger);
  background: #fff0ef;
}

.circuit-feedback strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
}

.circuit-feedback p {
  margin: 0;
  color: var(--navy-650);
  font-size: 0.7rem;
}

.circuit-readings,
.selected-readings {
  margin: 0;
}

.circuit-readings > div,
.selected-readings > div {
  padding: 0.65rem 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.circuit-readings dt,
.selected-readings dt {
  color: var(--navy-650);
  font-size: 0.68rem;
}

.circuit-readings dd,
.selected-readings dd {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.component-inspector {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.component-inspector h3 {
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.component-inspector > p {
  margin-bottom: 0.75rem;
  color: var(--navy-650);
  font-size: 0.68rem;
}

.inspector-control {
  margin-bottom: 0.75rem;
}

.inspector-control label,
.inspector-control > span {
  margin-bottom: 0.35rem;
  display: block;
  color: var(--navy-650);
  font-size: 0.65rem;
  font-weight: 850;
}

.inspector-control input[type="range"] {
  width: 100%;
  accent-color: var(--circuit-blue);
}

.inspector-control select {
  width: 100%;
  min-height: 2.3rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  color: var(--navy-950);
  background: var(--surface);
  font: inherit;
  font-size: 0.72rem;
}

.inspector-actions {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

.inspector-actions.is-wire-selection {
  grid-template-columns: 1fr;
}

.inspector-actions #delete-component {
  border-color: rgb(182 73 78 / 28%);
  color: #a13b40;
  background: #fff5f4;
}

.learning-summary {
  padding: clamp(3.5rem, 7vw, 6rem) 0;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 7vw, 7rem);
}

.learning-summary h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  letter-spacing: -0.05em;
}

.learning-summary ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  list-style: none;
}

.learning-summary li {
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--yellow);
  border-radius: 0 0.8rem 0.8rem 0;
  color: var(--navy-650);
  background: rgb(255 255 255 / 68%);
  font-size: 0.87rem;
}

.learning-summary strong {
  color: var(--navy-950);
}

.noscript-note {
  margin: 0;
  padding: 1rem;
  color: #a74448;
  background: #fff1f0;
  font-size: 0.8rem;
}

.circuit-learning-page button:focus-visible,
.circuit-learning-page select:focus-visible,
.circuit-learning-page input:focus-visible,
.learning-breadcrumb a:focus-visible {
  outline: 3px solid var(--circuit-blue);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

@keyframes circuit-motor-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1000px) {
  .circuit-layout {
    grid-template-columns: 175px minmax(0, 1fr);
  }

  .circuit-results {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .circuit-results > .circuit-panel-heading {
    grid-column: 1 / -1;
    margin-bottom: -0.2rem;
  }

  .component-inspector {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .circuit-results-section {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
}

@media (max-width: 720px) {
  .circuit-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .circuit-toolbar .test-circuit-button {
    width: 100%;
  }

  .circuit-layout {
    display: block;
  }

  .component-tray {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .component-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .component-choice {
    min-height: 4.8rem;
  }

  .circuit-workspace {
    min-height: 460px;
  }

  .circuit-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .learning-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .electricity-hub-hero {
    background-position: 60% center;
  }

  .circuit-level-tabs {
    padding: 0.55rem;
  }

  .component-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace-status-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .circuit-workspace-column {
    padding: 0.7rem;
  }

  .circuit-workspace {
    min-height: 420px;
  }

  .circuit-component {
    width: 7rem;
  }

  .circuit-component-body {
    width: 7rem;
  }

  .circuit-results {
    display: block;
  }

  .circuit-readings,
  .component-inspector,
  .circuit-results-section {
    margin-top: 1rem;
  }

  .component-inspector,
  .circuit-results-section {
    padding-top: 1rem;
    border-top: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  .circuit-component.is-active[data-type="motor"] .component-symbol,
  .switch-blade {
    animation: none;
    transition: none;
  }
}
