/* Chapter 8: circuit diagrams, equation text, the virtual multimeter and the step calculator. */

.wire { stroke: #cfe3ff; stroke-width: 5; stroke-linecap: round; }
.node { fill: #cfe3ff; }
.part { fill: #16223f; stroke: #cfe3ff; stroke-width: 4; }
.part-line { stroke: #cfe3ff; stroke-width: 4; stroke-linecap: round; fill: none; }
.plate { stroke: #cfe3ff; stroke-width: 4; }
.plate.short { stroke-width: 11; }
.part-label { font: 700 28px system-ui, sans-serif; fill: #e8eefc; }
.meter { fill: #0f1a33; stroke-width: 4; }
.meter.meter-A { stroke: #4dabf7; }
.meter.meter-V { stroke: #ff8fab; }
.meter-letter { font: 800 30px system-ui, sans-serif; }
.meter-letter.meter-A { fill: #4dabf7; }
.meter-letter.meter-V { fill: #ff8fab; }
.lead { fill: none; stroke: #ff8fab; stroke-width: 3.5; stroke-linejoin: round; }
.readout rect { fill: #0b1430; stroke-width: 3; }
.readout-text { font: 800 26px system-ui, sans-serif; }
.hl-ring { fill: none; stroke: #ffd166; stroke-width: 4; stroke-dasharray: 10 8; }
.combo-box { fill: rgba(255, 209, 102, .06); stroke: #ffd166; stroke-width: 3; stroke-dasharray: 12 9; }
.tri { fill: none; stroke: #e8eefc; stroke-width: 5; stroke-linejoin: round; }
.tri-letter { font: 800 64px system-ui, sans-serif; fill: #ffd166; }

.scene-title { font: 800 44px system-ui, sans-serif; fill: #ffd166; }
.scene-title.small { font-size: 38px; }
.eq-big { font: 800 120px system-ui, sans-serif; fill: #fff; }
.eq-line { font: 700 36px system-ui, sans-serif; fill: #e8eefc; }
.eq-line.gold-fill { fill: #ffd166; }
.eq-note { font: 600 26px system-ui, sans-serif; fill: #9fb4dd; }

/* Virtual multimeter */
.mm-target { cursor: pointer; outline: none; }
.mm-hit { fill: transparent; }
.mm-ring { fill: none; stroke: rgba(255, 255, 255, .35); stroke-width: 3; stroke-dasharray: 6 5; transition: stroke .2s, opacity .2s; }
.part-target .mm-ring { stroke-dasharray: 8 7; }
.tool-A .wire-target .mm-ring { stroke: #4dabf7; stroke-width: 4; }
.tool-A .part-target .mm-ring { opacity: .25; }
.tool-V .part-target .mm-ring { stroke: #ff8fab; stroke-width: 4; }
.tool-V .wire-target .mm-ring { opacity: .25; }
.wire-target.active .mm-ring { opacity: 0; }
.mm-target:hover .mm-ring, .mm-target:focus-visible .mm-ring { stroke: #ffd166; opacity: 1; }
#mm-tags, #mm-meter { pointer-events: none; }

.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: max(10px, 1.6cqw);
  width: 100%;
  align-items: start;
}
.lab-picture { width: 100%; border-radius: .8em; overflow: hidden; background: #0d1730; }
.lab-controls { display: flex; flex-direction: column; gap: 6px; }
.lab-controls .lab-tools { justify-content: flex-start; }
.lab-controls .chip-btn { padding: .35em .7em; font-size: .9em; }
.tool-btn.tool-A.on { border-color: #4dabf7; }
.tool-btn.tool-V.on { border-color: #ff8fab; }
.chip-btn.hint { box-shadow: 0 0 0 3px var(--gold); }
.lab-readout { margin: 0; font-weight: 700; font-size: .9em; color: #e8eefc; min-height: 2.6em; }
.lab-task-list { display: flex; flex-direction: column; gap: 6px; }
.lab-task { text-align: left; font-size: .85em; }
.lab-task.correct { border-color: var(--ok); background: #143a28; }

/* Step calculator */
.calc-question { margin: 0; font-size: 1.05em; line-height: 1.45; text-align: center; }
.calc-question b { color: var(--gold); }
.calc-diagram { margin: 6px auto 0; width: min(100%, 300px); }
.calc-diagram svg { width: 100%; height: auto; display: block; }
.calc-body { display: flex; flex-direction: column; gap: max(8px, 1.2cqw); width: 100%; align-items: center; }
.calc-step { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.calc-values { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; }
.calc-field { display: flex; align-items: center; gap: 6px; font-weight: 700; color: #cfd9ef; }
.calc-input {
  width: 6em;
  font: 700 1em ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: .45em .6em;
  border-radius: .6em;
  border: 2px solid #3a4f7d;
  background: #0f1a33;
  color: #fff;
}
.calc-input:focus { outline: none; border-color: var(--gold); }
.calc-input:disabled { opacity: .85; }
.calc-input.wrong { border-color: var(--bad); }
.calc-input.correct { border-color: var(--ok); background: #143a28; }
.calc-unit { font-weight: 700; color: #cfd9ef; }

@container (max-width: 620px) {
  .lab-grid { grid-template-columns: 1fr; }
  .calc-input { width: 5.2em; }
}
