/* =========================================================
   ELECNora — the electronics lab school (pages in /elec/)
   It uses the same header, drawer, settings and themes as NUMNora.
   ========================================================= */
.elec-hero { padding: 56px 0 48px; background: linear-gradient(135deg, #14275e, #1d3a8a 55%, #1e63c8); color: #fff; }
.elec-hero h1 { margin: 0 0 12px; font-size: clamp(1.9rem, 5vw, 3.2rem); line-height: 1.08; max-width: 780px; }
.elec-hero p { max-width: 640px; font-size: 1.08rem; opacity: 0.94; }
.elec-kicker { margin: 0 0 10px; font-weight: 800; letter-spacing: 0.04em; color: #ffd54a; opacity: 1 !important; }
.elec-on-dark { color: #fff !important; border-color: rgba(255, 255, 255, 0.6); }
.elec-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 16px 0; }
.elec-card { display: block; color: var(--text) !important; text-decoration: none; }
.elec-card:hover { border-color: var(--primary); }
.elec-card h3 { margin: 8px 0 4px; }
.elec-card p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.elec-ico { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 6px; border-radius: 12px; background: #1d3a8a; color: #ffd54a; font-size: 1.25rem; font-weight: 800; }
.elec-h2 { margin: 28px 0 12px; }
.elec-path { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.elec-path h3 { margin: 8px 0 4px; }
.elec-path p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.elec-bar { height: 12px; margin: 8px 0 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.elec-bar i { display: block; height: 100%; background: linear-gradient(90deg, #1d3a8a, #43a047); }
.elec-signin { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.elec-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.elec-pass { background: #e6f6ea !important; color: #1b5e20 !important; border-color: #9ccc9f !important; font-weight: 700; }
.elec-hint { background: #fff3cd; color: #5f4200; }
.elec-inline { display: flex; flex-wrap: wrap; gap: 8px; }
.elec-inline input { flex: 1 1 200px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }

/* lessons */
.elec-learn { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.elec-lessons { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 76px; }
.elec-lesson { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: 600 0.86rem var(--font-ui); text-align: left; cursor: pointer; }
.elec-lesson b { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.8rem; }
.elec-lesson small { display: block; margin-top: 2px; font-weight: 500; color: var(--muted); }
.elec-lesson.is-active { border-color: #1d3a8a; box-shadow: 0 0 0 2px rgba(29, 58, 138, 0.25); }
.elec-lesson.is-done b { background: #43a047; border-color: #43a047; color: #fff; }
.elec-article h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 1.3rem; }
.elec-article p, .elec-article li { line-height: 1.65; }
.elec-article ul { padding-left: 20px; }
.elec-fig { max-width: 420px; margin: 0 auto 14px; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.elec-fig svg { display: block; width: 100%; height: auto; font-family: Inter, sans-serif; }
.elec-q { margin: 0 0 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.elec-q legend { padding: 0 6px; font-weight: 700; }
.elec-q label { display: block; padding: 6px 4px; cursor: pointer; }
.elec-q.is-right { border-color: #43a047; }
.elec-q.is-wrong { border-color: #d32f2f; }
.elec-q label.is-answer { font-weight: 700; color: #2e7d32; }
.elec-why { margin: 6px 0 0; font-size: 0.88rem; color: var(--muted); }
.elec-task { border-left: 5px solid #1d3a8a; }
.elec-task.is-done { border-left-color: #43a047; }
.elec-task ol { padding-left: 22px; line-height: 1.65; }
.elec-task .chip-row { align-items: center; }
#elecTask { margin-top: 18px; }
.elec-more { margin-top: 10px; }
.elec-more summary { cursor: pointer; font-weight: 700; margin-bottom: 8px; }
.elec-next { text-align: right; }
.elec-check { list-style: none; margin: 0 0 14px; padding: 0; }
.elec-check li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.elec-check li span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); font-size: 0.8rem; }
.elec-check li.is-done span { background: #43a047; border-color: #43a047; color: #fff; }
.elec-check a { margin-left: auto; font-weight: 700; }

/* device manual */
.dv-tabs { margin-bottom: 14px; }
.dv-title { margin: 0 0 10px; font-size: 1.2rem; }
.dv-title small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.8rem; font-weight: 500; }
.dv-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 14px; }
.dv-svg { display: block; width: 100%; height: auto; font-family: Inter, sans-serif; }
.dv-group { font-size: 9px; font-weight: 800; letter-spacing: 0.08em; fill: #555; text-anchor: middle; }
.dv-label { font-size: 8.5px; font-weight: 700; fill: #333; text-anchor: middle; pointer-events: none; }
.dv-label.dv-on { fill: #fff; font-size: 8px; }
.is-dark .dv-label:not(.dv-on) { fill: #eee; }
.dv-btn { fill: #4a4f5c; stroke: #2b2f38; }
.dv-key { fill: #6a6f7c; stroke: #2b2f38; }
.dv-knob { fill: #b4b7bd; stroke: #6d7077; stroke-width: 1.5; }
.dv-tick { stroke: #333; stroke-width: 2.5; stroke-linecap: round; }
.dv-area { fill: rgba(30, 136, 229, 0.07); stroke: #1e88e5; stroke-width: 1.2; stroke-dasharray: 5 4; }
.dv-control { cursor: pointer; outline: none; }
.dv-badge { fill: #1d3a8a; stroke: #fff; stroke-width: 1.5; }
.dv-n { font-size: 9px; font-weight: 800; fill: #fff; text-anchor: middle; pointer-events: none; }
.dv-control:hover .dv-badge, .dv-control:focus .dv-badge { fill: #ff9800; }
.dv-control.is-active .dv-badge { fill: #ff5722; }
.dv-control.is-active .dv-btn, .dv-control.is-active .dv-key, .dv-control.is-active .dv-knob, .dv-control.is-active .dv-area { stroke: #ff5722; stroke-width: 3; }
.dv-detail { margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); min-height: 64px; }
.dv-detail h3 { margin: 0 0 6px; font-size: 1rem; }
.dv-detail p { margin: 0; line-height: 1.6; }
.dv-list { margin: 0; padding-left: 26px; }
.dv-list li { padding: 6px 4px; line-height: 1.55; border-radius: 8px; cursor: pointer; }
.dv-list li:hover { background: var(--surface-2); }
.dv-list li.is-active { background: rgba(255, 87, 34, 0.12); }

/* statistics */
.st-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.st-tiles .card { text-align: center; }
.st-tiles b { display: block; font-size: 1.9rem; color: #1d3a8a; }
:root[data-theme="dark"] .st-tiles b { color: #8fb4ff; }
.st-tiles span { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.st-scroll { overflow-x: auto; }
.st-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.st-table th, .st-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.st-table td:first-child { white-space: normal; min-width: 180px; }
.st-table th { font-size: max(12px, 0.74rem); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.st-bar { display: inline-block; width: 70px; height: 8px; margin-right: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; vertical-align: middle; }
.st-bar i { display: block; height: 100%; background: #43a047; }

/* certificate */
.cert { padding: 10px; border-radius: 16px; background: linear-gradient(135deg, #1d3a8a, #c9a227); }
.cert-in { padding: 34px 26px; border-radius: 10px; background: #fffdf6; color: #1b1f2a; text-align: center; }
.cert-brand { font-weight: 800; font-size: 1.1rem; color: #1d3a8a; }
.cert-brand span { color: #c9a227; }
.cert h2 { margin: 14px 0 2px; font-size: clamp(1.6rem, 5vw, 2.6rem); letter-spacing: 0.12em; color: #1d3a8a; }
.cert-sub { margin: 0 0 18px; font-weight: 700; color: #8a6d1f; }
.cert-name { margin: 6px 0 10px; font-size: clamp(1.4rem, 4.5vw, 2.2rem); font-weight: 800; border-bottom: 2px solid #c9a227; display: inline-block; padding: 0 18px 6px; }
.cert-text { max-width: 560px; margin: 0 auto 22px; line-height: 1.6; }
.cert-foot { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 700; }
.cert-foot b { display: block; font: 700 max(12px, 0.7rem) Inter, sans-serif; text-transform: uppercase; letter-spacing: 0.06em; color: #8a6d1f; }
.cert-note { margin: 22px 0 0; font-size: max(12px, 0.72rem); color: #777; }
.cert-actions { justify-content: center; margin-top: 12px; }

@media (max-width: 900px) {
  .elec-learn { grid-template-columns: minmax(0, 1fr); }
  .elec-lessons { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 6px; }
  .elec-lesson { flex: none; max-width: 220px; }
}
/* printing the certificate: only the sheet itself */
@media print {
  body * { visibility: hidden; }
  #certSheet, #certSheet * { visibility: visible; }
  #certSheet { position: absolute; left: 0; top: 0; width: 100%; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Compact, tidy layout ----------
   Less empty space above the content, one measure for running text, and every wrapped line
   starts under the text of its first line (not under the number, radio button or tick). */
body[data-site="elec"] .page-intro { padding: 22px 0 14px; }
body[data-site="elec"] .page-intro h1 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); margin-bottom: 4px; }
body[data-site="elec"] .page-intro p { font-size: 0.98rem; max-width: 760px; }
body[data-site="elec"] main.section { padding-top: 14px; }
body[data-site="elec"] .card { padding: 16px; }
body[data-site="elec"] .panel-title { margin: 0 0 10px; }
.elec-hero { padding: 34px 0 30px; }
.elec-text, .elec-task p, .elec-task ol { max-width: 760px; }
.elec-text p { margin: 0 0 10px; }
.elec-text ul, .elec-task ol { margin: 0 0 10px; padding-left: 22px; }
.elec-text li, .elec-task li { margin-bottom: 5px; padding-left: 2px; }
.elec-article h2 { align-items: flex-start; line-height: 1.25; }
.elec-article h2 .elec-ico { flex: none; }
.elec-q label { display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: start; padding: 6px 4px; }
.elec-q label input { margin: 4px 0 0; }
.elec-q legend { line-height: 1.4; }
.elec-check li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; }
.elec-check li > div { min-width: 0; line-height: 1.45; }
.elec-check a { margin-left: 0; white-space: nowrap; }
.dv-list li { padding-left: 4px; }
.dv-list li b { display: inline; }
.elec-lesson span { min-width: 0; line-height: 1.3; }

/* levels */
.elec-level-head { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; font: 800 max(12px, 0.74rem) var(--font-ui); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.elec-level-head b { display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 6px; background: #1d3a8a; color: #fff; font-size: max(12px, 0.72rem); }
.elec-level-head.is-done b { background: #43a047; }
.elec-level-tag { margin: 0 0 6px; font: 800 max(12px, 0.74rem) var(--font-ui); text-transform: uppercase; letter-spacing: 0.06em; color: #1d3a8a; }
:root[data-theme="dark"] .elec-level-tag { color: #8fb4ff; }
.elec-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.elec-level h3 { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; margin: 0 0 8px; font-size: 1rem; }
.elec-level h3 b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #1d3a8a; color: #fff; }
.elec-level h3 small { display: block; font-weight: 500; font-size: 0.78rem; color: var(--muted); }
.elec-level h3 i { font-style: normal; font-size: 1.3rem; color: #c9a227; }
.elec-level.is-done { border-color: #43a047; }
.elec-level.is-done h3 b { background: #43a047; }
.elec-level .elec-check { margin: 0; }
.cert-stars { margin: 0; font-size: 1.6rem; letter-spacing: 0.2em; color: #d9d4c2; }
.cert-stars .is-on { color: #c9a227; }
.cert-level { margin: 0 0 12px; font-weight: 800; color: #1d3a8a; }

/* how it works: the comparison beside the device */
.elec-how-title { margin: 0 0 8px; font-size: 1rem; }
.elec-how { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.elec-how figure { margin: 0; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.elec-how .elec-fig { max-width: none; margin: 0 0 8px; padding: 6px; background: var(--surface); }
.elec-how figcaption { font-size: 0.86rem; line-height: 1.5; }

/* dictionary, mind map, eras */
.at-search { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.at-search input { flex: 1 1 240px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.at-search span { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.at-group { border-left: 5px solid var(--c); }
.at-group h3 { margin: 0 0 8px; font-size: 1.02rem; }
.at-group h3 small { color: var(--muted); font-weight: 600; }
.at-group dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin: 0; }
.at-group dl > div { padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.at-group dl > div.is-active { border-color: var(--c); box-shadow: 0 0 0 2px var(--c); }
.at-group dt { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-weight: 800; }
.at-group dt span { font-weight: 500; font-size: 0.8rem; color: var(--muted); }
.at-group dt code { margin-left: auto; padding: 1px 7px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); font: 700 max(12px, 0.74rem) "JetBrains Mono", ui-monospace, monospace; }
.at-group dd { margin: 4px 0 0; font-size: 0.88rem; line-height: 1.5; }
.at-map { display: block; width: 100%; height: auto; font-family: Inter, sans-serif; }
.at-map text { font-size: 11px; font-weight: 700; fill: var(--text); pointer-events: none; }
.at-map .at-branch text, .at-map .at-centre { fill: #fff; text-anchor: middle; }
.at-map .at-centre { font-size: max(12px, 10.5px); }
.at-branch, .at-term { cursor: pointer; outline: none; }
.at-term:hover rect, .at-term:focus rect, .at-term.is-active rect { opacity: 0.4; stroke-width: 2.5; }
.at-eras { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 4px solid #1d3a8a; display: flex; flex-direction: column; gap: 14px; }
.at-eras li { position: relative; }
.at-eras li::before { content: ""; position: absolute; left: -29px; top: 22px; width: 14px; height: 14px; border-radius: 50%; background: #ffd54a; border: 3px solid #1d3a8a; }
.at-era-head { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; margin-bottom: 8px; }
.at-era-head b { font: 800 0.8rem "JetBrains Mono", ui-monospace, monospace; color: var(--muted); }
.at-era-head h3 { margin: 0; }
.at-eras .chip { cursor: default; font-size: 0.78rem; }
.at-era { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; margin: 10px 0 0; }
.at-era dt { font-weight: 800; font-size: 0.86rem; }
.at-era dd { margin: 0; line-height: 1.55; font-size: 0.92rem; }
@media (max-width: 700px) {
  .elec-how { grid-template-columns: minmax(0, 1fr); }
  .at-era { grid-template-columns: minmax(0, 1fr); }
  .at-era dd { margin-bottom: 6px; }
  .elec-check li { grid-template-columns: 22px 1fr; }
  .elec-check a { grid-column: 2; }
}

/* study plan */
.elec-plan summary { cursor: pointer; font-weight: 800; }
.elec-plan summary small { font-weight: 500; color: var(--muted); margin-left: 6px; }
.elec-plan-tools { align-items: center; margin: 10px 0; }
.elec-plan-tools label { font-size: 0.82rem; font-weight: 700; }
.elec-plan-tools input { padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.elec-weeks { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.elec-weeks li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 0.84rem; }
.elec-weeks li small { color: var(--muted); }
.elec-weeks li span { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 3px; }
.elec-weeks li a { font-weight: 600; line-height: 1.35; }
.elec-weeks li em { color: var(--muted); }
.elec-weeks li.is-now { border-color: #1d3a8a; box-shadow: 0 0 0 2px rgba(29, 58, 138, 0.25); }
.elec-weeks li.is-done { border-color: #43a047; }
.elec-level details summary { cursor: pointer; font-weight: 700; font-size: 0.86rem; margin-bottom: 6px; }
.elec-level .chip-row { align-items: center; justify-content: space-between; }
.elec-lessons { max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px); overflow-y: auto; }

/* device manual: the working picture and its explanation side by side */
.dv-stage { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(250px, 1fr); gap: 14px; align-items: start; }
.dv-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dv-side .dv-detail { margin: 0; }
.dv-side .chip-row { margin: 0; }
.dv-now { margin-top: 8px !important; padding: 6px 9px; border-radius: 8px; background: #10161c; color: #5cff4a; font: 700 0.8rem "JetBrains Mono", ui-monospace, monospace; }
.dv-knobhint { margin-top: 6px !important; font-size: 0.78rem; color: var(--muted); }
.dv-linked { margin: 0; color: var(--muted); }
.dv-control.is-live .dv-badge { fill: #2e7d32; }
.dv-control.is-live:hover .dv-btn, .dv-control.is-live:hover .dv-key, .dv-control.is-live:hover .dv-knob { filter: brightness(1.25); }
.dv-pm { font-size: 11px; font-weight: 800; fill: #1b1b1b; text-anchor: middle; pointer-events: none; }
.dv-label { paint-order: stroke; stroke: rgba(236, 234, 226, 0.85); stroke-width: 2.5px; }
.dv-label.dv-on, .is-dark .dv-label { stroke: none; }
.dv-list { columns: 2 320px; column-gap: 26px; }
.dv-list li { break-inside: avoid; }
/* simulator: the other two modes, tucked away at the bottom */
.elec-modes { margin: 0 0 30px; }
.elec-modes summary { cursor: pointer; font-weight: 700; color: var(--muted); }
@media (max-width: 900px) { .dv-stage { grid-template-columns: minmax(0, 1fr); } .dv-side { position: static; } }

/* =========================================================
   Circuit canvas (elec/circuit.html): toolbar on top, side panel, dotted stage, simulation bar
   The stage takes its colours from the chosen theme (--bg, --grid, --wire, --part, --dot, --text, --sel).
   ========================================================= */
.cz-app { width: calc(100% - 20px); max-width: 1680px; margin: 10px auto 30px; display: flex; flex-direction: column; gap: 8px; }
.cz-top, .cz-bottom { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 6px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.cz-menu { position: relative; }
.cz-tab { padding: 7px 12px; border: 0; border-radius: 9px; background: var(--surface-2); color: var(--text); font: 800 0.86rem var(--font-ui); cursor: pointer; }
.cz-menu.is-open .cz-tab { background: #1d3a8a; color: #fff; }
.cz-drop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: max-content; max-width: min(520px, 90vw); padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
.cz-drop b { flex-basis: 100%; font-size: max(12px, 0.74rem); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.cz-drop .chip, .cz-bottom .chip { padding: 4px 10px; font-size: 0.78rem; }
.cz-tiles { display: flex; gap: 5px; margin-left: auto; overflow-x: auto; max-width: 100%; }
.cz-tile { flex: none; display: flex; flex-direction: column; align-items: center; gap: 1px; width: 70px; padding: 3px 2px; border: 1px solid var(--border); border-radius: 10px; background: #10161c; color: #dfe9f2; font: 600 max(12px, 0.6rem)/1.15 var(--font-ui); cursor: grab; touch-action: none; }
.cz-tile:hover { border-color: #ffd54a; }
.cz-tile svg { width: 58px; height: 32px; fill: none; stroke: #e8edf5; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.cz-tile svg .cz-solid { fill: #e8edf5; }
.cz-tile svg .cz-glow, .cz-tile svg .cz-hit { display: none; }
.cz-tile svg .cz-in { fill: #e8edf5; stroke: none; font: 800 12px sans-serif; text-anchor: middle; }
.cz-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 8px; align-items: stretch; }
.cz-side { padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); min-width: 0; }
.cz-tabs { margin-bottom: 10px; }
.cz-sidebody h3 { margin: 0 0 8px; font-size: 1rem; }
.cz-sidebody label { display: block; font-weight: 700; font-size: 0.86rem; }
.cz-sidebody output { float: right; padding: 2px 8px; border-radius: 6px; background: #10161c; color: #5cff4a; font: 700 0.86rem "JetBrains Mono", monospace; }
.cz-sidebody input[type="range"] { width: 100%; margin-top: 8px; accent-color: #1d3a8a; }
.cz-read { margin: 10px 0; padding: 7px 9px; border-radius: 8px; background: #10161c; color: #5cff4a; font: 700 0.76rem/1.5 "JetBrains Mono", monospace; min-height: 2.6em; }
.cz-steps, .cz-rules { margin: 0; padding-left: 20px; font-size: 0.86rem; line-height: 1.55; }
.cz-steps li, .cz-rules li { margin-bottom: 7px; }
.cz-stage { overflow: auto; border-radius: 12px; border: 1px solid var(--border); background: var(--bg, #0b0d10); max-height: 74vh; min-height: 360px; }
.cz-world { position: relative; margin: 0 auto; }
.cz-svg, .cz-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cz-canvas { pointer-events: none; }
.cz-svg { touch-action: none; user-select: none; font-family: Inter, sans-serif; }
.cz-back { cursor: crosshair; }
.cz-wire-line { fill: none; stroke: var(--wire); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.cz-wire-hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; }
.cz-wire.is-selected .cz-wire-line { stroke: var(--sel); stroke-width: 4; }
.cz-draft { stroke: var(--sel); stroke-dasharray: 6 5; }
.cz-junction { fill: var(--wire); }
.cz-term { fill: var(--bg); stroke: var(--wire); stroke-width: 2; cursor: crosshair; }
.cz-term:hover { fill: var(--sel); stroke: var(--sel); }
.cz-part { cursor: grab; }
.cz-sym { fill: none; stroke: var(--part); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.cz-sym .cz-thick { stroke-width: 4; }
.cz-sym .cz-solid { fill: var(--part); }
.cz-sym .cz-led { fill: #ff3b30; stroke: #ff3b30; }
.cz-sym .cz-glow { fill: #ffd54a; stroke: none; opacity: 0; filter: blur(5px); }
.cz-sym .cz-hit { fill: transparent; stroke: none; }
.cz-sym .cz-in, .cz-sym .cz-pin { fill: var(--part); stroke: none; font: 800 12px sans-serif; text-anchor: middle; }
.cz-sym .cz-pin { font-size: 9px; fill: var(--text); }
.cz-part.is-selected .cz-hit { fill: color-mix(in srgb, var(--sel) 16%, transparent); stroke: var(--sel); stroke-width: 1.5; stroke-dasharray: 5 4; }
.cz-part.is-dead .cz-sym { opacity: 0.35; }
.cz-v, .cz-l { font: 700 11px "JetBrains Mono", monospace; fill: var(--text); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; pointer-events: none; }
.cz-l { fill: var(--dot); }
.cz-l--val { fill: var(--part); opacity: 0.85; }
.cz-stage.is-3d { perspective: 1200px; overflow: visible; background: none; border-color: transparent; }
.cz-stage.is-3d .cz-world { transform: rotateX(52deg); transform-origin: 50% 80%; background: var(--bg); border-radius: 14px; box-shadow: 0 16px 0 color-mix(in srgb, var(--bg) 70%, #000), 0 44px 40px rgba(0, 0, 0, 0.5); }
.cz-stage.is-3d .cz-part, .cz-stage.is-3d .cz-wire { filter: drop-shadow(3px 12px 3px rgba(0, 0, 0, 0.55)); }
.cz-note { margin: 0; padding: 0 4px; font-size: 0.8rem; color: var(--muted); }
.cz-note.is-warn { padding: 6px 10px; border-radius: 10px; background: #fff3cd; color: #5f4200; font-weight: 700; }
.cz-group { display: inline-flex; flex-wrap: wrap; gap: 5px; align-items: center; padding-right: 10px; border-right: 1px solid var(--border); }
.cz-group:last-child { border-right: 0; }
.cz-group b { font-size: max(12px, 0.74rem); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.cz-bottom code { font: 700 0.78rem "JetBrains Mono", monospace; min-width: 62px; text-align: center; }
.cz-table tr.is-selected td { background: rgba(255, 213, 74, 0.18); }
.cz-table tr[data-part] { cursor: pointer; }
@media (max-width: 800px) { .cz-body { grid-template-columns: minmax(0, 1fr); } .cz-tiles { margin-left: 0; } }

/* circuit canvas: full shelf in groups, wire handles, look controls */
.cz-shelf { flex: 1 1 100%; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cz-groups { display: flex; flex-wrap: wrap; gap: 4px; }
.cz-groups .chip { padding: 3px 9px; font-size: max(12px, 0.74rem); }
.cz-groups .chip small { opacity: 0.85; }
.cz-tiles { margin-left: 0; padding-bottom: 4px; }
.cz-tile { width: 76px; }
.cz-tile svg { height: 36px; }
.cz-tile svg text { font-family: Inter, sans-serif; }
.cz-tile svg .cz-pin { fill: #9fb4ff; stroke: none; font: 800 9px sans-serif; text-anchor: middle; }
.cz-tile.is-picture { background: #f4f1e6; color: #222; }
.cz-tile.is-picture svg { stroke: none; stroke-width: 1; }
.cz-wire-line { stroke-width: var(--ww, 2.5); }
.cz-v, .cz-l { font-size: var(--fs, 11px); }
.cz-end { fill: var(--sel); stroke: var(--bg); stroke-width: 2; cursor: move; }
.cz-wire { cursor: move; }
.cz-pic { stroke: none; stroke-width: 1; fill: initial; }
.cz-pic .bb-leg { stroke: #9a9a9a; stroke-width: 2.5; fill: none; }
.cz-pic text { stroke: none; }
.cz-colour { display: inline-flex; align-items: center; gap: 5px; font-size: 0.76rem; font-weight: 700; }
.cz-colour input { width: 30px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; }
.cz-range { display: flex; align-items: center; gap: 8px; flex-basis: 100%; font-size: 0.76rem; font-weight: 700; }
.cz-range input { flex: 1; accent-color: #1d3a8a; }
.cz-drop { max-height: 70vh; overflow-y: auto; }
.cz-param { margin-bottom: 10px; }
.cz-param span { float: right; display: inline-flex; align-items: center; gap: 4px; }
.cz-param input[type="text"] { width: 74px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: #10161c; color: #5cff4a; font: 700 0.82rem "JetBrains Mono", monospace; text-align: right; }
.cz-param b { font-size: 0.78rem; min-width: 1.2em; }

/* the value window on the sheet */
.cz-pop { position: absolute; z-index: 5; width: 222px; padding: 8px 10px; border: 2px solid #ffd54a; border-radius: 12px; background: #10161c; color: #e8edf5; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); font-size: 0.8rem; }
.cz-pop > b { display: block; margin: 0 24px 6px 0; }
.cz-pop small { display: block; margin-top: 4px; color: #9aa6b2; font-size: max(12px, 0.68rem); line-height: 1.3; }
.cz-popval { display: grid; grid-template-columns: 34px 1fr 34px; gap: 6px; align-items: center; margin-bottom: 6px; }
.cz-popval .bench-pm { height: 32px; background: #232a33; color: #fff; border-color: #3a424c; font-size: 1.1rem; }
.cz-popval span { display: inline-flex; align-items: center; gap: 4px; justify-content: center; }
.cz-popval input[type="text"] { width: 84px; padding: 4px 6px; border: 1px solid #3a424c; border-radius: 6px; background: #0b0d10; color: #5cff4a; font: 700 0.9rem "JetBrains Mono", monospace; text-align: right; }
.cz-popval input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: #ffd54a; }
.cz-pop .bench-pop-x { background: #232a33; color: #fff; }
.cz-stage.is-3d .cz-pop { display: none; }

/* lessons grouped by the labs of the lab manual */
.elec-viewtabs { margin-bottom: 8px; }
.elec-lab-head span { display: block; min-width: 0; }
.elec-lab-head small { display: block; font-weight: 500; color: var(--muted); font-size: max(12px, 0.72rem); }
.elec-book { margin: 2px 0 6px; font-size: 0.84rem; color: var(--muted); }

.elec-viewtabs { flex: none; }
/* the circuit editor inside the simulator's details card */
.cz-app.cz-embedded { width: 100%; max-width: none; margin: 8px 0; }
.cz-embedded .cz-stage { max-height: 62vh; }
@media (max-width: 760px) { .cz-embedded .cz-body { grid-template-columns: minmax(0, 1fr); } }

/* two tracks, lab pages and their games */
.elec-track { margin: 18px 0 8px; font-size: 1.05rem; }
.elec-labbtn b { background: #1d3a8a; color: #fff; }
.elec-steps { padding-left: 20px; line-height: 1.6; }
.lab-game { border: 2px solid #7c5cff; }
.lg-top { display: flex; justify-content: space-between; margin: 0 0 6px; font-size: 0.86rem; color: var(--muted); }
.lg-ask { font-size: 1.02rem; font-weight: 600; margin: 4px 0 10px; }
.lg-screen { width: 100%; max-width: 460px; display: block; border-radius: 10px; background: #06130c; }
.lg-screen line { stroke: #1d4a30; stroke-width: 1; }
.lg-screen .lg-axis { stroke: #3f7d58; }
.lg-trace { fill: none; stroke: #ffe14d; stroke-width: 2.5; }
.lg-ghost { fill: none; stroke: #4fd8ff; stroke-width: 1.5; stroke-dasharray: 5 5; opacity: 0.7; }
.lg-knobs { display: flex; gap: 10px; margin: 6px 0; }
.lg-knobs b { padding: 3px 10px; border-radius: 6px; background: #10161c; color: #5cff4a; font: 700 0.84rem "JetBrains Mono", monospace; }
.lg-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.lg-options .chip { font-size: 1rem; padding: 9px 16px; }
.lg-options .chip.is-right { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.lg-options .chip.is-wrong { background: #c62828; color: #fff; border-color: #c62828; }
.lg-why { display: block; margin-top: 4px; font-weight: 500; }
.lg-gate, .lg-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0; }
.lg-bit { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font: 700 1rem "JetBrains Mono", monospace; }
.lg-bit i { width: 14px; height: 14px; border-radius: 50%; background: #444; }
.lg-bit.is-on i { background: #ffd54a; box-shadow: 0 0 10px #ffd54a; }
.lg-chip { padding: 10px 16px; border-radius: 8px; background: #1b1f27; color: #fff; border: 2px solid #7c5cff; font-family: "JetBrains Mono", monospace; }
.lg-add code { font-size: 1.3rem; padding: 6px 12px; border-radius: 8px; background: #10161c; color: #5cff4a; }

.elec-examples { margin-top: 10px; }
.elec-tour { float: right; font-size: 0.78rem; }
.elec-tours { margin-bottom: 14px; }

/* ---------- Zones: one colour for each kind of page ---------- */
body[data-site="elec"] { --zone: #1d3a8a; }
body[data-zone="study"] { --zone: #1d6fe0; } body[data-zone="sim"] { --zone: #f26a1b; } body[data-zone="play"] { --zone: #7c5cff; } body[data-zone="ref"] { --zone: #2e9e5b; } body[data-zone="cert"] { --zone: #c9a227; }
body[data-zone] .page-intro { border-top: 4px solid var(--zone); }
.elec-zone { display: inline-block; margin-bottom: 6px; padding: 3px 12px; border-radius: 999px; background: color-mix(in srgb, var(--zone) 60%, #000); color: #fff; font: 800 max(12px, 0.74rem) var(--font-ui); letter-spacing: 0.05em; text-transform: uppercase; }
body[data-zone] .nav-link.is-active { background: var(--zone); }
/* tutorials look the same everywhere: teal */
.tutorial-box { border-top: 5px solid #00a3a3; }
.elec-tourcard { border-left: 5px solid #00a3a3; }
/* ---------- Games page ---------- */
.arcade-halls { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 14px; }
.arcade-hall { display: grid; gap: 4px; text-align: left; cursor: pointer; color: var(--text); font: inherit; border: 2px solid var(--border); }
.arcade-hall span { font-size: 2rem; } .arcade-hall b { font-size: 1.1rem; } .arcade-hall small { color: var(--muted); } .arcade-hall i { font-style: normal; font-size: 0.8rem; font-weight: 700; }
.arcade-hall--elec { border-color: #f26a1b; } .arcade-hall--logic { border-color: #00a3a3; }
.arcade-hall--elec.is-active { background: color-mix(in srgb, #f26a1b 16%, var(--surface)); } .arcade-hall--logic.is-active { background: color-mix(in srgb, #00a3a3 16%, var(--surface)); }
.arcade-list--elec .chip.is-active { background: #f26a1b; border-color: #f26a1b; color: #fff; } .arcade-list--logic .chip.is-active { background: #00a3a3; border-color: #00a3a3; color: #fff; }
.arcade-game--elec { border-color: #f26a1b; } .arcade-game--logic { border-color: #00a3a3; }
/* the five-part explanation of a topic: each part has its own colour */
.topic-info { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--border); }
.ti-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.ti-box { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); border-left: 5px solid var(--border); background: var(--surface-2); font-size: 0.86rem; line-height: 1.5; }
.ti-box h4 { margin: 0 0 4px; font-size: 0.86rem; } .ti-box p { margin: 0; } .ti-box a { display: inline-block; margin-top: 6px; font-weight: 700; }
.ti-how { border-left-color: #1d6fe0; } .ti-value { border-left-color: #c9a227; } .ti-know { border-left-color: #2e9e5b; } .ti-wrong { border-left-color: #d32f2f; } .ti-rel { border-left-color: #7c5cff; }
.ti-know p { font-family: "JetBrains Mono", monospace; font-size: 0.8rem; }
/* game pieces */
.lg-res { width: 100%; max-width: 320px; display: block; }
.lg-seg { width: 90px; display: block; background: #10161c; border-radius: 10px; padding: 8px; }
.lg-seg path { stroke: #2a323d; stroke-width: 9; stroke-linecap: round; fill: none; } .lg-seg path.is-on { stroke: #ff4d3d; filter: drop-shadow(0 0 4px #ff4d3d); }
.lg-table { border-collapse: collapse; margin: 6px 0; font-family: "JetBrains Mono", monospace; } .lg-table th, .lg-table td { border: 1px solid var(--border); padding: 4px 14px; text-align: center; } .lg-table th { background: var(--surface-2); }
.lg-bits { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.lg-bitbtn { display: grid; justify-items: center; gap: 4px; width: 46px; padding: 8px 0; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: 700 max(12px, 0.74rem) "JetBrains Mono", monospace; cursor: pointer; }
.lg-bitbtn i { width: 20px; height: 20px; border-radius: 50%; background: #444; } .lg-bitbtn.is-on i { background: #ffd54a; box-shadow: 0 0 12px #ffd54a; }

/* ---------- The logic simulator ---------- */
#logicSim { margin-top: 16px; }
.lgs { border-top: 5px solid #00a3a3; }
.lgs-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.lgs-gap { flex: 1 1 20px; }
.lgs-body-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 210px; gap: 10px; align-items: start; }
.lgs-shelf { display: flex; flex-direction: column; gap: 5px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.lgs-shelf b { margin-top: 4px; font-size: max(12px, 0.72rem); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.lgs-shelf .chip { text-align: left; }
.lgs-stage { overflow: auto; border: 1px solid var(--border); border-radius: 12px; background-color: var(--surface-2); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 20px 20px; }
.lgs-svg { display: block; width: 100%; min-width: 560px; touch-action: none; user-select: none; }
.lgs-side { padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.lgs-side h4 { margin: 0 0 6px; font-size: 0.88rem; }
.lgs-truth tr.is-now td { background: color-mix(in srgb, #00a3a3 30%, transparent); }
.lgs-body { fill: var(--surface); stroke: var(--text); stroke-width: 2; cursor: grab; }
.lgs-IN, .lgs-CLK { stroke: #2e9e5b; } .lgs-OUT, .lgs-SEG { stroke: #c9a227; } .lgs-DFF, .lgs-JKFF { stroke: #7c5cff; }
.lgs-name { fill: var(--text); font: 800 15px var(--font-ui); pointer-events: none; }
.lgs-label, .lgs-pinname { fill: var(--muted); font: 700 10px var(--font-ui); pointer-events: none; }
.lgs-pin { fill: var(--surface-2); stroke: var(--text); stroke-width: 2; cursor: pointer; }
.lgs-pin.is-on { fill: #ffd54a; stroke: #ff9800; } .lgs-pin.is-from { stroke: #00e5ff; stroke-width: 4; }
.lgs-wire { fill: none; stroke: var(--muted); stroke-width: 3; opacity: 0.7; pointer-events: none; }
.lgs-wire.is-on { stroke: #ffb300; opacity: 1; filter: drop-shadow(0 0 3px #ffb300); }
.lgs-switch { fill: #666; cursor: pointer; } .lgs-switch.is-on { fill: #2e9e5b; } .lgs-knob { fill: #fff; pointer-events: none; }
.lgs-led { fill: #3a3a3a; stroke: #111; stroke-width: 2; } .lgs-led.is-on { fill: #ff3d2e; filter: drop-shadow(0 0 8px #ff3d2e); }
.lgs-screen { fill: #10161c; } .lgs-digit { fill: #ff4d3d; font: 800 30px "JetBrains Mono", monospace; pointer-events: none; }
@media (max-width: 900px) { .lgs-body-row { grid-template-columns: minmax(0, 1fr); } .lgs-shelf { flex-direction: row; flex-wrap: wrap; align-items: center; } }

/* ---------- Simulator: board first on screens too narrow for the one-screen bench ----------
   Working order for a beginner: what to do now, the board, the parts, the sockets, the readings,
   then the instruments (supply and meter before generator and scope). Wide screens keep the desk. */
@media (max-width: 1099px) {
  body[data-site="elec"] #bench.is-dash .bench-flow { display: flex; flex-direction: column; gap: 12px; }
  body[data-site="elec"] #bench.is-dash :is(.bench-left, .bench-instruments, .bench-layout, .bench-main, .bench-side, .bench-slot, .bench-slot-well) { display: contents; }
  body[data-site="elec"] #bench.is-dash .bench-slot-cap { display: none; }
  body[data-site="elec"] #bench.is-dash .bench-nav { order: 0; }
  body[data-site="elec"] #bench.is-dash .bench-actbar { order: 1; }
  body[data-site="elec"] #bench.is-dash .bench-main > .card:first-child { order: 2; }
  body[data-site="elec"] #bench.is-dash #benchPalette { order: 3; max-height: 320px; overflow-y: auto; }
  body[data-site="elec"] #bench.is-dash .bench-cablebar { order: 4; }
  body[data-site="elec"] #bench.is-dash .bench-measure { order: 5; max-height: 300px; overflow-y: auto; }
  body[data-site="elec"] #bench.is-dash .bench-psu { order: 6; }
  body[data-site="elec"] #bench.is-dash .bench-dmm { order: 7; }
  body[data-site="elec"] #bench.is-dash .bench-gen { order: 8; }
  body[data-site="elec"] #bench.is-dash .bench-scope { order: 9; }
  body[data-site="elec"] #bench.is-dash .bench-dock { order: 10; }
  body[data-site="elec"] #bench.is-dash .bench-details { order: 11; }
}
/* Easier to read and to hit: no hint text under 12px in the bench, bigger targets for fingers */
body[data-site="elec"] #bench :is(.bench-hint, .bench-cabletip) { font-size: max(0.75rem, 12px); }
@media (pointer: coarse) {
  body[data-site="elec"] :is(#bench, #wsBar, #elecTask) :is(.chip, .ws-btn, .bench-fold, .bench-swap, .bench-pin, .bench-knob button, .link-btn) { min-height: 40px; min-width: 40px; }
}
body[data-site="elec"] :is(#bench, #wsBar) :is(button, input, select):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* The "where do you want to start?" window (elec/start.js) */
.sim-start { position: relative; max-width: 620px; }
.sim-start h2 { margin: 0 34px 6px 0; }
.sim-start h3 { margin: 18px 0 6px; font-size: 1rem; }
.sim-start-x { position: absolute; top: 12px; right: 12px; }
.sim-start-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.sim-start-choice { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 14px; border: 2px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.sim-start-choice:first-child { border-color: var(--zone, var(--primary)); background: var(--surface-2); }
.sim-start-choice:hover, .sim-start-choice:focus-visible { border-color: var(--accent); }
.sim-start-choice span { font-size: 1.7rem; }
.sim-start-choice small { color: var(--muted); line-height: 1.35; }
.sim-start-steps { margin: 0; padding-left: 22px; line-height: 1.6; }
.ws-start { font-weight: 700; }
@media (max-width: 620px) { .sim-start-choices { grid-template-columns: minmax(0, 1fr); } }
.elec-notice { margin: 0 0 14px; font-weight: 600; }

/* The 20 measurements of a lesson (elec/measure.js), under the bench's measurement card */
#mzBox { margin-top: 14px; }
body[data-ws="graph"] #mzBox, body[data-ws="logic"] #mzBox, body[data-ws="see"] #mzBox { display: none !important; }
.mz-jump { margin-top: 8px; }
.mz-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; }
.mz-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 700; font-size: 0.85rem; min-width: 0; max-width: 100%; }
.mz-pick select { max-width: 100%; min-width: 0; font: inherit; font-weight: 600; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.mz-count { margin: 4px 0 6px; font-weight: 700; font-size: 0.8rem; color: var(--muted); }
.mz-table { table-layout: auto; min-width: 520px; }
.mz-table th, .mz-table td { text-align: left; white-space: normal; vertical-align: top; }
.mz-table td:first-child { color: var(--muted); width: 2em; }
.mz-table .mz-sym { white-space: nowrap; color: var(--text); }
.mz-table .mz-val { white-space: nowrap; color: var(--text); font-weight: 800; }
.mz-table tr.is-empty .mz-val { color: var(--muted); }
.mz-table td.use { font: 600 max(12px, 0.72rem) var(--font-ui, system-ui); color: var(--muted); }
.mz-table sub { font-size: max(10px, 0.72em); }
.mz-how-in { display: none; }
@media (max-width: 640px) {
  .mz-table { min-width: 0; }
  .mz-table th:last-child, .mz-table td.use { display: none; }
  .mz-how-in { display: block; margin-top: 2px; font: 600 max(12px, 0.7rem) var(--font-ui, system-ui); color: var(--muted); }
  .mz-table .mz-val { white-space: normal; }
}

/* ---------- Look up: the 1,300 items (elec/items.js) ---------- */
#ixBox { margin-top: 14px; }
body[data-ws="graph"] #ixBox, body[data-ws="logic"] #ixBox, body[data-ws="see"] #ixBox { display: none !important; }
.ix-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ix-top .mz-pick span { display: none; }
.ix-top .mz-pick, .ix-top .mz-pick select { flex: 1 1 160px; }
.ix-q { flex: 1 1 160px; min-width: 0; padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 0.85rem; }
.ix-kinds { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.ix-chip { padding: 3px 8px; font-size: max(12px, 0.74rem); border-top: 3px solid var(--ixc); }
.ix-chip small { opacity: 0.7; }
.ix-M { --ixc: #2b6cb0; } .ix-F { --ixc: #c0392b; } .ix-S { --ixc: #2f855a; } .ix-V { --ixc: #7b4bb5; }
/* dark theme: lighter shades of the same four colours, 5:1 or more on the dark cards (were 2.4:1) */
:root[data-theme="dark"] .ix-M { --ixc: #7fb3ea; } :root[data-theme="dark"] .ix-F { --ixc: #f08a7e; } :root[data-theme="dark"] .ix-S { --ixc: #6fcf97; } :root[data-theme="dark"] .ix-V { --ixc: #b794e6; }
.ix-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.ix-item { padding: 6px 8px; border: 1px solid var(--border); border-left: 4px solid var(--ixc); border-radius: 8px; background: var(--surface); }
.ix-item p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin: 0; font-size: 0.84rem; color: var(--text); }
.ix-kind { font: 800 max(12px, 0.58rem) var(--font-ui, system-ui); font-style: normal; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ixc); }
.ix-sym { font: 700 0.8rem "JetBrains Mono", ui-monospace, monospace; color: var(--ixc); }
.ix-item output { margin-left: auto; font: 800 0.86rem "JetBrains Mono", ui-monospace, monospace; color: var(--text); white-space: nowrap; }
.ix-item output.is-empty { color: var(--muted); font-weight: 600; }
.ix-item small { display: block; margin-top: 1px; font-size: 0.76rem; color: var(--muted); }
.ix-F small { font-family: "JetBrains Mono", ui-monospace, monospace; color: var(--text); }
.ix-item em { display: block; margin-top: 2px; font-size: max(12px, 0.68rem); font-style: normal; color: var(--muted); }
.ix-item sub { font-size: max(10px, 0.72em); }
.bench-dock .ix-top .mz-pick select, .bench-dock .ix-q { font-size: 0.78rem; }
/* the longer notes of an item */
.ix-dots { margin-left: 4px; padding: 0 7px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text); font: 800 0.9rem/1.2 var(--font-ui, system-ui); cursor: pointer; }
.ix-dots.is-open, .ix-dots:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.ix-more { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); display: grid; gap: 6px; font-size: 0.8rem; line-height: 1.5; color: var(--text); }
.ix-more h5 { margin: 0 0 2px; font-size: max(12px, 0.68rem); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ixc, var(--primary)); }
.ix-more p { margin: 0; color: var(--text); }
.ix-more ol { margin: 0; padding-left: 1.3em; display: grid; gap: 2px; }
.ix-showme { margin-top: 4px; padding: 3px 9px; font-size: max(12px, 0.74rem); }
.mz-more td { background: var(--surface-2); }
.mz-more .ix-more { background: none; padding: 4px 0; }
.mz-table .ix-dots { vertical-align: 1px; }
