/* Школьные курсы: задания без микрофона (варианты, число, текст), тренажёр, справочник. Цвета — из style.css. */
body.school:not(.mode-session) .session-only,
body.school:not(.mode-drill) .drill-only,
body.school:not(.mode-theory) .theory-only,
body.school:not(.mode-tools) .tools-only { display: none; }
.qz-tool .fig-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.qz-care { color: var(--warn, #d9822b); }
.qz-toollink, .qz-toollink:visited { color: var(--draw); text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.qz-text { margin: 6px 0 10px; white-space: pre-line; }
.qz-listen { font: inherit; line-height: 1; padding: 4px 6px; margin: 0 0 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); cursor: pointer; vertical-align: middle; }
.qz-listen:hover { border-color: var(--muted); }
p > .qz-listen:first-child { margin-left: 0; }
#drillQ, #hwQ { white-space: pre-line; }
.qz-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 8px; margin: 8px 0; }
.qz-opt { font: inherit; font-size: 1.05rem; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; text-align: left; }
.qz-opt:hover:not(:disabled) { border-color: var(--muted); }
.qz-opt.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 18%, var(--card)); }
.qz-opt.wrong { border-color: var(--bad); opacity: .7; }
/* Порядок шагов и пары (exercises.js: order, match). */
.qz-hint { margin: 4px 0; font-size: .9rem; }
.qz-ord { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.qz-ord-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); }
.qz-ord-n { min-width: 1.4em; font-weight: 700; color: var(--muted); }
.qz-ord-t { flex: 1; }
.qz-ord-b { font: inherit; width: 36px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg, var(--card)); color: var(--text); cursor: pointer; }
.qz-ord-b:disabled { opacity: .3; cursor: default; }
.qz-match { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 8px 0; }
.qz-match-row { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); }
.qz-match-l { flex: 1 1 140px; }
.qz-match-s { font: inherit; flex: 1 1 160px; min-width: 0; max-width: 100%; /* #24: длинный вариант не раздвигает экран */ padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.qz-ord-row.right, .qz-match-row.right { border-color: var(--ok); }
.qz-ord-row.wrong, .qz-match-row.wrong { border-color: var(--bad); }
.qz-opt:disabled { cursor: default; }
.qz-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.qz-in { font: inherit; font-size: 1.2rem; width: 140px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); }
.qz-in-text { width: 220px; }
.qz-in:focus { outline: none; border-color: var(--heard); }
.qz-unit { color: var(--muted); font-weight: 600; }
.qz-fb { min-height: 1.4em; font-weight: 600; margin-top: 6px; }
.qz-fb.good { color: var(--ok); }
.qz-fb.bad { color: var(--bad); }
.qz-fb .muted { font-weight: 400; }
.qz-timer { display: flex; gap: 10px; align-items: baseline; margin: 10px 0; }
.qz-timer b { font: 800 1.6rem ui-monospace, Consolas, monospace; }

/* Тренажёр */
.qz-skills { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.qz-skills button { font: inherit; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.qz-skills button.active { border-color: var(--blow); background: var(--blow-soft); }
.qz-score { font-size: .75rem; color: var(--muted); margin-left: 4px; }
#drillList h4 { margin: 10px 0 4px; }
.qz-q { font-size: 1.25rem; font-weight: 700; margin: 6px 0; }

/* Справочник */
/* Карта тем в справочнике (0214): блоки гармошкой, у темы — чипы «сначала». */
.topic-map { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; background: var(--bg); }
.topic-map > summary { cursor: pointer; font-weight: 600; }
.tm-legend { margin: 6px 0; font-size: .85rem; }
.tm-block { border-top: 1px dashed var(--line); padding: 6px 0; }
.tm-block > summary { cursor: pointer; font-weight: 600; font-size: .95rem; }
.tm-list { list-style: none; margin: 4px 0 0; padding: 0; }
.tm-row { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; min-width: 0; }
.tm-st { flex: 0 0 1.4em; text-align: center; font-weight: 700; color: var(--muted); }
.tm-row.done .tm-st { color: var(--ok); }
.tm-row.next .tm-st { color: var(--blow); }
.tm-row.next > .tm-body > .tm-go { font-weight: 700; }
.tm-body { min-width: 0; overflow-wrap: anywhere; }
.tm-go { color: var(--text); text-decoration: underline dotted; text-underline-offset: 3px; }
.tm-row.done > .tm-body > .tm-go { color: var(--muted); }
.tm-pre { display: block; font-size: .82rem; margin-top: 2px; }
.tm-chip { display: inline-block; margin: 2px 4px 0 0; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--text); text-decoration: none; }
.tm-chip.ok { border-color: var(--ok); }
.tm-chip.ext { border-style: dashed; border-color: var(--draw); color: var(--draw); }
.tm-chip.ext.ok { border-color: var(--ok); color: var(--ok); }
a.tm-go:focus-visible, a.tm-chip:focus-visible { outline: 2px solid var(--blow); outline-offset: 2px; }
.qz-theory { border-top: 1px dashed var(--line); padding: 8px 0; }
.qz-theory summary { cursor: pointer; font-weight: 600; }
.qz-theory p { margin: 8px 0 0; }
.qz-theory p + p { margin-top: 4px; }

/* Формулы в условиях: моноширинный, но читаемый. */
.qz-text code, .ls-ex-title code { font-size: 1em; }

@media (max-width: 600px) {
  /* телефон: 3D и рисунок столбиком, во всю ширину, не шире экрана */
  .fig-row { flex-direction: column; align-items: center; }
  .fig-row > * { max-width: 100%; }
  .fig-row .fig-wrap { width: 100%; }
  .fig-row .mol3d canvas, .fig-row .sc3d canvas, .fig-row .hyp4 canvas { width: min(360px, 92vw); }
  .qz-in { width: 110px; }
  .qz-in-text { width: 100%; }
}
/* Матрица таблицей в высоких круглых скобках (js/matrixView.js, решение 0032). */
.mx { display: inline-block; position: relative; vertical-align: middle; margin: 2px 4px; padding: 0 11px; }
.mx::before, .mx::after { content: ''; position: absolute; top: 0; bottom: 0; width: 8px; border: 2px solid currentColor; opacity: .75; }
.mx::before { left: 0; border-right: 0; border-radius: 100% 0 0 100% / 50% 0 0 50%; }
.mx::after { right: 0; border-left: 0; border-radius: 0 100% 100% 0 / 0 50% 50% 0; }
.mx-t { display: inline-table; border-collapse: separate; border-spacing: 4px; font-weight: 600; font-size: 1rem; }
.mx-r { display: table-row; }
.mx-c { display: table-cell; vertical-align: middle; min-width: 2.2em; padding: 3px 7px; text-align: center; border: 1px solid var(--line); border-radius: 5px; background: color-mix(in srgb, var(--text) 6%, transparent); white-space: nowrap; }
/* Курсы «Шейдеры» (0033): блоки кода, редактор и холсты упражнения «шейдер». */
pre.code { margin: 8px 0; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--text) 7%, var(--card)); border: 1px solid var(--line); overflow-x: auto; font: 13px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; }
.ls-ex-title pre.code, #drillQ pre.code, #hwQ pre.code { font-weight: 400; font-size: 13px; }
pre.code code { padding: 0; margin: 0; background: none; border: 0; font: inherit; }
/* Markdown-подмножество в теории (0174): код в строке, подзаголовки, списки, таблицы */
:is(.qz-theory, #lsTheory) :not(pre) > code { font: .92em/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; padding: 1px 5px; border-radius: 5px; background: color-mix(in srgb, var(--text) 8%, var(--card)); border: 1px solid var(--line); white-space: nowrap; }
/* phone: a long inline formula in code must wrap, nowrap widened the whole page (hydraulics, signals, astro; phone check 2026-11-24) */
@media (max-width: 600px) { :is(.qz-theory, #lsTheory) :not(pre) > code { white-space: normal; overflow-wrap: anywhere; } }
.th-h { margin: 12px 0 4px; font-size: 1rem; }
.th-list { margin: 6px 0 0; padding-left: 1.4em; }
.th-list li + li { margin-top: 3px; }
.th-table { overflow-x: auto; margin: 8px 0; }
.th-table table { border-collapse: collapse; font-size: .95em; }
.th-table th, .th-table td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
.th-table th { background: color-mix(in srgb, var(--text) 6%, var(--card)); }
.sh-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; margin: 8px 0; }
.sh-edit { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: color-mix(in srgb, var(--text) 5%, var(--card)); min-height: 280px; }
.sh-gutter { margin: 0; padding: 10px 6px; min-width: 2.4em; text-align: right; color: var(--muted); font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; overflow: hidden; user-select: none; border-right: 1px solid var(--line); }
.sh-gutter b { color: var(--bad); }
.sh-code { flex: 1; min-width: 0; margin: 0; padding: 10px; border: 0; outline: 0; resize: vertical; min-height: 280px; background: transparent; color: var(--text); font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 2; white-space: pre; overflow: auto; }
.sh-views { display: flex; flex-direction: column; gap: 8px; }
.sh-views figure { margin: 0; text-align: center; }
.sh-views canvas { width: 168px; height: 168px; border-radius: 8px; border: 1px solid var(--line); display: block; background: #000; touch-action: none; }
.sh-views figcaption { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.sh-log { white-space: pre-wrap; font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--muted); min-height: 1em; }
.sh-log.bad { color: var(--bad); }
/* Набор кода на телефоне: ряд символов, «из прошлого задания», блокнот заготовок */
.sh-keys { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.sh-key { font: 14px/1 ui-monospace, SFMono-Regular, Consolas, monospace; min-width: 36px; padding: 9px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; touch-action: manipulation; }
.sh-key:active { background: var(--line); }
.sh-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.sh-notes { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin: 0 0 8px; background: var(--card); }
.sh-nb-h { font-weight: 600; margin: 8px 0 4px; }
.sh-nb-list { display: flex; flex-wrap: wrap; gap: 6px; }
.sh-note { display: inline-flex; align-items: center; gap: 2px; }
.sh-del { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; font: inherit; }
@media (max-width: 640px) {
  .sh-wrap { grid-template-columns: 1fr; }
  /* холсты — над редактором и прилипают к верху: при открытой клавиатуре результат правки виден (решение 0036) */
  .sh-views { flex-direction: row; justify-content: center; order: -1; position: sticky; top: 0; z-index: 2; padding: 6px 0; background: var(--card); }
  .sh-views canvas { width: 120px; height: 120px; }
  .sh-edit, .sh-code { min-height: 220px; }
}

/* Рисунки к задачам и теории (js/quiz/fig.js, решение 0048): цвета темы, не шире экрана. */
.fig-wrap { margin: 6px 0 10px; text-align: center; }
.fig { max-width: 100%; height: auto; overflow: visible; color: var(--text); }
.fig .f { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.fig .fw { stroke-width: 2.6; }
.fig .fwall { stroke-width: 4; stroke-linecap: square; }
.fig .ft { stroke-width: 1; }
.fig .fd { stroke-dasharray: 5 4; }
.fig .f1 { stroke: var(--heard); }
.fig .f2 { stroke: var(--blow); }
.fig .fm { stroke: var(--muted); }
.fig .ff { fill: color-mix(in srgb, currentColor 10%, transparent); }
.fig .ff1 { fill: color-mix(in srgb, var(--heard) 40%, transparent); }
.fig .ff2 { fill: color-mix(in srgb, var(--blow) 35%, transparent); }
.fig .fh { fill: currentColor; stroke: none; }
.fig .fh.f1 { fill: var(--heard); }
.fig .fh.f2 { fill: var(--blow); }
.fig .fh.fm { fill: var(--muted); }
.fig .fdot { fill: currentColor; }
.fig .fdot.f1 { fill: var(--heard); }
.fig .fdot.f2 { fill: var(--blow); }
.fig .fgrid { stroke: var(--line); stroke-width: 1; }
.fig .flab { fill: currentColor; font: 600 13px system-ui, sans-serif; paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.fig .fsm { font-size: 11px; font-weight: 500; }
.fig .fit { font-style: italic; }
.fig .f1t { fill: var(--heard); }
.fig .f2t { fill: var(--blow); }
.fig .fmt { fill: var(--muted); }

/* 3D-модели молекул (js/quiz/mol.js, решение 0049): холст с вращением, подпись-формула. */
.mol3d { display: inline-block; text-align: center; margin: 4px auto; max-width: 100%; }
.mol3d canvas { display: block; width: min(300px, 86vw); height: 220px; margin: 0 auto; touch-action: none; cursor: grab; border-radius: 12px; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--text) 7%, transparent), transparent 70%); }
.mol3d canvas:active { cursor: grabbing; }
.mol-cap { font-size: .9rem; color: var(--text); }
.mol-hint { color: var(--muted); font-size: .78rem; }
.mol3d.turned .mol-hint { visibility: hidden; }
.fig-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.fig-row .mol3d canvas { width: min(230px, 44vw); height: 190px; }
/* Объёмные сцены математики и физики (js/quiz/scene3d.js, решение 0083) */
.sc3d, .hyp4 { display: inline-block; text-align: center; margin: 4px auto; max-width: 100%; vertical-align: top; }
.sc3d canvas, .hyp4 canvas { display: block; width: min(340px, 88vw); height: 250px; margin: 0 auto; touch-action: none; cursor: grab; border-radius: 12px; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--text) 5%, transparent), transparent 75%); }
.sc3d canvas:active, .hyp4 canvas:active { cursor: grabbing; }
.sc3d.turned .mol-hint, .hyp4.turned .mol-hint { visibility: hidden; }
.fig-row .sc3d canvas, .fig-row .hyp4 canvas { width: min(280px, 44vw); height: 220px; }

/* Действия столбиком по шагам (js/quiz/column.js, решение 0052) */
.colcalc { max-width: 420px; margin: 8px auto; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-align: left; }
.cc-head { display: flex; gap: 6px; align-items: center; justify-content: center; margin-bottom: 10px; }
.cc-head input, .cc-head select { font: 600 1.05rem ui-monospace, Consolas, monospace; width: 6.5em; padding: 6px 8px; border: 2px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); text-align: center; }
.cc-head select { width: 3.2em; }
.cc-grid { display: grid; justify-content: center; font: 700 1.35rem/1.6 ui-monospace, Consolas, monospace; margin: 4px 0 8px; }
.cc { text-align: center; position: relative; min-height: 1.6em; border-radius: 4px; }
.cc.ul { border-bottom: 2px solid var(--text); }
.cc.vl { border-left: 2px solid var(--text); }
.cc.carry { font-size: .7em; color: var(--blow); line-height: 2.2; }
.cc.strike { text-decoration: line-through; text-decoration-color: var(--bad, #d33); opacity: .6; }
.cc.new { color: var(--heard); }
.cc.hl { background: color-mix(in srgb, var(--blow) 25%, transparent); }
.cc-text { min-height: 3.2em; margin: 4px 0 8px; font-size: .95rem; }
.cc-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.cc-btns .btn { padding: 7px 12px; font-size: .9rem; }
.cc-auto.on { outline: 2px solid var(--blow); }
.cc-step { text-align: center; font-size: .8rem; margin-top: 6px; }

/* Анимация фруктов (0051): по одному выпрыгивают, «съеденные» гаснут и зачёркиваются; нажатие повторяет. */
.fig .fa { transform-box: fill-box; transform-origin: center; animation: fa-pop .35s cubic-bezier(.3, 1.6, .5, 1) both; cursor: pointer; }
.fig .fa.fx { animation: fa-pop .35s cubic-bezier(.3, 1.6, .5, 1) both, fa-gone .4s ease forwards; }
.fig .fcross { stroke-dasharray: 60; stroke-dashoffset: 60; animation: fa-cross .35s ease forwards; }
@keyframes fa-pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fa-gone { to { opacity: .45; } }
@keyframes fa-cross { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .fig .fa, .fig .fa.fx, .fig .fcross { animation-duration: 1ms !important; animation-delay: 0s !important; } }

/* Живые опыты физики (js/quiz/anim.js, 0052) */
.anim { max-width: 440px; margin: 8px auto; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.anim canvas { display: block; width: 100%; height: 210px; }
.an-info { min-height: 2.6em; font-size: .9rem; margin: 6px 0; }
.an-ctl { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .85rem; color: var(--muted); }
.an-ctl label { display: flex; flex-direction: column; flex: 1 1 140px; }
.an-ctl b { color: var(--text); }
.an-ctl input[type=range] { width: 100%; accent-color: var(--heard); }
.cc-btns .btn:disabled { opacity: .35; cursor: default; pointer-events: none; }
.cc.ul, .cc.vl { border-radius: 0; }

/* Необязательный урок в программе (0053): без номера, чуть с отступом. */
li.extra { list-style: none; margin-left: -.2em; font-size: .92em; }
li.extra.skipped > a { opacity: .6; } /* skipped optional topic (0323) */
details.qz-theory.extra > summary { color: var(--heard); }

/* Прямая ссылка на тему справочника (0053) */
.qz-theory > summary .topic-link { margin-left: 8px; padding: 0 4px; border: 0; background: none; cursor: pointer; font-size: .85em; opacity: 0; transition: opacity .15s; }
.qz-theory[open] > summary .topic-link, .qz-theory > summary:hover .topic-link { opacity: .7; }
.qz-theory > summary .topic-link:hover, .qz-theory > summary .topic-link:focus-visible { opacity: 1; }

/* Код программы в задаче (0057): отступы важны (Python), поэтому pre с прокруткой вбок, а не перенос строк. */
.qz-code { margin: 6px 0 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: pre; tab-size: 4; line-height: 1.45; }
.qz-code code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: .92em; }

/* 3D-конструкции (js/quiz/struct3d.js, решение 0086): холст, подписи поверх, кнопки видов. */
.st3d { max-width: 520px; margin: 8px auto; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.st-box { position: relative; }
.st-box canvas { display: block; width: 100%; height: 320px !important; touch-action: none; cursor: grab; border-radius: 10px; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--text) 6%, transparent), transparent 75%); }
.st-box canvas:active { cursor: grabbing; }
.st-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.st-lab { position: absolute; left: 0; top: 0; font: 600 13px system-ui, sans-serif; color: var(--text); white-space: nowrap; text-shadow: 0 0 3px var(--card), 0 0 3px var(--card), 0 0 2px var(--card); }
.st-lab.c1 { color: var(--heard); } .st-lab.c2 { color: var(--blow); } .st-lab.dim { color: var(--muted); font-weight: 500; font-size: 12px; } .st-lab.small { font-size: 11px; }
.st-ctl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.st-ctl .btn { padding: 5px 10px; font-size: .85rem; }
.st-hint { font-size: .75rem; }
.st3d.st-nogl .st-box canvas { background: none; }

/* Варианты ответа картинками (0086): «какая эпюра верная». */
.qz-figopts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.qz-figopts .qz-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.qz-optfig svg { max-width: 100%; height: auto; }
/* Русские счёты (0090): смахивание по горизонтали, страница листается по вертикали */
.schoty { text-align: center; margin: 8px auto; }
.schoty-svg { width: min(440px, 92vw); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.schoty-task { font-weight: 600; margin: 4px 0; }
.schoty-num { color: var(--muted); margin: 2px 0 6px; }
/* Соробан (0090): жест вертикальный — страницу под ним не листаем */
.schoty-svg.soroban-svg { width: min(260px, 70vw); touch-action: none; }
.qz-theory .qz-golesson, .qz-golesson { display: flex; margin: 14px 0 4px; } /* сильнее «.qz-theory p + p» (4px) — кнопка не липнет к последней строке теории */

.qz-mark { font-weight: 800; margin-left: auto; }
.qz-match-row.right .qz-mark { color: var(--ok); }
.qz-match-row.wrong .qz-mark { color: var(--bad); }

/* Мини-тренажёры (js/quiz/anim.js, Trainer; решение 0210): пушка, уравнивание реакций, весы уравнений. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tr { margin: 8px 0; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); max-width: 100%; box-sizing: border-box; }
.tr-hint { margin: 0 0 8px; font-size: .92rem; }
.tr-info { min-height: 1.5em; margin-top: 8px; font-weight: 600; }
.tr-info.good { color: var(--ok); }
.tr-info.bad { color: var(--bad); }
.tr-svg { display: block; width: 100%; height: auto; max-height: 260px; }
.tr-ground { stroke: var(--muted); stroke-width: 2; }
.tr-band { fill: color-mix(in srgb, var(--ok) 35%, transparent); }
.tr-flag { stroke: var(--text); stroke-width: 2; }
.tr-flagc { fill: var(--bad); }
.tr-lab { fill: var(--muted); font-size: 13px; }
.tr-path { fill: none; stroke: var(--heard); stroke-width: 2.5; }
.tr-past path { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .6; }
.tr-barrel { fill: var(--text); }
.tr-wheel { fill: var(--muted); }
.tr-ball { fill: var(--blow); }
.tr-ctl { display: grid; gap: 4px; margin: 8px 0; }
.tr-ctl input[type=range] { width: 100%; min-height: 28px; }
.tr-out { font-weight: 700; }
/* touch screens: the range input is only 16px tall, a finger needs >= 44px to grab it (phone check 2026-11-24) */
@media (pointer: coarse) { .an-ctl input[type=range], .tr-ctl input[type=range] { height: 44px; min-height: 44px; } }
.tr .actions { margin: 8px 0 0; }
.tr-eq { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 6px; margin: 8px 0; font-size: 1.15rem; }
.tr-sub { display: inline-flex; align-items: center; gap: 4px; }
.tr-b { font: inherit; min-width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg, var(--card)); color: var(--text); cursor: pointer; }
.tr-b:disabled { opacity: .3; cursor: default; }
.tr-c { min-width: 1.4em; text-align: center; font-weight: 700; }
.tr-f { padding-left: 2px; }
.tr-op { font-weight: 700; color: var(--muted); padding: 0 2px; }
.tr-atoms { border-collapse: collapse; margin: 8px 0; }
.tr-atoms th, .tr-atoms td { padding: 4px 12px; border-bottom: 1px solid var(--line); text-align: center; }
.tr-atoms tr.ok td:last-child { color: var(--ok); font-weight: 700; }
.tr-atoms tr.no td:last-child { color: var(--bad); font-weight: 700; }
.tr-atoms tr.ok td, .tr-atoms tr.ok th { background: color-mix(in srgb, var(--ok) 14%, transparent); }
.tr-beam { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; position: relative; padding-bottom: 14px; border-bottom: 6px solid var(--text); border-radius: 3px; margin-top: 4px; }
.tr-beam::after { content: ''; position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); border: 16px solid transparent; border-top: 0; border-bottom: 20px solid var(--text); }
.tr-pan { display: flex; flex-direction: column; align-items: stretch; min-height: 96px; justify-content: flex-end; }
.tr-stuff { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-content: flex-end; padding: 4px; min-height: 50px; }
.tr-plate { height: 6px; border-radius: 3px; background: var(--muted); }
.tr-x { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; background: var(--heard); color: #fff; font-weight: 700; font-style: italic; }
.tr-w { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--blow); color: #fff; font-size: .8rem; font-weight: 700; }
.tr-eqline { margin: 34px 0 8px; text-align: center; font-size: 1.2rem; font-weight: 700; }
.tr-ops { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tr-divgrp { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tr-divgrp[hidden] { display: none; }
.tr-div { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
.tr-ops .btn { min-height: 40px; }
@media (max-width: 600px) { .tr { padding: 8px; } .tr-x { width: 26px; height: 26px; } .tr-w { width: 20px; height: 20px; } .tr-atoms th, .tr-atoms td { padding: 4px 8px; } }

/* Мини-тренажёры, вторая очередь (решение 0210): рычаг, парабола, высота дерева, решётка Пеннета, пищевая цепь. */
.tr-pivot { fill: var(--muted); }
.tr-bar { fill: var(--text); }
.tr-beamg { transition: transform .35s; }
.tr-rope { stroke: var(--muted); stroke-width: 2; }
.tr-load { fill: var(--heard); }
.tr-ltxt { fill: #fff; font-size: 13px; font-weight: 700; }
.tr-grid { stroke: var(--line); stroke-width: 1; }
.tr-axis { stroke: var(--muted); stroke-width: 1.5; }
.tr-vx { fill: var(--blow); }
.tr-target { fill: none; stroke: var(--bad); stroke-width: 2.5; }
.tr-trunk { fill: var(--muted); stroke: var(--muted); stroke-width: 6; }
.tr-crown { fill: var(--ok); }
.tr-person { stroke: var(--text); stroke-width: 3; }
.tr-head { fill: var(--text); }
.tr-sight { stroke: var(--blow); stroke-width: 2; stroke-dasharray: 5 4; }
.tr-arc { fill: none; stroke: var(--bad); stroke-width: 2; }
.tr-water { fill: color-mix(in srgb, var(--heard) 30%, transparent); }
.tr-pun { border-collapse: separate; border-spacing: 6px; margin: 4px auto; }
.tr-pun th { font-weight: 700; font-size: 1.1rem; padding: 4px 10px; }
.tr-cell { font: inherit; font-size: 1.1rem; font-weight: 700; width: 84px; height: 52px; border-radius: 10px; border: 2px dashed var(--line); background: var(--bg, var(--card)); color: var(--muted); cursor: pointer; }
.tr-cell.on { border-style: solid; border-color: var(--ok); color: var(--text); }
.tr-cell.on.rec { border-color: var(--blow); }
.tr-leg { text-align: center; margin: 4px 0; }
.tr-pool { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.tr-org { min-height: 40px; }
.tr-org:disabled { opacity: .35; }
.tr-chainrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; padding: 6px; border: 1px dashed var(--line); border-radius: 10px; margin-bottom: 8px; }
.tr-link { padding: 4px 10px; border-radius: 999px; background: var(--ok); color: #fff; font-weight: 600; }
.tr-arrow { font-weight: 700; color: var(--muted); }
.tr-chain .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-chain .actions .btn { min-height: 40px; }
@media (prefers-reduced-motion: reduce) { .tr-beamg { transition: none; } }
@media (max-width: 600px) { .tr-cell { width: 72px; } }
.tr-lever .tr-lab, .tr-parab .tr-lab, .tr-height .tr-lab { font-size: 18px; font-weight: 600; }
.tr-lever .tr-ltxt { font-size: 16px; }

/* Мини-тренажёры, третья очередь: логическая схема и сортировка обменами (информатика). */
.tr-sw { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.tr-swb { min-height: 40px; min-width: 72px; font-weight: 700; }
.tr-swb.on { background: var(--ok); color: #fff; border-color: var(--ok); }
.tr-logsvg { max-height: 220px; }
.tr-wire { fill: none; stroke: var(--muted); stroke-width: 2.5; }
.tr-wire.on { stroke: var(--ok); }
.tr-gate { fill: var(--bg, var(--card)); stroke: var(--text); stroke-width: 2; }
.tr-gtxt { fill: var(--text); font-size: 15px; font-weight: 700; }
.tr-in { fill: var(--bg, var(--card)); stroke: var(--muted); stroke-width: 2; }
.tr-in.on { fill: color-mix(in srgb, var(--ok) 30%, transparent); stroke: var(--ok); }
.tr-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 6px; margin-top: 8px; }
.tr-row { font: inherit; font-size: .9rem; min-height: 40px; padding: 4px 6px; border-radius: 8px; border: 1px dashed var(--line); background: var(--bg, var(--card)); color: var(--muted); cursor: pointer; }
.tr-row.seen { border-style: solid; color: var(--text); }
.tr-row.one { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.tr-row.cur { outline: 2px solid var(--heard); outline-offset: 1px; }
.tr-arr { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin: 4px 0 0; }
.tr-num { display: flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg, var(--card)); font-size: 1.15rem; font-weight: 700; }
.tr-swaps { position: relative; height: 44px; }
.tr-sw2 { position: absolute; top: 4px; transform: translateX(-50%); width: 40px; height: 36px; font: inherit; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.tr-sw2:disabled { opacity: .3; cursor: default; }
.tr-bubble .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.tr-bubble .actions .btn { min-height: 40px; }
.tr-cnt { font-weight: 700; }

/* Сноска «Задание в формате ЕГЭ … №N» под условием (js/exam-origins.js) */
.ex-origin { display: block; margin-top: .35em; font-size: .78em; font-weight: 400; color: var(--muted, #8a8f98); }
/* Windows high contrast (forced-colors, checked 2026-11-24): colour and background of right / wrong answers are dropped, so mark them by border. */
@media (forced-colors: active) {
  .qz-opt.right, .qz-ord-row.right, .qz-match-row.right { border: 3px solid Highlight; }
  .qz-opt.wrong, .qz-ord-row.wrong, .qz-match-row.wrong { border: 3px dashed GrayText; opacity: 1; text-decoration: line-through; }
  .qz-in:focus { outline: 2px solid Highlight; outline-offset: 1px; }
}
