/* NeuroPrep · SL165. Спокойная «лаборатория»: тёплая бумага, зелёный лицея, у каждого раздела свой цвет.
   Яркость — только в цветах разделов, кольце результата и стимулах тестов. Телефон — главное устройство. */
:root {
  --bg: #f3f4f0; --card: #ffffff; --raised: #eceee8; --hover: #f8f9f6; --line: rgba(20, 28, 24, .09); --line-2: rgba(20, 28, 24, .17);
  --ink: #141a17; --sub: #48514c; --muted: #6c746f;
  --accent: #0f6b38; --accent-ink: #0b5a2f; --accent-soft: #e3efe7; --sun: #f2c200;
  --ok: #15803d; --ok-s: #e4f3ea; --bad: #c8322a; --bad-s: #fbe9e7; --warn: #a86b00; --warn-s: #fbf1da; --info: #2453c9; --info-s: #e6edfb;
  --r-sm: 8px; --r: 12px; --r-card: 16px; --r-lg: 22px;
  --sh: 0 1px 2px rgba(0, 0, 0, .05); --sh-float: 0 10px 30px rgba(10, 30, 20, .10);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --display: 'Montserrat', 'Onest', 'Segoe UI', system-ui, sans-serif;
  --body: 'Onest', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --stim: #141a17; --stim-bg: #ffffff;
  color-scheme: light;
}
[data-theme=dark] {
  --bg: #0f1412; --card: #171d1a; --raised: #212924; --hover: #1c231f; --line: rgba(230, 240, 234, .09); --line-2: rgba(230, 240, 234, .17);
  --ink: #e9efeb; --sub: #b4bdb7; --muted: #8b958f;
  --accent: #3fae6f; --accent-ink: #6fd09a; --accent-soft: #183326;
  --ok: #4ade80; --ok-s: #15301f; --bad: #f87171; --bad-s: #3a1b19; --warn: #fbbf24; --warn-s: #33280f; --info: #7aa2ff; --info-s: #1a2440;
  --sh: none; --sh-float: 0 10px 30px rgba(0, 0, 0, .45);
  --stim: #e9efeb; --stim-bg: #171d1a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
button, a, input, select, textarea, label { -webkit-tap-highlight-color: transparent; }
button, .btn { touch-action: manipulation; }
body { font-family: var(--body); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; font-variant-numeric: tabular-nums; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.2; margin: 0 0 8px; letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0 0 12px; }
a { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .sub { color: var(--sub); } .small { font-size: 13px; } .center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; } .row.end { justify-content: flex-end; } .row.top { align-items: flex-start; } .grow { flex: 1; }
.stack > * + * { margin-top: 12px; } .stack-lg > * + * { margin-top: 22px; }
.ic { display: inline-flex; }
.boot { min-height: 70vh; display: grid; place-items: center; }
.boot img { animation: pulse 1.4s ease-in-out infinite; border-radius: 50%; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.94); } }

/* ---------- оболочка ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; padding-bottom: 88px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 18px 16px; }
.wrap.narrow { max-width: 720px; }
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .in { max-width: 1100px; margin: 0 auto; padding: 8px 12px; display: flex; align-items: center; gap: 8px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.brand b { font-family: var(--display); font-size: 16px; display: block; white-space: nowrap; }
.brand b span { color: var(--muted); font-weight: 600; }
.brand small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav { display: none; gap: 2px; margin-left: 18px; }
.topnav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--sub); font-weight: 500; }
.topnav a:hover { background: var(--raised); color: var(--ink); }
.topnav a.on { background: var(--accent-soft); color: var(--accent-ink); }
.lang { display: flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; }
.lang button { border: 0; background: none; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.lang button.on { background: var(--ink); color: var(--bg); }
.mnav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: flex; background: var(--card); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
.mnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500; border-radius: 10px; }
.mnav a.on { color: var(--accent-ink); }
.mnav a.on span:first-child { background: var(--accent-soft); border-radius: 999px; padding: 2px 14px; }
.mnav span:first-child { display: flex; padding: 2px 14px; }
.foot { border-top: 1px solid var(--line); background: var(--raised); margin-top: 24px; }
.foot .in { max-width: 1100px; margin: 0 auto; padding: 18px 16px 100px; display: grid; gap: 10px; color: var(--sub); font-size: 13px; }
.foot .dev { color: var(--muted); }
@media (min-width: 900px) {
  .topnav { display: flex; } .mnav { display: none; } .main { padding-bottom: 24px; } .foot .in { padding-bottom: 22px; grid-template-columns: 1fr auto; align-items: end; }
  h1 { font-size: 32px; } .wrap { padding: 26px 20px; }
}
@media (max-width: 520px) { .brand small, .brand b span { display: none; } .top .btn.sm { padding: 6px 10px; } .chart.w640 text { font-size: 20px; } }
@media (max-width: 400px) { .brand b { font-size: 14px; } .top .in { gap: 4px; } }
body.focus .main { padding-bottom: 0; }

/* ---------- кнопки, поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  padding: 10px 16px; border-radius: 999px; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 42px; transition: background .15s, transform .1s, border-color .15s; white-space: nowrap; }
.btn:hover { background: var(--hover); border-color: var(--line-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme=dark] .btn.primary { color: #06140c; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.ghost { background: none; border-color: transparent; }
.btn.ghost:hover { background: var(--raised); }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13.5px; }
.btn.big { min-height: 54px; padding: 14px 24px; font-size: 16.5px; }
.btn.wide { width: 100%; }
.btn.icon { padding: 0; width: 40px; min-height: 40px; }
.field { display: block; }
.field > span { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--sub); }
.input { width: 100%; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--card); min-height: 48px; font-size: 16px; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.input.bad { border-color: var(--bad); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.field-err { color: var(--bad); font-size: 13px; margin-top: 6px; }
.class-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg { display: flex; background: var(--raised); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px 12px; border-radius: 999px; font-weight: 600; color: var(--sub); cursor: pointer; min-height: 38px; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--sh); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--raised); color: var(--sub); white-space: nowrap; }
.chip.c { background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.chip.ok { background: var(--ok-s); color: var(--ok); } .chip.bad { background: var(--bad-s); color: var(--bad); } .chip.warn { background: var(--warn-s); color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); display: inline-block; flex: none; }

/* ---------- карточки ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; box-shadow: var(--sh); }
.card.pad-lg { padding: 22px; }
.card h3 { margin-bottom: 4px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.sec-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 10px; }
.sec-title h2 { margin: 0; }
.empty { text-align: center; padding: 40px 16px; color: var(--sub); }

.tcard { position: relative; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 14px 14px 12px; transition: border-color .15s, transform .15s; min-height: 118px; }
.tcard:hover { border-color: color-mix(in srgb, var(--c) 45%, var(--line)); transform: translateY(-1px); }
.tcard::before { content: ''; position: absolute; left: 14px; top: 0; width: 34px; height: 3px; border-radius: 0 0 3px 3px; background: var(--c); }
.tcard h3 { font-size: 15px; margin: 4px 0 0; }
.tcard p { margin: 0; color: var(--sub); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .meta { margin-top: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding-top: 6px; }
.tcard .best { margin-left: auto; font-weight: 700; color: var(--ink); }
.ccard { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px; }
.ccard:hover { border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.ccard .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--c); flex: none; }
[data-theme=dark] .ccard .ico { color: color-mix(in srgb, var(--c) 60%, #fff); }
.ccard b { display: block; font-family: var(--display); font-size: 15px; }
.ccard small { color: var(--muted); font-size: 12.5px; display: block; line-height: 1.35; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { flex: none; border: 1px solid var(--line-2); background: var(--card); padding: 7px 13px; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--sub); text-decoration: none; cursor: pointer; }
.tabs .on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- главная (гость) ---------- */
.hero { padding: 28px 0 10px; display: grid; gap: 22px; }
.hero h1 { font-size: clamp(28px, 6.4vw, 48px); line-height: 1.08; max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--accent-ink); }
.hero .lead { font-size: 17px; color: var(--sub); max-width: 52ch; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; }
.pulse { display: grid; gap: 6px; }
.pulse-line { width: 100%; height: auto; display: block; border-radius: 12px; background:
  linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 22px, linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 40px 100%; }
.pulse-line path { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.pulse-line .calm { stroke: var(--accent); animation: draw 1.8s linear .2s forwards; }
.pulse-line .stress { stroke: var(--bad); animation: draw 1.7s linear 2s forwards; }
.pulse-mark { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0; animation: fade .3s 2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: .7; } }
@keyframes show { to { opacity: 1; } }
.pulse-cap { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--sub); }
.pulse-cap b { font-family: var(--display); font-size: 17px; }
.pulse-cap .calm b { color: var(--accent-ink); }
.pulse-cap .stress { text-align: right; opacity: 0; animation: show .5s 2.2s forwards; }
.pulse-cap .stress b { color: var(--bad); }
@media (prefers-reduced-motion: reduce) { .pulse-line path, .pulse-mark, .pulse-cap .stress { animation: none; stroke-dashoffset: 0; opacity: 1; } }
.facts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.fact { border-left: 3px solid var(--c, var(--accent)); padding: 4px 0 4px 12px; }
.fact b { font-family: var(--display); font-size: 24px; display: block; }
.fact span { color: var(--sub); font-size: 13.5px; }
.quote { font-family: var(--display); font-size: 18px; font-weight: 600; border-left: 3px solid var(--sun); padding: 2px 0 2px 14px; max-width: 60ch; }

/* ---------- главная ученика ---------- */
.today { display: grid; gap: 12px; }
.daycard { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); text-decoration: none; color: var(--ink); }
.daycard .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); flex: none; }
.daycard.done .n { background: var(--ok-s); color: var(--ok); }
.daycard .why { color: var(--muted); font-size: 12.5px; }
.streak { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; color: var(--warn); }
.banner { border-radius: var(--r-card); padding: 18px; background: var(--ink); color: var(--bg); display: grid; gap: 10px; }
.banner .btn { background: var(--sun); color: #1a1500; border-color: var(--sun); justify-self: start; }
.banner p { color: color-mix(in srgb, var(--bg) 78%, transparent); margin: 0; }

/* ---------- раннер тестов ---------- */
.runner { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; height: 100dvh; overscroll-behavior: none; }
.rbar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--card); min-height: 54px; }
.rbar .title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.rbar .timer { font-family: var(--display); font-weight: 700; font-size: 17px; min-width: 56px; text-align: right; }
.rbar .timer.low { color: var(--bad); }
.rprog { height: 3px; background: var(--raised); }
.rprog i { display: block; height: 100%; background: var(--c, var(--accent)); width: 0; transition: width .3s var(--ease); }
.stage { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; }
.stage-in { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; }
.stage-c { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; }
.no-select { user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.instr { max-width: 560px; margin: 0 auto; text-align: left; }
.instr h2 { font-size: 22px; }
.instr ol, .instr ul { padding-left: 20px; margin: 8px 0 14px; color: var(--sub); }
.instr li + li { margin-top: 6px; }
.count-in { font-family: var(--display); font-size: 72px; font-weight: 800; color: var(--c, var(--accent)); }
.fix { font-size: 40px; color: var(--muted); font-weight: 300; }
.stim { font-family: var(--display); font-weight: 800; font-size: clamp(40px, 12vw, 76px); letter-spacing: .02em; line-height: 1.1; }
.stim-box { width: min(86vw, 420px); height: min(48vh, 300px); display: grid; place-items: center; position: relative; }
.resp { display: grid; gap: 10px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto; width: 100%; }
.resp.c2 { grid-template-columns: 1fr 1fr; } .resp.c4 { grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .resp.c4 { grid-template-columns: repeat(4, 1fr); } }
.rbtn { min-height: 74px; border-radius: var(--r-lg); border: 1.5px solid var(--line-2); background: var(--card); font-weight: 700; font-size: 18px; cursor: pointer; touch-action: manipulation;
  display: flex; align-items: center; justify-content: center; gap: 10px; transition: transform .06s, background .1s; user-select: none; -webkit-user-select: none; color: var(--ink); }
.rbtn:active, .rbtn.press { transform: scale(.97); background: var(--raised); }
.rbtn .sw { width: 22px; height: 22px; border-radius: 6px; flex: none; }
.rbtn.tap { min-height: 120px; font-size: 20px; }
.fb-ok { color: var(--ok); } .fb-bad { color: var(--bad); }
.flash-ok { animation: fok .35s; } .flash-bad { animation: fbad .35s; }
@keyframes fok { 30% { background: var(--ok-s); } } @keyframes fbad { 30% { background: var(--bad-s); } }
.shake { animation: shake .3s; } @keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* сетки (Шульте, Горбов, узоры) */
.sgrid { display: grid; gap: 6px; width: min(92vw, 520px, 62vh); aspect-ratio: 1; margin: 0 auto; }
.sgrid button { border: 1.5px solid var(--line-2); background: var(--stim-bg); border-radius: 10px; font-family: var(--display); font-weight: 700; font-size: clamp(16px, 5vw, 28px); color: var(--stim); cursor: pointer; padding: 0; touch-action: manipulation; user-select: none; }
.sgrid button.red { color: #d22b2b; } [data-theme=dark] .sgrid button.red { color: #ff6b6b; }
.sgrid button.hit { animation: fok .3s; } .sgrid button.miss { animation: fbad .3s; }
.sgrid button.done { opacity: .25; }
.sgrid button.lit { background: var(--c, var(--accent)); border-color: var(--c, var(--accent)); }
.sgrid button.picked { background: var(--ink); border-color: var(--ink); }
.sgrid button.wrong { background: var(--bad); border-color: var(--bad); }
.sgrid button.right { background: var(--ok); border-color: var(--ok); }
.need { font-size: 15px; color: var(--sub); }
.need b { font-family: var(--display); font-size: 22px; color: var(--ink); }
.field-pts { position: relative; width: min(94vw, 640px); height: min(66vh, 640px); margin: 0 auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--stim-bg); touch-action: manipulation; }
.field-pts svg.lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.field-pts button { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 2px solid var(--ink); background: var(--stim-bg); color: var(--stim); font-weight: 700; font-size: 14px; cursor: pointer; padding: 0; }
.field-pts button.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.field-pts button.miss { animation: fbad .3s; border-color: var(--bad); }
.corsi { position: relative; width: min(92vw, 460px); aspect-ratio: 1; margin: 0 auto; background: var(--raised); border-radius: var(--r-card); }
.corsi button { position: absolute; width: 18%; height: 18%; border-radius: 10px; border: 0; background: var(--card); cursor: pointer; box-shadow: var(--sh); transition: background .12s; }
.corsi button.lit { background: var(--sun); } .corsi button.picked { background: var(--ink); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(92vw, 360px); margin: 0 auto; }
.keypad button { min-height: 58px; font-size: 22px; font-weight: 700; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; touch-action: manipulation; color: var(--ink); }
.keypad button:active { background: var(--raised); }
.keypad .wide2 { grid-column: span 2; }
.entry { font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: .18em; min-height: 48px; }
.letters { display: grid; gap: 2px; font-family: ui-monospace, 'Cascadia Mono', monospace; font-size: clamp(17px, 4.6vw, 22px); user-select: none; -webkit-user-select: none; }
.letters span { display: grid; place-items: center; min-height: 36px; border-radius: 6px; cursor: pointer; touch-action: manipulation; }
.letters span.on { background: var(--accent); color: #fff; }
.letters span.err { background: var(--bad-s); color: var(--bad); }
.letters span.miss { outline: 2px dashed var(--warn); }
.mstr { font-family: ui-monospace, 'Cascadia Mono', monospace; font-size: clamp(17px, 4.8vw, 22px); line-height: 2; word-break: break-all; user-select: none; -webkit-user-select: none; letter-spacing: .06em; }
.mstr span { cursor: pointer; padding: 3px 0; border-radius: 3px; touch-action: manipulation; }
.mstr span.found { background: var(--accent); color: #fff; }
.mstr span.err { background: var(--bad-s); color: var(--bad); }
.mstr span.missed { background: var(--warn-s); color: var(--warn); }
.diffs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(94vw, 640px); margin: 0 auto; }
.diffs > div { display: grid; gap: 4px; padding: 6px; border-radius: var(--r); background: var(--stim-bg); border: 1px solid var(--line); }
.diffs svg { width: 100%; aspect-ratio: 1; display: block; }
.diffs .cell { cursor: pointer; border-radius: 6px; }
.diffs .cell.found { outline: 3px solid var(--ok); outline-offset: -3px; }
.diffs .cell.miss { animation: fbad .3s; }
.wchips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.wchips .chip { font-size: 14px; padding: 5px 12px; }

/* ---------- экзаменационный режим ---------- */
.qnav { display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--card); scrollbar-width: none; }
.qnav::-webkit-scrollbar { display: none; }
.qnav button { flex: none; width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--card); font-weight: 700; font-size: 13.5px; cursor: pointer; position: relative; color: var(--ink); }
.qnav button.ans { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.qnav button.cur { outline: 2px solid var(--ink); outline-offset: 1px; }
.qnav button.flag::after { content: ''; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--sun); border: 2px solid var(--card); }
.q { display: grid; gap: 14px; }
.q .qn { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; gap: 8px; align-items: center; }
.q .qt { font-size: 18px; line-height: 1.5; font-weight: 500; }
.q .fig { display: flex; justify-content: center; }
.q .fig svg { width: min(100%, 420px); height: auto; color: var(--ink); }
.opts { display: grid; gap: 8px; }
.opts.g2 { grid-template-columns: 1fr 1fr; }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 13px 14px; min-height: 56px; border-radius: var(--r); border: 1.5px solid var(--line-2); background: var(--card); cursor: pointer; font-size: 16.5px; color: var(--ink); line-height: 1.35; }
.opt .k { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--raised); font-weight: 700; font-size: 13px; flex: none; color: var(--sub); }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.opt.on .k { background: var(--accent); color: #fff; }
.opt svg { width: 100%; max-width: 120px; height: auto; color: var(--ink); }
.opt.svgopt { justify-content: center; padding: 8px; flex-direction: column; gap: 4px; }
.qfoot { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.qfoot .btn { flex: 1; }
.numin { display: flex; gap: 8px; } .numin .input { font-size: 20px; font-weight: 600; }
.worry { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.worry button { border: 1.5px solid var(--line-2); background: var(--card); border-radius: 14px; padding: 10px 2px; cursor: pointer; display: grid; gap: 2px; justify-items: center; font-size: 11.5px; color: var(--sub); }
.worry button b { font-size: 20px; font-family: var(--display); color: var(--ink); }
.worry button.on { border-color: var(--accent); background: var(--accent-soft); }

/* опросники */
.likert { display: grid; gap: 8px; }
.likert button { text-align: left; padding: 13px 16px; border-radius: var(--r); border: 1.5px solid var(--line-2); background: var(--card); cursor: pointer; font-size: 16px; min-height: 52px; color: var(--ink); }
.likert button.on { border-color: var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 12%, var(--card)); }
.sq { font-size: 19px; font-weight: 600; line-height: 1.4; font-family: var(--display); }
.pair { display: grid; gap: 10px; }
.pair button { text-align: left; padding: 16px; border-radius: var(--r); border: 1.5px solid var(--line-2); background: var(--card); cursor: pointer; font-size: 16px; color: var(--ink); }

/* спокойствие */
.breath { width: min(70vw, 300px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; position: relative; }
.breath::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c) 8%, transparent)); transform: scale(var(--s, .55)); transition: transform var(--d, 4s) ease-in-out; }
.breath span { position: relative; font-family: var(--display); font-weight: 700; font-size: 22px; }

/* ---------- результаты ---------- */
.res-head { display: grid; gap: 16px; align-items: center; grid-template-columns: auto 1fr; }
.ring { width: 112px; height: 112px; position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 30px; }
.ring small { position: absolute; left: 0; right: 0; bottom: 24px; text-align: center; font-size: 11px; color: var(--muted); }
.kpis { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.kpi b { display: block; font-family: var(--display); font-size: 20px; line-height: 1.2; }
.kpi span { font-size: 12.5px; color: var(--muted); display: block; }
.kpi i { font-style: normal; font-size: 12px; color: var(--sub); display: block; margin-top: 2px; }
.notes { display: grid; gap: 8px; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--info-s); align-items: flex-start; }
.note.ok { background: var(--ok-s); } .note.warn { background: var(--warn-s); } .note.bad { background: var(--bad-s); }
.note .ic { margin-top: 1px; flex: none; }
.note b { display: block; }
.scale-bar { display: grid; gap: 4px; }
.scale-bar .track { position: relative; height: 10px; border-radius: 999px; background: var(--raised); overflow: hidden; }
.scale-bar .track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--c, var(--accent)); }
.scale-bar .lbl { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.scale-bar .lbl b { font-family: var(--display); }
.qrows { display: grid; gap: 6px; }
.qrow { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.qrow > summary { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer; list-style: none; }
.qrow > summary::-webkit-details-marker { display: none; }
.qrow .st { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.qrow .st.ok { background: var(--ok-s); color: var(--ok); } .qrow .st.bad { background: var(--bad-s); color: var(--bad); } .qrow .st.skip { background: var(--raised); color: var(--muted); }
.qrow .tbar { height: 6px; border-radius: 999px; background: var(--raised); margin-top: 4px; overflow: hidden; }
.qrow .tbar i { display: block; height: 100%; background: var(--muted); }
.qrow .qbody { padding: 0 12px 12px 52px; display: grid; gap: 8px; font-size: 14.5px; }
.qrow .qbody .ans { display: flex; gap: 6px; flex-wrap: wrap; }
.chart { width: 100%; height: auto; display: block; color: var(--muted); }
.chart text { font-size: 11px; fill: var(--muted); font-family: var(--body); }
.chart .grid-l { stroke: var(--line); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--sub); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.ai-box { white-space: pre-wrap; line-height: 1.6; }
.radar text { font-size: 11.5px; fill: var(--sub); font-weight: 600; }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--hover); position: sticky; top: 0; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.link { cursor: pointer; } table.t tr.link:hover td { background: var(--hover); }
.cell-score { font-weight: 700; font-family: var(--display); }
.heat { display: inline-block; min-width: 34px; text-align: center; padding: 2px 6px; border-radius: 6px; font-weight: 700; font-size: 13px; }

/* ---------- окна и уведомления ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(8, 14, 11, .5); display: grid; place-items: end center; padding: 0; }
.modal { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column; border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--sh-float); animation: up .25s var(--ease); }
.modal.wide { max-width: 860px; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 640px) { .overlay { place-items: center; padding: 20px; } .modal { border-radius: var(--r-lg); } }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.modal header h2 { margin: 0; font-size: 18px; }
.modal .body { padding: 6px 16px 16px; overflow-y: auto; }
.modal footer { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.toasts { position: fixed; z-index: 200; left: 50%; top: 12px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-weight: 500; box-shadow: var(--sh-float); animation: up .25s var(--ease); }
.toast.err { background: var(--bad); color: #fff; }

/* формулы */
.fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .92em; margin: 0 2px; line-height: 1.15; }
.fr > span:first-child { border-bottom: 1.4px solid currentColor; padding: 0 3px 1px; }
.fr > span:last-child { padding: 1px 3px 0; }
.rt { white-space: nowrap; } .rt .ov { border-top: 1.4px solid currentColor; padding: 0 2px; } .rt .rn { font-size: .62em; margin-right: -3px; }
sup, sub { font-size: .7em; line-height: 0; }
.md { line-height: 1.6; } .md p { margin: 0 0 10px; }

@media print { .top, .mnav, .foot, .no-print { display: none !important; } body { background: #fff; } .card { break-inside: avoid; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
