/* =====================================================================
   Ohmov zákon: svet elektrotechnického výkresu.
   Technický papier, tuš, hierarchia hrúbok čiar, farby veličín podľa IEC 60757.
   ===================================================================== */

/* ---------- tokeny ---------- */
:root {
  --paper: #f1f3f5;
  --sheet: #ffffff;
  --sheet-2: #f6f7f9;
  --ink: #15171a;
  --ink-2: #3f444b;
  --muted: #5e636b;
  --rule: #d5d9de;
  --rule-2: #a8adb4;
  --bar: #15171a;
  --bar-ink: #f1f3f5;
  --bar-muted: #a8adb4;
  --bar-rule: #33373d;
  --focus: #1c5dbd;
  --ok: #1d7a3a;
  --warn: #9a5a00;
  --bad: #c4261c;
  --wire: #15171a;
  --flow: #e08a00;
  --grid: #e9ecef;
  --axis: #868b93;

  /* veličiny: farebný kód IEC 60757 (RD, BU, BN, OG) */
  --qv: #c4261c;
  --qi: #1c5dbd;
  --qr: #7b4a22;
  --qp: #a65500;
  --qv-tint: #fbeceb;
  --qi-tint: #e9f0fb;
  --qr-tint: #f4ede6;
  --qp-tint: #fcf0e0;
  --on-q: #ffffff;

  --f-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-label: "Barlow Semi Condensed", "DIN Condensed", "Roboto Condensed", "Arial Narrow", var(--f-ui);
  --f-num: "Barlow", "DIN Alternate", var(--f-ui);
  --f-head: "Barlow", var(--f-ui);
  --hair: 1px;
  --frame: 2px;
  --gap: clamp(16px, 2.2vw, 28px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1012; --sheet: #16191c; --sheet-2: #1c2024; --ink: #e9ebee; --ink-2: #c3c8cf; --muted: #9aa0a9;
    --rule: #2b3035; --rule-2: #474d54; --bar: #050607; --bar-ink: #e9ebee; --bar-muted: #9aa0a9; --bar-rule: #2b3035;
    --focus: #7faaf5; --ok: #5cc47a; --warn: #f0a441; --bad: #ff7a6e; --wire: #d5d9de; --flow: #ffb43d; --grid: #22262a; --axis: #7d838c;
    --qv: #ff7a6e; --qi: #7faaf5; --qr: #d3a57c; --qp: #f5ae4e;
    --qv-tint: #2d1a19; --qi-tint: #17233a; --qr-tint: #2a2119; --qp-tint: #2e2312; --on-q: #0e1012;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1012; --sheet: #16191c; --sheet-2: #1c2024; --ink: #e9ebee; --ink-2: #c3c8cf; --muted: #9aa0a9;
  --rule: #2b3035; --rule-2: #474d54; --bar: #050607; --bar-ink: #e9ebee; --bar-muted: #9aa0a9; --bar-rule: #2b3035;
  --focus: #7faaf5; --ok: #5cc47a; --warn: #f0a441; --bad: #ff7a6e; --wire: #d5d9de; --flow: #ffb43d; --grid: #22262a; --axis: #7d838c;
  --qv: #ff7a6e; --qi: #7faaf5; --qr: #d3a57c; --qp: #f5ae4e;
  --qv-tint: #2d1a19; --qi-tint: #17233a; --qr-tint: #2a2119; --qp-tint: #2e2312; --on-q: #0e1012;
  color-scheme: dark;
}

/* profil mení mierku a hustotu, nie obsah */
html { font-size: 16px; }
html[data-profile="teacher"] { font-size: 19px; }
html[data-profile="maker"] { font-size: 15px; }
@media (max-width: 520px) { html[data-profile="teacher"] { font-size: 17px; } }

/* ---------- základ a povrchy prehliadača ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; scrollbar-color: var(--rule-2) transparent; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 1rem/1.55 var(--f-ui); overflow-x: clip; padding-bottom: 76px;
  caret-color: var(--qi);
}
::selection { background: color-mix(in srgb, var(--qi) 26%, transparent); color: inherit; }
h1, h2, h3 { font-family: var(--f-head); line-height: 1.15; margin: 0; letter-spacing: -.005em; text-wrap: balance; }
h2 { font-size: 1.3rem; font-weight: 750; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button { font: inherit; color: inherit; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 50; }
.skip:focus { top: 8px; }
.sheet__note, .badge, .tblock__lab, .chart figcaption b, .pairs th, .unit, .seg-ctl button { font-family: var(--f-label); }
.hint { color: var(--muted); font-size: .92rem; margin: 0 0 14px; max-width: 70ch; }
.kbd { font-family: var(--f-num); font-variant-numeric: tabular-nums; padding: 0 5px; border: var(--hair) solid var(--rule-2); border-radius: 0; background: var(--sheet-2); color: var(--ink); white-space: nowrap; }

/* symbol veličiny: štvorček vo farbe kódu */
.sym { display: inline-grid; place-items: center; width: 1.45em; height: 1.45em; border-radius: 2px; background: var(--qc); color: var(--on-q); font-family: var(--f-num); font-weight: 700; font-size: .95em; line-height: 1; flex: none; }
.sym--v, [data-k="V"] { --qc: var(--qv); --qt: var(--qv-tint); }
.sym--i, [data-k="I"] { --qc: var(--qi); --qt: var(--qi-tint); }
.sym--r, [data-k="R"] { --qc: var(--qr); --qt: var(--qr-tint); }
.sym--p, [data-k="P"] { --qc: var(--qp); --qt: var(--qp-tint); }
.qv { color: var(--qv); } .qi { color: var(--qi); } .qr { color: var(--qr); } .qp { color: var(--qp); }

/* ---------- lišta (rám výkresu) ---------- */
.bar { position: sticky; top: 0; z-index: 20; background: var(--bar); color: var(--bar-ink); border-bottom: var(--hair) solid var(--bar-rule); }
.bar__in { display: flex; align-items: center; gap: 18px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--f-head); font-weight: 700; font-size: 1.08rem; letter-spacing: -.01em; white-space: nowrap; }
.brand__mark { width: 26px; height: 26px; display: block; }
.nav { display: flex; gap: 2px; margin-right: auto; }
.nav a { text-decoration: none; color: var(--bar-muted); padding: 6px 10px; border-radius: 0; font-size: .92rem; }
.nav a:hover { color: var(--bar-ink); background: var(--bar-rule); }
.bar__tools { display: flex; align-items: center; gap: 8px; }
.seg-ctl { display: inline-flex; border: var(--hair) solid var(--bar-rule); border-radius: 0; padding: 2px; gap: 2px; }
.seg-ctl button {
  background: transparent; border: 0; color: var(--bar-muted); padding: 5px 10px 3px; border-radius: 0; cursor: pointer;
  text-transform: uppercase; letter-spacing: .06em; font-size: .86rem; font-weight: 700; line-height: 1.2;
}
.seg-ctl button:hover { color: var(--bar-ink); }
html[data-picked] .seg-ctl button[aria-checked="true"] { background: var(--bar-ink); color: var(--bar); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 0; border: var(--hair) solid var(--bar-rule); background: transparent; color: var(--bar-ink); cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--bar-rule); }
@media (max-width: 860px) {
  .nav { display: none; }
  .bar__tools { margin-left: auto; }
}
@media (max-width: 420px) {
  .brand__name { display: none; }
  .seg-ctl button { padding: 5px 8px 3px; font-size: .8rem; }
}

/* ---------- výber profilu (prvá návšteva) ---------- */
.pick { margin-top: var(--gap); background: var(--sheet); border: var(--hair) solid var(--rule); border-top: var(--frame) solid var(--ink); padding: clamp(18px, 3vw, 32px); }
html[data-picked] .pick { display: none; }
.pick__head { display: grid; gap: 6px; margin-bottom: 18px; }
.pick__head h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.pick__head p { color: var(--muted); max-width: 60ch; }
.pick__opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .pick__opts { grid-template-columns: minmax(0, 1fr); } }
.pick__opt {
  display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; gap: 2px 14px; text-align: left;
  background: var(--sheet-2); border: var(--hair) solid var(--rule-2); border-radius: 0; padding: 16px; cursor: pointer;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}
.pick__opt svg { grid-row: span 2; width: 44px; height: 44px; color: var(--ink); }
.pick__opt b { font-size: 1.08rem; }
.pick__opt span { color: var(--muted); font-size: .92rem; }
.pick__opt:hover { border-color: var(--ink); background: var(--sheet); }

/* ---------- úvod ---------- */
.intro { padding: clamp(22px, 4vw, 40px) 0 clamp(14px, 2vw, 20px); display: grid; gap: 8px; }
.intro__title { font-size: clamp(2rem, 4.6vw, 3.3rem); font-weight: 700; letter-spacing: -.015em; }
.intro__lead { color: var(--ink-2); font-size: 1.05rem; max-width: 68ch; }

/* ---------- listy ---------- */
main > * + * { margin-top: var(--gap); }
.intro + .lab { margin-top: 0; }
.sheet { background: var(--sheet); border: var(--hair) solid var(--rule); border-top: var(--frame) solid var(--ink); padding: clamp(16px, 2vw, 24px); min-width: 0; }
.sheet__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 16px; border-bottom: var(--hair) solid var(--rule); flex-wrap: wrap; }
.sheet__note { color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-size: .86rem; font-weight: 700; }
.lab { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
@media (max-width: 980px) { .lab { grid-template-columns: minmax(0, 1fr); } }

.btn {
  background: var(--sheet); color: var(--ink); border: var(--hair) solid var(--rule-2); border-radius: 0;
  padding: 6px 12px; font-size: .9rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn--ink { background: var(--ink); color: var(--sheet); border-color: var(--ink); }
.btn--ink:hover { background: var(--ink-2); border-color: var(--ink-2); }

/* ---------- kalkulačka ---------- */
.fields { display: grid; gap: 8px; }
.field {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  border: var(--hair) solid var(--rule); border-radius: 0; padding: 8px 10px 8px 8px; background: var(--sheet);
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}
.field__sym {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 0;
  font-family: var(--f-num); font-weight: 700; font-size: 1.5rem; color: var(--qc); border: var(--hair) solid var(--rule-2); background: var(--sheet);
}
.field.is-input { border-color: var(--ink); }
.field.is-input .field__sym { background: var(--qc); border-color: var(--qc); color: var(--on-q); }
.field.is-output { background: var(--qt); border-color: transparent; }
.field.is-output .field__sym { border-color: var(--qc); }
.field.is-error { border-color: var(--bad); background: var(--sheet); }
.field__main { min-width: 0; }
.field__name { font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; }
.field__q { white-space: nowrap; }
.badge { font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); line-height: 1.3; padding-top: 2px; }
.field.is-input .badge { color: var(--ink); }
.field.is-output .badge { color: var(--qc); }
.field.is-error .badge { color: var(--bad); }
.field__input {
  width: 100%; font-family: var(--f-num); font-size: 1.4rem; font-variant-numeric: tabular-nums; font-weight: 600;
  color: var(--ink); background: transparent; border: 0; padding: 0; min-width: 0; line-height: 1.3;
}
.field__input::placeholder { color: var(--muted); font-family: var(--f-ui); font-size: .95rem; font-weight: 400; }
.field__input:focus { outline: none; }
.field:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); }
.field.is-output .field__input { color: var(--qc); }
.field__err { color: var(--bad); font-size: .82rem; }
.field__err:empty { display: none; }
.units { display: inline-flex; border: var(--hair) solid var(--rule-2); border-radius: 0; background: var(--sheet); padding: 2px; gap: 2px; }
.unit {
  font-size: 1rem; font-weight: 700; letter-spacing: .02em; color: var(--muted); background: transparent; border: 0;
  border-radius: 0; min-width: 44px; min-height: 36px; padding: 2px 8px 0; cursor: pointer; white-space: nowrap;
}
.unit:hover { color: var(--ink); background: var(--sheet-2); }
.unit.is-on { background: var(--qc); color: var(--on-q); }
.status { min-height: 1.5em; margin: 14px 0 10px; font-size: .92rem; color: var(--muted); }
.status.is-error { color: var(--bad); }
@media (max-width: 520px) {
  .field { grid-template-columns: 40px minmax(0, 1fr); gap: 6px 10px; }
  .field__sym { width: 40px; height: 40px; font-size: 1.3rem; }
  .field .units { grid-column: 2; justify-self: start; }
  .unit { min-width: 54px; min-height: 38px; }
}

.results { display: grid; gap: 10px; }
.result { border: var(--hair) solid var(--rule); border-radius: 0; padding: 14px 16px; background: var(--sheet); }
.result.is-primary { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.result__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.result__val { display: flex; align-items: center; gap: 10px; font-family: var(--f-num); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.result__val .sym { font-size: 1rem; width: 1.8em; height: 1.8em; }
.result__val .v { color: var(--qc); }
.result__formula { font-family: var(--f-num); font-weight: 700; padding: 3px 10px; border: var(--hair) solid var(--ink); border-radius: 0; white-space: nowrap; font-size: 1rem; }
.result__why { margin: 10px 0 8px; color: var(--ink-2); font-size: .94rem; max-width: 68ch; }
details.fold { margin-top: 8px; }
details.fold > summary { cursor: pointer; color: var(--muted); font-size: .9rem; font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .2s var(--ease-out); }
details.fold[open] > summary::before { transform: rotate(45deg); }
details.fold > summary:hover { color: var(--ink); }

.steps { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: st; display: grid; gap: 5px; font-variant-numeric: tabular-nums; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 1.7em minmax(0, 1fr); gap: 10px; align-items: baseline; overflow-wrap: anywhere; }
.steps li::before { content: counter(st); font-family: var(--f-num); font-size: .78rem; font-weight: 700; color: var(--muted); border: var(--hair) solid var(--rule-2); border-radius: 0; text-align: center; line-height: 1.55; }
.steps li.is-final { font-weight: 700; }
.steps li.is-hidden { display: none; }
.stepper { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.stepper span { color: var(--muted); font-size: .86rem; font-family: var(--f-num); }

/* ---------- kruh ---------- */
.wheel { max-width: 560px; margin: 0 auto; }
html[data-profile="teacher"] .wheel { max-width: 640px; }
.wheel svg { width: 100%; height: auto; display: block; overflow: visible; }
.wheel .seg { cursor: pointer; }
.wheel .seg path.bg { transition: opacity .25s var(--ease-out), filter .15s; }
.wheel .seg:hover path.bg { filter: brightness(1.05) saturate(1.1); }
.wheel .seg:focus { outline: none; }
.wheel .seg:focus-visible path.bg { stroke: var(--focus); stroke-width: 8; }
.wheel.has-sel .seg:not(.is-used) path.bg { opacity: .42; }
.wheel .ring { fill: none; stroke: #15171a; stroke-width: 0; opacity: 0; transition: opacity .25s var(--ease-out); pointer-events: none; }
.wheel .ring.is-used { stroke-width: 4; opacity: 1; }
.wheel .ring.is-primary { stroke-width: 9; opacity: 1; }
.wheel .hl { fill: none; stroke: #15171a; opacity: 0; pointer-events: none; transition: opacity .25s; }
.wheel .hl.is-dst { opacity: 1; stroke-width: 8; }
.wheel .hl.is-src { opacity: 1; stroke-width: 6; stroke-dasharray: 16 12; animation: march 1.2s linear infinite; }
@keyframes march { to { stroke-dashoffset: -28; } }
.wheel-legend { display: flex; justify-content: center; gap: 18px; margin-top: 12px; color: var(--muted); font-size: .85rem; flex-wrap: wrap; }
.wheel-legend span { display: inline-flex; align-items: center; gap: 8px; }
.lg { display: inline-block; width: 26px; height: 0; border-top: 3px solid var(--ink); }
.lg--src { border-top-style: dashed; }
.wheel-caption { text-align: center; min-height: 3em; margin: 10px auto 4px; font-size: .95rem; max-width: 52ch; color: var(--ink-2); }
.wheel-caption b { color: var(--ink); font-family: var(--f-num); font-size: 1.08rem; }
.howto { margin-top: 12px; border-top: var(--hair) solid var(--rule); padding-top: 12px; }
.howto > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 10px; }
.howto > summary::-webkit-details-marker { display: none; }
.howto > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .2s var(--ease-out); }
.howto[open] > summary::before { transform: rotate(45deg); }
.howto ol { margin: 10px 0 14px; padding-left: 1.3em; }
.howto li { padding: 1px 0; }
.pairs { width: 100%; border-collapse: collapse; font-size: .93rem; font-variant-numeric: tabular-nums; }
.pairs caption { text-align: left; color: var(--muted); font-size: .86rem; padding-bottom: 6px; }
.pairs th { text-align: left; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-size: .82rem; padding: 4px 8px; border-bottom: var(--hair) solid var(--ink); }
.pairs td { padding: 7px 8px; border-bottom: var(--hair) solid var(--rule); }
.pairs tbody tr { cursor: pointer; }
.pairs tbody tr:hover { background: var(--sheet-2); }
.pairs tr.is-current { background: var(--sheet-2); }
.pairs tr.is-current td:first-child { box-shadow: inset 2px 0 0 var(--ink); }
.pairs td:first-child { white-space: nowrap; font-weight: 700; }
.pairs .sym { font-size: .8rem; }

/* ---------- grafy ---------- */
.sliders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; margin-bottom: 18px; }
@media (max-width: 720px) { .sliders { grid-template-columns: minmax(0, 1fr); } }
.slider { display: grid; gap: 6px; min-width: 0; }
.slider__lab { font-size: .9rem; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }
.slider__lab .sym { font-size: .8rem; }
.slider output { margin-left: auto; color: var(--ink); font-family: var(--f-num); font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--rule-2); }
input[type="range"]::-moz-range-track { height: 2px; background: var(--rule-2); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -9px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--ink); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--ink); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 35%, transparent); }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .chart-grid { grid-template-columns: minmax(0, 1fr); } }
.chart { margin: 0; border: var(--hair) solid var(--rule); border-radius: 0; padding: 12px 12px 4px; min-width: 0; }
.chart figcaption { display: grid; gap: 2px; margin-bottom: 4px; }
.chart figcaption b { font-family: var(--f-ui); font-size: .98rem; font-weight: 700; }
.chart figcaption span { font-size: .86rem; color: var(--muted); }
.chart svg { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--f-num); }
.chart .ax { stroke: var(--ink); stroke-width: 1.4; }
.chart .gr { stroke: var(--grid); stroke-width: 1; }
.chart .axlab { fill: var(--ink); font-weight: 600; font-size: 12px; font-family: var(--f-ui); }
.chart .line { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.chart .line.alt { stroke-width: 1.4; stroke-dasharray: 6 5; }
.chart .guide { stroke: var(--axis); stroke-dasharray: 3 4; }
.chart .pt { stroke: var(--sheet); stroke-width: 3; }
.chart .ptlab { fill: var(--ink); font-weight: 700; font-size: 12px; paint-order: stroke; stroke: var(--sheet); stroke-width: 4px; stroke-linejoin: round; }
.chart .serlab { font-size: 11px; font-weight: 700; paint-order: stroke; stroke: var(--sheet); stroke-width: 4px; stroke-linejoin: round; }

/* ---------- príklady zapojení ---------- */
.section-head { display: grid; gap: 6px; padding: 8px 0 14px; border-bottom: var(--frame) solid var(--ink); margin-bottom: var(--gap); }
.section-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.section-head p { color: var(--muted); max-width: 72ch; font-size: .95rem; }
.circuits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
@media (max-width: 980px) { .circuits { grid-template-columns: minmax(0, 1fr); } }
html[data-profile="maker"] #c-led { order: 1; }
html[data-profile="maker"] #c-res { order: 2; }
html[data-profile="maker"] #c-usb { order: 3; }
html[data-profile="maker"] #c-mains { order: 4; }
html[data-profile="maker"] #c-ser { order: 5; }
html[data-profile="maker"] #c-par { order: 6; }
.circuit { display: flex; flex-direction: column; gap: 14px; }
.circuit .sheet__head { margin-bottom: 0; }
.circuit__task { color: var(--ink-2); font-size: .95rem; max-width: 68ch; }
.circuit__svg {
  border: var(--hair) solid var(--rule); border-radius: 0; padding: 6px; background: var(--sheet-2);
}
.circuit__svg svg { width: 100%; height: auto; display: block; }
.circuit__controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 22px; }
.circuit__controls .slider__lab { font-size: .88rem; }
.circuit__controls select {
  font: inherit; font-size: .92rem; color: var(--ink); background: var(--sheet); border: var(--hair) solid var(--rule-2);
  border-radius: 0; padding: 7px 8px; width: 100%; min-height: 38px;
}
.formula-box { display: grid; grid-template-columns: auto minmax(0, 1fr); border: var(--hair) solid var(--ink); border-radius: 0; }
.formula-box__f { display: grid; align-content: center; gap: 2px; padding: 10px 14px; border-right: var(--hair) solid var(--ink); background: var(--qt); }
.formula-box__f small { font-family: var(--f-label); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--qc); }
.formula-box__f b { font-family: var(--f-num); font-size: 1.15rem; white-space: nowrap; }
.formula-box__why { padding: 10px 14px; font-size: .92rem; color: var(--ink-2); }
@media (max-width: 520px) {
  .formula-box { grid-template-columns: minmax(0, 1fr); }
  .formula-box__f { border-right: 0; border-bottom: var(--hair) solid var(--ink); }
}
.circuit h4 { margin: 0 0 2px; font-size: .95rem; }
.circuit .steps { font-size: .93rem; }
.circuit .steps b { font-weight: 700; }
.circuit .steps li.is-final { font-weight: 400; }
.verdict { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; font-weight: 600; padding: 10px 12px; border-radius: 0; border: var(--hair) solid currentColor; }
.verdict svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.verdict.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 7%, transparent); }
.verdict.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.verdict.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 7%, transparent); }
.circuit__body { display: flex; flex-direction: column; gap: 14px; }
html[data-profile="maker"] .circuit__body .verdict { order: -1; }
.circuit__foot { display: flex; justify-content: flex-end; margin-top: auto; padding-top: 4px; }

/* schémy */
.sch .w { fill: none; stroke: var(--wire); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sch .flow { fill: none; stroke: var(--flow); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 0.1 18; }
.sch .comp { fill: var(--sheet); stroke: var(--wire); stroke-width: 2.2; stroke-linejoin: round; }
.sch .solid { fill: var(--wire); }
.sch .thin { fill: none; stroke: var(--wire); stroke-width: 1.5; stroke-linecap: round; }
.sch text { fill: var(--ink); font-size: 12px; font-family: var(--f-ui); }
.sch .lab { font-weight: 700; font-size: 13px; }
.sch .val { font-variant-numeric: tabular-nums; font-size: 12px; fill: var(--muted); font-family: var(--f-num); }
.sch .val.strong { fill: var(--ink); font-weight: 700; }
.sch .pol { font-weight: 800; font-size: 14px; }
@media (max-width: 520px) {
  .sch text { font-size: 14px; } .sch .lab { font-size: 15px; } .sch .val { font-size: 13.5px; }
}

.foot { color: var(--muted); font-size: .86rem; padding: 18px 0 30px; border-top: var(--hair) solid var(--rule); }

/* ---------- popisové pole obvodu (podpis stránky) ---------- */
.tblock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bar); color: var(--bar-ink); border-top: var(--hair) solid var(--bar-rule); }
.tblock__in { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; min-height: 60px; }
.tblock__in { border-left: var(--hair) solid var(--bar-rule); border-right: var(--hair) solid var(--bar-rule); }
.tblock__name { display: grid; align-content: center; gap: 1px; text-decoration: none; padding: 6px 16px; border-right: var(--hair) solid var(--bar-rule); min-width: 0; }
.tblock__name:hover .tblock__formula { text-decoration: underline; text-underline-offset: 4px; }
.tblock__lab { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--bar-muted); }
.tblock__formula { font-family: var(--f-num); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.tblock__cells { display: grid; grid-template-columns: repeat(4, minmax(118px, auto)); margin: 0; }
.tbc { display: grid; align-content: center; gap: 1px; padding: 6px 16px; border-right: var(--hair) solid var(--bar-rule); min-width: 0; }
.tbc:last-child { border-right: 0; }
.tbc dt { display: flex; align-items: center; gap: 6px; font-family: var(--f-label); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bar-muted); }
.tbc dt i { width: 9px; height: 9px; border-radius: 2px; background: var(--qc); flex: none; }
.tbc dd { margin: 0; font-family: var(--f-num); font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; display: flex; align-items: baseline; gap: 6px; }
.tbc dd small { font-size: .74rem; font-weight: 600; color: var(--bar-muted); }
.tbc.is-in dt { color: var(--bar-ink); }
.tbc.is-changed dd { animation: tick .9s var(--ease-out); }
@keyframes tick {
  0% { color: var(--qc); transform: translateY(3px); }
  100% { color: inherit; transform: none; }
}
.tblock [data-k="V"] { --qc: #ff7a6e; } .tblock [data-k="I"] { --qc: #7faaf5; }
.tblock [data-k="R"] { --qc: #d3a57c; } .tblock [data-k="P"] { --qc: #f5ae4e; }
@media (max-width: 760px) {
  .tblock__in { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .tblock__in { border: 0; }
  .tblock__name { grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 10px; padding: 5px 10px; border-right: 0; border-bottom: var(--hair) solid var(--bar-rule); }
  .tblock__formula { font-size: .9rem; }
  .tbc__n { display: none; }
  .tblock__cells { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tbc { padding: 6px 8px; }
  .tbc dd { font-size: .95rem; flex-direction: column; gap: 0; }
  body { padding-bottom: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wheel .hl.is-src { animation: none; }
  .tbc.is-changed dd { animation: none; }
  * { transition-duration: 0s !important; }
}
