/* Палитра — по цветовой логике ECAM:
   зелёный = выполнено/норма, янтарный = требует внимания, циан = действие, мадженда = комментарий ИИ на проверку */
:root {
  --panel: #dde2e7;
  --surface: #f5f7f9;
  --ink: #17222e;
  --muted: #566472;
  --line: #b9c2cb;
  --key: #2a333d;
  --key-ink: #e9eef3;
  --green: #138a4e;
  --amber: #b9640c;
  --cyan: #0b7699;
  --magenta: #9c2f88;
  --red: #b5322a;
  --radius: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --panel: #1d242c; --surface: #262f38; --ink: #e6ecf1; --muted: #9aa8b5; --line: #3a4652;
    --key: #11171d; --key-ink: #d9e2ea;
    --green: #39d185; --amber: #f2a33a; --cyan: #3cc3ea; --magenta: #e271d1; --red: #f0705f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --panel: #1d242c; --surface: #262f38; --ink: #e6ecf1; --muted: #9aa8b5; --line: #3a4652;
  --key: #11171d; --key-ink: #d9e2ea;
  --green: #39d185; --amber: #f2a33a; --cyan: #3cc3ea; --magenta: #e271d1; --red: #f0705f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--panel); color: var(--ink);
  font: 16px/1.5 "Golos Text", system-ui, sans-serif;
}
h1, h2, h3, .keys button, .num { font-family: "PT Sans Narrow", "Golos Text", sans-serif; }
h1 { font-size: 1.9rem; line-height: 1.15; margin: 0 0 .4rem; font-weight: 700; }
h2 { font-size: 1.35rem; margin: 1.6rem 0 .6rem; }
h3 { font-size: 1.1rem; margin: 1.2rem 0 .4rem; }
a { color: var(--cyan); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--cyan); outline-offset: 2px;
}
small, .muted { color: var(--muted); }

/* Шапка с клавишами в духе панели ECAM */
header.top {
  position: sticky; top: 0; z-index: 5; background: var(--key);
  padding: .5rem 16px .55rem; display: flex; flex-direction: column; gap: .45rem;
}
.brand { color: var(--key-ink); display: flex; align-items: baseline; gap: .75rem; }
.brand b { font-family: "PT Sans Narrow", sans-serif; font-size: 1.15rem; letter-spacing: .02em; }
.brand span { color: #8d9aa7; font-size: .85rem; }
.brand .theme { margin-left: auto; background: none; border: 1px solid #45515d; color: var(--key-ink);
  border-radius: 4px; font-size: .8rem; padding: .15rem .5rem; cursor: pointer; }
.keys { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.keys::-webkit-scrollbar { display: none; }
.keys button {
  flex: 0 0 auto; min-width: 5.6rem; padding: .55rem .7rem .4rem; cursor: pointer;
  background: #3a444f; color: var(--key-ink); border: 1px solid #55616d; border-radius: 3px;
  font-size: 1rem; letter-spacing: .03em; position: relative;
}
.keys button::before { /* «лампа» над надписью клавиши */
  content: ""; position: absolute; left: 22%; right: 22%; top: 4px; height: 3px; border-radius: 2px;
  background: #4b5560;
}
.keys button[aria-current="page"] { background: #46515d; }
.keys button[aria-current="page"]::before { background: #39d185; box-shadow: 0 0 6px #39d18599; }

main { max-width: 1100px; margin: 0 auto; padding: 1.2rem 16px 4rem; }
.lead { color: var(--muted); max-width: 62ch; margin: 0 0 1.2rem; }

/* Обзор */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.stat .num { font-size: 2rem; line-height: 1; font-weight: 700; }
.stat .bar { height: 6px; background: var(--line); border-radius: 3px; margin: .55rem 0 .3rem; overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
.bar .g { background: var(--green); } .bar .a { background: var(--amber); } .bar .m { background: var(--magenta); }
.steps { list-style: none; padding: 0; margin: 0; border-left: 3px solid var(--line); }
.steps li { padding: .35rem 0 .35rem 1rem; position: relative; }
.steps li::before { content: ""; position: absolute; left: -8px; top: .75rem; width: 13px; height: 13px; border-radius: 50%;
  background: var(--panel); border: 3px solid var(--line); }
.steps li.now::before { border-color: var(--amber); background: var(--amber); }
.steps li.done::before { border-color: var(--green); background: var(--green); }
.log { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.log li { padding: .3rem 0; border-bottom: 1px solid var(--line); display: flex; gap: .8rem; }
.log time { color: var(--muted); white-space: nowrap; }

/* Библиотека */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1rem; }
input[type=search], input[type=text] {
  flex: 1 1 260px; font: inherit; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
}
button.act, label.act {
  font: inherit; padding: .55rem 1rem; border-radius: var(--radius); border: 1px solid var(--cyan);
  background: var(--cyan); color: #fff; cursor: pointer;
}
button.ghost { font: inherit; padding: .35rem .7rem; border-radius: var(--radius); border: 1px solid var(--line);
  background: transparent; color: var(--ink); cursor: pointer; }
details.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
details.sec > summary { cursor: pointer; padding: .7rem 1rem; display: flex; justify-content: space-between; gap: 1rem; list-style: none; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary b { font-family: "PT Sans Narrow", sans-serif; font-size: 1.12rem; }
details.sec[open] > summary { border-bottom: 1px solid var(--line); }
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: .55rem 1rem; border-bottom: 1px solid var(--line); }
.files li:last-child { border-bottom: 0; }
.files .fname { overflow-wrap: anywhere; }
.files .meta { font-size: .82rem; color: var(--muted); }
.files .do { display: flex; gap: .4rem; align-items: center; grid-row: span 2; }
.files .do a { font-size: .9rem; text-decoration: none; border: 1px solid var(--line); border-radius: 4px; padding: .2rem .55rem; }
.folder { padding: .45rem 1rem .2rem; font-size: .85rem; color: var(--muted); font-weight: 600; }
.notext { color: var(--amber); }
.need { background: var(--surface); border: 1px solid var(--amber); border-left-width: 5px; border-radius: var(--radius);
  padding: .6rem 1rem; margin: 1.5rem 0; }
.need li { margin: .2rem 0; }

/* Поиск */
.hit { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 8px; }
.hit .where { font-size: .82rem; color: var(--muted); }
.hit mark { background: color-mix(in srgb, var(--amber) 30%, transparent); color: inherit; border-radius: 2px; }

/* Markdown */
.md { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem 1.2rem 1.2rem; }
.md table { border-collapse: collapse; width: 100%; font-size: .92rem; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: .35rem .5rem; text-align: left; vertical-align: top; }
.md th { background: var(--panel); }
.md code { background: var(--panel); padding: .05rem .3rem; border-radius: 3px; font-size: .9em; }
.md li { margin: .2rem 0; }
.md ul { padding-left: 1.3rem; }
button.st { font-size: 1.05rem; background: none; border: 1px solid transparent; border-radius: 4px; padding: 0 .15rem;
  cursor: pointer; line-height: 1.2; }
button.st:hover { border-color: var(--line); }
.legend { font-size: .85rem; color: var(--muted); margin: .4rem 0 1rem; }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: .8rem; }
.subtabs button { font: inherit; font-size: .92rem; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; }
.subtabs button[aria-pressed="true"] { border-color: var(--cyan); color: var(--cyan); font-weight: 600; }

/* Загрузка */
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 1.6rem; text-align: center; background: var(--surface); }
.drop.over { border-color: var(--cyan); }
.uplist { list-style: none; padding: 0; }
.uplist li { padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.ok { color: var(--green); } .err { color: var(--red); }
progress { width: 100%; height: 8px; }
pre.box { background: var(--key); color: var(--key-ink); padding: .8rem 1rem; border-radius: var(--radius);
  overflow-x: auto; font-size: .82rem; white-space: pre-wrap; }

@media (max-width: 600px) {
  h1 { font-size: 1.55rem; }
  .files li { grid-template-columns: 1fr; }
  .files .do { grid-row: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

main:focus { outline: none; }

/* Библиотека: разделы → полки → папки */
.gnav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 1rem; align-items: center; }
.gnav a { display: inline-flex; gap: .45rem; align-items: baseline; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--cyan); border-radius: 4px; padding: .35rem .7rem; }
.gnav a b { font-family: "PT Sans Narrow", sans-serif; font-size: 1.02rem; }
.gnav a span { color: var(--muted); font-size: .85rem; }
.gnav a.warn { border-left-color: var(--amber); }
.gnav .gtotal { color: var(--muted); font-size: .85rem; margin-left: .3rem; }
section.grp { margin-top: 1.4rem; scroll-margin-top: 7rem; }
section.grp h2 { margin: 0 0 .1rem; padding-bottom: .25rem; border-bottom: 2px solid var(--key); }
section.grp h2 small { color: var(--muted); font-weight: 400; font-size: .95rem; }
.ghint { margin: .2rem 0 .6rem; font-size: .9rem; }
details.sec > summary > span { display: flex; flex-direction: column; }
details.sec > summary .note { color: var(--muted); font-size: .82rem; }
details.sec > summary .cnt { white-space: nowrap; }
details.fold { border-top: 1px solid var(--line); }
details.fold > summary { cursor: pointer; padding: .5rem 1rem .5rem 1.6rem; display: flex; justify-content: space-between; gap: 1rem;
  font-size: .93rem; font-weight: 600; color: var(--ink); position: relative; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸"; position: absolute; left: .8rem; color: var(--cyan); }
details.fold[open] > summary::before { content: "▾"; }
details.fold > summary small { color: var(--muted); font-weight: 400; }
details.fold .files li { padding-left: 1.6rem; }
.tag { display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--amber);
  border: 1px solid var(--amber); border-radius: 3px; padding: 0 .3rem; vertical-align: 1px; }
.need { scroll-margin-top: 7rem; }
@media (max-width: 600px) {
  details.sec > summary { flex-direction: column; gap: .15rem; }
  details.fold > summary { padding-right: .8rem; }
}

/* Загрузка частями */
.ups { list-style: none; padding: 0; margin: .8rem 0 0; }
.ups li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 8px; }
.uphead { display: flex; justify-content: space-between; gap: .8rem; align-items: center; flex-wrap: wrap; }
.uphead .btns { display: flex; gap: .4rem; }
.upbar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; margin: .55rem 0 .35rem; }
.upbar i { display: block; height: 100%; width: 0; background: var(--cyan); transition: width .3s; }
.upinfo { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .88rem; color: var(--muted); }
.upinfo .pct { font-family: "PT Sans Narrow", sans-serif; font-size: 1.05rem; color: var(--ink); font-weight: 700; }
.upinfo .st.ok { color: var(--green); } .upinfo .st.err { color: var(--red); } .upinfo .st.warn { color: var(--amber); }
a.act { display: inline-block; text-decoration: none; padding: .55rem 1rem; border-radius: var(--radius); background: var(--cyan); color: #fff; margin: .2rem .4rem .3rem 0; }
a.ghost-l { display: inline-block; text-decoration: none; padding: .5rem .9rem; border-radius: var(--radius); border: 1px solid var(--line); color: var(--ink); }
.store { display: grid; gap: 8px; margin: .8rem 0; }
.store > div { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--cyan); border-radius: var(--radius); padding: .6rem 1rem; display: flex; flex-direction: column; gap: .15rem; }
.store > div:last-child { border-left-color: var(--amber); }
.store span { font-size: .92rem; color: var(--muted); }

/* Статус загрузки на клавише — видно с любой вкладки */
.keys button .kst { margin-left: .35rem; font-size: .85rem; font-weight: 700; }
.keys button .kst:empty { display: none; }
.keys button[data-st="run"]::before { background: #3cc3ea; box-shadow: 0 0 6px #3cc3eaaa; animation: lamp 1.2s ease-in-out infinite; }
.keys button[data-st="run"] .kst { color: #3cc3ea; }
.keys button[data-st="pause"]::before { background: #f2a33a; }
.keys button[data-st="pause"] .kst { color: #f2a33a; }
.keys button[data-st="err"]::before { background: #f0705f; box-shadow: 0 0 6px #f0705faa; }
.keys button[data-st="err"] .kst { color: #f0705f; }
.keys button[data-st="done"]::before { background: #39d185; }
.keys button[data-st="done"] .kst { color: #39d185; }
@keyframes lamp { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .keys button[data-st="run"]::before { animation: none; } }
.brand .upst { margin-left: auto; text-decoration: none; font-size: .82rem; font-weight: 700; padding: .12rem .55rem;
  border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.brand .upst + .theme { margin-left: .5rem; }
.brand .upst[data-st="run"] { color: #3cc3ea; } .brand .upst[data-st="pause"] { color: #f2a33a; }
.brand .upst[data-st="err"] { color: #f0705f; } .brand .upst[data-st="done"] { color: #39d185; }
.brand .upst[hidden] { display: none; }
.brand b { white-space: nowrap; }
@media (max-width: 480px) { .brand > span { display: none; } }
button.ib { font-size: 1.25rem; line-height: 1; width: 2.6rem; height: 2.6rem; display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--radius); background: transparent; cursor: pointer; padding: 0; }
button.ib:hover { border-color: var(--cyan); }
.uphead { flex-wrap: nowrap; } .uphead .fname { min-width: 0; overflow-wrap: anywhere; }
/* Карточка загрузки постоянной высоты: строка цифр + строка статуса, всё в одну линию с многоточием */
.upinfo { display: grid; grid-template-columns: auto auto minmax(0, 1fr); grid-template-rows: 1.5em 1.5em; column-gap: 1rem; row-gap: .1rem; align-items: center; }
.upinfo > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upinfo .st { grid-column: 1 / -1; grid-row: 2; }
.uphead { min-height: 2.6rem; }
button.ib { border: 0; background: transparent; }
button.ib:hover { border: 0; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.ydl { list-style: none; padding: 0; margin: .4rem 0 1rem; }
.ydl li { display: grid; grid-template-columns: 1.6rem 1fr; column-gap: .4rem; padding: .45rem .8rem; background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: var(--radius); margin-bottom: 6px; }
.ydl li[data-st="ok"] { border-left-color: var(--green); } .ydl li[data-st="err"] { border-left-color: var(--red); }
.ydl .ic { grid-row: span 2; } .ydl small { color: var(--muted); grid-column: 2; }
.vbox { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--green); border-radius: var(--radius);
  padding: .6rem 1rem; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .2rem; }
.vbox[data-st="err"] { border-left-color: var(--red); }
.vbox span { font-size: .88rem; color: var(--muted); } .vbox ul { margin: .3rem 0; padding-left: 1.2rem; font-size: .88rem; }
.vbox[data-st="run"] { border-left-color: var(--cyan); } .vbox .upbar { margin: .35rem 0 .2rem; }

/* Длинные имена — в одну строку с «…»; страница никогда не уезжает вбок */
html, body { overflow-x: hidden; max-width: 100%; }
main, .md, .hit, .files li, .ups li, .uplist li, .ydl li { min-width: 0; }
.fname { display: block; min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.files li > .fname { overflow-wrap: normal; }
.uplist li { display: flex; flex-direction: column; }
.uplist small { color: var(--muted); }
.hit a b, .folder, details.fold > summary span, details.sec > summary b { overflow-wrap: anywhere; }
pre.box { max-width: 100%; }

/* Клавиши разделов на телефоне — сеткой в две строки, без прокрутки вбок */
@media (max-width: 700px) {
  .keys { display: grid; grid-template-columns: repeat(5, 1fr); overflow: visible; gap: 4px; }
  .keys button { min-width: 0; padding: .5rem .1rem .3rem; font-size: .74rem; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .keys button .kst { margin-left: .15rem; font-size: .68rem; }
  .keys button::before { left: 18%; right: 18%; top: 3px; }
  header.top { padding-bottom: .45rem; }
}
/* Статус на клавише «ЗАГРУЗКА» на телефоне — значком в углу, а не в строке (иначе не влезает) */
@media (max-width: 700px) {
  .keys button { overflow: visible; }
  .keys button .kst { position: absolute; top: -7px; right: -3px; margin: 0; padding: 0 .3rem; line-height: 1.35;
    font-size: .62rem; border-radius: 999px; background: var(--key); border: 1px solid currentColor; z-index: 1; }
}

/* CBT */
.cbtbar { display: flex; gap: .8rem; align-items: center; margin-bottom: .6rem; min-width: 0; }
.cbtbar .fname { flex: 1; }
.cbtn { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.cbtstage { position: relative; width: 100%; overflow: hidden; background: #000; border-radius: var(--radius); }
.cbtstage iframe { width: 650px; height: 486px; border: 0; transform-origin: 0 0; background: #fff; display: block; }
.cbtmiss[hidden] { display: none; }
.cbtmiss { position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; text-align: center; color: #ddd; }
.cbtctl { display: flex; gap: .6rem; align-items: center; margin: .6rem 0; }
.cbtctl audio { flex: 1; min-width: 0; height: 40px; }
.cbtq { color: var(--muted); font-size: .92rem; }
@media (max-width: 700px) { .keys { grid-template-columns: repeat(5, 1fr); } }

/* CBT: наборы, курсы, разделы */
.subtabs a.sbtn { font-size: .92rem; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line); color: inherit; text-decoration: none; }
.subtabs a.sbtn[aria-pressed="true"] { border-color: var(--cyan); color: var(--cyan); font-weight: 600; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .6rem; }
.cards .card { display: flex; flex-direction: column; gap: .3rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; height: 100%; box-sizing: border-box; }
.cards .card:hover { border-color: var(--cyan); }
.cards .card .meta, details.cbtsec .meta { color: var(--muted); font-size: .85rem; font-weight: 400; }
details.cbtsec { border-bottom: 1px solid var(--line); padding: .3rem 0; }
details.cbtsec details.cbtsec { margin-left: 1rem; border-bottom: 0; }
details.cbtsec > summary { cursor: pointer; padding: .4rem 0; list-style-position: inside; }
details.cbtsec .files { margin: .2rem 0 .6rem; }
li.gone .fname { color: var(--muted); }

/* оболочка VACBI — как Vwrtmenu / Vwrtcdb (оформление из .vwm/.vwl курса) */
.vac { container-type: inline-size; --u: max(0.55px, min(1px, 100cqw / 1024)); border: 1px solid #000; border-radius: 4px; overflow: hidden;
  display: flex; flex-direction: column; height: min(80vh, 820px); min-height: 420px; background: #000; }
.vac { --u: clamp(0.55px, calc(100vw / 1100), 1px); }
@supports (width: 1cqw) { .vac-v, .vac-h, .vac-f { --u: clamp(0.55px, calc(100cqw / 1024), 1px); } }
.vac .vr { box-shadow: inset 2px 2px rgba(255,255,255,.75), inset -2px -2px rgba(0,0,0,.55); }
.vac .vs { box-shadow: inset -2px -2px rgba(255,255,255,.6), inset 2px 2px rgba(0,0,0,.5); }
.vac-h { display: flex; align-items: center; gap: calc(var(--u) * 14); padding: 0 calc(var(--u) * 8); flex: none; min-height: 40px; }
.vac-logo { width: max(28px, calc(var(--u) * 48)); height: auto; image-rendering: pixelated; }
.vac-t { flex: 1; text-align: center; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; }
.vac-v { flex: 1; background-size: cover; background-position: center; padding: calc(var(--u) * 24) calc(var(--u) * 20) calc(var(--u) * 40); overflow: auto; }
.vac-f { display: flex; align-items: center; gap: 8px; padding: calc(var(--u) * 5); flex: none; min-height: 40px; box-sizing: border-box; }
.vac-ft { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.vbtn { border: 0; padding: 0 1em; height: max(32px, calc(var(--u) * 45)); width: min(40%, calc(var(--u) * 256)); cursor: pointer; letter-spacing: .02em; }
.vbtn:active { box-shadow: inset 2px 2px rgba(0,0,0,.5), inset -2px -2px rgba(255,255,255,.6); }
#vadv { margin-left: auto; }
.vtree, .vtree ul { list-style: none; margin: 0; padding: 0; }
.vtree ul { display: none; margin-left: calc(var(--ind) + 1px); padding-left: 0; border-left: 3px solid var(--thread); }
.vtree li.open > ul { display: block; }
.vtree li { padding-top: calc(var(--u) * 5); }
.vtree ul > li { position: relative; padding-left: var(--ind); }
.vtree ul > li::before { content: ""; position: absolute; left: 0; top: calc(var(--u) * 5 + max(36px, calc(var(--u) * var(--hgt, 48))) / 2); width: var(--ind); border-top: 3px solid var(--thread); }
.vtree li.open > ul { border-left-color: var(--thread-hi); }
.vtree .leaf { display: flex; align-items: center; gap: calc(var(--u) * 10); box-sizing: border-box; width: min(100%, calc(var(--u) * var(--w, 450)));
  min-height: max(36px, calc(var(--u) * var(--hgt, 48))); padding: 4px calc(var(--u) * 12); background: var(--bg); color: var(--fg);
  text-decoration: none; border: 0; text-align: left; cursor: pointer; line-height: 1.15; }
.vtree .leaf:hover, .vtree .leaf:focus-visible, .vtree li.open > .leaf { background: var(--bgh); color: var(--fgh); outline: none; }
.vtree .leaf.dis { cursor: default; opacity: .9; }
.vtree .leaf.dis:hover { background: var(--bg); color: var(--fg); }
.vico { width: max(20px, calc(var(--u) * 32)); height: auto; flex: none; image-rendering: pixelated; }
.vmiss { display: inline-block; font: 600 12px/1.3 system-ui, sans-serif; padding: 1px 7px; margin-left: 6px; border-radius: 999px;
  background: #ffe08a; color: #3a2a00; vertical-align: middle; white-space: nowrap; }
.vacsets { margin-bottom: .4rem; align-items: center; }
.vacsets .muted.small { min-width: 5.5em; }

/* стартовый экран S7 */
.s7l { position: relative; aspect-ratio: 2000 / 1351; background: #b8d530 center/cover no-repeat; border-radius: 4px; overflow: hidden; }
.s7btns { position: absolute; left: 5%; top: 7%; display: flex; flex-direction: column; gap: clamp(6px, 2.2%, 18px); width: min(46%, 420px); }
.s7b { display: block; padding: clamp(6px, 1.6vw, 14px) clamp(10px, 2vw, 18px); background: rgba(255,255,255,.92); color: #3f7f1f; border-radius: 10px;
  text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.18); border-left: 6px solid #d7263d; }
.s7b b { display: block; font-size: clamp(14px, 2.4vw, 24px); color: #2f6a12; }
.s7b span { display: block; font-size: clamp(11px, 1.4vw, 14px); color: #4d6b3a; }
.s7b:hover { background: #fff; transform: translateY(-1px); }
.s7video { width: 100%; max-height: 70vh; background: #000; border-radius: 4px; margin-bottom: .6rem; }
.small { font-size: .85rem; }
@media (max-width: 600px) { .s7l { aspect-ratio: auto; min-height: 440px; background-position: 65% bottom; } .s7btns { width: auto; right: 5%; } }

/* уроки CAT II/III — экран оригинального проигрывателя */
.catscr { position: relative; width: 100%; max-width: 960px; aspect-ratio: 4 / 3; background: #000; border-radius: 4px; overflow: hidden; }
.catscr img { width: 100%; height: 100%; display: block; image-rendering: pixelated; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.catwait { position: absolute; inset: 0; display: grid; place-items: center; color: #ddd; text-align: center; padding: 1rem; }
.catwait[hidden] { display: none; }

/* тренажёр радиообмена */
.rgrid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 1rem; align-items: start; }
@media (max-width: 760px) { .rgrid { grid-template-columns: 1fr; } }
.rmap { background: #000; border-radius: 4px; padding: 4px; }
.rmap { text-align: center; }
.rmapin { position: relative; display: inline-block; max-width: 100%; }
.rmapin img { max-width: 100%; max-height: 72vh; width: auto; height: auto; display: block; background: #fff; min-height: 120px; }
.rplane { position: absolute; font-size: 26px; color: #e11; text-shadow: 0 0 3px #fff, 0 0 6px #fff; pointer-events: none; transition: left .6s linear, top .6s linear; }
.rmap .muted { color: #bbb; padding: .3rem .2rem; }
.rinst { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: .6rem; }
.rinst > div { background: #0b1220; color: #7CFC00; border-radius: 6px; padding: .35rem .55rem; font-family: ui-monospace, Menlo, monospace; }
.rinst small { display: block; color: #9ab; font: 11px system-ui, sans-serif; }
.rinst .rloc { grid-column: 1 / -1; }
.rturn { background: var(--surface); border: 1px solid var(--cyan); border-radius: var(--radius); padding: .6rem .8rem; margin: .5rem 0; }
.rturn[hidden] { display: none; }
.rlog { list-style: decimal; padding-left: 2rem; max-height: 46vh; overflow: auto; margin-top: .6rem; }
.rlog li { padding: .35rem .2rem; border-bottom: 1px solid var(--line); }
.rlog li small { color: var(--muted); margin-right: .4rem; }
.rlog li.rC small { color: #3a7bd5; } .rlog li.rP small { color: #2e8b57; } .rlog li.rM small { color: #b8860b; }
.rlog .rt[hidden] { display: none; }
.rlog .rrep, .rlog .rsh { margin-left: .3rem; }
.stlist { list-style: none; padding: 0; margin: .4rem 0 0; }
.strow { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; border-top: 1px solid var(--line); }
.strow .stname { flex: 1; min-width: 0; }
.strow .stbtn { display: flex; gap: 2px; flex: none; }

.vnote{font-size:.72em;padding:0 .4em;border-radius:.6em;background:#dfe8f7;color:#1e3174;font-weight:600;white-space:nowrap}
.vstat{display:block;font-size:.62em;font-weight:600;line-height:1.3;margin-top:.15em;opacity:.95}
.vstat i{font-style:normal}.vstat .ok{color:#1d7a2e}.vstat .fl{color:#8a5a00}.vstat .no{color:#a3262b}
.leaf:hover .vstat .ok,.leaf:hover .vstat .fl,.leaf:hover .vstat .no{color:inherit}
/* что раскрывается (▸/▾) и что открывается (PDF / VIDEO / CBT / ›) */
.vtree .leaf .vtx{flex:1;min-width:0}
.vtree .leaf .vk{margin-left:auto;font-style:normal;font-weight:700;flex:none;transition:transform .15s}
.vtree li.open > .leaf > .vk:not(.vo){transform:rotate(90deg)}
.vtree .leaf .vk.vo{font-size:.62em;letter-spacing:.04em;padding:.15em .5em;border-radius:.4em;border:1.5px solid currentColor;opacity:.85}
