/* ElecNora (public site only) — the Graph | Circuit | Inside switch and the live circuits of the Lab 6 lesson cards
   (elec/lab-circ.js). Colours come from the page's tokens (--text, --surface, --lr-in/out/ok/bad). */
.lr-mini { --lc-ink: var(--text); --lc-res: color-mix(in srgb, var(--lr-out) 16%, var(--surface)); --lc-deep: #6b5bd2; }
@media (prefers-color-scheme: dark) { .lr-mini { --lc-deep: #a99cf2; } }

/* the iOS-style three-way switch */
.lc-seg { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; max-width: 440px; padding: 3px; border-radius: 999px; background: color-mix(in srgb, var(--text) 9%, transparent); }
.lc-seg button { position: relative; z-index: 1; min-height: 40px; padding: 0 6px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 600 0.86rem/1.1 Inter, system-ui, sans-serif; cursor: pointer; transition: color 0.2s; }
.lc-seg button[aria-checked="true"] { color: var(--text); }
.lc-seg button:focus-visible { outline: 2px solid var(--lr-out); outline-offset: -2px; }
.lc-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3); border-radius: 999px; background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / 0.18); transition: transform 0.28s cubic-bezier(0.3, 0.7, 0.4, 1); }
.lr-mini[data-lc-view="circ"] .lc-thumb { transform: translateX(100%); }
.lr-mini[data-lc-view="inner"] .lc-thumb { transform: translateX(200%); background: color-mix(in srgb, var(--lc-deep) 18%, var(--surface)); }
@media (prefers-reduced-motion: reduce) { .lc-thumb { transition: none; } }

/* the switch and «Enlarge» on one row; enlarged, the whole mini fills the screen (phones: the circuit becomes readable) */
.lc-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lc-top .lc-seg { flex: 1 1 260px; }
.lc-fullbtn { min-height: 40px; }
.lr-mini.lc-full { position: fixed; inset: 0; z-index: 2000; overflow-y: auto; border: 0; border-radius: 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
.lr-mini.lc-full .lc-sch { max-height: 80vh; }
.lc-rot { display: none; margin: 0; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--lr-in) 12%, transparent); color: var(--lr-in); font-size: 0.86rem; font-weight: 700; }
@media (max-width: 640px) and (orientation: portrait) { .lr-mini.lc-full .lc-rot { display: block; } }
html.lc-lock { overflow: hidden; }

/* one view at a time: the graph's canvas and legend, or the stage */
.lr-mini[data-lc-view="circ"] > .lr-mini-cv, .lr-mini[data-lc-view="inner"] > .lr-mini-cv,
.lr-mini[data-lc-view="circ"] > .lr-mini-key, .lr-mini[data-lc-view="inner"] > .lr-mini-key { display: none; }
.lr-mini[data-lc-view="graph"] .lc-stage { display: none; }
.lr-mini[data-lc-view="circ"] .lc-inner { display: none; }
.lr-mini[data-lc-view="inner"] .lc-opts, .lr-mini[data-lc-view="inner"] .lc-svg, .lr-mini[data-lc-view="inner"] .lc-help, .lr-mini[data-lc-view="inner"] .lc-tip { display: none; }
.lc-stage { display: flex; flex-direction: column; gap: 8px; }
.lc-opts { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.lc-svg, .lc-inner { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.lc-inner { padding: 6px; border-color: color-mix(in srgb, var(--lc-deep) 45%, var(--border)); background: color-mix(in srgb, var(--lc-deep) 6%, var(--surface)); }
.lc-sch { display: block; width: 100%; height: auto; max-height: 360px; }
.lc-help { margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
.lc-tip { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 10px; border-left: 3px solid var(--lr-out); border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--lr-out) 9%, transparent); font-size: 0.88rem; line-height: 1.45; }
.lc-tip[hidden] { display: none; }
.lc-val { font: 700 0.9rem "JetBrains Mono", ui-monospace, monospace; color: var(--lr-out); }

/* the circuit's parts */
.lc-w { fill: none; stroke-linejoin: round; stroke-linecap: round; transition: stroke 0.25s, stroke-width 0.25s; }
.lc-lead { fill: none; stroke: var(--lc-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lc-bar { stroke: var(--lc-ink); stroke-width: 4; }
.lc-arh { fill: var(--lc-ink); }
.lc-dot { fill: var(--lc-ink); }
.lc-r { fill: var(--lc-res); stroke: var(--lc-ink); stroke-width: 1.6; }
.lc-plate { stroke: var(--lc-ink); stroke-width: 3; stroke-linecap: round; }
.lc-plate.lc-short { stroke-width: 5; }
.lc-q { fill: var(--surface); stroke: var(--lc-ink); stroke-width: 1.8; transition: fill 0.25s; }
.lc-q.is-cut { fill: color-mix(in srgb, var(--muted) 22%, var(--surface)); }
.lc-q.is-active { fill: color-mix(in srgb, var(--lr-ok) 26%, var(--surface)); }
.lc-q.is-sat { fill: color-mix(in srgb, var(--lr-bad) 26%, var(--surface)); }
.lc-heat { fill: #e8622c; }
.lc-led { fill: color-mix(in srgb, #e0b000 30%, var(--surface)); stroke: var(--lc-ink); stroke-width: 1.6; }
.lc-glow { fill: #f2c200; }
.lc-mbox { fill: var(--surface); stroke: var(--muted); stroke-width: 1.6; }
.lc-ar { fill: var(--lc-ink); }
.lc-big { fill: none; stroke: var(--lc-ink); stroke-width: 2.4; }
.lc-loop { fill: none; stroke-width: 16; stroke-linejoin: round; opacity: 0.16; }
.lc-loop.in { stroke: var(--lr-in); } .lc-loop.out { stroke: var(--lr-out); }
.lc-fb { fill: none; stroke: var(--lr-ok); stroke-width: 2.4; stroke-dasharray: 6 4; }
.lc-fb.is-off { stroke: var(--lr-bad); opacity: 0.7; }
.lc-fbh { fill: var(--lr-ok); }
.lc-x { fill: var(--lr-bad); font: 800 15px Inter, system-ui, sans-serif; }
.lc-hit { fill: transparent; }
.lc-el { cursor: pointer; outline: none; }
.lc-el:hover .lc-body, .lc-el:focus-visible .lc-body, .lc-el.is-sel .lc-body { stroke: var(--lr-out); stroke-width: 3; }
.lc-el:focus-visible .lc-hit { stroke: var(--lr-out); stroke-dasharray: 4 3; }
.lc-body.is-hl { stroke: var(--lr-out); stroke-width: 3; }

/* labels: readable on a phone (the drawing shrinks to about 0.6) */
.lc-t { fill: var(--text); font: 700 16px Inter, system-ui, sans-serif; }
.lc-tv { fill: var(--muted); font: 600 14px Inter, system-ui, sans-serif; }
.lc-tb { fill: var(--text); font: 700 14px Inter, system-ui, sans-serif; }
.lc-tag { fill: var(--text); font: 700 14px "JetBrains Mono", ui-monospace, monospace; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.lc-mtx { fill: var(--text); font: 700 14px "JetBrains Mono", ui-monospace, monospace; }
.lc-mode { font: 800 15px Inter, system-ui, sans-serif; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.lc-mode.is-cut { fill: var(--muted); } .lc-mode.is-active { fill: var(--lr-ok); } .lc-mode.is-sat { fill: var(--lr-bad); }
.lc-hot { fill: #d4541c; font: 700 14px Inter, system-ui, sans-serif; }
.lc-tin { fill: var(--lr-in); font: 700 14px Inter, system-ui, sans-serif; }
.lc-tout { fill: var(--lr-out); font: 700 14px Inter, system-ui, sans-serif; }
.lc-fw { fill: var(--lr-ok); font: 700 14px Inter, system-ui, sans-serif; }
.lc-rv { fill: var(--muted); font: 700 14px Inter, system-ui, sans-serif; }

/* «Inside»: layers, carriers, the ladder, the chain */
.lc-n { fill: color-mix(in srgb, var(--lr-in) 20%, var(--surface)); stroke: var(--lc-ink); stroke-width: 1; }
.lc-p { fill: color-mix(in srgb, var(--lr-out) 20%, var(--surface)); stroke: var(--lc-ink); stroke-width: 1; }
.lc-dep { fill: var(--surface); fill-opacity: 0.85; stroke: var(--muted); stroke-dasharray: 3 3; }
.lc-fwd { fill: var(--lr-ok); fill-opacity: 0.55; }
.lc-e { fill: var(--lr-in); stroke: var(--lr-in); }
.lc-h { fill: var(--lr-bad); stroke: var(--lr-bad); }
.lc-big.lc-e, .lc-big.lc-h { fill: none; }
.lc-lad1 { fill: color-mix(in srgb, var(--lr-out) 30%, var(--surface)); stroke: var(--lc-ink); }
.lc-lad2 { fill: color-mix(in srgb, var(--lr-in) 26%, var(--surface)); stroke: var(--lc-ink); }
.lc-lad3 { fill: color-mix(in srgb, var(--lc-deep) 26%, var(--surface)); stroke: var(--lc-ink); }
.lc-dash { fill: none; stroke: var(--muted); stroke-dasharray: 5 4; }
.lc-gap { fill: none; stroke: var(--lr-ok); stroke-width: 3; }
.lc-chain { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; }
.lc-box { padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 0.86rem; line-height: 1.35; }
.lc-box b { display: block; font-size: 0.9rem; }
.lc-box.is-brake { border-color: var(--lr-ok); background: color-mix(in srgb, var(--lr-ok) 12%, var(--surface)); }
.lc-box.is-miss { border-style: dashed; border-color: var(--lr-bad); color: var(--muted); }
.lc-arrow { color: var(--muted); font-weight: 800; }
.lc-note { margin: 4px 6px 6px; color: var(--muted); font-size: 0.84rem; }
@media (max-width: 520px) { .lc-seg button { font-size: 0.8rem; } .lc-box { font-size: 0.8rem; } }
html.lc-knows .lc-help-long { display: none; }
