/* =========================================================
   ELECNora — «Онол ба томьёо» tab (elec/theory.js)
   Colours of the bold words by kind (the owner's choice, 2026-11-21): idea blue · quantity green · formula orange ·
   part purple · key statement a yellow highlight. Circuits: «Өнгөт» colours the wires by role, «Ном» is black on paper.
   ========================================================= */
.th-doc { --th-i: #2a64b8; --th-v: #1f7a4a; --th-f: #b8590f; --th-p: #7b3fb0; --th-mark: #fff0a8; --th-in: #2f6fb3; --th-out: #c55e19; --th-fb: #7b3fb0; --th-pwr: #b03838; --th-gnd: #6b7280;
  --th-paper: var(--surface); --th-line: var(--text); max-width: 1100px; margin: 0 auto; }
@media (prefers-color-scheme: dark) { .th-doc { --th-i: #7fb0f0; --th-v: #5fc995; --th-f: #f0a060; --th-p: #c29af0; --th-mark: #5b4f12; --th-in: #72a9e5; --th-out: #f08f48; --th-fb: #c29af0; --th-pwr: #e57474; --th-gnd: #9aa3ae; } }
:root[data-theme="dark"] .th-doc { --th-i: #7fb0f0; --th-v: #5fc995; --th-f: #f0a060; --th-p: #c29af0; --th-mark: #5b4f12; --th-in: #72a9e5; --th-out: #f08f48; --th-fb: #c29af0; --th-pwr: #e57474; --th-gnd: #9aa3ae; }
:root[data-theme="light"] .th-doc { --th-i: #2a64b8; --th-v: #1f7a4a; --th-f: #b8590f; --th-p: #7b3fb0; --th-mark: #fff0a8; --th-in: #2f6fb3; --th-out: #c55e19; --th-fb: #7b3fb0; --th-pwr: #b03838; --th-gnd: #6b7280; }
.th-doc .ic { width: 1.05em; height: 1.05em; vertical-align: -0.16em; flex: none; }

/* header and chapter navigation */
.th-top { display: grid; gap: 8px; margin-bottom: 14px; }
.th-eyebrow { display: inline-flex; gap: 6px; align-items: center; font: 600 0.78rem/1.2 "JetBrains Mono", ui-monospace, monospace; letter-spacing: 0.04em; color: var(--muted); }
.th-title { margin: 0; font-size: clamp(1.35rem, 2.6vw, 1.8rem); text-wrap: balance; }
.th-nav { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.th-nav .btn { display: inline-flex; gap: 6px; align-items: center; }
.th-chips { display: flex; gap: 6px; }
.th-chip { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font-weight: 700; cursor: pointer; position: relative; }
.th-chip.is-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary, #fff); }
.th-chip.is-read::after { content: ""; position: absolute; right: -2px; top: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--th-v); border: 2px solid var(--surface); }
.th-prog { font-size: 0.85rem; color: var(--muted); }
.th-mode { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-left: auto; }
.th-seg { display: inline-flex; gap: 5px; align-items: center; padding: 7px 11px; min-height: 36px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.85rem; cursor: pointer; }
.th-seg.is-on { background: var(--surface-2, var(--border)); color: var(--text); font-weight: 700; }

/* the card */
.th-stage { transition: opacity 0.16s ease; }
.th-stage.is-fading { opacity: 0; }
.th-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: clamp(16px, 3vw, 30px); }
.th-card-h { display: grid; gap: 6px; padding-bottom: 14px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.th-chno { font: 700 0.75rem/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); }
.th-card-h h2 { margin: 0; font-size: clamp(1.2rem, 2.2vw, 1.5rem); text-wrap: balance; }
.th-chsub { margin: 0; color: var(--muted); }
.th-card-tools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 4px; }
.th-read { display: inline-flex; gap: 6px; align-items: center; font-size: 0.88rem; cursor: pointer; min-height: 36px; }
.th-allsum { margin: 6px 0 0; padding: 12px 14px 12px 34px; display: grid; gap: 6px; border-radius: 12px; background: color-mix(in srgb, var(--th-mark) 55%, transparent); }
.th-allsum a { color: inherit; text-decoration: none; }
.th-allsum a:hover, .th-allsum a:focus-visible { text-decoration: underline; }
.th-card-f { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.th-card-f .btn { display: inline-flex; gap: 6px; align-items: center; }
.th-btn { display: inline-flex; gap: 6px; align-items: center; min-height: 34px; padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer; }
.th-btn[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); }

/* text */
.th-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.th-body > * { min-width: 0; }
@media (max-width: 560px) { .th-fbox .th-ftex { min-width: 0; line-height: 2.2; } }   /* a long derivation wraps at its ⇒ instead of scrolling */
.th-h { margin: 14px 0 0; font-size: 1.08rem; }
.th-p, .th-f, .th-fig, .th-tbl { position: relative; scroll-margin-top: 120px; border-radius: 12px; transition: background 0.4s; }
.th-p.is-flash, .th-f.is-flash, .th-fig.is-flash, .th-tbl.is-flash { background: color-mix(in srgb, var(--th-mark) 60%, transparent); }
.th-p > p { margin: 0; padding-right: 34px; line-height: 1.7; max-width: 78ch; text-align: justify; hyphens: auto; }
.th-k { font-weight: 700; }
.th-k.th-i { color: var(--th-i); } .th-k.th-v { color: var(--th-v); } .th-k.th-f { color: var(--th-f); } .th-k.th-p { color: var(--th-p); }
.th-doc b.th-k.tm-link { border-bottom: 1.5px dotted currentColor; cursor: pointer; }
.th-th { background: var(--th-mark); color: inherit; padding: 0 2px; border-radius: 3px; }
.th-fix { border-bottom: 1.5px dotted var(--muted); position: relative; cursor: help; }
.th-fix:hover::after, .th-fix:focus::after { content: attr(data-th-orig); position: absolute; left: 0; bottom: calc(100% + 4px); z-index: 5; white-space: nowrap; padding: 3px 8px; border-radius: 6px; background: var(--text); color: var(--surface); font-size: 0.78rem; font-weight: 400; }
.th-fix:hover::before, .th-fix:focus::before { content: "Номонд:"; position: absolute; left: 0; bottom: calc(100% + 26px); font-size: 0.7rem; color: var(--muted); white-space: nowrap; }
.th-sumb { position: absolute; top: 0; right: 0; z-index: 2; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--th-f); cursor: pointer; }
.th-sumb:hover, .th-sumb.is-on { background: var(--th-f); color: var(--surface); border-color: var(--th-f); }
.th-sum { position: relative; margin: 10px 0 2px; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--th-f) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--th-f) 40%, transparent); }
.th-sum::before { content: ""; position: absolute; top: -7px; right: 12px; width: 12px; height: 12px; background: inherit; border-left: 1px solid color-mix(in srgb, var(--th-f) 40%, transparent); border-top: 1px solid color-mix(in srgb, var(--th-f) 40%, transparent); transform: rotate(45deg); }
.th-sum-k { display: inline-flex; gap: 5px; align-items: center; font-size: 0.74rem; font-weight: 700; color: var(--th-f); text-transform: uppercase; letter-spacing: 0.05em; }
.th-sum p { margin: 4px 0 0; }

/* formulas */
.th-f { padding-right: 34px; }
.th-fbox { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 1.5px solid color-mix(in srgb, var(--th-f) 45%, var(--border)); border-radius: 14px; background: color-mix(in srgb, var(--th-f) 5%, var(--surface)); overflow-x: auto; }
.th-ftex { flex: 1; min-width: max-content; text-align: center; font: 1.12rem/1.4 "Cambria Math", "Times New Roman", serif; }
.th-fno { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--th-f); color: #fff; font: 700 0.8rem/1.4 "JetBrains Mono", ui-monospace, monospace; }
.th-fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 3px; }
.th-fr > span:first-child { border-bottom: 1.3px solid currentColor; padding: 0 4px 1px; }
.th-fr > span:last-child { padding: 1px 4px 0; }
.th-sq > span { border-top: 1.3px solid currentColor; padding: 0 2px; }
.th-fbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.th-stars { display: inline-flex; gap: 1px; }
.th-stars i { color: var(--border); display: inline-flex; } .th-stars i.on { color: #e0a800; }
.th-stars i.on .ic { fill: currentColor; }
.th-fpanel { margin-top: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2, var(--surface)); }
.th-dsteps, .th-steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.th-use { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.th-use dt { font-weight: 700; color: var(--th-f); }
.th-use dd { margin: 0; }
@media (max-width: 560px) { .th-use { grid-template-columns: 1fr; } .th-use dd { margin-bottom: 6px; } }

/* worked problems */
.th-lvtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.th-lvtab { display: inline-flex; gap: 5px; align-items: center; min-height: 36px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted); font: inherit; font-size: 0.86rem; cursor: pointer; }
.th-lvtab.is-on { color: var(--text); border-color: var(--primary); box-shadow: inset 0 -3px 0 var(--primary); font-weight: 700; }
.th-prob { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 700px) { .th-prob { grid-template-columns: 1fr; } }
.th-prob-fig { border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: var(--surface); }
.th-prob-q p { margin: 0 0 10px; line-height: 1.6; }
.th-ansrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.th-ans { width: 150px; min-height: 40px; padding: 6px 10px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.th-unit { color: var(--muted); font-weight: 700; min-width: 1.5em; }
.th-fb { min-height: 1.4em; margin: 8px 0; }
.th-fb .ok { color: var(--th-v); } .th-fb .bad { color: var(--th-pwr); }
.th-hintline { display: inline; }
.th-ans-line { margin: 8px 0 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* figures */
.th-fig { margin: 6px 0; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--th-paper); }
.th-fig-row { display: grid; grid-template-columns: minmax(0, 7fr) minmax(170px, 3fr); gap: 14px; align-items: start; }
@media (max-width: 760px) { .th-fig-row { grid-template-columns: 1fr; } }
.th-fig-art { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.th-pan { flex: 1 1 220px; min-width: 0; max-width: 420px; display: grid; justify-items: center; gap: 2px; }
.th-pan.is-wide { flex-basis: 100%; max-width: 640px; }
.th-pan svg { width: 100%; height: auto; }
.th-pan-l { font-size: 0.85rem; color: var(--muted); }
.th-fig figcaption { margin-top: 8px; text-align: center; font-size: 0.9rem; color: var(--muted); }
.th-taphint { margin: 4px 0 0; text-align: center; font-size: 0.8rem; color: var(--muted); display: flex; gap: 5px; justify-content: center; align-items: center; }
.th-tools { display: grid; gap: 6px; align-content: start; }
.th-tools-h { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
@media (max-width: 760px) { .th-tools { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } .th-tools-h { grid-column: 1 / -1; } }
.th-tool { display: flex; gap: 8px; align-items: center; min-height: 40px; padding: 6px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 0.86rem; text-align: left; cursor: pointer; }
.th-tool .ic { width: 1.15em; height: 1.15em; color: var(--primary); }
.th-tool:hover { border-color: var(--primary); }
.th-tool[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary, #fff); }
.th-tool[aria-pressed="true"] .ic { color: inherit; }
.th-panel { margin-top: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2, var(--surface)); }
.th-role { position: relative; margin-top: 10px; padding: 12px 40px 12px 14px; border-radius: 12px; border: 1.5px solid var(--th-p); background: color-mix(in srgb, var(--th-p) 7%, var(--surface)); }
.th-role h4 { margin: 0 0 6px; }
.th-role dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; }
.th-role dt { font-weight: 700; color: var(--th-p); } .th-role dd { margin: 0; }
@media (max-width: 560px) { .th-role dl { grid-template-columns: 1fr; } }
.th-x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.th-x:hover { background: var(--border); }
.th-ctl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px 16px; margin-bottom: 10px; }
.th-par label { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 0.86rem; }
.th-par input[type="range"] { grid-column: 1 / -1; width: 100%; min-height: 28px; }
.th-pre { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.th-pre .chip { min-height: 30px; padding: 2px 9px; font-size: 0.78rem; }
.th-read-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.th-read-out div { padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.th-read-out small { display: block; color: var(--muted); font-size: 0.76rem; }
.th-read-out strong { font-variant-numeric: tabular-nums; }
.th-cv { width: 100%; height: 260px; display: block; --lr-in: var(--th-in); --lr-out: var(--th-out); --lr-ok: var(--th-v); --lr-bad: var(--th-pwr); }
.th-scope { height: 240px; }
.th-scopebar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.th-scopebar .chip { display: inline-flex; gap: 5px; align-items: center; }
.th-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 0; font-size: 0.82rem; color: var(--muted); }
.th-key span { display: inline-flex; gap: 6px; align-items: center; }
.th-sw { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
.th-note { margin: 10px 0 0; font-size: 0.9rem; }
.th-chains { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.th-chains li { display: grid; gap: 4px; }
.th-chain { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.th-chain b { padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.th-chain sup { color: var(--th-f); margin-left: 2px; }
.th-chain em { color: var(--muted); display: inline-flex; }
.th-anal { display: grid; gap: 4px 0; margin: 0; }
.th-anal dt { font-weight: 700; margin-top: 6px; } .th-anal dd { margin: 0; }
.th-flowbar { margin-bottom: 10px; } .th-flowbar .th-mode { margin-left: 0; }
.th-flowtext p { margin: 0 0 6px; }
/* mind maps: a concept network; each relation has its colour and symbol */
.th-mindbox { display: grid; gap: 8px; }
.th-r-cause { --rc: var(--th-f); } .th-r-from { --rc: var(--th-i); } .th-r-special { --rc: var(--th-p); } .th-r-part { --rc: var(--th-v); }
.th-r-vs { --rc: #d9485f; } .th-r-use { --rc: #0f9b8e; }
.th-ma-cause { fill: var(--th-f); } .th-ma-from { fill: var(--th-i); } .th-ma-special { fill: var(--th-p); } .th-ma-part { fill: var(--th-v); } .th-ma-vs { fill: #d9485f; } .th-ma-use { fill: #0f9b8e; }
.th-mind-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.th-mind-zoom { display: inline-flex; gap: 6px; } .th-mind-zoom .chip { min-width: 44px; justify-content: center; }
.th-mind-wrap { border: 1px solid var(--border); border-radius: 14px; background: var(--th-paper, var(--surface)); overflow: hidden; touch-action: pan-y; }
.th-mind-wrap.is-zoomed { touch-action: none; cursor: grab; }
.th-mind { width: 100%; height: auto; display: block; user-select: none; -webkit-user-select: none; }
.th-mn { cursor: pointer; transition: opacity .35s; }
.th-mn rect { fill: var(--surface); stroke: var(--border); stroke-width: 1.6; }
.th-mn text { fill: var(--text); font: 600 12.5px Inter, system-ui, sans-serif; pointer-events: none; }
.th-mn .th-mn-s { fill: var(--muted); font-weight: 400; font-size: 10.5px; }
.th-mn-c rect { fill: var(--primary); stroke: var(--primary); } .th-mn-c text { fill: var(--on-primary, #fff); font-size: 13.5px; }
.th-mn-i rect { stroke: var(--th-i); } .th-mn-v rect { stroke: var(--th-v); } .th-mn-f rect { stroke: var(--th-f); } .th-mn-p rect { stroke: var(--th-p); }
.th-mn:hover rect, .th-mn:focus-visible rect, .th-mn.is-on rect { stroke-width: 2.8; }
.th-mn:focus-visible { outline: none; } .th-me:focus-visible { outline: none; }
.th-me { cursor: pointer; transition: opacity .35s; }
.th-me-l { stroke: var(--rc); stroke-width: 1.6; fill: none; opacity: .85; }
.th-me-hit { stroke: transparent; stroke-width: 14; fill: none; }
.th-me-dot { fill: var(--surface); stroke: var(--rc); stroke-width: 1.6; }
.th-me-s { fill: var(--rc); font: 700 13px "Cambria Math", "Segoe UI Symbol", system-ui, sans-serif; pointer-events: none; }
.th-me:hover .th-me-dot, .th-me:focus-visible .th-me-dot, .th-me.is-on .th-me-dot { fill: color-mix(in srgb, var(--rc) 18%, var(--surface)); stroke-width: 2.4; }
.th-me.is-on .th-me-l { stroke-width: 2.6; opacity: 1; }
.th-mind.is-focus .th-mn:not(.is-on), .th-mind.is-focus .th-me:not(.is-on) { opacity: .16; }
.th-mn.is-hid, .th-me.is-hid { opacity: 0; pointer-events: none; }
.th-mn .sk-sub { font-size: .78em; }
.th-mind-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; font-size: .86rem; color: var(--muted); }
.th-mind-legend b { color: var(--rc); font-size: 1.05rem; margin-right: 2px; }
.th-mind-tip { margin: 0; font-size: .82rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.th-mind-card h4 b, .th-mind-links > li > b { color: var(--rc); }
.th-mind-lh { margin: 8px 0 4px; font-weight: 700; font-size: .86rem; color: var(--muted); }
.th-mind-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.th-mind-links > li { display: grid; grid-template-columns: 22px 1fr; gap: 6px; }
.th-mind-links > li > b { font-size: 1.1rem; text-align: center; }
.th-mind-links small { color: var(--muted); }
.th-chmind { position: relative; display: grid; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .th-mn, .th-me { transition: none; } }
.th-inside { overflow-x: auto; }

/* the schematic kit */
.sk { overflow: visible; }
.sk-w { fill: none; stroke: var(--th-line); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sk-p { fill: none; stroke: var(--th-line); stroke-width: 1.8; stroke-linejoin: round; }
.sk-op { fill: var(--th-paper); }
.sk-src { fill: var(--th-paper); }
.sk-plate { stroke-width: 2.6; }
.sk-t { fill: var(--th-line); font: italic 13px "Times New Roman", serif; }
.sk-sign { font: 700 14px Inter, system-ui, sans-serif; font-style: normal; }
.sk-sub { font-size: 9px; }
.sk-dot { fill: var(--th-line); }
.sk-term { fill: var(--th-paper); stroke: var(--th-line); stroke-width: 1.6; }
.sk-arw { fill: var(--th-line); stroke: none; }
.sk-hit { fill: transparent; stroke: none; }
.sk-el { cursor: pointer; outline: none; }
.sk-el:focus-visible .sk-p, .sk-el:hover .sk-p { stroke-width: 2.6; }
.sk-el.is-hi .sk-p, .sk-el.is-hi .sk-w { stroke: var(--th-p); stroke-width: 3; }
.sk-el.is-hi .sk-t { fill: var(--th-p); }
.sk-ci { font: italic 13px "Times New Roman", serif; }
.th-color .sk-w.w-in { stroke: var(--th-in); } .th-color .sk-w.w-out { stroke: var(--th-out); } .th-color .sk-w.w-fb { stroke: var(--th-fb); }
.th-color .sk-w.sk-pwr { stroke: var(--th-pwr); } .th-color .sk-w.sk-g, .th-color .sk-w.w-g { stroke: var(--th-gnd); }
.th-color .sk-cur .sk-arw, .th-color .sk-ci { fill: var(--th-v); }
.th-color .sk-el .sk-op { fill: color-mix(in srgb, var(--primary) 8%, var(--th-paper)); }
.th-color .sk-v .sk-va { stroke: var(--th-out); } .th-color .sk-v .sk-arw.sk-va { fill: var(--th-out); stroke: none; }
.th-color .sk-wave-in { stroke: var(--th-in); } .th-color .sk-wave-out { stroke: var(--th-out); }
.sk-pinno { font: 600 10px Inter, system-ui, sans-serif; fill: var(--muted); }
.sk-wave-x { stroke-dasharray: 5 3; } .th-color .sk-wave-x { stroke: var(--th-p); }
.sk-wave-in, .sk-wave-out, .sk-wave-x { fill: none; stroke: var(--th-line); stroke-width: 2; }
.th-book .sk-wave-out { stroke-dasharray: 0; }
.sk-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; fill: none; }
.sk-axis { stroke: var(--th-line); stroke-width: 1.2; fill: none; }
.th-book .sk-grid { stroke: color-mix(in srgb, var(--th-line) 35%, transparent); }
/* «Гүйдлийн урсгал»: the current arrows blink in their direction; electron mode turns them round */
.th-fig.is-flow .sk-cur .sk-arw { animation: th-blink 0.9s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.th-elec .sk-cur .sk-arw { transform-box: fill-box; transform-origin: center; rotate: 180deg; }
.th-elec .th-fig.is-flow .sk-cur .sk-arw { fill: var(--th-in); }
@keyframes th-blink { 0%, 100% { opacity: 0.25; scale: 0.85; } 50% { opacity: 1; scale: 1.25; } }
@media (prefers-reduced-motion: reduce) { .th-fig.is-flow .sk-cur .sk-arw { animation: none; } .th-stage { transition: none; } }

/* the card picker: five cards fanned like the deck */
.th-fan { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); background: color-mix(in srgb, #000 45%, transparent); }
.th-fan[hidden] { display: none; }
.th-fan-in { position: relative; width: min(980px, 100%); padding: 22px 18px 26px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.th-fan-h { margin: 0 0 14px; font-weight: 800; font-size: 1.1rem; }
.th-fan-row { display: flex; justify-content: center; gap: 0; padding: 20px 0 6px; overflow-x: auto; }
.th-fcard { --i: 0; position: relative; flex: 0 0 168px; height: 236px; margin: 0 -14px; padding: 34px 14px 14px; display: grid; align-content: start; justify-items: center; gap: 6px; text-align: center; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
  rotate: calc(var(--i) * 5deg); translate: 0 calc(var(--i) * var(--i) * 4px); box-shadow: 0 6px 18px rgb(0 0 0 / 0.12); transition: translate 0.18s, rotate 0.18s, z-index 0s; }
.th-fcard:hover, .th-fcard:focus-visible { translate: 0 -18px; rotate: 0deg; z-index: 2; border-color: var(--primary); }
.th-fcard.is-now { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary), 0 6px 18px rgb(0 0 0 / 0.12); }
.th-fc-corner { position: absolute; top: 8px; left: 10px; display: grid; justify-items: center; font-weight: 800; color: var(--primary); }
.th-fc-ico .ic { width: 34px; height: 34px; color: var(--primary); }
.th-fc-t { font-size: 0.95rem; line-height: 1.25; }
.th-fcard small { color: var(--muted); font-size: 0.75rem; line-height: 1.3; }
.th-fc-tick { position: absolute; top: 8px; right: 10px; color: var(--th-v); }
@media (max-width: 640px) { .th-fan-row { justify-content: flex-start; padding-left: 14px; } .th-fcard { flex-basis: 140px; height: 210px; rotate: 0deg; translate: none; margin: 0 4px; } }
.th-tbl table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.th-tbl th, .th-tbl td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; }
.th-tbl th { background: var(--surface-2, var(--surface)); }
.th-scroll { overflow-x: auto; }
.th-cap { margin: 0 0 6px; font-weight: 700; padding-right: 34px; }
@media (max-width: 560px) { .th-p > p { text-align: left; } .th-nav .th-mode { margin-left: 0; } .th-fbox { padding: 12px; } .th-ftex { font-size: 1rem; } }
