:root {
  --teal: #0e7c86; --teal-dark: #0b5d66; --teal-bg: #e5f4f5; --teal-soft: #f2f9fa;
  --ink: #16323a; --muted: #5c757d; --line: #d3e3e6;
  --green: #0b7a3e; --green-bg: #e7f6ec;
  --amber: #a05a00; --amber-bg: #fdf1dd;
  --red: #b3372a; --red-bg: #fdeae7;
  --grey-bg: #eef1f2;
  --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 17px; line-height: 1.5; color: var(--ink); background: #f6fafa; }
.hidden { display: none !important; }

/* Шапка. Липкая: кнопки разделов не уезжают при прокрутке и не прячутся ни на одном
   экране — при нехватке ширины строка переносится, а не обрезается. */
#topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--teal-dark); color: #fff; box-shadow: 0 2px 8px rgba(11,93,102,.25); }
#brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 19px; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.brand-ico { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; display: block; }
/* Строка навигации остаётся одной строкой всегда, как просила Наталья: на широком
   экране кнопки переносятся при нехватке места, а на узком (телефон/планшет) ряд не
   переносится вовсе, а прокручивается вбок — так шапка никогда не растягивается на
   пол-экрана. */
#nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
#nav .nav-btn { font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 10px; border: 1.5px solid rgba(255,255,255,.45); background: rgba(255,255,255,.08); color: #fff; transition: background .15s, border-color .15s; white-space: nowrap; flex-shrink: 0; }
#nav .nav-btn:hover { background: rgba(255,255,255,.2); }
#nav .nav-btn.on { background: #fff; color: var(--teal-dark); border-color: #fff; }
#nav .nav-sep { width: 1px; align-self: stretch; margin: 2px 2px; background: rgba(255,255,255,.28); flex-shrink: 0; }
#topbar #logout-btn { flex: 0 0 auto; }
.whoami { flex: 0 0 auto; font-size: 13.5px; color: rgba(255,255,255,.75); white-space: nowrap; }
@media (max-width: 820px) {
  .whoami { display: none; }
  .brand-txt { display: none; }
  #topbar { gap: 8px; padding: 8px 10px; }
  #nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
  #nav::-webkit-scrollbar { display: none; }
  #nav .nav-btn { font-size: 14px; padding: 6px 10px; }
}

/* Боковые кнопки прокрутки. Полупрозрачные, чтобы не закрывать текст;
   при наведении и нажатии становятся плотными. */
#scroller { position: fixed; right: 10px; top: 50%; transform: translateY(-50%); z-index: 45; display: flex; flex-direction: column; gap: 6px; }
#scroller button { min-height: 0; width: 42px; height: 42px; padding: 0; justify-content: center; font-size: 19px; line-height: 1; border-radius: 50%; background: rgba(14,124,134,.32); color: #fff; box-shadow: 0 2px 6px rgba(11,93,102,.18); transition: background .15s; }
#scroller button:hover, #scroller button:active { background: rgba(11,93,102,.95); filter: none; }
/* Не мешать модальным окнам и полноэкранным пробам */
body:has(.modal-back) #scroller, body:has(.stim-overlay) #scroller { display: none; }
@media (max-width: 480px) { #scroller { right: 6px; gap: 5px; } #scroller button { width: 38px; height: 38px; font-size: 17px; } }

main { max-width: 880px; margin: 0 auto; padding: 16px 12px 90px; }
.loading { text-align: center; color: var(--muted); padding: 48px 0; font-size: 18px; }

h1 { font-size: 24px; margin: 10px 0 14px; }
h2 { font-size: 20px; margin: 18px 0 10px; }
.sub { color: var(--muted); font-size: 15px; }

/* Кнопки */
button, .btn { font: inherit; cursor: pointer; border: none; border-radius: var(--r); padding: 12px 18px; font-size: 17px; font-weight: 600; background: var(--teal); color: #fff; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; transition: filter .15s; min-height: 48px; }
button:hover, .btn:hover { filter: brightness(1.08); }
button:disabled { opacity: .55; cursor: default; }
.ghost { background: transparent; color: var(--teal-dark); border: 2px solid var(--teal); }
#topbar .ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.danger-ghost { background: transparent; color: var(--red); border: 2px solid var(--red-bg); }
.modal-danger { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; }
.modal-danger .sub { margin-top: 6px; }
.small { padding: 7px 14px; font-size: 15px; min-height: 38px; }
.big { font-size: 18px; padding: 14px 22px; width: 100%; justify-content: center; }

/* Карточки */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.card.tap { cursor: pointer; transition: box-shadow .15s, border-color .15s; display: block; color: inherit; text-decoration: none; }
.card.tap:hover { border-color: var(--teal); box-shadow: 0 3px 12px rgba(14,124,134,.12); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }

/* Формы */
label.f { display: block; margin-bottom: 14px; }
label.f > span, .flabel { display: block; font-weight: 600; margin-bottom: 6px; font-size: 16.5px; }
input[type=text], input[type=date], input[type=password], input[type=number], textarea, select {
  width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
textarea { min-height: 88px; resize: vertical; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: none; min-height: auto; padding: 8px; font-size: 20px; line-height: 1; cursor: pointer; color: var(--teal-dark); }
input:focus, textarea:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
/* Поля с минутами узкие — рядом с ними подпись, растягивать их на всю ширину незачем */
.mins-in { width: 96px; flex: 0 0 96px; text-align: center; }
.step-row .ghost.small { flex: 0 0 auto; padding: 7px 12px; }
.note-input { margin-top: 8px; }
.note-input input { font-size: 15.5px; padding: 9px 12px; }

/* Чипы-варианты */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 10px 16px; font-size: 16px; font-weight: 500; min-height: 44px; }
.chip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip.norm.on { background: var(--green); border-color: var(--green); }
.chip.warn.on { background: var(--red); border-color: var(--red); }

/* Баллы */
.score-row { display: flex; flex-wrap: wrap; gap: 8px; }
.score-btn { flex: 1 1 130px; min-height: 58px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: 15.5px; line-height: 1.25; padding: 8px 10px; }
.score-btn b { font-size: 20px; display: block; }
.score-btn.s3.on { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.score-btn.s2.on { background: var(--amber-bg); border-color: var(--amber); color: var(--amber); }
.score-btn.s1.on { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.score-btn.s0.on { background: var(--grey-bg); border-color: var(--muted); color: var(--muted); }
.help-row { margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.help-row .hint-t { font-size: 14.5px; color: var(--muted); }
.chip.help { padding: 6px 13px; min-height: 36px; font-size: 15px; }

/* Проба-подсказка */
.probe { margin-top: 8px; background: var(--teal-soft); border: 1px dashed var(--teal); border-radius: 10px; padding: 9px 12px; font-size: 15.5px; color: var(--teal-dark); }
.probe-toggle { background: none; border: none; color: var(--teal-dark); font-size: 15px; padding: 4px 0; min-height: 0; font-weight: 600; text-decoration: underline dotted; }

/* Разделы карты */
.section { background: #fff; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; overflow: hidden; }
.section > .sec-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #fff; border: none; text-align: left; font-size: 18px; font-weight: 700; color: var(--ink); border-radius: 0; }
.sec-head .num { background: var(--teal-bg); color: var(--teal-dark); border-radius: 10px; min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.sec-head .state { margin-left: auto; font-size: 14px; color: var(--muted); font-weight: 500; flex: none; }
.sec-head .core-badge { background: #fdf1dd; color: var(--amber); font-size: 12.5px; padding: 2px 9px; border-radius: 999px; flex: none; }
.sec-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.sec-hint { font-size: 15px; color: var(--muted); margin: 10px 0 14px; }
.field { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.field:last-child { border-bottom: none; }
.age-badge { display: inline-block; background: var(--teal-bg); color: var(--teal-dark); font-size: 13.5px; border-radius: 999px; padding: 1px 10px; margin-left: 8px; vertical-align: 2px; font-weight: 600; }

/* Звуки */
.snd-group { margin-bottom: 14px; }
.snd-group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.snd-group-head b { font-size: 16.5px; }
.snd-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px dotted var(--line); }
.snd-letter { min-width: 46px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: var(--teal-bg); color: var(--teal-dark); font-weight: 800; font-size: 17px; border-radius: 10px; flex: none; }
.snd-words { color: var(--muted); font-size: 14px; flex: 1 1 120px; }
.snd-detail { width: 100%; padding: 8px 0 2px 0; display: flex; flex-direction: column; gap: 8px; background: var(--red-bg); border-radius: 10px; padding: 10px; }
.snd-detail .chips .chip { font-size: 14.5px; padding: 7px 12px; min-height: 38px; }

/* Полноэкранный показ картинок по звуку */
.snd-pic-row { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.snd-pic-card { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.snd-pic-card img { width: 220px; height: 220px; max-width: 38vw; max-height: 38vw; object-fit: contain; border-radius: 18px; background: #f5f2e9; }
.snd-pic-card img.missing { display: none; }
.snd-pic-card span { font-size: 22px; font-weight: 700; color: var(--teal-dark); }

/* Цепочки */
.chain-chip { min-width: 108px; text-align: center; font-family: ui-monospace, monospace; font-size: 16px; }
.chain-chip.ok { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.chain-chip.bad { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.chain-hint { font-size: 14.5px; color: var(--muted); margin-top: 8px; }

/* Прогресс */
.progress-wrap { position: sticky; top: var(--topbar-h, 56px); z-index: 40; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; margin-bottom: 14px; box-shadow: 0 2px 10px rgba(11,93,102,.08); }
.pbar { height: 10px; background: var(--grey-bg); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.pbar > div { height: 100%; background: linear-gradient(90deg, var(--teal), #16a3ae); border-radius: 999px; transition: width .3s; }
.ptext { font-size: 15px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.savestate { color: var(--green); font-weight: 600; }
.savestate.saving { color: var(--muted); }

/* Заключение */
.concl-block { margin-bottom: 16px; }
.spinner-box { text-align: center; padding: 40px 16px; }
.spinner { width: 52px; height: 52px; border: 5px solid var(--teal-bg); border-top-color: var(--teal); border-radius: 50%; margin: 0 auto 16px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-badge { display: inline-block; border-radius: 999px; padding: 3px 13px; font-size: 14px; font-weight: 700; }
.status-badge.draft { background: var(--amber-bg); color: var(--amber); }
.status-badge.approved { background: var(--green-bg); color: var(--green); }

.pdf-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.pdf-row .btn { flex: 1 1 240px; justify-content: center; }
.btn.parents-pdf { background: #7c5db0; }

/* Логин */
.login-box { max-width: 420px; margin: 8vh auto 0; }
.login-box .card { padding: 28px 24px; }

/* Тосты */
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast-item { background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 20px; font-size: 16px; box-shadow: 0 4px 16px rgba(0,0,0,.25); animation: fadein .25s; max-width: 90vw; }
.toast-item.err { background: var(--red); }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } }

/* Модал */
.modal-back { position: fixed; inset: 0; background: rgba(10,40,45,.45); z-index: 90; display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow-y: auto; }
.modal { background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 540px; }
.modal h2 { margin-top: 0; }

.tpl-pick { display: grid; gap: 10px; }
.tpl-pick .card { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 30px 12px; font-size: 16.5px; }
.mini-stat { font-size: 14.5px; color: var(--muted); }
.info-strip { background: var(--teal-soft); border: 1px solid var(--teal-bg); border-radius: var(--r); padding: 12px 16px; font-size: 15.5px; color: var(--teal-dark); margin-bottom: 14px; }

@media (max-width: 560px) {
  body { font-size: 16.5px; }
  main { padding: 12px 8px 80px; }
  .score-btn { flex: 1 1 46%; }
  .progress-wrap { top: 52px; }
}

/* Parts — структурные подполя («сидит с [7] мес.») */
.parts-row { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.part-item { display: inline-flex; align-items: center; gap: 8px; }
.part-label { font-size: 16px; }
.part-item input { width: 84px; text-align: center; font-size: 18px; padding: 10px 8px; }
.part-suffix { color: var(--muted); font-size: 15.5px; }

/* Расшифровка помощи С/О/Об */
.help-explain { width: 100%; font-size: 14px; color: var(--muted); line-height: 1.45; margin-top: 2px; }

/* Кнопка стимульного экрана */
.probe-stim-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.stim-btn { background: #fdf1dd; color: #7a4a00; border: 1.5px solid #f0c060; border-radius: 999px; padding: 8px 16px; font-size: 15.5px; font-weight: 700; min-height: 42px; }
.stim-btn:hover { filter: none; background: #fbe6c2; }

/* Просмотр PDF внутри приложения — свои кнопки «Назад»/«Печать» вместо системных,
   которых нет в PWA поверх PDF того же домена */
.pdf-overlay { position: fixed; inset: 0; background: #fff; z-index: 200; display: flex; flex-direction: column; }
.pdf-overlay-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 2px solid var(--teal-bg); }
.pdf-overlay-title { font-size: 15.5px; font-weight: 700; color: var(--teal-dark); }
.pdf-overlay-print { background: var(--teal); color: #fff; font-weight: 700; border-radius: 10px; padding: 8px 14px; }
.pdf-overlay-frame { flex: 1; border: 0; width: 100%; }

/* Стимульный экран */
.stim-overlay { position: fixed; inset: 0; background: #fff; z-index: 200; display: flex; flex-direction: column; }
.stim-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 2px solid var(--teal-bg); }
.stim-titles b { font-size: 18px; color: var(--teal-dark); display: block; }
.stim-hint { font-size: 14.5px; color: var(--muted); }
.stim-close { background: var(--red-bg); color: var(--red); font-weight: 700; border-radius: 12px; }
.stim-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 12px; }
.stim-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); justify-content: center; }

/* Печатный материал: предпросмотр листа и настройки */
.stim-btn.print-stim { background: #e9f0fd; color: #1b4a86; border-color: #a8c4ee; }
.stim-btn.print-stim:hover { background: #dbe7fb; }
.print-note { max-width: 900px; font-size: 16.5px; line-height: 1.5; color: var(--muted); align-self: center; }
.print-controls { display: flex; flex-wrap: wrap; gap: 14px 26px; justify-content: center; max-width: 940px; }
.print-control { display: flex; flex-direction: column; gap: 6px; }
.print-control-label { font-size: 15px; color: var(--muted); font-weight: 700; }
.sheet-scroll { width: 100%; display: flex; justify-content: center; }
.sheet-scale { transform-origin: top center; }
.sheet-frame { width: 794px; height: 1123px; border: 1px solid var(--line); border-radius: 4px; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.12); }
.print-download { background: var(--teal); color: #fff; font-weight: 700; }

/* Экран диктанта */
.dikt-meta { font-size: 17px; color: var(--muted); align-self: center; }
.dikt-text { max-width: 900px; font-size: 25px; line-height: 1.55; align-self: center; }
.dikt-text p { margin: 0 0 12px; }
.dikt-num { display: inline-block; min-width: 34px; color: var(--muted); font-size: 18px; }
.dikt-more { max-width: 900px; width: 100%; align-self: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fbfdfd; }
.dikt-more summary { font-size: 17px; font-weight: 700; color: var(--teal-dark); cursor: pointer; }
.dikt-more ul { margin: 8px 0 2px; padding-left: 22px; font-size: 16.5px; line-height: 1.5; }
.dikt-more li { margin-bottom: 6px; }
.dikt-disclaimer { max-width: 900px; align-self: center; font-size: 15.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }

.stim-cards { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; max-width: 720px; }
.stim-card { position: relative; background: #fff; border: 3px solid var(--line); border-radius: 20px; padding: 18px; min-width: 110px; min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.stim-cards.big .stim-card { min-width: 128px; min-height: 128px; }
.stim-card.sel { border-color: var(--teal); background: var(--teal-bg); box-shadow: 0 0 0 4px rgba(14,124,134,.25); }
.stim-emoji { font-size: 72px; line-height: 1; }
.stim-emoji.sm { font-size: 44px; }
.stim-emoji.xl { font-size: 108px; }
.stim-cap { font-size: 15px; color: var(--muted); }
.stim-theme-name { font-size: 22px; font-weight: 800; color: var(--teal-dark); margin-bottom: 4px; }
.color-tile { display: block; width: 84px; height: 84px; border-radius: 16px; }
.shape-svg { width: 96px; height: 96px; }
.order-mark { position: absolute; top: 6px; right: 6px; background: var(--teal); color: #fff; border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; }

/* Пирамидка */
.pyr-stage { position: relative; width: 300px; height: 300px; }
.pyr-rod { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); width: 14px; height: 250px; background: #8a5a2b; border-radius: 7px 7px 0 0; }
.pyr-base { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); width: 270px; height: 20px; background: #6a4520; border-radius: 10px; }
.pyr-stack { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column-reverse; align-items: center; }
.pyr-ring { height: 40px; border-radius: 20px; border: 3px solid rgba(0,0,0,.18); }
.pyr-ring.stacked { margin-top: 2px; }
.pyr-cap { width: 68px; height: 50px; margin-top: 2px; background: #c0392b; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.pyr-pool { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: center; margin-top: 10px; min-height: 56px; }

/* Разрезная картинка */
.cut-grid { display: grid; gap: 6px; width: 100%; }
.cut-tile { border: 2.5px solid var(--line); border-radius: 10px; padding: 0; overflow: hidden; background: #fff; }
.cut-tile svg { display: block; width: 100%; height: auto; }
.cut-tile.sel { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(14,124,134,.3); }

.contour-svg { width: min(76vw, 380px); height: auto; }
.clock-svg { width: min(70vw, 340px); height: auto; }

/* Сравнение множеств */
.compare-wrap { display: flex; gap: 18px; width: 100%; max-width: 640px; }
.compare-side { flex: 1; min-height: 200px; border: 3px solid var(--line); border-radius: 20px; background: #fff; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 14px; }
.compare-side.sel { border-color: var(--teal); background: var(--teal-bg); }

/* Предлоги: кот и коробка */
.prep-stage { position: relative; width: 320px; height: 320px; }
.prep-box-back { position: absolute; left: 50%; top: 58%; transform: translate(-50%,-50%); width: 190px; height: 130px; background: #c8955c; border-radius: 8px; z-index: 0; }
.prep-box-front { position: absolute; left: 50%; top: 66%; transform: translate(-50%,-50%); width: 190px; height: 96px; background: #e0ac6e; border: 4px solid #a8763e; border-radius: 8px; z-index: 2; }
.prep-cat { position: absolute; transform: translate(-50%,-50%); font-size: 78px; transition: all .4s; }

.seq-arrow { font-size: 16px; color: var(--muted); font-weight: 700; }
.seq-answer { min-height: 140px; border: 2.5px dashed var(--line); border-radius: 20px; padding: 10px; width: 100%; max-width: 640px; }
.scene-card { display: flex; gap: 24px; align-items: center; justify-content: center; background: var(--teal-soft); border: 2px solid var(--teal-bg); border-radius: 24px; padding: 40px 48px; }

@media (max-width: 560px) {
  .stim-emoji { font-size: 56px; }
  .stim-emoji.xl { font-size: 80px; }
  .stim-card { min-width: 92px; min-height: 92px; padding: 12px; }
  .stim-cards.big .stim-card { min-width: 100px; min-height: 100px; }
  .color-tile { width: 68px; height: 68px; }
  .pyr-stage { width: 260px; height: 260px; }
  .pyr-rod { height: 214px; }
}

/* Возрастной фильтр */
.age-strip { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 15px; color: var(--teal-dark); }
.age-strip.warn { color: var(--amber); }

/* Уровень глубины карты */
.depth-bar { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.depth-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.depth-label { font-size: 15px; color: var(--teal-dark); font-weight: 600; }
.depth-chips { gap: 8px; }
.depth-hint { margin-top: 6px; font-size: 14px; color: var(--muted); }
.deeper { display: block; width: 100%; margin-top: 10px; padding: 11px 14px; background: transparent; color: var(--teal);
  border: 2px dashed var(--line); border-radius: 12px; font-size: 15.5px; font-weight: 600; text-align: center; }
.deeper:hover { border-color: var(--teal); background: var(--teal-bg); }
.deeper.on { color: var(--muted); }

/* Экран настройки уровней */
.level-summary { font-size: 16.5px; }
.level-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--line); }
.level-row:last-child { border-bottom: 0; }
.level-name { flex: 1 1 240px; font-size: 16px; }
.level-chips { gap: 6px; flex-wrap: nowrap; }
.level-chips .chip { padding: 6px 12px; font-size: 14.5px; }
@media (max-width: 560px) { .level-chips { width: 100%; } .level-chips .chip { flex: 1; text-align: center; } }
.field-extra { opacity: .62; }
.extra-badge { background: var(--grey-bg); color: var(--muted); }

/* Справочные нормы для специалиста */
.norm-strip { background: var(--green-bg); border-left: 4px solid var(--green); border-radius: 8px; padding: 8px 12px; font-size: 14.5px; color: #14522e; margin: 4px 0 10px; line-height: 1.45; }
.norm-strip.snd-norm { margin: 2px 0 8px; }

/* Вопросы к помощнику */
.qa-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.qa-msg { max-width: 84%; padding: 12px 16px; border-radius: 16px; line-height: 1.5; font-size: 16.5px; }
.qa-user { align-self: flex-end; background: var(--teal); color: #fff; border-bottom-right-radius: 4px; }
.qa-assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; white-space: pre-line; }
.qa-assistant.qa-error { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.qa-thinking { display: flex; gap: 5px; padding: 18px 20px; }
.qa-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: qa-bounce 1.2s infinite ease-in-out; }
.qa-dot:nth-child(2) { animation-delay: .15s; }
.qa-dot:nth-child(3) { animation-delay: .3s; }
@keyframes qa-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-6px); opacity: 1; } }
.qa-input-card textarea { min-height: 56px; }
@media (max-width: 560px) { .qa-msg { max-width: 92%; } }

/* История версий */
.hist-list { display: flex; flex-direction: column; gap: 8px; max-width: 640px; margin: 0 auto; width: 100%; }
.hist-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.hist-row b { min-width: 170px; }
.hist-row span { color: var(--muted); font-size: 14.5px; flex: 1; }
.hist-row.hist-current { background: var(--teal-soft); border-color: var(--teal-bg); }

/* ── Волна 2: бланк заучивания слов ── */
.mem-read { font-size: 18px; color: var(--ink); background: var(--teal-soft); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; max-width: 900px; }
.mem-read b { color: var(--teal-dark); letter-spacing: .3px; }
.mem-table { border-collapse: collapse; font-size: 16px; }
.mem-table th { font-weight: 700; color: var(--muted); font-size: 14.5px; padding: 4px 8px; }
.mem-table td { padding: 3px 6px; text-align: center; }
.mem-word { text-align: left !important; font-weight: 600; font-size: 17px; padding-right: 12px !important; }
.mem-cell { width: 46px; height: 44px; border-radius: 10px; border: 2px solid var(--line); background: #fff; color: var(--teal-dark); font-size: 20px; font-weight: 700; padding: 0; min-height: 0; }
.mem-cell.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.mem-total { font-weight: 800; color: var(--teal-dark); font-size: 18px; border-top: 2px solid var(--line); }
.mem-hidden { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--muted); font-size: 19px; text-align: center; max-width: 520px; }
.mem-hidden-ico { font-size: 86px; }
.stim-card.mem-right { border-color: var(--green); background: var(--green-bg); }

/* ── Волна 2: словесные пробы ── */
.stim-words { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; max-width: 760px; }
.stim-word { font-size: 30px; font-weight: 600; color: var(--ink); background: #fff; border: 3px solid var(--line); border-radius: 16px; padding: 12px 22px; }
.an-row { display: flex; align-items: center; gap: 14px; font-size: 30px; }
.an-row.an-ask { padding-top: 6px; border-top: 2px dashed var(--line); }
.an-pic { font-size: 66px; line-height: 1; }
.an-dash { color: var(--muted); }
.an-txt { font-weight: 600; }
.stim-card.an-opt { min-width: 0; min-height: 0; padding: 14px 20px; }
.stim-card.an-opt .an-txt { font-size: 22px; color: var(--ink); }
.stim-card.sel .an-txt { color: var(--teal-dark); }
.an-zagadka { font-size: 27px; line-height: 1.45; text-align: center; max-width: 620px; font-weight: 600; }

/* ── Волна 2: порядковый счёт ── */
.ord-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.ord-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ord-num { font-size: 15px; color: var(--muted); font-weight: 700; }

/* ── Волна 2: почтовый ящик ── */
.post-box { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; background: #6a4520; border-radius: 18px; padding: 16px; max-width: 560px; }
.post-slot { background: #4a2f16; border-radius: 12px; padding: 6px; display: flex; align-items: center; justify-content: center; }
.post-slot.filled { background: #7a5228; }
.post-pool { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; min-height: 96px; align-items: center; }
.post-fig { background: #fff; border: 3px solid var(--line); border-radius: 16px; padding: 6px; min-height: 0; }
.konstr-svg { background: #fff; border: 2px solid var(--line); border-radius: 16px; }
