/* Слово — веб-кабинет. Тот же язык, что и в приложении: жирный шрифт, чёрное, насыщенные цвета, пилюли. */

:root {
  --paper: #F2F2F7; --card: #FFFFFF; --ink: #000000; --inv: #FFFFFF;
  --mute: #4A4A4F; --dim: #D1D1D6; --line: rgba(0,0,0,.1); --chip: rgba(118,118,128,.16);
  --y: #FFD60A; --o: #FF9F0A; --c: #64D2FF; --g: #30D158; --p: #FF6482; --v: #BF5AF2;
  --bad: #D70015; --good: #248A3D;
  --r: 24px;
  color-scheme: light;
}
[data-theme="dark"] {
  --paper: #000000; --card: #1C1C1E; --ink: #FFFFFF; --inv: #000000;
  --mute: #AEAEB2; --dim: #3A3A3C; --line: rgba(255,255,255,.14); --chip: rgba(118,118,128,.36);
  --bad: #FF6961; --good: #30D158;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font: 500 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { flex-shrink: 0; display: block; }
:focus-visible { outline: 3px solid var(--c); outline-offset: 2px; }

/* ---------- каркас ---------- */
.main { min-height: 100vh; padding: 28px clamp(16px, 4vw, 48px) 120px; max-width: 1480px; }
.has-rail .main { margin-left: 96px; }
.rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: 96px; z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 0 16px;
  background: var(--card); border-right: 1px solid var(--line);
}
.rail-logo { width: 52px; height: 52px; border-radius: 26px; background: var(--ink); color: var(--y); display: grid; place-items: center; font-weight: 900; font-size: 26px; text-decoration: none; margin-bottom: 8px; }
.rail-items { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; scrollbar-width: none; }
.rail-foot { display: flex; flex-direction: column; gap: 2px; }
.rail-foot form { margin: 0; }
.rail-btn {
  width: 80px; border: 0; background: none; padding: 7px 0 6px; border-radius: 18px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--ink);
}
.rail-btn > .ic { width: 46px; height: 46px; padding: 12px; border-radius: 23px; background: var(--chip); transition: background .2s, color .2s; }
.rail-btn .ava { width: 46px !important; height: 46px !important; }
.rail-btn span { font-size: 11.5px; font-weight: 700; letter-spacing: -.01em; }
.rail-btn:hover > .ic { background: var(--dim); }
.rail-btn.is-on > .ic { background: var(--ink); color: var(--inv); }

@media (max-width: 760px) {
  .has-rail .main { margin-left: 0; padding-bottom: 130px; }
  .rail { top: auto; right: 0; width: auto; height: 92px; flex-direction: row; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); }
  .rail-logo { display: none; }
  .rail-items, .rail-foot { flex-direction: row; overflow-x: auto; }
  .rail-btn { width: 70px; }
}

/* ---------- заголовки ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 24px; }
.head h1 { margin: 0; font-size: clamp(34px, 5vw, 54px); font-weight: 800; letter-spacing: -.045em; line-height: 1; text-wrap: balance; }
.head p { margin: 8px 0 0; color: var(--mute); font-weight: 600; }
.head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
h2 { font-size: 30px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; margin: 34px 0 14px; }
h3 { font-size: 21px; font-weight: 800; letter-spacing: -.025em; margin: 0 0 10px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 700; color: var(--mute); margin-bottom: 10px; }
.mute { color: var(--mute); }
.small { font-size: 13.5px; }
.big-num { font-size: 64px; font-weight: 800; letter-spacing: -.055em; line-height: .9; }
.num { font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* ---------- блоки ---------- */
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 900px) { .span2 { grid-column: auto; } }
.card { background: var(--card); border-radius: var(--r); padding: 22px; min-width: 0; }
.card.flat { background: transparent; padding: 0; }
.card.ink { background: var(--ink); color: var(--inv); }
.card.ink .mute { color: var(--dim); }
.tile { border-radius: 28px; padding: 22px; color: #000; display: flex; flex-direction: column; gap: 6px; text-decoration: none; min-height: 150px; position: relative; overflow: hidden; }
.tile .big-num { margin-top: auto; }
.tile b { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.tile small { font-weight: 600; opacity: .8; font-size: 14px; }
a.tile:hover, a.card:hover { filter: brightness(.97); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.sep { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px;
  border-radius: 24px; border: 0; background: var(--ink); color: var(--inv); font-weight: 800; font-size: 16px;
  letter-spacing: -.01em; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { opacity: .88; }
.btn.ghost { background: var(--chip); color: var(--ink); }
.btn.line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.color { color: #000; }
.btn.sm { height: 38px; padding: 0 15px; font-size: 14px; border-radius: 19px; }
.btn.lg { height: 64px; padding: 0 30px; font-size: 20px; border-radius: 32px; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.round { width: 48px; padding: 0; }
.btn.round.sm { width: 38px; }
.btn[disabled] { opacity: .35; pointer-events: none; }
.inline { display: inline; margin: 0; }

/* ---------- подписи ---------- */
.chip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 14px; background: var(--chip); font-size: 13px; font-weight: 700; white-space: nowrap; }
.chip-admin { background: var(--v); color: #000; } .chip-teacher { background: var(--c); color: #000; }
.chip-assistant { background: var(--o); color: #000; } .chip-student { background: var(--y); color: #000; } .chip-parent { background: var(--g); color: #000; }
.mode { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.mode i { width: 14px; height: 14px; border-radius: 7px; box-shadow: inset 0 0 0 2px var(--ink); display: inline-block; }
.flag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12.5px; font-weight: 800; background: var(--p); color: #000; }
.flag.idle { background: var(--dim); color: var(--ink); }
.ava { border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; color: #000; flex-shrink: 0; letter-spacing: -.02em; }
.dot { width: 10px; height: 10px; border-radius: 5px; display: inline-block; }

/* ---------- прогресс ---------- */
.bar { display: block; height: 10px; border-radius: 5px; background: var(--dim); overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; border-radius: 5px; }
.blocks { display: flex; gap: 4px; }
.blocks i { flex: 1; height: 22px; border-radius: 6px; background: var(--dim); }
.blocks i.on { background: var(--ink); }
.spark { width: 100%; height: 64px; display: block; }

/* ---------- таблицы ---------- */
.tbl-wrap { overflow-x: auto; background: var(--card); border-radius: var(--r); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--mute); padding: 14px 16px 8px; white-space: nowrap; }
.tbl td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tr.link { cursor: pointer; }
.tbl tr.link:hover td { background: var(--paper); }
.tbl .who { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; }
.tbl .who small { display: block; color: var(--mute); font-weight: 600; font-size: 12.5px; }
.heat { border-collapse: separate; border-spacing: 4px; }
.heat td, .heat th { padding: 0; border: 0; }
.heat th.w { writing-mode: vertical-rl; transform: rotate(180deg); padding: 6px 0; font-size: 13px; font-weight: 800; color: var(--ink); height: 92px; }
.heat .c { width: 34px; height: 34px; border-radius: 10px; display: block; }
.c-new { background: var(--dim); } .c-learning { background: var(--o); } .c-known { background: var(--ink); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; font-weight: 700; color: var(--mute); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* ---------- формы ---------- */
form.form { display: grid; gap: 16px; max-width: 760px; }
.field { display: grid; gap: 7px; }
.field > span { font-size: 14px; font-weight: 700; }
.field small { color: var(--mute); font-size: 13px; font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; min-height: 52px; padding: 13px 16px; border-radius: 16px; border: 2px solid transparent;
  background: var(--card); font-size: 16px; font-weight: 600; outline: none;
}
.card .input, .card select.input { background: var(--paper); }
.input:focus { border-color: var(--ink); }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.4; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14.5px; }
.cols { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); }
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 22px; background: var(--chip); font-weight: 700; }
.seg input:checked + span { background: var(--ink); color: var(--inv); }
.seg input:focus-visible + span { outline: 3px solid var(--c); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input { width: auto; min-width: 220px; min-height: 44px; padding: 9px 14px; }

/* ---------- сообщения ---------- */
.flash { padding: 15px 20px; border-radius: 18px; font-weight: 700; margin-bottom: 16px; background: var(--ink); color: var(--inv); }
.flash-err { background: var(--bad); color: #fff; }
.flash-info { background: var(--c); color: #000; }
.empty { padding: 34px 22px; border-radius: var(--r); background: var(--card); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.empty b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.empty span { color: var(--mute); font-weight: 600; }

/* ---------- лента ---------- */
.feed { display: flex; flex-direction: column; }
.feed > div { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.feed > div:first-child { border-top: 0; }
.feed .t { margin-left: auto; color: var(--mute); font-size: 13px; font-weight: 600; white-space: nowrap; }
.ok { color: var(--good); font-weight: 800; } .no { color: var(--bad); font-weight: 800; }

/* ---------- шаги дня (как в приложении) ---------- */
.steps { position: relative; display: flex; justify-content: space-between; max-width: 520px; }
.steps::before { content: ""; position: absolute; left: 40px; right: 40px; top: 31px; height: 2px; background: var(--line); }
.step { position: relative; width: 96px; display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; text-decoration: none; }
.step i { width: 64px; height: 64px; border-radius: 32px; display: grid; place-items: center; font-style: normal; font-size: 26px; font-weight: 800; background: var(--card); box-shadow: 0 0 0 5px var(--paper); }
.step.done i { background: var(--ink); color: var(--inv); }
.step.now i { background: var(--y); color: #000; }
.step b { font-size: 13.5px; }
.step small { font-size: 12px; color: var(--mute); font-weight: 600; line-height: 1.2; }

/* ---------- «Как я учусь» и «Древо» — типографика из приложения ---------- */
.weights { display: flex; flex-direction: column; }
.weights .lbl { font-size: 13.5px; font-weight: 800; }
.weights .lbl span { font-weight: 600; color: var(--mute); }
.weights .w { letter-spacing: -.05em; line-height: 1; padding-bottom: .06em; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.fills { display: flex; flex-direction: column; gap: 2px; }
.fills .lbl { font-size: 13.5px; font-weight: 800; }
.fills .lbl span { font-weight: 600; color: var(--mute); }
.fill { position: relative; display: block; font-weight: 800; letter-spacing: .012em; line-height: 1; white-space: nowrap; }
.fill > span { display: block; padding: .03em .05em .14em .04em; }
.fill .sil { position: absolute; left: 0; top: 0; color: var(--ink); -webkit-text-stroke: 6px var(--ink); }
.fill .fg { position: relative; color: transparent; -webkit-background-clip: text; background-clip: text; }
[data-theme="dark"] .fill .sil { color: transparent; -webkit-text-stroke: 0; }
.lvl { display: flex; align-items: center; gap: 14px; }
.lvl b { font-size: 56px; font-weight: 800; letter-spacing: -.05em; line-height: 1; }
.lvl b.next { color: transparent; -webkit-text-stroke: 2px var(--ink); }
.lvl .bar { flex: 1; height: 16px; border-radius: 8px; }

/* ---------- обучение в браузере ---------- */
.learn { max-width: 720px; margin: 0 auto; text-align: center; }
.learn .word { font-size: clamp(80px, 16vw, 168px); font-weight: 800; letter-spacing: -.05em; line-height: 1; margin: 30px 0 8px; }
.learn .chunks { display: flex; justify-content: center; gap: 18px; font-size: 22px; font-weight: 700; color: var(--mute); }
.learn .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; }
.learn .opt { height: 92px; border-radius: 28px; border: 0; background: var(--card); font-size: 24px; font-weight: 800; cursor: pointer; }
.learn .opt.right { background: var(--g); color: #000; } .learn .opt.wrong { background: var(--p); color: #000; }
.learn .progress { display: flex; gap: 6px; justify-content: center; }
.learn .progress i { width: 34px; height: 8px; border-radius: 4px; background: var(--dim); }
.learn .progress i.on { background: var(--ink); }

/* ---------- живой урок ---------- */
.live-pin { font-size: clamp(90px, 15vw, 180px); font-weight: 900; letter-spacing: .06em; line-height: 1; }
.live-q { font-size: clamp(70px, 12vw, 150px); font-weight: 800; letter-spacing: -.05em; line-height: 1; }
.pads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pad { min-height: 110px; border-radius: 30px; border: 0; font-size: 26px; font-weight: 800; color: #000; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 0 20px; }
.pad em { font-style: normal; width: 44px; height: 44px; border-radius: 22px; background: #000; color: #fff; display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.pad.right { outline: 6px solid var(--ink); } .pad.dim { opacity: .3; }
.coop { height: 26px; border-radius: 13px; background: var(--dim); overflow: hidden; }
.coop > span { display: block; height: 100%; background: var(--g); transition: width .6s; }

/* ---------- вход ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: var(--ink); color: var(--inv); padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth-art .w { font-size: clamp(110px, 17vw, 240px); font-weight: 800; letter-spacing: -.06em; line-height: .85; }
.auth-art .w span { display: block; }
.auth-form { padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; gap: 18px; max-width: 560px; }
.demo { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.demo button { text-align: left; border: 0; border-radius: 18px; padding: 12px 14px; background: var(--card); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.demo button b { font-size: 15px; } .demo button small { color: var(--mute); font-weight: 600; font-size: 12.5px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-art { min-height: 260px; } }

/* ---------- код и API ---------- */
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13.5px; }
pre { background: var(--ink); color: var(--inv); padding: 16px 18px; border-radius: 18px; overflow-x: auto; line-height: 1.5; margin: 8px 0 0; }
.ep { display: grid; grid-template-columns: 74px 1fr; gap: 6px 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.ep .m { height: 28px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; color: #000; }
.m-GET { background: var(--c); } .m-POST { background: var(--y); } .m-PATCH { background: var(--o); } .m-DELETE { background: var(--p); }
.ep code.path { font-size: 15px; font-weight: 700; }

.hide-sm { } @media (max-width: 760px) { .hide-sm { display: none; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- добавки для Laravel-версии ---------- */
:root { --hollow: #FFFFFF; }
[data-theme="dark"] { --hollow: #3A3A3C; }
.band { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 66px; padding: 0 22px; border-radius: 26px; box-shadow: inset 0 0 0 3px var(--ink); font-size: 24px; cursor: pointer; list-style: none; }
.band b { font-weight: 800; letter-spacing: -.02em; }
.band span { font-size: 34px; font-weight: 800; letter-spacing: -.04em; }
.band-d summary::-webkit-details-marker, .fill-d summary::-webkit-details-marker { display: none; }
.band-d p { margin: 8px 6px 4px; font-size: 18px; font-weight: 600; }
.fill-d summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; }
.fill .sil { position: absolute; left: 0; top: 0; color: var(--ink); -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; }
.path { display: flex; align-items: center; margin-top: 10px; }
.path i { flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; }
.path .p-done { width: 40px; height: 40px; background: var(--ink); color: var(--inv); }
.path .p-now { width: 52px; height: 52px; box-shadow: inset 0 0 0 5px var(--ink); }
.path .p-next { width: 40px; height: 40px; box-shadow: inset 0 0 0 5px var(--dim); }
.path s { flex: 1; height: 6px; background: var(--ink); text-decoration: none; }
.path s.off { background: var(--dim); }
.mode-strip { display: flex; height: 26px; border-radius: 13px; overflow: hidden; gap: 3px; }
.mode-strip span { box-shadow: inset 0 0 0 2px var(--ink); border-radius: 6px; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pagination a, .pagination span { min-width: 40px; height: 40px; border-radius: 20px; display: inline-grid; place-items: center; padding: 0 12px; background: var(--chip); text-decoration: none; font-weight: 700; }
.pagination .on { background: var(--ink); color: var(--inv); }

/* особенность ученика меняет и веб-кабинет */
body.mode-vision { font-size: 19px; }
body.mode-vision .card, body.mode-vision .tile { box-shadow: inset 0 0 0 3px var(--ink); }
body.mode-vision .mute, body.mode-vision small { color: var(--ink) !important; opacity: 1 !important; }
body.mode-dys { --paper: #FBF3DC; letter-spacing: .03em; word-spacing: .12em; }
body.mode-dys .card { background: #FFFBEF; }
[data-theme="dark"] body.mode-dys { --paper: #000; }
[data-theme="dark"] body.mode-dys .card { background: var(--card); }
body.mode-calm { --paper: #ECE8DF; }
body.mode-calm * { animation: none !important; transition: none !important; }
[data-theme="dark"] body.mode-calm { --paper: #000; }
body.mode-motor .btn { height: 64px; padding: 0 30px; font-size: 19px; border-radius: 32px; }
body.mode-motor .learn .opt { height: 120px; }

/* ---------- слайды: одна большая карточка на экране вместо длинной прокрутки ----------
   Спокойное движение без вспышек: короткий сдвиг и проявление. При «Без анимации», режиме «Нужен покой»
   и системной настройке «уменьшить движение» карточка просто сменяется. */
.deck-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.deck-tabs { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.deck-tabs::-webkit-scrollbar { display: none; }
.deck-tab { flex-shrink: 0; height: 44px; padding: 0 18px; border: 0; border-radius: 22px; background: var(--chip); font-weight: 800; letter-spacing: -.01em; cursor: pointer; white-space: nowrap; }
.deck-tab[aria-selected="true"] { background: var(--ink); color: var(--inv); }
.deck-tab .n { opacity: .55; margin-right: 6px; font-variant-numeric: tabular-nums; }
.deck-count { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--mute); white-space: nowrap; }
.deck-stage { position: relative; }
.slide { min-width: 0; }
.deck:not(.js) .deck-bar, .deck:not(.js) .deck-foot { display: none; }
.deck:not(.js) .slide + .slide { margin-top: 28px; }
.deck.js .slide { display: none; }
.deck.js .slide.on { display: block; animation: slide-in .34s cubic-bezier(.2, .7, .2, 1) both; }
.deck.js.back .slide.on { animation-name: slide-in-back; }
@keyframes slide-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes slide-in-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .deck.js .slide.on { animation: none; } }
body.still .deck.js .slide.on { animation: none; }
.slide-card { background: var(--card); border-radius: 32px; padding: clamp(20px, 3vw, 34px); min-height: min(62vh, 620px); display: flex; flex-direction: column; gap: 18px; }
.slide-card.ink { background: var(--ink); color: var(--inv); }
.slide-title { margin: 0; font-size: clamp(28px, 4vw, 44px); font-weight: 800; letter-spacing: -.04em; line-height: 1.02; text-wrap: balance; }
.slide-kicker { font-weight: 800; color: var(--mute); letter-spacing: .02em; }
.deck-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.deck-go { min-height: 64px; flex: 1; max-width: 360px; border: 0; border-radius: 32px; background: var(--card); padding: 10px 24px; cursor: pointer; display: flex; align-items: center; gap: 12px; text-align: left; font-weight: 800; font-size: 17px; }
.deck-go small { display: block; color: var(--mute); font-size: 13px; font-weight: 700; }
.deck-go.next { margin-left: auto; justify-content: flex-end; text-align: right; background: var(--ink); color: var(--inv); }
.deck-go.next small { color: var(--dim); }
.deck-go[disabled] { visibility: hidden; }
.deck-go .ic { width: 26px; height: 26px; }
@media (max-width: 760px) {
  .deck-count { display: none; }
  .slide-card { border-radius: 26px; min-height: 0; }
  .deck-go { font-size: 15px; padding: 8px 18px; min-height: 58px; }
}

/* ---------- учебник: раздел курса ---------- */
.unit-hero { border-radius: 32px; padding: clamp(20px, 3vw, 34px); color: #000; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: end; }
.unit-hero .u-n { font-size: clamp(72px, 12vw, 150px); font-weight: 800; letter-spacing: -.06em; line-height: .85; }
.unit-hero h2 { margin: 0; font-size: clamp(30px, 4.4vw, 52px); font-weight: 800; letter-spacing: -.045em; line-height: 1; }
.unit-hero p { margin: 6px 0 0; font-weight: 700; }
.gram { display: grid; gap: 8px; }
.gram div { background: var(--paper); border-radius: 18px; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.gram b { font-size: 19px; letter-spacing: -.02em; }
.gram span { color: var(--mute); font-weight: 600; }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-list > * { background: var(--chip); border-radius: 18px; padding: 8px 14px; font-weight: 700; text-decoration: none; }
@media (max-width: 640px) { .unit-hero { grid-template-columns: 1fr; } }

/* ---------- занятие в браузере ---------- */
.pr { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.pr-top { display: flex; align-items: center; gap: 14px; }
.pr-bar { flex: 1; height: 12px; border-radius: 6px; background: var(--dim); overflow: hidden; }
.pr-bar i { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 6px; transition: width .4s ease; }
.pr-n { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.pr-head { display: flex; flex-direction: column; gap: 2px; }
.pr-head span { font-weight: 700; color: var(--mute); }
.pr-head b { font-size: 24px; letter-spacing: -.03em; }
.pr-stage { background: var(--card); border-radius: 36px; padding: clamp(22px, 4vw, 44px); min-height: min(64vh, 640px); display: flex; flex-direction: column; gap: 22px; text-align: center; }
.pr-stage.in { animation: slide-in .34s cubic-bezier(.2, .7, .2, 1) both; }
@media (prefers-reduced-motion: reduce) { .pr-stage.in { animation: none; } }
body.still .pr-stage.in { animation: none; }
.pr-help { margin: 0; color: var(--mute); font-weight: 600; text-align: center; }
.pr-q { font-weight: 800; color: var(--mute); font-size: 18px; }
.pr-word { font-size: clamp(56px, 11vw, 128px); font-weight: 800; letter-spacing: -.05em; line-height: 1; overflow-wrap: anywhere; }
.pr-word.sm { font-size: clamp(34px, 6vw, 60px); letter-spacing: -.035em; line-height: 1.08; }
.pr-sub { font-size: 22px; font-weight: 700; color: var(--mute); }
.pr-chunks { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.pr-chunks span { background: var(--paper); border-radius: 16px; padding: 8px 14px; font-size: 24px; font-weight: 800; }
.pr-chunks small { display: block; font-size: 14px; color: var(--mute); font-weight: 700; }
.pr-ex { background: var(--paper); border-radius: 22px; padding: 16px 20px; text-align: left; font-size: 20px; font-weight: 700; }
.pr-ex span { display: block; color: var(--mute); font-size: 16px; font-weight: 600; margin-top: 4px; }
.pr-sign { background: var(--c); color: #000; border-radius: 22px; padding: 14px 18px; text-align: left; font-weight: 700; }
.pr-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: auto; }
.pr-opts.one { grid-template-columns: 1fr; }
.pr-opt { min-height: 88px; border-radius: 28px; border: 0; background: var(--paper); font-size: 24px; font-weight: 800; letter-spacing: -.02em; cursor: pointer; padding: 10px 18px; }
.pr-opt:hover { box-shadow: inset 0 0 0 3px var(--ink); }
.pr-opt.right { background: var(--g); color: #000; }
.pr-opt.wrong { background: var(--p); color: #000; }
.pr-opt[disabled] { cursor: default; }
.pr-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 76px; padding: 12px; border-radius: 24px; box-shadow: inset 0 0 0 3px var(--dim); }
.pr-slots.full { box-shadow: inset 0 0 0 3px var(--ink); }
.pr-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pr-tile { min-width: 60px; height: 60px; padding: 0 18px; border: 0; border-radius: 30px; background: var(--ink); color: var(--inv); font-size: 24px; font-weight: 800; cursor: pointer; }
.pr-tile small { font-size: 13px; opacity: .7; margin-left: 4px; }
.pr-slots .pr-tile { background: var(--y); color: #000; }
.pr-tile.used { visibility: hidden; }
.pr-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: auto; }
.pr-msg { min-height: 30px; font-size: 22px; font-weight: 800; }
.pr-bubble { align-self: flex-start; max-width: 85%; background: var(--paper); border-radius: 28px 28px 28px 8px; padding: 18px 22px; text-align: left; }
.pr-bubble b { display: block; font-size: 26px; letter-spacing: -.025em; line-height: 1.15; }
.pr-bubble span { display: block; color: var(--mute); font-weight: 600; margin-top: 6px; }
.pr-who { align-self: flex-start; font-weight: 800; color: var(--mute); }
.pr-fin { margin: auto 0; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.pr-fin .pr-word { font-size: clamp(48px, 8vw, 96px); }
body.mode-motor .pr-opt { min-height: 116px; font-size: 28px; }
body.mode-motor .pr-tile { height: 84px; min-width: 84px; font-size: 30px; border-radius: 42px; }
body.mode-vision .pr-opt, body.mode-vision .pr-tile { font-size: 32px; }
body.mode-vision .pr-stage { box-shadow: inset 0 0 0 4px var(--ink); }
@media (max-width: 560px) { .pr-opts { grid-template-columns: 1fr; } .pr-opt { min-height: 70px; font-size: 21px; } .pr-stage { border-radius: 28px; } }

/* ---------- карточки входа (печать) ---------- */
.login-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.login-card { background: var(--card); border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: inset 0 0 0 2px var(--ink); break-inside: avoid; }
.lc-top { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.lc-logo { width: 34px; height: 34px; border-radius: 17px; background: #000; color: #FFD60A; display: grid; place-items: center; font-weight: 900; }
.lc-name { font-size: 26px; letter-spacing: -.03em; line-height: 1.05; }
.login-card dl { margin: 0; display: grid; gap: 4px; }
.login-card dl div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.login-card dt { color: var(--mute); font-weight: 700; }
.login-card dd { margin: 0; font-weight: 800; font-size: 19px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.login-card small { color: var(--mute); font-weight: 600; }
@media print {
  .rail, .no-print, .flash, .crumb { display: none !important; }
  .has-rail .main { margin: 0; padding: 0; }
  body { background: #fff; color: #000; }
  .login-cards { grid-template-columns: 1fr 1fr; gap: 8mm; }
  .login-card { box-shadow: none; border: 1.5px dashed #000; background: #fff; color: #000; }
}

/* ---------- сообщения ---------- */
.inbox { display: grid; grid-template-columns: 340px 1fr; gap: 14px; height: calc(100vh - 200px); min-height: 480px; }
.threads { background: var(--card); border-radius: 28px; padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.thread { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 20px; text-decoration: none; }
.thread span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.thread small { color: var(--mute); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread.on, .thread:hover { background: var(--paper); }
.chat { background: var(--card); border-radius: 28px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.chat-back { display: none; }
.chat-feed { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 76%; align-self: flex-start; background: var(--paper); border-radius: 22px 22px 22px 6px; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.msg small { color: var(--mute); font-size: 12px; font-weight: 700; }
.msg.mine { align-self: flex-end; background: var(--ink); color: var(--inv); border-radius: 22px 22px 6px 22px; }
.msg.mine small { color: var(--dim); }
.msg.report { background: var(--y); color: #000; }
.msg.report small { color: rgba(0,0,0,.6); }
.chat-form { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { flex: 1; min-height: 52px; max-height: 160px; font-family: inherit; resize: vertical; }
@media (max-width: 860px) {
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox.has-current .threads { display: none; }
  .inbox:not(.has-current) .chat { display: none; }
  .chat { height: calc(100vh - 260px); min-height: 420px; }
  .chat-back { display: inline-flex; }
}
.rail-btn { position: relative; }
.rail-badge { position: absolute; top: 2px; right: 12px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--o); color: #000; font-style: normal; font-size: 12px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; }
.thread .ava, .who .ava, .msg .ava { flex-shrink: 0; }

/* узкие экраны: ничего не вылезает за край */
.slide-card > *, .deck-stage, .slide, .ep > div, .grid > * { min-width: 0; }
.slide-card { max-width: 100%; }
.deck-go { min-width: 0; }
.deck-go b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  .btn { white-space: normal; height: auto; min-height: 48px; padding-block: 10px; text-align: center; line-height: 1.2; }
  .btn.sm { min-height: 38px; padding-block: 6px; }
  .btn.round { padding: 0; height: 48px; min-height: 0; }
  .btn.round.sm { height: 38px; }
  .feed > div { flex-wrap: wrap; }
  .feed .t { margin-left: 0; white-space: normal; }
  .head .actions { width: 100%; }
}
.ep .chip { height: auto; min-height: 28px; white-space: normal; padding-block: 4px; } .ep .path { overflow-wrap: anywhere; }

/* ---------- страница-экран: слайд занимает весь экран, страница не прокручивается ---------- */
body.fit { overflow: hidden; height: 100vh; height: 100dvh; }
body.fit .main { height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding-top: 18px; padding-bottom: 18px; overflow: hidden; }
body.fit .main > .crumb { margin-bottom: 4px; }
body.fit .main > .head { margin: 0 0 12px; flex-shrink: 0; }
body.fit .main > .head h1 { font-size: clamp(26px, min(5vw, 6vh), 54px); }
body.fit .main > .flash { position: fixed; z-index: 40; top: 14px; left: 50%; transform: translateX(-50%); width: min(640px, calc(100vw - 32px)); margin: 0; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
body.fit.has-rail .main > .flash { left: calc(50% + 48px); width: min(640px, calc(100vw - 140px)); }
body.fit .deck { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.fit .deck-bar { margin-bottom: 10px; flex-shrink: 0; }
body.fit .deck-stage { flex: 1; min-height: 0; position: relative; }
body.fit .deck.js .slide { position: absolute; inset: 0; }
body.fit .deck.js .slide.on { display: flex; flex-direction: column; }
body.fit .deck.measuring .slide { display: flex !important; flex-direction: column; visibility: hidden; animation: none !important; }
body.fit .slide > .slide-card { flex: 1; min-height: 0; height: 100%; overflow: hidden; gap: clamp(10px, 1.8vh, 18px); }
body.fit .slide-card.dense { font-size: 14px; gap: 8px; }
body.fit .slide-card.dense .tile { min-height: 110px; }
body.fit .slide-card.dense .big-num { font-size: 52px; }
body.fit .slide-card.overflow { overflow-y: auto; overscroll-behavior: contain; }
body.fit .deck-foot { margin-top: 10px; flex-shrink: 0; }
body.fit .deck-go { min-height: 56px; }
.deck-tab.part { padding: 0 12px; opacity: .8; }
@media (max-width: 760px) {
  body.fit .main { height: calc(100dvh - 92px - env(safe-area-inset-bottom)); padding-top: 12px; padding-bottom: 10px; }
  body.fit.has-rail .main > .flash { left: 50%; width: calc(100vw - 32px); }
  body.fit .main > .head { margin-bottom: 8px; gap: 8px; }
  body.fit .main > .head p { display: none; }
  body.fit .main > .head .actions .btn { min-height: 40px; height: 40px; padding: 0 14px; font-size: 14px; }
  body.fit .main > .head .ava { width: 44px !important; height: 44px !important; font-size: 17px !important; }
  body.fit .deck-go { min-height: 48px; padding: 4px 14px; }
  body.fit .deck-go small { display: none; }
  body.fit .slide-card { padding: 16px; border-radius: 24px; }
}
@media (max-height: 640px) {
  body.fit .main > .head p, body.fit .main > .crumb { display: none; }
  body.fit .deck-go small { display: none; }
  body.fit .deck-go { min-height: 46px; }
}
body.fit .main { min-height: 0; }
body.fit .slide-card > * { flex-shrink: 0; }
body.fit .slide-card.overflow > * { flex-shrink: 0; }

/* занятие: ровно один экран, размеры от высоты окна */
body.practice-page { overflow: hidden; height: 100dvh; }
body.practice-page .main { height: 100vh; height: 100dvh; min-height: 0; padding-top: 14px; padding-bottom: 14px; display: flex; flex-direction: column; overflow: hidden; }
body.practice-page .main > .flash { display: none; }
body.practice-page .pr { flex: 1; min-height: 0; width: 100%; max-width: 900px; gap: clamp(6px, 1.4vh, 14px); }
body.practice-page .pr-stage { flex: 1; min-height: 0; overflow: hidden; gap: clamp(8px, 2vh, 22px); padding: clamp(14px, 3vh, 40px) clamp(14px, 3vw, 40px); }
body.practice-page .pr-word { font-size: clamp(36px, min(11vw, 13vh), 128px); }
body.practice-page .pr-word.sm { font-size: clamp(24px, min(6vw, 6.5vh), 60px); }
body.practice-page .pr-opt { min-height: clamp(52px, 9vh, 96px); font-size: clamp(18px, 2.8vh, 26px); }
body.practice-page.mode-motor .pr-opt { min-height: clamp(64px, 12vh, 120px); }
body.practice-page .pr-tile { height: clamp(46px, 7.5vh, 64px); font-size: clamp(18px, 3vh, 24px); }
body.practice-page.mode-motor .pr-tile { height: clamp(56px, 10vh, 84px); }
body.practice-page .pr-chunks span { font-size: clamp(17px, 2.8vh, 24px); padding: 6px 12px; }
body.practice-page .pr-ex { font-size: clamp(15px, 2.2vh, 20px); padding: 10px 16px; }
body.practice-page .pr-slots { min-height: clamp(56px, 9vh, 76px); }
@media (max-width: 760px) { body.practice-page .main { height: calc(100dvh - 92px - env(safe-area-inset-bottom)); padding-top: 10px; padding-bottom: 8px; } }
@media (max-height: 700px) { body.practice-page .pr-help, body.practice-page .pr-head span { display: none; } }
@media (max-height: 760px), (max-width: 560px) {
  body.fit .unit-hero { padding: 14px 18px; gap: 8px; }
  body.fit .unit-hero .u-n { font-size: 64px; }
  body.fit .unit-hero h2 { font-size: clamp(24px, 6vw, 36px); }
  body.fit .tile { min-height: 104px; padding: 16px; }
  body.fit .big-num { font-size: clamp(40px, 7vh, 64px); }
}
@media (max-width: 560px) { body.fit .unit-hero .u-n { display: none; } }
/* сообщения тоже в один экран: прокручивается только лента переписки */
body.fit .inbox { flex: 1; min-height: 0; height: auto; }
@media (max-width: 860px) { body.fit .chat { height: auto; min-height: 0; flex: 1; } body.fit .inbox.has-current { display: flex; flex-direction: column; } }
/* телефон: шапка страницы компактнее, чтобы слайду досталось больше места */
@media (max-width: 760px) {
  body.fit .main > .crumb { display: none; }
  body.fit .main > .head h1 { font-size: 24px; letter-spacing: -.03em; }
  body.fit .main > .head .ava { display: none; }
  body.fit .main > .head > .row { gap: 0 !important; }
  body.fit .deck-bar { margin-bottom: 8px; }
  body.fit .deck-tab { height: 38px; padding: 0 14px; font-size: 14px; }
  body.fit .deck-foot { margin-top: 8px; }
  body.fit .deck-go { min-height: 44px; font-size: 14px; }
  body.fit .slide-card { padding: 14px; gap: 10px; }
  body.fit .pill-list > * { padding: 6px 11px; font-size: 14px; }
  body.fit .gram div { padding: 8px 12px; }
  body.fit .gram b { font-size: 16px; }
}

/* ================= компоновка v2: экран = одна карточка ================= */
body.fit .main { padding-top: 14px; padding-bottom: 14px; }
.stage-top { display: flex; align-items: center; gap: 10px; flex-shrink: 0; min-height: 52px; margin-bottom: 12px; }
.st-back { width: 52px; height: 52px; border-radius: 26px; background: var(--card); display: grid; place-items: center; flex-shrink: 0; color: var(--ink); text-decoration: none; }
.st-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.st-page { font-size: 13px; font-weight: 700; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-slide { font-size: clamp(18px, 2.4vw, 24px); font-weight: 800; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-btn { height: 44px; min-width: 44px; padding: 0 14px; border-radius: 22px; border: 0; background: var(--card); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; flex-shrink: 0; }
.st-count { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--mute); flex-shrink: 0; min-width: 52px; text-align: right; }
body.fit .deck { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.fit .slide > .slide-card { border-radius: 36px; }
.cover-card { justify-content: space-between; }
.cover-card .head { display: flex; margin: 0; }
.cover-card .head h1 { font-size: clamp(32px, min(6vw, 8vh), 72px); }
.toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.toc-item { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; border: 0; border-radius: 22px; background: var(--paper); text-align: left; font-weight: 800; font-size: 18px; letter-spacing: -.02em; cursor: pointer; color: var(--ink); }
.toc-item i { font-style: normal; width: 36px; height: 36px; border-radius: 18px; background: var(--ink); color: var(--inv); display: grid; place-items: center; font-size: 15px; flex-shrink: 0; }
.toc-item span { flex: 1; min-width: 0; }
.toc-item:hover { box-shadow: inset 0 0 0 3px var(--ink); }
body.fit .deck-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; margin-top: 12px; flex-shrink: 0; }
body.fit .deck-go { height: 60px; min-height: 0; max-width: none; flex: none; border-radius: 30px; padding: 0 22px; gap: 10px; font-size: 16px; display: flex; align-items: center; }
body.fit .deck-go.prev { justify-self: start; background: var(--card); color: var(--ink); }
body.fit .deck-go.next { justify-self: end; background: var(--ink); color: var(--inv); margin: 0; }
body.fit .deck-go .lbl { max-width: 24vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 800; }
body.fit .deck-go[disabled] { visibility: hidden; }
.dots { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; max-width: 46vw; }
.dot { width: 12px; height: 12px; border-radius: 6px; border: 0; padding: 0; background: var(--dim); cursor: pointer; }
.dot.on { width: 34px; background: var(--ink); }
body:not(.still) .dot { transition: width .3s ease, background .3s ease; }
@media (max-width: 760px) {
  .stage-top { min-height: 44px; margin-bottom: 8px; gap: 8px; }
  .st-back { width: 44px; height: 44px; }
  .st-btn span { display: none; }
  .st-btn { height: 40px; min-width: 40px; padding: 0 10px; }
  body.fit .deck-go { height: 52px; padding: 0 16px; }
  body.fit .deck-go .lbl { display: none; }
  .dots { gap: 6px; }
  .dot { width: 9px; height: 9px; }
  .dot.on { width: 22px; }
  .toc { grid-template-columns: 1fr 1fr; gap: 8px; }
  .toc-item { min-height: 52px; font-size: 15px; padding: 8px 10px; gap: 8px; }
  .toc-item i { width: 28px; height: 28px; font-size: 13px; }
  .toc-item .ic { display: none; }
  body.fit .slide > .slide-card { border-radius: 26px; }
}

/* пауза */
.pause { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, var(--paper) 88%, transparent); display: grid; place-items: center; padding: 16px; }
.pause-card { background: var(--card); border-radius: 36px; padding: clamp(24px, 5vw, 48px); max-width: 560px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.pause-card b { font-size: clamp(40px, 7vw, 64px); letter-spacing: -.05em; line-height: 1; }
.pause-card p { margin: 0; font-size: 20px; font-weight: 600; }
.pause-breath { color: var(--mute); }

/* задержка указателя («трудно попадать»): полоска медленно заполняется снизу, без мигания */
.dwelling { position: relative; overflow: hidden; }
.dwelling::after { content: ""; position: absolute; left: 0; bottom: 0; height: 6px; width: 100%; background: var(--o); transform-origin: left; animation: dwell var(--dwell, 1.4s) linear forwards; }
@keyframes dwell { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* «Трудно попадать»: всё крупнее, кнопки листания огромные */
body.mode-motor.fit .deck-go { height: 84px; min-width: 120px; border-radius: 42px; font-size: 19px; }
body.mode-motor .toc-item { min-height: 84px; font-size: 21px; }
body.mode-motor .dot { width: 18px; height: 18px; border-radius: 9px; }
body.mode-motor .dot.on { width: 44px; }
body.mode-motor .st-back { width: 64px; height: 64px; border-radius: 32px; }

/* «Плохо вижу»: всё крупно и контрастно, фокус огромный */
body.mode-vision .st-slide { font-size: clamp(22px, 3vw, 32px); }
body.mode-vision :focus-visible { outline: 5px solid var(--o); outline-offset: 3px; }
body.mode-vision .slide-card { font-size: 20px; }
body.mode-vision .toc-item { font-size: 22px; min-height: 76px; box-shadow: inset 0 0 0 3px var(--ink); }

/* «Трудно читать»: тёплый фон, больше воздуха между строками и словами */
body.mode-dys .slide-card { line-height: 1.6; word-spacing: .16em; }
body.mode-dys .toc-item { font-size: 20px; }

/* «Нужен покой»: приглушённые цвета, без процентов, весь план виден точками */
body.mode-calm .slide-card .tile { filter: saturate(.55); }
body.mode-calm .dots { max-width: 60vw; }

/* «Эпилепсия»: ничего не движется, мягкая яркость, без чистого белого и резких контрастных пятен */
body.mode-epi * { animation: none !important; transition: none !important; }
body.mode-epi { --paper: #E6E3EA; --card: #F3F1F5; --ink: #2B2830; --inv: #F3F1F5; --mute: #5A5560; --dim: #C9C4CF; }
[data-theme="dark"] body.mode-epi { --paper: #17151A; --card: #232027; --ink: #E4DFE8; --inv: #232027; --mute: #A9A2AF; --dim: #3B3640; }
body.mode-epi .tile, body.mode-epi .card[style*="background:var(--y)"], body.mode-epi .unit-hero { filter: saturate(.45) brightness(.97); }
body.mode-epi .heat .c, body.mode-epi .bar i { filter: saturate(.5); }
body.mode-epi .rail-btn.is-on > .ic { background: var(--ink); }

/* занятие по особенностям */
.pr-chunks span.now { background: var(--y); color: #000; }
body:not(.still) .pr-chunks span { transition: background .25s ease, color .25s ease; }
.scan { box-shadow: inset 0 0 0 6px var(--o) !important; }
.pr-next { margin-top: 0; }
/* «Эпилепсия»: ответ отмечается значком и рамкой, без заливки экрана цветом */
body.mode-epi .pr-opt.right, body.mode-epi .pr-opt.wrong { background: var(--card); color: var(--ink); }
body.mode-epi .pr-opt.right { box-shadow: inset 0 0 0 4px #5E8F6E; }
body.mode-epi .pr-opt.right::after { content: "  ✓ верно"; font-size: .7em; color: #4C7A5B; }
body.mode-epi .pr-opt.wrong { box-shadow: inset 0 0 0 3px var(--dim); opacity: .7; }
body.mode-epi .pr-chunks span.now { background: var(--dim); color: var(--ink); }
body.mode-epi .pr-slots .pr-tile { background: var(--dim); color: var(--ink); }
/* «Нужен покой»: ошибка не краснеет */
body.mode-calm .pr-opt.wrong { background: var(--paper); color: var(--ink); }

/* ================= компоновка v3: вертикальная лента карточек ================= */
body.fit .deck { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; flex: 1; min-height: 0; }
body.fit .deck-stage { --peek: clamp(46px, 9vh, 96px); --gap: 14px; position: relative; min-height: 0; overflow: hidden; border-radius: 36px; }
body.fit .deck.js .slide { display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: var(--peek); bottom: var(--peek); inset-inline: 0;
  transition: transform .62s cubic-bezier(.22, .8, .24, 1), opacity .5s ease; will-change: transform; animation: none !important; }
body.fit .deck.js .slide[data-pos="cur"] { transform: none; opacity: 1; z-index: 3; }
body.fit .deck.js .slide[data-pos="prev"] { transform: translateY(calc(-100% - var(--gap))) scale(.955); opacity: .55; z-index: 2; cursor: pointer; }
body.fit .deck.js .slide[data-pos="next"] { transform: translateY(calc(100% + var(--gap))) scale(.955); opacity: .55; z-index: 2; cursor: pointer; }
body.fit .deck.js .slide[data-pos="up"] { transform: translateY(calc(-200% - 2 * var(--gap))) scale(.9); opacity: 0; z-index: 1; pointer-events: none; }
body.fit .deck.js .slide[data-pos="down"] { transform: translateY(calc(200% + 2 * var(--gap))) scale(.9); opacity: 0; z-index: 1; pointer-events: none; }
body.fit .deck.js .slide[data-pos="prev"] .slide-card, body.fit .deck.js .slide[data-pos="next"] .slide-card { pointer-events: none; }
body.fit .deck.js .slide[data-pos="prev"]:hover, body.fit .deck.js .slide[data-pos="next"]:hover { opacity: .75; }
body.fit .deck.measuring .slide { display: flex !important; visibility: visible; }
body.fit .deck.instant .slide, body.still .deck.js .slide { transition: none !important; }
/* «Эпилепсия» и «Нужен покой»: движение медленнее и мягче, без мерцания прозрачности */
body.mode-epi.fit .deck.js .slide, body.mode-calm.fit .deck.js .slide { transition: transform 1s cubic-bezier(.3, .6, .25, 1) !important; }
body.mode-epi.fit .deck.js .slide[data-pos="prev"], body.mode-epi.fit .deck.js .slide[data-pos="next"] { opacity: .5; }

/* подпись выглядывающей карточки */
.peek-tag { position: absolute; left: 50%; transform: translateX(-50%); z-index: 4; display: none; align-items: center; gap: 8px; height: 34px; padding: 0 16px; border-radius: 17px; background: var(--ink); color: var(--inv); font-weight: 800; font-size: 14px; white-space: nowrap; max-width: 80%; overflow: hidden; text-overflow: ellipsis; }
.slide[data-pos="prev"] .peek-tag { display: flex; bottom: calc(var(--peek) / 2 - 24px); }
.slide[data-pos="next"] .peek-tag { display: flex; top: calc(var(--peek) / 2 - 24px); }
.slide[data-pos="prev"] .peek-tag::before { content: "↑"; }
.slide[data-pos="next"] .peek-tag::before { content: "↓"; }

/* правая колонка: вверх · точки · вниз */
.deck-rail { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.rail-go { width: 56px; height: 56px; border-radius: 28px; border: 0; background: var(--card); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.rail-go.down { background: var(--ink); color: var(--inv); }
.rail-go[disabled] { opacity: .25; cursor: default; }
.deck-rail .dots { flex-direction: column; max-width: none; gap: 8px; }
.deck-rail .dot { width: 12px; height: 12px; }
.deck-rail .dot.on { width: 12px; height: 34px; }
body:not(.still) .deck-rail .dot { transition: height .3s ease, background .3s ease; }
body.mode-motor .rail-go { width: 84px; height: 84px; border-radius: 42px; }
body.mode-motor .deck-rail .dot { width: 18px; height: 18px; }
body.mode-motor .deck-rail .dot.on { width: 18px; height: 44px; }
.page-head { margin: 0 0 10px !important; }
@media (max-width: 760px) {
  body.fit .deck { gap: 8px; }
  body.fit .deck-stage { --peek: clamp(34px, 6vh, 56px); --gap: 10px; border-radius: 26px; }
  .rail-go { width: 44px; height: 44px; }
  .deck-rail { gap: 8px; }
  .deck-rail .dot { width: 9px; height: 9px; }
  .deck-rail .dot.on { width: 9px; height: 24px; }
  .peek-tag { height: 28px; font-size: 12px; padding: 0 12px; }
  .slide[data-pos="prev"] .peek-tag { bottom: calc(var(--peek) / 2 - 20px); }
  .slide[data-pos="next"] .peek-tag { top: calc(var(--peek) / 2 - 20px); }
}

/* ================= главная ученика: живые карточки ================= */
.today { justify-content: space-between; }
.today-hi { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.note-strip { display: flex; gap: 10px; align-items: center; background: var(--c); color: #000; border-radius: 18px; padding: 12px 16px; font-weight: 700; }
.daypath { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.path-step { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 26px; background: var(--paper); text-decoration: none; min-height: 150px; }
.path-step i { font-style: normal; width: 48px; height: 48px; border-radius: 24px; display: grid; place-items: center; background: var(--card); font-weight: 800; font-size: 20px; }
.path-step b { font-size: 20px; letter-spacing: -.02em; margin-top: auto; }
.path-step small { color: var(--mute); font-weight: 600; font-size: 14px; }
.path-step.done i { background: var(--ink); color: var(--inv); }
.path-step.now { background: var(--y); color: #000; }
.path-step.now i { background: #000; color: var(--y); }
.path-step.now small { color: rgba(0,0,0,.7); }
.path-step:hover { box-shadow: inset 0 0 0 3px var(--ink); }
.path-step[aria-disabled] { pointer-events: none; opacity: .6; }
.go-big { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-radius: 28px; background: var(--ink); color: var(--inv); text-decoration: none; }
.go-big small { display: block; color: var(--dim); font-weight: 700; }
.go-big b { font-size: clamp(20px, 2.6vw, 28px); letter-spacing: -.03em; }
.ring { --p: 0; --c: var(--y); width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), color-mix(in srgb, currentColor 18%, transparent) 0); }
.ring em { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: var(--inv); display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 13px; }
.ring.big { width: 96px; height: 96px; }
.ring.big em { width: 72px; height: 72px; font-size: 18px; background: var(--card); color: var(--ink); }

.wod { align-items: center; justify-content: center; text-align: center; }
.flip { width: min(640px, 100%); flex: 1; max-height: 340px; min-height: 160px; border: 0; border-radius: 32px; background: var(--y); color: #000; cursor: pointer; display: grid; place-items: center; padding: 20px; transition: transform .18s ease; }
.flip.turning { transform: scaleY(.04); }
body.still .flip { transition: none; }
.flip-face { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.flip-face b { font-size: clamp(48px, min(10vw, 12vh), 120px); letter-spacing: -.05em; line-height: 1; overflow-wrap: anywhere; }
.flip-face em { font-style: normal; font-size: 20px; font-weight: 700; opacity: .75; }
.flip-face small { font-size: 16px; }
.chunk-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.chunk { border: 0; border-radius: 18px; background: var(--paper); padding: 10px 16px; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.chunk b { font-size: 24px; }
.chunk small { color: var(--mute); font-weight: 700; }
.sign { background: var(--c); color: #000; border-radius: 18px; padding: 10px 16px; font-weight: 700; }
.wod-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.picker { display: grid !important; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: stretch; }
.picker-units { display: grid; grid-template-columns: repeat(3, 64px); grid-auto-rows: 64px; gap: 8px; align-content: center; }
.unit-chip { position: relative; border: 0; border-radius: 20px; background: var(--paper); cursor: pointer; overflow: hidden; display: grid; place-items: center; padding: 0; }
.unit-chip b { position: relative; z-index: 1; font-size: 22px; font-weight: 800; }
.unit-chip i { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--p) * 1%); background: var(--c); opacity: .55; }
.unit-chip.on { box-shadow: inset 0 0 0 4px var(--ink); }
.unit-more { grid-column: 1 / -1; height: 48px; font-size: 14px; }
.picker-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; justify-content: center; }
.picker-head { display: flex; align-items: center; gap: 18px; }
.picker-head small { color: var(--mute); font-weight: 700; }
.kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kind { display: flex; flex-direction: column; gap: 4px; padding: 16px; min-height: 120px; border-radius: 24px; background: var(--paper); text-decoration: none; }
.kind i { font-style: normal; width: 46px; height: 46px; border-radius: 23px; background: var(--ink); color: var(--inv); display: grid; place-items: center; font-weight: 800; font-size: 18px; margin-bottom: auto; }
.kind b { font-size: 19px; letter-spacing: -.02em; }
.kind small { color: var(--mute); font-weight: 600; }
.kind:hover, .kind:focus-visible { background: var(--y); color: #000; }
.kind:hover small { color: rgba(0,0,0,.65); }

.chats, .tasks { display: flex; flex-direction: column; gap: 10px; }
.chat-item, .task { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 24px; background: var(--paper); text-decoration: none; }
.chat-item:hover, .task:hover { box-shadow: inset 0 0 0 3px var(--ink); }
.chat-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-body small { color: var(--mute); font-weight: 700; }
.chat-body b { font-size: 19px; letter-spacing: -.02em; }
.chat-body em { font-style: normal; color: var(--mute); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task > i { width: 40px; height: 40px; border-radius: 20px; flex-shrink: 0; display: grid; place-items: center; box-shadow: inset 0 0 0 3px var(--dim); font-style: normal; }
.task.done > i { background: var(--ink); color: var(--inv); box-shadow: none; }
.task > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.task b { font-size: 18px; }
.task small { color: var(--mute); font-weight: 600; }
.task > em { font-style: normal; font-weight: 800; background: var(--ink); color: var(--inv); border-radius: 18px; padding: 8px 14px; }
.task.done > em { background: var(--chip); color: var(--ink); }

.mood { justify-content: center; }
.battery { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.cell { min-height: 110px; border: 0; border-radius: 22px; background: var(--paper); cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding: 12px 6px; font-weight: 800; }
.cell.fill { background: var(--g); color: #000; }
.battery[data-l="1"] .cell.fill { background: var(--p); }
.battery[data-l="2"] .cell.fill { background: var(--o); }
.moods { display: flex; gap: 8px; flex-wrap: wrap; }
.mood-btn { height: 52px; padding: 0 20px; border: 0; border-radius: 26px; background: var(--paper); font-weight: 800; cursor: pointer; }
.mood-btn.on { background: var(--ink); color: var(--inv); }
.mood-msg { min-height: 24px; margin: 0; font-weight: 800; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; background: var(--y); color: #000; border-radius: 16px; padding: 6px 12px; font-weight: 800; font-size: 14px; }

body.mode-motor .path-step, body.mode-motor .kind { min-height: 170px; }
body.mode-motor .unit-chip { border-radius: 24px; }
body.mode-motor .picker-units { grid-template-columns: repeat(3, 80px); grid-auto-rows: 80px; }
body.mode-epi .path-step.now, body.mode-epi .flip, body.mode-epi .cell.fill { filter: saturate(.5); }
body.mode-calm .path-step.now { background: var(--paper); box-shadow: inset 0 0 0 3px var(--ink); color: var(--ink); }

@media (max-width: 760px) {
  .daypath { grid-template-columns: 1fr 1fr; gap: 8px; }
  .path-step { min-height: 96px; padding: 12px; border-radius: 20px; }
  .path-step i { width: 36px; height: 36px; font-size: 16px; }
  .path-step b { font-size: 16px; }
  .path-step small { display: none; }
  .go-big { padding: 14px 16px; }
  .picker { grid-template-columns: 1fr; gap: 12px; }
  .picker-units { grid-template-columns: repeat(5, 1fr); grid-auto-rows: 48px; }
  .unit-more { height: 44px; }
  .ring.big { width: 64px; height: 64px; } .ring.big em { width: 48px; height: 48px; font-size: 14px; }
  .kinds { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kind { min-height: 84px; padding: 12px; } .kind i { width: 34px; height: 34px; font-size: 15px; } .kind small { display: none; }
  .cell { min-height: 72px; font-size: 12px; }
  .chat-item, .task { padding: 10px 12px; }
}
.slide-card:focus { outline: none; }
.card-head { margin: 0 !important; align-items: center !important; }
.card-head h1 { font-size: clamp(26px, min(4vw, 6vh), 48px) !important; }
.card-head .ava { width: 64px !important; height: 64px !important; font-size: 22px !important; }
.tile.go { cursor: pointer; }
.tile.go:hover { box-shadow: inset 0 0 0 3px #000; }

/* ===== учитель, помощник, родитель: обычная страница, разделы идут друг за другом ===== */
.deck:not(.js) > .deck-stage > .slide { display: block; }
.deck:not(.js) > .deck-stage > .slide + .slide { margin-top: 30px; }
.deck:not(.js) > .deck-stage > .slide[data-title]::before { content: attr(data-title); display: block; font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.035em; margin: 0 0 12px; }
.deck:not(.js) .slide-card { min-height: 0; border-radius: var(--r); }
.deck:not(.js) .slide-card > .slide-title:first-child { display: none; } /* заголовок уже над разделом */

/* ===== ученик: меньше пустого места, больше содержимого ===== */
body.role-student .main { max-width: none; }
body.role-student.fit .main { padding: 10px clamp(12px, 1.6vw, 22px) 10px; }
body.role-student .stage-top { min-height: 40px; margin-bottom: 6px; gap: 8px; }
body.role-student .st-back { width: 40px; height: 40px; border-radius: 20px; }
body.role-student .st-page { font-size: 12px; }
body.role-student .st-slide { font-size: 18px; }
body.role-student .st-btn { height: 38px; }
body.role-student.fit .deck { gap: 10px; }
body.role-student.fit .deck-stage { --peek: clamp(24px, 4vh, 40px); --gap: 8px; border-radius: 28px; }
body.role-student .rail-go { width: 44px; height: 44px; border-radius: 22px; }
body.role-student .deck-rail { gap: 8px; }
body.role-student .peek-tag { height: 26px; font-size: 12px; padding: 0 12px; }
body.role-student .slide[data-pos="prev"] .peek-tag { bottom: 0; }
body.role-student .slide[data-pos="next"] .peek-tag { top: 0; }
body.role-student.fit .slide > .slide-card { padding: clamp(14px, 1.8vw, 22px); gap: 12px; border-radius: 28px; }
body.role-student .slide-title { font-size: clamp(22px, 2.6vw, 32px); }
body.role-student .today-hi .ava { width: 48px !important; height: 48px !important; font-size: 18px !important; }
body.role-student .path-step { min-height: 0; padding: 12px 14px; border-radius: 20px; gap: 4px; }
body.role-student .path-step i { width: 38px; height: 38px; font-size: 16px; }
body.role-student .path-step b { font-size: 18px; margin-top: 6px; }
body.role-student .go-big { padding: 12px 18px; border-radius: 22px; }
body.role-student .ring { width: 54px; height: 54px; } body.role-student .ring em { width: 40px; height: 40px; }
body.role-student .ring.big { width: 80px; height: 80px; } body.role-student .ring.big em { width: 60px; height: 60px; font-size: 16px; }
body.role-student .note-strip { padding: 8px 14px; border-radius: 14px; }
body.role-student .flip { max-height: none; min-height: 120px; border-radius: 24px; }
body.role-student .kind { min-height: 92px; padding: 12px 14px; border-radius: 20px; }
body.role-student .kind i { width: 38px; height: 38px; font-size: 16px; }
body.role-student .chats, body.role-student .tasks { gap: 6px; }
body.role-student .chat-item, body.role-student .task { padding: 8px 14px; border-radius: 18px; gap: 12px; }
body.role-student .chat-item .ava { width: 40px !important; height: 40px !important; font-size: 16px !important; }
body.role-student .chat-body b, body.role-student .task b { font-size: 17px; }
body.role-student .cell { min-height: 80px; border-radius: 18px; }
body.role-student .tile { min-height: 0; padding: 14px 16px; border-radius: 22px; }
/* при «Трудно попадать» кнопки остаются крупными, несмотря на плотность */
body.role-student.mode-motor .path-step, body.role-student.mode-motor .kind { min-height: 130px; }
body.role-student.mode-motor .rail-go { width: 72px; height: 72px; border-radius: 36px; }
body.role-student.mode-motor .chat-item, body.role-student.mode-motor .task { min-height: 72px; }
/* занятие: шире и плотнее */
body.practice-page .pr { max-width: 1100px; gap: 6px; }
body.practice-page .pr-stage { border-radius: 28px; }

/* ученик: содержимое растягивается на всю карточку, а не висит посередине */
body.role-student .today { justify-content: flex-start; }
body.role-student .today .daypath { flex: 1; grid-auto-rows: 1fr; min-height: 120px; }
body.role-student .path-step { justify-content: space-between; }
body.role-student .path-step b { font-size: clamp(18px, 2.2vw, 26px); margin-top: auto; }
body.role-student .path-step small { font-size: 15px; }
.today-tasks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
body.role-student .picker { align-items: stretch; }
body.role-student .picker-units { align-content: stretch; grid-auto-rows: minmax(52px, 1fr); }
body.role-student .picker-main { justify-content: flex-start; }
body.role-student .kinds { flex: 1; grid-auto-rows: 1fr; }
body.role-student .kind b { font-size: clamp(18px, 2vw, 24px); }
body.role-student .mood { justify-content: flex-start; }
body.role-student .battery { flex: 1; min-height: 90px; }
body.role-student .cell { min-height: 0; font-size: 15px; }
body.role-student .wod { justify-content: flex-start; }
body.role-student .flip { flex: 1; max-height: none; }
/* подпись соседней карточки — внутри видимой полоски */
body.role-student .peek-tag { height: 22px; font-size: 12px; }
body.role-student .slide[data-pos="prev"] .peek-tag { bottom: max(0px, calc((var(--peek) - var(--gap) - 22px) / 2)); }
body.role-student .slide[data-pos="next"] .peek-tag { top: max(0px, calc((var(--peek) - var(--gap) - 22px) / 2)); }
body.role-student.fit .deck-stage { --peek: clamp(34px, 5vh, 46px); }
@media (max-width: 760px) { body.role-student .today .daypath { min-height: 0; } .today-tasks { grid-template-columns: 1fr; } }
body.role-student .today .daypath { align-items: stretch; } body.role-student .path-step { height: auto; align-self: stretch; }
.kprev { flex: 1; display: flex; flex-wrap: wrap; align-content: center; align-items: center; gap: 6px; padding: 8px 0; min-height: 0; overflow: hidden; }
.kprev em { font-style: normal; background: var(--card); border-radius: 12px; padding: 4px 10px; font-weight: 800; font-size: 15px; }
.kprev strong { font-size: clamp(20px, 2.4vw, 30px); letter-spacing: -.03em; }
.kprev strong.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .08em; font-size: clamp(18px, 2vw, 26px); }
.kprev span { color: var(--mute); font-weight: 700; width: 100%; }
.kind i { margin-bottom: 0; }
.kind:hover .kprev em { background: rgba(255,255,255,.6); }
@media (max-width: 760px) { .kprev { display: none; } }
body.role-student .kinds { grid-auto-rows: minmax(0, 1fr); }
body.role-student .kind { min-height: 0; overflow: hidden; }
body.role-student .today .daypath { flex: 0 1 auto; max-height: 200px; min-height: 110px; }
body.role-student .today-tasks { flex: 1; align-content: start; }
body.role-student .path-step small { font-size: 16px; font-weight: 700; }
.today-tasks { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* ================= ученик: док сверху + меню занятий слева ================= */
body.has-shell { --cats-w: 232px; --dock-h: 72px; }
.dock { position: fixed; z-index: 30; top: 10px; left: calc(50% + var(--cats-w) / 2); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 34px;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 8px 30px rgba(0,0,0,.12), inset 0 0 0 1px var(--line); }
.dock form { margin: 0; }
.dock-btn { width: 48px; height: 48px; border-radius: 24px; border: 0; background: var(--paper); color: var(--ink); display: grid; place-items: center; cursor: pointer; text-decoration: none; padding: 0; }
.dock-btn .ava { width: 40px !important; height: 40px !important; }
.dock-btn:hover { background: var(--dim); }
.dock-btn.on { background: var(--ink); color: var(--inv); }
body:not(.still) .dock-btn { transition: transform .2s ease, background .2s ease; }
body:not(.still) .dock-btn:hover { transform: translateY(-2px); }

.cats { position: fixed; z-index: 25; left: 0; top: 0; bottom: 0; width: var(--cats-w); padding: 16px 12px 20px; overflow-y: auto; scrollbar-width: none; background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.cats::-webkit-scrollbar { display: none; }
.cats-logo { width: 48px; height: 48px; border-radius: 24px; background: var(--ink); color: var(--y); display: grid; place-items: center; font-weight: 900; font-size: 24px; text-decoration: none; margin: 0 4px 2px; flex-shrink: 0; }
.cats-group { display: flex; flex-direction: column; gap: 2px; }
.cats-title { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); padding: 0 10px 4px; }
.cat { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 18px; text-decoration: none; font-weight: 700; font-size: 15px; }
.cat i { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 30%, transparent); flex-shrink: 0; }
.cat span { flex: 1; min-width: 0; }
.cat em { font-style: normal; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--ink); color: var(--inv); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.cat:hover { background: var(--paper); }
.cat.on { background: var(--ink); color: var(--inv); }
.cat.on i { background: var(--c); color: #000; }
.cat.on em { background: var(--y); color: #000; }
body.mode-epi .cat i { background: var(--paper); }

body.has-shell .main { margin-left: var(--cats-w); padding-top: calc(var(--dock-h) + 8px); max-width: none; }
body.has-shell.fit .main { padding-top: calc(var(--dock-h) + 8px); }
body.has-shell.fit .main > .flash { left: calc(50% + var(--cats-w) / 2); width: min(640px, calc(100vw - var(--cats-w) - 32px)); top: calc(var(--dock-h) + 10px); }
body.has-shell .stage-top { display: none; } /* где я — видно по меню и подписи над карточками */
.page-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 8px; flex-shrink: 0; }
.page-title h1 { margin: 0; font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; letter-spacing: -.04em; }
.page-title span { color: var(--mute); font-weight: 700; }
.page-title .st-count { margin-left: auto; }

/* полоса разделов учебника над карточками */
.unitbar { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; flex-shrink: 0; }
.unitbar a { position: relative; overflow: hidden; height: 40px; min-width: 40px; padding: 0 12px; border-radius: 20px; background: var(--card); text-decoration: none; font-weight: 800; display: grid; place-items: center; }
.unitbar a i { position: absolute; left: 0; bottom: 0; height: 4px; width: calc(var(--p) * 1%); background: var(--c); }
.unitbar a.on { background: var(--ink); color: var(--inv); }
.unitbar a span { position: relative; }

@media (max-width: 900px) {
  body.has-shell { --cats-w: 0px; --dock-h: 124px; }
  .dock { left: 50%; top: 6px; padding: 6px; gap: 6px; }
  .dock-btn { width: 44px; height: 44px; }
  .cats { top: 68px; bottom: auto; right: 0; width: auto; height: 52px; flex-direction: row; padding: 4px 10px; gap: 4px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); background: var(--paper); }
  .cats-logo, .cats-title { display: none; }
  .cats-group { flex-direction: row; gap: 4px; }
  .cat { white-space: nowrap; padding: 4px 12px 4px 4px; font-size: 14px; background: var(--card); }
  .cat i { width: 34px; height: 34px; }
  body.has-shell .main { margin-left: 0; padding-bottom: 12px; }
  body.has-shell.fit .main { height: 100dvh; }
}

/* ================= страницы занятий ученика ================= */
.unitbar-title { align-self: center; margin-left: 6px; font-weight: 800; color: var(--mute); }
.uc-n { width: 76px; height: 76px; border-radius: 24px; background: rgba(0,0,0,.12); display: grid; place-items: center; font-size: 40px; font-weight: 800; letter-spacing: -.04em; flex-shrink: 0; }
.uc-n.sm { width: 52px; height: 52px; border-radius: 16px; font-size: 26px; color: #000; }
.unit-card { gap: 14px !important; }
.uc-head { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 24px; background: var(--c); color: #000; }
.uc-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.uc-titles small, .uc-titles span { font-weight: 700; opacity: .75; }
.uc-titles .slide-title { color: #000; }
.uc-head .ring em { background: var(--c); color: #000; }
.uc-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; }
.uc-words { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 8px; align-content: stretch; }
.wchip { border: 0; border-radius: 18px; background: var(--paper); padding: 10px 12px; text-align: left; cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 0; }
.wchip b { font-size: 18px; letter-spacing: -.02em; }
.wchip small { color: var(--mute); font-weight: 600; }
.wchip.st-known { box-shadow: inset 0 0 0 3px var(--g); }
.wchip.st-learning { box-shadow: inset 0 0 0 3px var(--o); }
.wchip:hover { background: var(--y); color: #000; }
.uc-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.uc-gram { display: flex; flex-direction: column; gap: 8px; }
.uc-gram button, .rule { border: 0; border-radius: 18px; background: var(--paper); padding: 10px 14px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.uc-gram b, .rule b { font-size: 17px; }
.uc-gram span, .rule span { color: var(--mute); font-weight: 600; font-size: 14px; }
.uc-facts { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.uc-facts div { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 14px; }
.uc-facts i { width: 34px; height: 34px; border-radius: 12px; background: var(--paper); display: grid; place-items: center; flex-shrink: 0; }
.uc-facts b { display: block; font-size: 13px; color: var(--mute); }
.uc-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.fc { align-items: center; text-align: center; }
.fc-top { width: 100%; display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.fc-st { padding: 4px 12px; border-radius: 14px; background: var(--chip); font-weight: 800; font-size: 14px; }
.fc-st.st-known { background: var(--g); color: #000; } .fc-st.st-learning { background: var(--o); color: #000; }
.fc-flip { width: min(760px, 100%); }
.fc-rate { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.fc-rate .picked { box-shadow: inset 0 0 0 4px var(--o); }
.chunk.now, .pr-chunks > span.now { background: var(--y); color: #000; }
body:not(.still) .chunk, body:not(.still) .pr-chunks > span { transition: background .25s ease; }
.fc-done { align-items: center; justify-content: center; text-align: center; }
.big-check { width: 120px; height: 120px; border-radius: 60px; background: var(--g); color: #000; display: grid; place-items: center; }

.pr-unit .kinds { flex: 1; }
.gram-head, .talk-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.gram-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.gram-rules { display: flex; flex-direction: column; gap: 8px; }
.rule { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 14px 16px; }
.rule b { font-size: clamp(18px, 1.8vw, 22px); flex-basis: 100%; }
.rule .ic { margin-left: auto; }
.gram-build { display: flex; flex-direction: column; gap: 10px; }
.builder { background: var(--paper); border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.builder.ok { box-shadow: inset 0 0 0 3px var(--g); }
.b-ru { font-weight: 800; font-size: 18px; }
.b-slots { min-height: 52px; border-radius: 16px; box-shadow: inset 0 0 0 2px var(--dim); display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; }
.b-tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.b-tile { height: 44px; padding: 0 14px; border: 0; border-radius: 22px; background: var(--ink); color: var(--inv); font-weight: 800; font-size: 16px; cursor: pointer; }
.b-slots .b-tile { background: var(--y); color: #000; }
.b-tile.used { visibility: hidden; }
.b-msg { min-height: 20px; font-weight: 800; }
body.mode-motor .b-tile { height: 64px; padding: 0 22px; font-size: 20px; border-radius: 32px; }

.snd-rule { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.snd-rule > i { width: 44px; height: 44px; border-radius: 14px; background: var(--p); color: #000; display: grid; place-items: center; }
.snd-rule b { display: block; font-size: 18px; }
.snd-speed { margin-left: auto; }
.snd-words { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 10px; }
.snd-word { border: 0; border-radius: 22px; background: var(--paper); cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; padding: 12px 16px; text-align: left; min-height: 0; }
.snd-word b { font-size: clamp(20px, 2vw, 28px); letter-spacing: -.03em; }
.snd-word em { font-style: normal; color: var(--mute); font-weight: 600; }
.snd-word .pr-chunks { justify-content: flex-start; gap: 4px; }
.snd-word .pr-chunks > span { font-size: 16px; padding: 4px 10px; border-radius: 10px; background: var(--card); font-weight: 800; }
.snd-word:hover { box-shadow: inset 0 0 0 3px var(--ink); }

.talk-preview { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 8px; background: var(--paper); border-radius: 24px; padding: 14px; }
.tp-them { align-self: flex-start; max-width: 75%; background: var(--card); border-radius: 20px 20px 20px 6px; padding: 10px 14px; }
.tp-them b { display: block; font-size: 17px; } .tp-them span { color: var(--mute); font-weight: 600; font-size: 14px; }
.tp-me { align-self: flex-end; background: var(--dim); border-radius: 20px 20px 6px 20px; padding: 8px 14px; color: var(--mute); font-weight: 700; font-size: 14px; }

.world-q { border-radius: 24px; padding: 16px 20px; background: var(--c); color: #000; display: flex; flex-direction: column; gap: 4px; }
.world-q small { font-weight: 800; opacity: .7; } .world-q b { font-size: clamp(22px, 2.6vw, 32px); letter-spacing: -.03em; } .world-q span { font-weight: 700; opacity: .7; }
.world-words { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 10px; }
.ww { border: 0; border-radius: 22px; background: var(--paper); padding: 12px 16px; text-align: left; display: flex; flex-direction: column; gap: 2px; justify-content: center; cursor: pointer; min-height: 0; }
.ww b { font-size: 22px; letter-spacing: -.02em; } .ww span { font-weight: 700; } .ww em { font-style: normal; color: var(--mute); font-weight: 600; font-size: 14px; }

.pairs-top { display: flex; justify-content: space-between; align-items: center; font-size: 18px; }
.pairs-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 10px; }
.pairs-grid.n8, .pairs-grid.n6 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ptile { border: 0; border-radius: 22px; background: var(--paper); font-size: clamp(16px, 1.8vw, 22px); font-weight: 800; cursor: pointer; padding: 8px; min-height: 0; }
.ptile.en { background: var(--card); box-shadow: inset 0 0 0 3px var(--ink); }
.ptile.sel { background: var(--y); color: #000; box-shadow: inset 0 0 0 4px #000; }
.ptile.done { background: var(--g); color: #000; box-shadow: none; opacity: .55; cursor: default; }
.pairs-msg { min-height: 24px; margin: 0; font-weight: 800; text-align: center; }
body.mode-epi .ptile.done { background: var(--paper); opacity: .4; }
body.mode-epi .ptile.sel { background: var(--card); box-shadow: inset 0 0 0 4px var(--ink); }

.odd-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 12px; }
.otile { border: 0; border-radius: 26px; background: var(--paper); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 0; }
.otile b { font-size: clamp(24px, 3vw, 40px); letter-spacing: -.03em; }
.otile span { color: var(--mute); font-weight: 700; }
.otile.right { background: var(--g); color: #000; }
.otile.nope { opacity: .45; }
.odd-next { display: flex; justify-content: center; }
body.mode-epi .otile.right { background: var(--card); box-shadow: inset 0 0 0 4px #5E8F6E; }

.units-prog { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.up-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 20px; background: var(--paper); text-decoration: none; }
.up-row span:nth-child(2) { flex: 1; display: flex; flex-direction: column; } .up-row small { color: var(--mute); font-weight: 700; }
.up-row em { font-style: normal; font-weight: 800; }
.up-row .ring em { background: var(--paper); color: var(--ink); }
.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.award { border-radius: 22px; padding: 14px; background: var(--paper); display: flex; flex-direction: column; gap: 4px; opacity: .55; }
.award i { width: 48px; height: 48px; border-radius: 16px; background: var(--card); display: grid; place-items: center; }
.award.mine { opacity: 1; background: var(--y); color: #000; } .award.mine i { background: #000; color: var(--y); }
.award span { font-weight: 600; font-size: 14px; } .award em { font-style: normal; font-weight: 800; font-size: 13px; }

.energy-bars { flex: 1; min-height: 160px; display: flex; align-items: flex-end; gap: 8px; }
.eb { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.eb i { width: 100%; border-radius: 10px 10px 4px 4px; }
.eb span { font-size: 12px; font-weight: 700; color: var(--mute); }

.calm-card { align-items: center; justify-content: center; gap: 18px !important; }
.breath { width: min(40vh, 280px); aspect-ratio: 1; max-width: 100%; display: grid; place-items: center; }
.breath span { width: 100%; height: 100%; border-radius: 50%; background: color-mix(in srgb, var(--g) 55%, var(--card)); animation: breathe 8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.55); } 50% { transform: scale(1); } }
body.still .breath span { animation: none; transform: scale(.8); }
.breath-text { font-size: 40px; letter-spacing: -.04em; }
.five { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; width: 100%; flex: 1; }
.five div { border-radius: 24px; background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; }
.five b { font-size: 56px; letter-spacing: -.05em; } .five span { font-weight: 700; }

@media (max-width: 760px) {
  .uc-body, .gram-grid { grid-template-columns: 1fr; }
  .uc-n { width: 52px; height: 52px; font-size: 26px; border-radius: 16px; }
  .uc-words { grid-template-columns: 1fr 1fr; }
  .pairs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .five { grid-template-columns: 1fr 1fr; }
  .unitbar-title { display: none; }
}
.uc-head .ring em { background: rgba(255,255,255,.75); color: #000; } .uc-head .ring { background: conic-gradient(#000 calc(var(--p) * 1%), rgba(0,0,0,.15) 0); }
@media (max-width: 760px) {
  .unitbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 6px; }
  .unitbar::-webkit-scrollbar { display: none; }
  .unitbar a { height: 36px; min-width: 36px; flex-shrink: 0; }
  .page-title > span:not(.st-count) { display: none; }
  .page-title h1 { font-size: 22px; }
}

/* ================= ученик v2: док по центру экрана, меню одной линией ================= */
body.has-shell { --cats-w: 68px; --dock-h: 64px; }
.dock { left: 50%; top: 8px; padding: 6px; gap: 6px; border-radius: 30px; }
.dock-btn { width: 42px; height: 42px; border-radius: 21px; }
.dock-btn .ava { width: 34px !important; height: 34px !important; font-size: 13px !important; }
.corner-logo { position: fixed; z-index: 30; top: 12px; right: 14px; width: 40px; height: 40px; border-radius: 20px; background: var(--ink); color: var(--y); display: grid; place-items: center; font-weight: 900; font-size: 20px; text-decoration: none; }

/* одна линия круглых значков; при наведении значок плавно раскрывается в «пилюлю» с названием */
.cats { width: var(--cats-w); padding: 12px 0; gap: 0; overflow: visible; align-items: center; justify-content: center; background: var(--card); }
.cats-group { gap: 6px; align-items: flex-start; width: 44px; }
.cats-group + .cats-group { margin-top: 10px; padding-top: 10px; border-top: 2px solid var(--line); }
.cats-title, .cats-logo { display: none; }
.cat { position: relative; height: 44px; min-width: 44px; padding: 0; gap: 0; border-radius: 22px; font-size: 14px; font-weight: 800; white-space: nowrap; background: color-mix(in srgb, var(--c) 28%, var(--card)); z-index: 1;
  transition: background .3s ease, box-shadow .3s ease; }
.cat i { width: 44px; height: 44px; border-radius: 22px; background: none; flex-shrink: 0; }
.cat span { max-width: 0; opacity: 0; overflow: hidden; transition: max-width .35s cubic-bezier(.22, .8, .24, 1), opacity .25s ease, padding .35s ease; padding-right: 0; }
.cat em { position: absolute; top: -4px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; font-size: 11px; border-radius: 10px; box-shadow: 0 0 0 2px var(--card); }
.cat:hover, .cat:focus-visible { z-index: 5; background: var(--c); color: #000; box-shadow: 0 6px 20px rgba(0,0,0,.14); }
.cat:hover span, .cat:focus-visible span { max-width: 220px; opacity: 1; padding-right: 16px; }
.cat:hover em, .cat:focus-visible em { position: static; margin-right: 10px; box-shadow: none; }
.cat.on { background: var(--ink); color: var(--inv); }
.cat.on i { background: none; color: var(--inv); }
.cat.on:hover { background: var(--ink); color: var(--inv); }
.cat:hover { background-color: var(--c); }
body.still .cat, body.still .cat span { transition: none; }
body.mode-epi .cat { background: var(--paper); }
body.mode-motor .cat, body.mode-motor .cat i { height: 52px; min-width: 52px; width: auto; border-radius: 26px; }
body.mode-motor .cats-group { width: 52px; }
body.mode-motor { --cats-w: 76px; }
@media (max-height: 760px) {
  .cat, .cat i { height: 38px; min-width: 38px; }
  .cat i { width: 38px; }
  .cats-group { width: 38px; gap: 4px; }
  .cats-group + .cats-group { margin-top: 6px; padding-top: 6px; }
}
@media (max-width: 900px) {
  body.has-shell { --cats-w: 0px; --dock-h: 112px; }
  .corner-logo { display: none; }
  .cats { top: 60px; height: 50px; left: 0; right: 0; width: auto; justify-content: flex-start; padding: 3px 10px; overflow-x: auto; overflow-y: hidden; }
  .cats-group { flex-direction: row; width: auto; }
  .cats-group + .cats-group { margin: 0 0 0 8px; padding: 0 0 0 8px; border-top: 0; border-left: 2px solid var(--line); }
  .cat span { display: none; }
  .cat em { top: -2px; right: -4px; }
}
/* левое меню без фона: значки висят прямо на странице */
@media (min-width: 901px) { .cats { background: transparent; border-right: 0; } }
/* плотнее: меньше воздуха между доком, заголовком и карточкой */
body.has-shell { --dock-h: 56px; }
body.has-shell .main, body.has-shell.fit .main { padding-top: calc(var(--dock-h) + 4px); }
.page-title { margin: 0 0 4px; gap: 10px; align-items: center; flex-wrap: nowrap; min-width: 0; }
.page-title h1 { white-space: nowrap; }
.page-title > span:not(.st-count) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.page-title .unitbar { margin: 0; flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.page-title .unitbar a { height: 34px; min-width: 34px; padding: 0 10px; flex-shrink: 0; }
.page-title .unitbar-title { white-space: nowrap; }
body.role-student.fit .deck-stage { --peek: clamp(20px, 3vh, 30px); --gap: 6px; }
@media (max-width: 900px) { body.has-shell { --dock-h: 104px; } .page-title .unitbar-title { display: none; } }
/* подписи соседних карточек: на линии края выглядывающей карточки, поверх всего */
.peek-tag { display: none !important; }
body.fit .deck { position: relative; }
.peek-line { position: absolute; z-index: 10; transform: translate(-50%, -50%); height: 24px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--ink); color: var(--inv);
  font: 800 12px/24px inherit; font-family: inherit; white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; cursor: pointer; box-shadow: 0 0 0 3px var(--paper); }

/* =====================================================================
   ОСОБЕННОСТИ УЧЕНИКА — жёсткие глобальные изменения
   ===================================================================== */

/* меню с подписями всегда (плохо вижу, трудно попадать, нужен покой, трудно читать) */
.cats.labeled { --lw: 196px; }
body.has-shell:has(.cats.labeled) { --cats-w: 212px; }
.cats.labeled .cats-group { width: var(--lw); }
.cats.labeled .cats-title { display: block; padding: 0 8px 2px; font-size: 11px; }
.cats.labeled .cat { width: 100%; justify-content: flex-start; }
.cats.labeled .cat span { max-width: none; opacity: 1; padding-right: 12px; }
.cats.labeled .cat em { position: static; margin: 0 8px 0 auto; box-shadow: none; }
.cats.labeled .cat:hover { box-shadow: none; }
@media (max-width: 900px) { .cats.labeled .cat span { display: inline; } .cats.labeled .cats-group { width: auto; } .cats.labeled .cats-title { display: none; } .cats.labeled .cat { width: auto; } }

/* ---------- ПЛОХО ВИЖУ: чёрный экран, белый и жёлтый текст, всё крупно, без мелочей ---------- */
body.mode-vision, [data-theme="dark"] body.mode-vision {
  --paper: #000; --card: #000; --ink: #FFF; --inv: #000; --mute: #FFF; --dim: #8A8A8A; --line: #FFF; --chip: #222;
  --y: #FFE500; --c: #00E5FF; --g: #00FF66; --o: #FFB000; --p: #FF6FA8; color-scheme: dark; font-size: 20px; }
body.mode-vision .slide-card, body.mode-vision .card, body.mode-vision .pr-stage { box-shadow: inset 0 0 0 4px #FFF !important; }
body.mode-vision .cats, body.mode-vision .dock { background: #000; box-shadow: inset 0 0 0 3px #FFF; }
body.mode-vision .cat { background: #000; box-shadow: inset 0 0 0 3px #FFF; color: #FFF; height: 52px; font-size: 17px; }
body.mode-vision .cat i { width: 52px; height: 52px; }
body.mode-vision .cat.on { background: #FFE500; color: #000; box-shadow: none; }
body.mode-vision .cat.on i { color: #000; }
body.mode-vision .dock-btn { width: 56px; height: 56px; border-radius: 28px; background: #000; color: #FFF; box-shadow: inset 0 0 0 3px #FFF; }
body.mode-vision .dock-btn.on { background: #FFE500; color: #000; }
body.mode-vision .page-title h1 { font-size: 40px; color: #FFE500; }
body.mode-vision .slide-title { font-size: clamp(32px, 3.6vw, 48px) !important; color: #FFE500; }
body.mode-vision .wchip, body.mode-vision .ww, body.mode-vision .snd-word, body.mode-vision .kind, body.mode-vision .path-step, body.mode-vision .task, body.mode-vision .chat-item, body.mode-vision .ptile, body.mode-vision .otile, body.mode-vision .rule, body.mode-vision .uc-gram button, body.mode-vision .unit-chip, body.mode-vision .chunk {
  background: #000 !important; color: #FFF !important; box-shadow: inset 0 0 0 3px #FFF !important; }
body.mode-vision .wchip b, body.mode-vision .ww b { font-size: 30px; }
body.mode-vision .wchip small, body.mode-vision .ww span { font-size: 20px; color: #FFE500; }
body.mode-vision .uc-words { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
body.mode-vision .uc-body, body.mode-vision .gram-grid { grid-template-columns: 1fr; }
body.mode-vision .flip { background: #000 !important; color: #FFE500 !important; box-shadow: inset 0 0 0 6px #FFE500; }
body.mode-vision .flip-face b { font-size: clamp(64px, min(14vw, 16vh), 160px); }
body.mode-vision .flip-face em { color: #FFF; font-size: 28px; opacity: 1; }
body.mode-vision .btn { min-height: 64px; height: auto; font-size: 22px; padding: 10px 28px; border-radius: 32px; box-shadow: inset 0 0 0 3px #FFF; }
body.mode-vision .btn:not(.ghost) { background: #FFE500; color: #000; box-shadow: none; }
body.mode-vision .ptile.sel, body.mode-vision .otile.right, body.mode-vision .ptile.done { background: #FFE500 !important; color: #000 !important; }
body.mode-vision .uc-head, body.mode-vision .world-q { background: #000 !important; color: #FFE500; box-shadow: inset 0 0 0 4px #FFE500; }
body.mode-vision .uc-head *, body.mode-vision .world-q * { color: #FFE500 !important; }
body.mode-vision .kprev, body.mode-vision .uc-facts, body.mode-vision .peek-line { display: none !important; }
body.mode-vision .deck.js .slide[data-pos="prev"], body.mode-vision .deck.js .slide[data-pos="next"] { opacity: 0 !important; }
body.mode-vision .rail-go { width: 72px; height: 72px; border-radius: 36px; background: #000; color: #FFF; box-shadow: inset 0 0 0 4px #FFF; }
body.mode-vision .rail-go.down { background: #FFE500; color: #000; box-shadow: none; }
body.mode-vision .dot { background: #555; } body.mode-vision .dot.on { background: #FFE500; }
body.mode-vision :focus-visible, body.mode-vision .scan { outline: 6px solid #FFE500 !important; outline-offset: 4px; }
body.mode-vision .mute, body.mode-vision small { color: #FFF !important; opacity: 1 !important; }

/* ---------- ПЛОХО СЛЫШУ: никаких звуков; всё, что звучит, — на экране ---------- */
body.mode-hearing [data-karaoke], body.mode-hearing .btn[data-say], body.mode-hearing .snd-speed, body.mode-hearing .uc-gram .ic, body.mode-hearing .rule .ic { display: none !important; }
body.mode-hearing .wchip em, body.mode-hearing .ww em { font-style: normal; font-weight: 700; color: var(--c); font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
body.mode-hearing .flip-face.front em { font-size: 30px; font-family: ui-monospace, Menlo, monospace; opacity: 1; }
.reading { font-style: normal; font-size: 22px !important; font-family: inherit !important; font-weight: 800; background: rgba(0,0,0,.08); border-radius: 12px; padding: 4px 12px; }
body.mode-hearing .sign { font-size: 20px; padding: 14px 18px; border-radius: 20px; }
body.mode-hearing .chunk small { color: #000; background: var(--c); border-radius: 8px; padding: 0 6px; }
body.mode-hearing .snd-word em { font-size: 22px; font-family: ui-monospace, Menlo, monospace; color: var(--ink); }
.caption { position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(720px, calc(100vw - 32px)); background: #000; color: #FFF; border-radius: 22px; padding: 14px 22px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.caption b { font-size: 30px; } .caption span { font-family: ui-monospace, Menlo, monospace; font-size: 22px; color: var(--c); } .caption em { font-style: normal; flex-basis: 100%; color: var(--y); font-weight: 700; }

/* ---------- ТРУДНО ЧИТАТЬ: свой шрифт, тёплый фон, воздух, цветные слоги, линейка ---------- */
body.mode-dys { --paper: #F7EFD9; --card: #FFF9EA; --ink: #2A2118; --mute: #5C4E3D; --dim: #D8CBAE;
  font-family: Verdana, Tahoma, "Trebuchet MS", sans-serif; letter-spacing: .04em; word-spacing: .18em; line-height: 1.7; }
[data-theme="dark"] body.mode-dys { --paper: #1B1813; --card: #26221B; --ink: #F1E6CF; --mute: #C2B59C; --dim: #4A4232; }
body.mode-dys button, body.mode-dys input, body.mode-dys .btn { font-family: inherit; letter-spacing: .03em; }
body.mode-dys h1, body.mode-dys h2, body.mode-dys .slide-title { letter-spacing: 0 !important; font-weight: 700; }
body.mode-dys .flip-face b, body.mode-dys .wchip b, body.mode-dys .ww b, body.mode-dys .snd-word b { letter-spacing: .06em; }
.syls { display: inline-flex; gap: .08em; }
.syl-a { color: #0050B3; } .syl-b { color: #C2410C; }
[data-theme="dark"] .syl-a { color: #7CC4FF; } [data-theme="dark"] .syl-b { color: #FFB27A; }
body.mode-dys .flip .syl-a { color: #003C88; } body.mode-dys .flip .syl-b { color: #9A2E00; }
body.mode-dys .uc-words { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
body.mode-dys .uc-facts, body.mode-dys .kprev em:nth-child(n+3) { display: none; }
body.mode-dys .flip { background: #FFE9A8 !important; }
body.mode-dys .uc-body { grid-template-columns: 1fr; }
.ruler { position: fixed; z-index: 55; left: 0; right: 0; height: 2.6em; transform: translateY(-50%); pointer-events: none;
  background: color-mix(in srgb, #FFE08A 35%, transparent); box-shadow: 0 0 0 100vmax color-mix(in srgb, #000 10%, transparent); }
[data-theme="dark"] .ruler { background: color-mix(in srgb, #FFE08A 14%, transparent); box-shadow: 0 0 0 100vmax rgba(0,0,0,.25); }
.ruler-toggle.on { background: var(--y) !important; color: #000 !important; }

/* ---------- НУЖЕН ПОКОЙ: приглушённо, без чисел и оценок, виден весь план ---------- */
body.mode-calm { --paper: #ECEAE4; --card: #F7F6F2; --ink: #2E2E2C; --mute: #6B6A66; --dim: #D3D1CA;
  --y: #E8D9A0; --o: #E6C3A0; --c: #B9D7E0; --g: #BFD8B8; --p: #E3C1C8; }
[data-theme="dark"] body.mode-calm { --paper: #1C1C1B; --card: #262624; --ink: #E7E5DF; --mute: #A3A19B; --dim: #3B3A37; }
body.mode-calm .ring em, body.mode-calm .cat em, body.mode-calm [data-count], body.mode-calm .st-count, body.mode-calm [data-left], body.mode-calm .fc-top .mute,
body.mode-calm .fc-st, body.mode-calm .wchip.st-known, body.mode-calm .award em, body.mode-calm .up-row > em { visibility: hidden; }
body.mode-calm .wchip.st-known, body.mode-calm .wchip.st-learning { box-shadow: none; }
body.mode-calm .ring { background: var(--dim) !important; }
body.mode-calm .kprev { display: none; }
body.mode-calm .peek-line { display: none; }
body.mode-calm .deck.js .slide[data-pos="prev"], body.mode-calm .deck.js .slide[data-pos="next"] { opacity: .35; }
/* план: справа список всех карточек с названиями */
body.mode-calm .deck-rail { width: 190px; align-items: stretch; }
body.mode-calm .deck-rail .dots { align-items: stretch; gap: 4px; overflow-y: auto; scrollbar-width: none; max-height: 60vh; }
body.mode-calm .deck-rail .dot { width: auto !important; height: auto !important; min-height: 30px; border-radius: 12px; padding: 5px 10px; text-align: left; font-size: 13px; font-weight: 700; color: var(--mute); background: transparent; }
body.mode-calm .deck-rail .dot.on { background: var(--ink); color: var(--inv); }
body.mode-calm .deck-rail .dot.on::before { content: "сейчас · "; opacity: .6; }
body.mode-calm .rail-go { width: 100%; border-radius: 16px; height: 44px; }
body.mode-calm .flip { background: var(--y) !important; }
@media (max-width: 760px) { body.mode-calm .deck-rail { width: 120px; } }

/* ---------- ТРУДНО ПОПАДАТЬ: огромные цели, большие промежутки, без мелких кнопок ---------- */
body.mode-motor .btn { min-height: 72px; height: auto; font-size: 20px; padding: 12px 30px; border-radius: 36px; }
body.mode-motor .uc-actions, body.mode-motor .fc-rate { gap: 18px; }
body.mode-motor .wchip, body.mode-motor .ww, body.mode-motor .snd-word { min-height: 84px; }
body.mode-motor .uc-words, body.mode-motor .world-words, body.mode-motor .snd-words { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
body.mode-motor .uc-body { grid-template-columns: 1fr; }
body.mode-motor .uc-facts, body.mode-motor .kprev, body.mode-motor .chunk-row { display: none; }
body.mode-motor .ptile, body.mode-motor .otile { font-size: 24px; }
body.mode-motor .pairs-grid, body.mode-motor .odd-grid { gap: 18px; }
body.mode-motor .cat { height: 56px; font-size: 16px; }
body.mode-motor .cat i { width: 56px; height: 56px; }
body.mode-motor .dock-btn { width: 60px; height: 60px; border-radius: 30px; }
body.mode-motor .unitbar a { height: 52px; min-width: 52px; font-size: 20px; }
body.mode-motor .scan { outline: 6px solid var(--o) !important; outline-offset: 3px; }
.scan-hint { font-size: 13px; font-weight: 700; color: var(--mute); white-space: nowrap; }
@media (max-width: 1100px) { .scan-hint { display: none; } }

/* ---------- ЭПИЛЕПСИЯ: ничего не движется, мягкая яркость, без контрастных пятен ---------- */
body.mode-epi .deck.js .slide, body.mode-epi .cat, body.mode-epi .cat span, body.mode-epi .dock-btn { transition: none !important; }
body.mode-epi.fit .deck.js .slide { transition: none !important; }
body.mode-epi .deck.js .slide[data-pos="prev"], body.mode-epi .deck.js .slide[data-pos="next"] { opacity: .3; }
body.mode-epi .flip, body.mode-epi .uc-head, body.mode-epi .world-q, body.mode-epi .path-step.now { background: #E3DEC8 !important; color: #2B2830 !important; }
[data-theme="dark"] body.mode-epi .flip, [data-theme="dark"] body.mode-epi .uc-head, [data-theme="dark"] body.mode-epi .world-q { background: #34303A !important; color: #E4DFE8 !important; }
body.mode-epi .uc-head *, body.mode-epi .world-q * { color: inherit !important; }
body.mode-epi .btn:not(.ghost) { background: #4A4552; }
body.mode-epi img, body.mode-epi video { filter: brightness(.9) saturate(.6); }
body.mode-epi .breath span { animation: none !important; transform: scale(.8); }
.dock-timer { height: 42px; padding: 0 14px; border-radius: 21px; background: var(--paper); display: grid; place-items: center; font-weight: 800; font-size: 14px; white-space: nowrap; }
.dock-btn.rest { background: color-mix(in srgb, var(--g) 40%, var(--paper)); }
.cats.labeled { justify-content: flex-start; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
/* крупные режимы: раздел учебника делится на карточки, а не сжимается */
body.mode-vision .unit-card .uc-body, body.mode-motor .unit-card .uc-body, body.mode-dys .unit-card .uc-body { display: flex; flex-direction: column; flex: none; }
body.mode-vision .uc-words, body.mode-motor .uc-words, body.mode-dys .uc-words { grid-auto-rows: auto; }
body.mode-vision .uc-gram b, body.mode-vision .rule b { font-size: 26px; } body.mode-vision .uc-gram span, body.mode-vision .rule span { font-size: 19px; color: #FFE500; }
body.has-shell.mode-motor, body.has-shell.mode-vision { --dock-h: 80px; } @media (max-width: 900px) { body.has-shell.mode-motor, body.has-shell.mode-vision { --dock-h: 130px; } }
body.mode-epi .wchip.st-known, body.mode-epi .ww.st-known { box-shadow: inset 0 0 0 2px #9DB5A3; } body.mode-epi .wchip.st-learning, body.mode-epi .ww.st-learning { box-shadow: inset 0 0 0 2px #C9B79A; } body.mode-epi .fc-st { background: var(--paper) !important; color: var(--ink) !important; } body.mode-epi .ring { filter: saturate(.3); }

/* ================= управление ================= */
.settings { display: flex; flex-direction: column; gap: 14px; max-width: 1100px; }
.toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.toggle { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--paper); cursor: pointer; }
.toggle input { appearance: none; width: 46px; height: 28px; border-radius: 14px; background: var(--dim); position: relative; flex-shrink: 0; cursor: pointer; transition: background .2s; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 11px; background: #fff; transition: transform .2s; }
.toggle input:checked { background: var(--g); } .toggle input:checked::after { transform: translateX(18px); }
.toggle span { display: flex; flex-direction: column; } .toggle small { color: var(--mute); font-weight: 600; }
.save-bar { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; }
.cols3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
.ach-form.off { opacity: .6; }
.phrase-row { display: grid; grid-template-columns: 2fr 1.4fr 1fr auto auto; gap: 8px; align-items: center; padding: 12px; }
.phrase-row.new { box-shadow: inset 0 0 0 2px var(--dim); }
.mono-area { font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
@media (max-width: 760px) { .cols3, .phrase-row { grid-template-columns: 1fr; } }
.brand-prev { width: 56px; height: 56px; border-radius: 16px; object-fit: contain; background: var(--paper); display: grid; place-items: center; font-size: 12px; color: var(--mute); flex-shrink: 0; }
.color-in { width: 56px; height: 44px; border: 0; border-radius: 12px; padding: 0; background: none; cursor: pointer; }
.corner-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.corner-logo.has-img { background: transparent; }
.phrase-row { grid-template-columns: 2fr 1.2fr 1.2fr 1.2fr 1fr auto auto; }
.links-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pill-link { background: var(--paper); border-radius: 14px; padding: 6px 12px; font-weight: 800; font-size: 14px; display: flex; flex-direction: column; align-items: center; }
.pill-link small { color: var(--mute); font-weight: 700; font-size: 12px; }
.braille-line { font-size: 30px; letter-spacing: .25em; color: var(--ink); }
body.mode-motor .links-row { display: none; }

/* ---------- переводы содержимого в формах ---------- */
.i18n-box { display: grid; gap: 14px; padding: 18px 20px; border-radius: 22px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.i18n-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.i18n-head b { font-size: 17px; letter-spacing: -.01em; }
.i18n-head span { color: var(--mute); font-size: 14px; font-weight: 600; }
.i18n-lang { display: grid; gap: 12px; align-content: start; }
.i18n-tag { justify-self: start; padding: 4px 12px; border-radius: 99px; background: var(--ink); color: var(--inv); font-size: 13px; font-weight: 800; letter-spacing: .02em; }
.i18n-more > summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--mute); padding: 4px 0; }
.i18n-more[open] > summary { margin-bottom: 10px; }
