/* ==========================================================================
   kt.css — общая таблица стилей редизайна «Тетрадь и живой цвет».
   Токены и компоненты: docs/redesign-plan.md §3–§4. Префикс классов kt-.
   Страницы нового дизайна наследуют templates/kt/base.html; старые страницы
   живут на base.html + main.css и этот файл не подключают.
   ========================================================================== */

:root {
  --kt-paper: #F3F0E8;
  --kt-paper-grid: linear-gradient(rgba(22,24,29,.05) 1px, transparent 1px),
                   linear-gradient(90deg, rgba(22,24,29,.05) 1px, transparent 1px);
  --kt-ink: #16181D;
  --kt-muted: #4A505C;
  --kt-faint: #9AA0AA;
  --kt-card: #FFFFFF;
  --kt-soft: #F7F5EF;
  --kt-line: rgba(22,24,29,.06);
  --kt-line-row: rgba(22,24,29,.07);
  --kt-line-input: rgba(22,24,29,.12);
  --kt-track: rgba(22,24,29,.08);
  --kt-accent: #2B46D4;
  --kt-accent-hover: #1E34A8;
  --kt-accent-soft: rgba(43,70,212,.10);
  --kt-accent-tint: rgb(191,200,242);
  --kt-butter: #FBE98B;
  --kt-sky: #CFE5EC;
  --kt-pistachio: #E2EDA3;
  --kt-blush: #F5D1DA;
  --kt-peach: #FAD9BF;
  --kt-lime: #D9F36E;
  --kt-success: #1F7A4D;
  --kt-confirm: rgba(251,233,139,.4);

  --kt-serif: 'Literata', Georgia, serif;
  --kt-sans: 'Onest', 'Segoe UI', system-ui, sans-serif;

  --kt-shadow-float: 0 12px 32px rgba(22,24,29,.08);
  --kt-shadow-menu: 0 18px 40px rgba(22,24,29,.16), 0 2px 6px rgba(22,24,29,.06);
  --kt-shadow-nav: 0 1px 2px rgba(22,24,29,.06), 0 4px 12px rgba(22,24,29,.05);
  --kt-shadow-stat: 0 1px 2px rgba(22,24,29,.05), 0 10px 24px rgba(22,24,29,.07);
}

/* ---------- База ---------- */
.kt-body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--kt-paper);
  background-image: var(--kt-paper-grid);
  background-size: 24px 24px;
  font-family: var(--kt-sans);
  font-size: 14px;
  line-height: normal;
  color: var(--kt-ink);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
.kt-body *, .kt-body *::before, .kt-body *::after { box-sizing: border-box; }
/* Сбросы элементов — через :where(), чтобы любой класс компонента ниже их перебивал. */
.kt-body :where(a) { color: var(--kt-accent); }
.kt-body :where(a:hover) { color: var(--kt-accent-hover); }
.kt-body :where(input)::placeholder { color: #6B7280; }
.kt-body :where(button, input, select, textarea) { font: inherit; color: inherit; }
.kt-body :focus-visible { outline: 2px solid var(--kt-accent); outline-offset: 2px; }
.kt-body svg { flex-shrink: 0; }
.kt-num { font-variant-numeric: lining-nums tabular-nums; }
.kt-serif { font-family: var(--kt-serif); }
.kt-muted { color: var(--kt-muted); }
.kt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Каркас страницы репетитора ---------- */
.kt-shell {
  display: flex;
  gap: 16px;
  padding: 16px;
  min-height: 100vh;
}
.kt-main {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Сайдбар */
.kt-side {
  width: 256px;
  flex-shrink: 0;
  position: sticky;
  top: 16px;
  align-self: flex-start;
  height: calc(100vh - 32px);
  min-height: 560px;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--kt-line);
  border-radius: 22px;
  overflow-y: auto;
}
.kt-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; text-decoration: none; color: var(--kt-ink); }
.kt-brand__mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--kt-ink); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--kt-serif); font-size: 20px; font-weight: 600;
}
.kt-brand__name { font-family: var(--kt-serif); font-size: 20px; font-weight: 600; letter-spacing: -.01em; }

.kt-userchip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  background: var(--kt-card);
  border: 1px solid var(--kt-line);
  border-radius: 14px;
}
.kt-userchip__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kt-userchip__name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kt-userchip__role { font-size: 12px; color: var(--kt-muted); }

.kt-nav { display: flex; flex-direction: column; gap: 2px; }
.kt-nav__label {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--kt-muted); padding: 4px 12px 8px;
}
.kt-body .kt-nav__item {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 0 12px;
  border-radius: 12px;
  color: var(--kt-muted); text-decoration: none;
  font-size: 14px; font-weight: 500;
}
.kt-body .kt-nav__item:hover { color: var(--kt-ink); background: rgba(255,255,255,.6); }
.kt-body .kt-nav__item[aria-current="page"] {
  background: var(--kt-card);
  box-shadow: var(--kt-shadow-nav);
  color: var(--kt-ink);
  font-weight: 600;
}
.kt-nav__grow { flex-grow: 1; }
.kt-count {
  font-size: 12px; font-weight: 600; line-height: normal;
  color: var(--kt-ink); background: var(--kt-lime);
  border-radius: 999px; padding: 2px 9px;
}

.kt-seats {
  background: var(--kt-card);
  border: 1px solid var(--kt-line);
  border-radius: 16px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.kt-seats__label { font-size: 12px; color: var(--kt-muted); }
.kt-seats__row { display: flex; align-items: baseline; gap: 6px; }
.kt-seats__num { font-family: var(--kt-serif); font-size: 24px; line-height: 1; font-weight: 600; }
.kt-seats__of { font-size: 13px; color: var(--kt-muted); }
.kt-seats__note { font-size: 12px; color: var(--kt-muted); }

.kt-side__foot { display: flex; gap: 4px; padding: 0 6px; }
.kt-body .kt-side__foot a { font-size: 13px; color: var(--kt-muted); text-decoration: none; padding: 6px; }
.kt-body .kt-side__foot a:hover { color: var(--kt-ink); }
.kt-spacer { flex-grow: 1; }

/* Прогресс-полоса */
.kt-bar { height: 6px; border-radius: 3px; background: var(--kt-track); overflow: hidden; }
.kt-bar__fill { display: block; height: 100%; border-radius: inherit; background: var(--kt-accent); }
.kt-bar--lg { height: 8px; border-radius: 4px; }

/* ---------- Заголовок страницы ---------- */
.kt-pagehead {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 10px 8px 0;
}
.kt-pagehead__text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kt-pagehead__meta { font-size: 13px; color: var(--kt-muted); }
.kt-pagehead__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* Заголовок вложенной страницы ученика: круглая «назад» слева, заголовок рядом */
.kt-pagehead--back { align-items: center; justify-content: flex-start; gap: 12px; }
.kt-pagehead--back .kt-h1 { font-size: 30px; line-height: 1.15; overflow-wrap: anywhere; }
.kt-h1 {
  margin: 0;
  font-family: var(--kt-serif); font-size: 40px; line-height: 1.12; font-weight: 500;
  letter-spacing: -.02em;
}
.kt-h2 { margin: 0; font-family: var(--kt-serif); font-size: 24px; font-weight: 500; line-height: normal; }
.kt-h2--sm { font-size: 22px; }
.kt-h2--lg { font-size: 26px; }

/* ---------- Кнопки ---------- */
.kt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  background: var(--kt-card); color: var(--kt-ink);
}
.kt-btn--sm { height: 40px; padding: 0 16px; }
.kt-btn--lg { height: 52px; padding: 0 24px; font-size: 15px; }
.kt-btn--xl { height: 56px; padding: 0 28px; font-size: 16px; }
.kt-btn--outline { border-color: var(--kt-line-input); background: var(--kt-card); }
.kt-btn--outline:hover { border-color: rgba(22,24,29,.24); }
.kt-btn--plain { border-color: transparent; background: var(--kt-card); }
.kt-btn--primary { background: var(--kt-accent); color: #FFFFFF; }
.kt-pagehead__actions .kt-btn--primary { padding: 0 20px; }
.kt-btn--primary:hover { background: var(--kt-accent-hover); color: #FFFFFF; }
.kt-btn--dark { background: var(--kt-ink); color: #FFFFFF; }
.kt-btn--quiet { background: transparent; color: var(--kt-accent); }
.kt-btn--quiet:hover { color: var(--kt-accent-hover); }
/* Форма уже отправлена (двойной клик): кнопка не disabled — её имя и значение остаются в запросе, — но выглядит и ведёт себя как неактивная */
.kt-btn[aria-disabled="true"] { opacity: .6; cursor: default; pointer-events: none; }
.kt-textbtn {
  min-height: 32px; padding: 0; border: 0; background: none; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--kt-muted);
}
.kt-textbtn:hover { color: var(--kt-ink); }
.kt-body .kt-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--kt-accent); text-decoration: none;
}
.kt-body .kt-link:hover { color: var(--kt-accent-hover); }
.kt-inline-form { display: inline; margin: 0; }

/* ---------- Карточки ---------- */
.kt-card {
  background: var(--kt-card);
  border: 1px solid var(--kt-line);
  border-radius: 22px;
  padding: 20px 24px;
  display: flex; flex-direction: column;
}
.kt-card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.kt-card__title { display: flex; align-items: center; gap: 10px; }
.kt-card--float { box-shadow: var(--kt-shadow-float); }
.kt-soft { background: var(--kt-soft); border-radius: 16px; padding: 14px 16px; }
.kt-cols { display: flex; gap: 16px; align-items: flex-start; }
.kt-col { flex-basis: 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.kt-col--wide { flex-grow: 1.4; }
.kt-col--narrow { flex-grow: 1; }

/* Строки списков */
.kt-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--kt-line-row); }
.kt-row__body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.kt-row__title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.kt-row__meta { font-size: 13px; color: var(--kt-muted); }
.kt-row__aside { font-size: 13px; color: var(--kt-muted); white-space: nowrap; }
.kt-body a.kt-row__link { color: inherit; text-decoration: none; }

/* Пары «подпись — значение» */
.kt-kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--kt-line-row); }
.kt-kv__k { font-size: 13px; color: var(--kt-muted); }
.kt-kv__v { font-size: 14px; font-weight: 500; text-align: right; overflow-wrap: anywhere; }

/* ---------- Аватары, плитки, чипы ---------- */
.kt-ava {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: var(--kt-ink);
}
.kt-ava--round { border-radius: 50%; }
.kt-ava--38 { width: 38px; height: 38px; font-size: 13px; }
.kt-ava--56 { width: 56px; height: 56px; font-size: 18px; }
.kt-stack { display: flex; }
.kt-stack .kt-ava {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--kt-soft); font-size: 11px;
}
.kt-stack .kt-ava + .kt-ava { margin-left: -8px; }
.kt-stack .kt-ava--more { background: var(--kt-ink); color: #FFFFFF; }

.kt-tile {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--kt-ink);
}
.kt-tile--36 { width: 36px; height: 36px; border-radius: 10px; }
.kt-tile--40 { width: 40px; height: 40px; border-radius: 12px; }
.kt-tile--48 { width: 48px; height: 48px; border-radius: 14px; }

.kt-bg-butter { background: var(--kt-butter); }
.kt-bg-sky { background: var(--kt-sky); }
.kt-bg-pistachio { background: var(--kt-pistachio); }
.kt-bg-blush { background: var(--kt-blush); }
.kt-bg-peach { background: var(--kt-peach); }
.kt-bg-lime { background: var(--kt-lime); }

.kt-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; line-height: normal;
  border-radius: 999px; padding: 2px 10px;
  color: var(--kt-ink); background: var(--kt-lime);
}
.kt-chip--done, .kt-chip--correct { background: var(--kt-lime); }
.kt-chip--passed { background: var(--kt-sky); }
.kt-chip--repeat { background: var(--kt-blush); }
.kt-chip--waiting { background: var(--kt-butter); }
.kt-chip--new { background: transparent; border: 1px dashed rgba(22,24,29,.3); }

.kt-check {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%;
  background: var(--kt-lime); color: var(--kt-ink);
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Карточка-показатель ---------- */
.kt-stat {
  background: var(--kt-card);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--kt-shadow-stat);
  min-width: 0;
}
.kt-stat__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kt-stat__label { font-size: 13px; font-weight: 500; color: var(--kt-muted); }
.kt-stat__value { display: flex; align-items: baseline; gap: 8px; }
.kt-stat__num {
  font-family: var(--kt-serif); font-size: 44px; line-height: 1; font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
}
.kt-stat__unit { font-size: 13px; color: var(--kt-muted); }
.kt-stat__foot {
  font-size: 12px; font-weight: 500; color: var(--kt-muted);
  display: flex; align-items: center; gap: 4px; min-height: 15px;
}
.kt-stat__foot--up { color: var(--kt-success); }

/* ---------- Формы ---------- */
.kt-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.kt-hint { font-size: 13px; line-height: 1.45; color: var(--kt-muted); }
.kt-input {
  width: 100%; min-width: 0; height: 44px;
  border-radius: 12px; border: 1px solid var(--kt-line-input);
  padding: 0 12px; font-size: 14px; color: var(--kt-ink); background: var(--kt-card);
}
.kt-input:focus { outline: none; border-color: var(--kt-accent); box-shadow: 0 0 0 3px var(--kt-accent-soft); }

/* Сегментированный выбор (0/1/2 балла, вкладки-пилюли) */
.kt-seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.kt-seg__item {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--kt-line-input); background: var(--kt-card);
  font-size: 13px; font-weight: 500; color: var(--kt-ink); text-decoration: none; cursor: pointer;
}
.kt-seg__item[aria-current="page"], .kt-seg__item[aria-pressed="true"], .kt-seg__item.is-active {
  background: var(--kt-ink); border-color: var(--kt-ink); color: #FFFFFF; font-weight: 600;
}

/* Раскрывающаяся подсказка на месте (<details>), без оверлея */
.kt-details > summary { list-style: none; cursor: pointer; }
.kt-details > summary::-webkit-details-marker { display: none; }
.kt-details__body {
  margin-top: 8px; padding: 12px 14px; border-radius: 14px;
  background: var(--kt-soft); font-size: 13px; line-height: 1.5; color: var(--kt-muted);
}

/* Подтверждение на месте (без window.confirm и затемнения) */
.kt-confirm { background: var(--kt-confirm); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }

/* Выпадающее меню, привязанное к кнопке */
.kt-menu {
  position: absolute; z-index: 50; min-width: 220px;
  background: var(--kt-card); border-radius: 16px; padding: 6px;
  box-shadow: var(--kt-shadow-menu);
}
.kt-menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px;
  background: none; text-align: left; font-size: 14px; color: var(--kt-ink); text-decoration: none; cursor: pointer;
}
.kt-menu__item:hover { background: var(--kt-soft); }

/* Таблица данных */
.kt-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.kt-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--kt-muted); padding: 8px 12px; }
.kt-table td { padding: 12px; border-top: 1px solid var(--kt-line-row); }
.kt-table tr:hover td { background: var(--kt-soft); }

/* Пустое состояние */
.kt-empty { padding: 18px 0 12px; font-size: 14px; color: var(--kt-muted); border-top: 1px solid var(--kt-line-row); }

/* ---------- Сообщения и плашки над контентом ---------- */
.kt-notices { display: flex; flex-direction: column; gap: 8px; }
.kt-msg {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--kt-card); border: 1px solid var(--kt-line); border-radius: 16px;
  padding: 12px 16px; font-size: 14px; line-height: 1.45;
  box-shadow: var(--kt-shadow-float);
}
.kt-msg--success { border-left: 4px solid var(--kt-success); }
.kt-msg--error { border-left: 4px solid #B42318; }
.kt-msg--warning, .kt-msg--lesson { background: #FFFCEB; border-left: 4px solid var(--kt-butter); }
.kt-msg--info { border-left: 4px solid var(--kt-accent); }

/* ---------- Компоненты PR 2: вкладки, фильтры, меню, подтверждения ---------- */
/* Вкладки-ссылки (карточка ученика): пилюля с активной чёрной; на телефоне полоса скроллится вбок. */
.kt-tabs {
  align-self: flex-start; display: flex; gap: 4px; padding: 4px; border-radius: 999px;
  background: rgba(255,255,255,.72); border: 1px solid var(--kt-line);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.kt-tabs::-webkit-scrollbar { display: none; }
.kt-body a.kt-tabs__item {
  flex-shrink: 0; height: 40px; padding: 0 18px; border-radius: 999px;
  display: flex; align-items: center; font-size: 14px; font-weight: 500;
  color: var(--kt-muted); text-decoration: none; white-space: nowrap;
}
.kt-body a.kt-tabs__item:hover { color: var(--kt-ink); }
.kt-body a.kt-tabs__item[aria-current="page"] { background: var(--kt-ink); color: #FFFFFF; font-weight: 600; }

/* Крупные пилюли фильтра (список учеников) и поле поиска с иконкой */
.kt-seg--lg .kt-seg__item { height: 36px; border-color: rgba(22,24,29,.14); }
.kt-search { position: relative; display: block; }
.kt-search > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--kt-muted); pointer-events: none; }
.kt-search .kt-input { padding-left: 42px; border-color: rgba(22,24,29,.16); font-size: 15px; }
.kt-search--sm .kt-input { height: 40px; padding-left: 38px; font-size: 14px; }
.kt-search--sm > svg { left: 12px; }

/* Чип помельче / статусный чип таблицы */
.kt-chip--sm { font-size: 12px; padding: 3px 10px; }
.kt-chip--row { padding: 5px 10px; white-space: nowrap; }
.kt-chip--new.kt-chip--sm { padding: 2px 9px; font-weight: 500; color: var(--kt-muted); }
.kt-btn--xs { height: 36px; padding: 0 14px; font-size: 13px; }
.kt-btn--ink { background: var(--kt-ink); color: #FFFFFF; }
.kt-ava--44 { width: 44px; height: 44px; font-size: 14px; }
.kt-ava--64 { width: 64px; height: 64px; font-size: 20px; }
.kt-ava--36 { width: 36px; height: 36px; font-size: 12px; }
.kt-iconbtn {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; border: 0;
  background: transparent; color: var(--kt-muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.kt-iconbtn:hover { background: var(--kt-soft); color: var(--kt-ink); }

/* Меню у кнопки: контейнер .kt-pop (relative), само меню .kt-menu; без JS работает на <details>. */
.kt-pop { position: relative; display: inline-block; }
.kt-pop > summary { list-style: none; cursor: pointer; }
.kt-pop > summary::-webkit-details-marker { display: none; }
.kt-menu { top: calc(100% + 6px); left: 0; border: 1px solid rgba(22,24,29,.08); display: flex; flex-direction: column; gap: 2px; }
.kt-menu--right { left: auto; right: 0; }
.kt-menu--up { top: auto; bottom: calc(100% + 6px); }
.kt-menu form { margin: 0; }
.kt-menu__item { font-weight: 500; }
.kt-menu__item:focus-visible { background: var(--kt-soft); outline: 2px solid var(--kt-accent); outline-offset: -2px; }
.kt-menu__radio { min-height: 44px; }
.kt-menu__radio[aria-checked="true"] { background: var(--kt-soft); }
.kt-menu__label { width: 96px; flex-shrink: 0; }
.kt-menu__hint { flex-grow: 1; font-size: 13px; color: var(--kt-muted); }
.kt-menu__sep { height: 1px; margin: 4px 8px; background: rgba(22,24,29,.08); }

/* Подтверждение на месте: кнопки действия и отмены */
.kt-confirm__text { font-size: 14px; line-height: 1.5; }
.kt-confirm__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kt-confirm__actions form { margin: 0; }
.kt-btn--ghost { background: transparent; border-color: transparent; }

/* ---------- Телефон: верхняя панель и нижние вкладки ---------- */
.kt-topbar, .kt-tabbar { display: none; }

@media (max-width: 899px) {
  .kt-shell { display: block; padding: 0 16px calc(88px + env(safe-area-inset-bottom)); }
  .kt-side { display: none; }
  .kt-main { gap: 16px; }
  .kt-topbar {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 40;
    margin: 0 -16px 4px; padding: 10px 16px;
    padding-top: calc(10px + env(safe-area-inset-top));
    min-height: 56px;
    background: rgba(243,240,232,.92);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--kt-line);
  }
  .kt-topbar__title {
    font-family: var(--kt-serif); font-size: 18px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .kt-tabbar {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.96);
    border-top: 1px solid var(--kt-line);
    box-shadow: 0 -4px 16px rgba(22,24,29,.05);
  }
  .kt-body .kt-tabbar__item {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 52px; border-radius: 12px;
    font-size: 11px; font-weight: 500; color: var(--kt-muted); text-decoration: none;
  }
  .kt-body .kt-tabbar__item[aria-current="page"] { color: var(--kt-ink); font-weight: 600; background: var(--kt-soft); }
  .kt-tabbar__count {
    position: absolute; top: 3px; left: calc(50% + 6px);
    font-size: 10px; font-weight: 700; line-height: 16px; min-width: 18px; text-align: center;
    padding: 0 5px; border-radius: 999px; background: var(--kt-lime); color: var(--kt-ink);
  }
  .kt-pagehead { flex-direction: column; align-items: stretch; padding: 8px 0 0; }
  .kt-h1 { font-size: 30px; }
  .kt-h2 { font-size: 21px; }
  .kt-card { padding: 18px; border-radius: 20px; }
  .kt-cols { flex-direction: column; align-items: stretch; }
  .kt-col { flex-basis: auto; }
  .kt-stat__num { font-size: 36px; }
}

/* ---------- Компоненты PR 3: шаги, карточки-радио, переключатель, баллы ---------- */
/* Шаг формы: номер в чёрном круге + заголовок карточки */
.kt-step { display: flex; align-items: center; gap: 10px; }
.kt-step__n {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%;
  background: var(--kt-ink); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}

/* Карточка с радио: вариант, группа, ученик. Выбранная подсвечивается (без :has остаётся видимая радиокнопка). */
.kt-choice {
  display: flex; align-items: center; gap: 14px;
  min-height: 60px; padding: 10px 16px; border-radius: 16px;
  border: 1px solid rgba(22,24,29,.1); background: var(--kt-card); cursor: pointer;
}
.kt-choice:hover { border-color: rgba(22,24,29,.22); }
.kt-choice > input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; accent-color: var(--kt-accent); }
.kt-choice:has(input:checked) { border: 1.5px solid var(--kt-accent); background: var(--kt-accent-soft); padding: 9.5px 15.5px; }
.kt-choice:has(input:focus-visible) { outline: 2px solid var(--kt-accent); outline-offset: 2px; }
.kt-choice__body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kt-choice__title { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.kt-choice__meta { font-size: 13px; color: var(--kt-muted); }
.kt-choice__tag {
  flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--kt-muted);
  background: var(--kt-paper); border-radius: 999px; padding: 4px 10px;
}
.kt-choice__tag--mine { color: var(--kt-ink); background: var(--kt-pistachio); }
.kt-choice:has(input:checked) .kt-choice__tag:not(.kt-choice__tag--mine) { background: var(--kt-card); }

/* Сегмент-контейнер: мягкая подложка, выбранный пункт белый («Группе / Одному ученику») */
.kt-segctl { align-self: flex-start; display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--kt-paper); max-width: 100%; }
.kt-segctl__item {
  height: 40px; padding: 0 20px; border-radius: 999px; border: 0; background: transparent;
  font-size: 14px; font-weight: 500; color: var(--kt-muted); cursor: pointer; white-space: nowrap;
}
.kt-segctl__item[aria-checked="true"],
.kt-segctl__item[aria-current="step"] {
  background: var(--kt-card); color: var(--kt-ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(22,24,29,.08), 0 4px 10px rgba(22,24,29,.06);
}
/* Во всю ширину (шаги онбординга, шкала 1–5): пункты делят строку поровну; «шаг» — текущий пункт нумерованного списка */
.kt-segctl--fill { align-self: stretch; display: flex; margin: 0; list-style: none; }
.kt-segctl--fill .kt-segctl__item { flex: 1 1 0; min-width: 0; padding: 0 8px; display: flex; align-items: center; justify-content: center; text-align: center; }
@media (max-width: 359px) {
  .kt-segctl--fill { gap: 2px; padding: 3px; }
  .kt-segctl--fill .kt-segctl__item { padding: 0 2px; font-size: 12px; }
}

/* Переключатель (checkbox role=switch) */
.kt-switch { position: relative; display: inline-block; width: 48px; height: 28px; flex-shrink: 0; cursor: pointer; }
.kt-switch > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.kt-switch__track { position: absolute; inset: 0; border-radius: 999px; background: rgba(22,24,29,.22); transition: background .15s; pointer-events: none; }
.kt-switch__track::after {
  content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 1px 2px rgba(22,24,29,.2); transition: transform .15s;
}
.kt-switch > input:checked + .kt-switch__track { background: var(--kt-accent); }
.kt-switch > input:checked + .kt-switch__track::after { transform: translateX(20px); }
.kt-switch > input:focus-visible + .kt-switch__track { outline: 2px solid var(--kt-accent); outline-offset: 2px; }

/* Балл 0…max: радио-кнопки-плитки, минимум 44 px в высоту */
.kt-score { display: flex; gap: 6px; flex-wrap: wrap; }
.kt-score__opt { position: relative; display: block; cursor: pointer; }
.kt-score__opt > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.kt-score__opt > span {
  display: flex; align-items: center; justify-content: center;
  min-width: 48px; height: 44px; padding: 0 6px; border-radius: 12px;
  border: 1px solid rgba(22,24,29,.14); background: var(--kt-card);
  font-family: var(--kt-serif); font-size: 18px; font-weight: 600; font-variant-numeric: lining-nums tabular-nums;
}
.kt-score__opt:hover > span { border-color: rgba(22,24,29,.3); }
.kt-score__opt > input:checked + span { background: var(--kt-accent); border-color: var(--kt-accent); color: #FFFFFF; }
.kt-score__opt > input:focus-visible + span { outline: 2px solid var(--kt-accent); outline-offset: 2px; }

/* Выбор одного из 3–4 пунктов с подписями (отметка посещаемости): радио-плитки на всю ширину,
   4 в ряд, на узком экране 2×2; не меньше 44 px по высоте. Выбранная — чёрная, с тоном — пастельная с чёрной рамкой.
   Родной <input type="radio"> лежит поверх плитки: стрелки и Tab работают как у radiogroup. */
.kt-rseg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.kt-rseg__opt { position: relative; display: block; cursor: pointer; min-width: 0; }
.kt-rseg__opt > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.kt-rseg__opt > span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 44px; padding: 6px 8px; border-radius: 12px;
  border: 1px solid rgba(22,24,29,.14); background: var(--kt-card);
  font-size: 14px; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere;
}
.kt-rseg__opt:hover > span { border-color: rgba(22,24,29,.3); }
.kt-rseg__opt > input:checked + span { background: var(--kt-ink); border-color: var(--kt-ink); color: #FFFFFF; font-weight: 600; }
.kt-rseg__opt--lime > input:checked + span { background: var(--kt-lime); color: var(--kt-ink); }
.kt-rseg__opt--butter > input:checked + span { background: var(--kt-butter); color: var(--kt-ink); }
.kt-rseg__opt--sky > input:checked + span { background: var(--kt-sky); color: var(--kt-ink); }
.kt-rseg__opt--blush > input:checked + span { background: var(--kt-blush); color: var(--kt-ink); }
.kt-rseg__opt > input:focus-visible + span { outline: 2px solid var(--kt-accent); outline-offset: 2px; }
@media (max-width: 479px) { .kt-rseg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Маленькая пилюля-подпись (тип, «до 2 баллов», «проверено автоматически») */
.kt-tag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; color: var(--kt-muted); background: var(--kt-paper); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }

@media (max-width: 899px) {
  .kt-segctl__item { height: 44px; }
  .kt-seg--quick { flex-wrap: nowrap; gap: 4px; }
  .kt-seg--quick .kt-seg__item { height: 40px; padding: 0 10px; flex: 1 1 auto; }
}

/* ==========================================================================
   PR 4a — ученик и вход: каркас ученика, карточка входа, поля, плавающие вкладки
   ========================================================================== */

/* Поля в формах входа и регистрации: 48 px, шрифт 16 px (iOS не зумит поле) */
.kt-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kt-field > .kt-label { margin-bottom: 0; }
.kt-field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.kt-field__err { font-size: 13px; line-height: 1.4; color: #B42318; }
.kt-field__hint { font-size: 12px; line-height: 1.45; color: var(--kt-muted); }
.kt-input--lg { height: 48px; padding: 0 14px; font-size: 16px; border-color: rgba(22,24,29,.16); }
.kt-input--lg:focus { border-color: var(--kt-accent); box-shadow: 0 0 0 .5px var(--kt-accent), 0 0 0 4px var(--kt-accent-soft); }
.kt-input.is-invalid { border-color: #B42318; }
.kt-input--code {
  height: 60px; border-radius: 14px; padding: 0 14px;
  font-family: var(--kt-serif); font-size: 26px; font-weight: 600; letter-spacing: .16em;
  text-align: center; text-transform: uppercase;
}
.kt-input--code::placeholder { text-transform: uppercase; letter-spacing: .16em; font-weight: 500; }
.kt-pw { position: relative; }
.kt-pw .kt-input { padding-right: 52px; }
.kt-pw__eye {
  position: absolute; right: 4px; top: 2px; width: 44px; height: 44px; border: 0; border-radius: 10px;
  background: transparent; color: var(--kt-muted); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.kt-checkrow { display: flex; align-items: flex-start; gap: 10px; min-height: 32px; font-size: 14px; line-height: 1.45; cursor: pointer; }
.kt-checkrow > input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; accent-color: var(--kt-accent); }
.kt-checkrow--muted { font-size: 13px; color: var(--kt-muted); }
.kt-checkrow--muted a { font-weight: 600; }

/* Крупные кнопки: 48 px и 52 px на всю ширину */
.kt-btn--md { height: 48px; padding: 0 22px; font-size: 15px; }
.kt-btn--cta { height: 52px; padding: 0 24px; font-size: 16px; }
.kt-btn--block { display: flex; width: 100%; }

/* Страница входа / регистрации: карточка по центру, до 560 px */
.kt-authpage {
  display: flex; flex-direction: column; gap: 18px;
  min-height: 100vh; max-width: 560px; margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}
.kt-authbar { display: flex; justify-content: space-between; align-items: center; min-height: 44px; gap: 12px; }
.kt-brand--sm { padding: 0; gap: 8px; min-height: 44px; }
.kt-brand--sm .kt-brand__mark { width: 30px; height: 30px; border-radius: 9px; font-size: 17px; }
.kt-brand--sm .kt-brand__name { font-size: 17px; }
.kt-body a.kt-authbar__link { display: flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; text-decoration: none; }
.kt-authcard {
  background: var(--kt-card); border: 1px solid var(--kt-line); border-radius: 24px;
  padding: 24px 20px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--kt-shadow-float);
}
.kt-authcard--form { padding: 22px 20px; gap: 16px; }
.kt-authcard__head { display: flex; flex-direction: column; gap: 6px; }
.kt-authcard__h1 { margin: 0; font-family: var(--kt-serif); font-size: 34px; line-height: 1.1; font-weight: 500; letter-spacing: -.02em; }
.kt-authcard--form .kt-authcard__h1, .kt-authcard__h1--md { font-size: 30px; line-height: 1.15; }
.kt-authcard__lead { margin: 0; font-size: 14px; line-height: 1.5; color: var(--kt-muted); }
.kt-authform { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.kt-authform__row { display: flex; gap: 10px; }
.kt-authform__row > .kt-field { flex: 1 1 0; }
/* Карточка-итог по центру (письмо отправлено, пароль изменён, ссылка не работает): плитка, заголовок, текст, кнопка */
.kt-authcard--center { align-items: center; text-align: center; padding: 32px 24px 28px; }
.kt-authcard--center .kt-authcard__head { align-items: center; }
.kt-authcard--center .kt-authcard__lead { max-width: 380px; }
.kt-authcard__actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 360px; }
@media (max-width: 359px) {
  .kt-authcard--center { padding-left: 16px; padding-right: 16px; }
  .kt-authcard--center .kt-authcard__h1 { font-size: 26px; }
}
.kt-linkrows { background: rgba(255,255,255,.72); border: 1px solid var(--kt-line); border-radius: 20px; padding: 6px 16px; display: flex; flex-direction: column; }
.kt-body a.kt-linkrow { display: flex; align-items: center; gap: 12px; min-height: 60px; color: var(--kt-ink); text-decoration: none; }
.kt-linkrow + .kt-linkrow { border-top: 1px solid var(--kt-line-row); }
.kt-linkrow__body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.kt-linkrow__title { font-size: 15px; font-weight: 600; }
.kt-linkrow__sub { font-size: 13px; color: var(--kt-muted); }
.kt-linkrow > svg:last-child { color: var(--kt-muted); }
.kt-infocard { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: rgba(255,255,255,.72); border: 1px solid var(--kt-line); font-size: 13px; line-height: 1.45; color: var(--kt-muted); }
.kt-infocard a { font-weight: 600; }
.kt-authfoot { margin-top: auto; align-self: center; font-size: 13px; }
.kt-body a.kt-authfoot { color: var(--kt-muted); text-decoration: none; }
.kt-tutorpill { align-self: flex-start; display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--kt-accent-soft); font-size: 13px; }
.kt-tutorpill .kt-ava { width: 30px; height: 30px; font-size: 12px; }
.kt-tutorpill span.kt-tutorpill__k { color: var(--kt-muted); }

/* Круглая кнопка 44 px с рамкой (колокольчик, «назад», PDF) */
.kt-roundbtn {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
  border: 1px solid rgba(22,24,29,.1); background: var(--kt-card); color: var(--kt-ink);
  display: flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; padding: 0;
}
.kt-body a.kt-roundbtn { color: var(--kt-ink); }
.kt-roundbtn--dark { background: var(--kt-ink); border-color: var(--kt-ink); color: #FFFFFF; }
.kt-pill { font-size: 12px; font-weight: 600; color: var(--kt-accent); background: var(--kt-accent-soft); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.kt-chip--lg { height: 32px; padding: 0 12px; }
.kt-chip--outline { background: var(--kt-card); border: 1px solid rgba(22,24,29,.1); }

/* Шкала результата: заливка + чёрная отметка проходного балла */
.kt-scorebar { position: relative; height: 22px; }
.kt-scorebar__track { position: absolute; left: 0; right: 0; top: 7px; height: 8px; border-radius: 4px; background: var(--kt-track); }
.kt-scorebar__fill { position: absolute; left: 0; top: 7px; height: 8px; border-radius: 4px; background: var(--kt-accent); }
.kt-scorebar__tick { position: absolute; top: 1px; width: 2px; height: 20px; border-radius: 1px; background: var(--kt-ink); }

/* Подсказка-уведомление над вкладками (toast) */
.kt-toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 60;
  max-width: 420px; margin: 0 auto;
  background: var(--kt-ink); color: #FFFFFF; border-radius: 16px; padding: 12px 16px; font-size: 14px; line-height: 1.45;
  box-shadow: var(--kt-shadow-menu);
}

/* ---------- Каркас ученика ---------- */
.kt-stop { display: none; }
.kt-stab { display: none; }
.kt-smain { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(112px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 18px; }
.kt-sphone { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; }
.kt-sphone__right { display: flex; align-items: center; gap: 8px; }
.kt-ava--me { width: 44px; height: 44px; border-radius: 50%; font-size: 14px; text-decoration: none; }
.kt-body a.kt-ava--me { color: var(--kt-ink); }

/* Плавающая нижняя панель (телефон): отступ 12 px, 72 px высотой, активный пункт — акцентом */
.kt-stab {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40;
  max-width: 536px; margin: 0 auto; height: 72px; border-radius: 22px;
  background: rgba(255,255,255,.92); border: 1px solid var(--kt-line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(22,24,29,.08);
  justify-content: space-around; align-items: center;
}
.kt-body a.kt-stab__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-width: 64px; min-height: 48px; font-size: 11px; font-weight: 500; color: var(--kt-muted); text-decoration: none;
}
.kt-body a.kt-stab__item[aria-current="page"] { color: var(--kt-accent); font-weight: 600; }

@media (min-width: 900px) {
  .kt-stop {
    display: block; position: sticky; top: 0; z-index: 40;
    background: rgba(255,255,255,.72); border-bottom: 1px solid var(--kt-line);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  .kt-stop__in { max-width: 960px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 24px; }
  .kt-stop__nav { display: flex; gap: 4px; flex-grow: 1; }
  .kt-body a.kt-stop__item {
    display: flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px;
    font-size: 14px; font-weight: 500; color: var(--kt-muted); text-decoration: none;
  }
  .kt-body a.kt-stop__item:hover { color: var(--kt-ink); background: rgba(255,255,255,.7); }
  .kt-body a.kt-stop__item[aria-current="page"] { background: var(--kt-card); color: var(--kt-ink); font-weight: 600; box-shadow: var(--kt-shadow-nav); }
  .kt-stop__right { display: flex; align-items: center; gap: 8px; }
  .kt-sphone { display: none; }
  .kt-smain { padding: 32px 24px 64px; }
  .kt-toast { bottom: 24px; }
  .kt-authpage { padding-top: 48px; }
}
@media (max-width: 899px) {
  .kt-stab { display: flex; }
}

/* ---------- Зоны нажатия ≥ 44 px на телефоне (PR 4a). Десктоп не меняется. ----------
   Кнопки и сегменты растут по высоте; мелкие текстовые кнопки, иконки и переключатель получают
   прозрачный ::after нужного размера — вёрстка вокруг не сдвигается. */
@media (max-width: 899px) {
  .kt-btn--xs, .kt-btn--sm { height: 44px; }
  .kt-seg__item, .kt-seg--lg .kt-seg__item, .kt-seg--quick .kt-seg__item { height: 44px; }
  .kt-checkrow { min-height: 44px; align-items: center; }
  .kt-body a.kt-tabs__item { height: 44px; }
  .kt-textbtn, .kt-switch, .kt-iconbtn, .kt-link, .kt-topbar .kt-brand { position: relative; }
  .kt-link::after, .kt-topbar .kt-brand::after { content: ''; position: absolute; left: -6px; right: -6px; top: 50%; height: 44px; transform: translateY(-50%); }
  .kt-textbtn::after { content: ''; position: absolute; left: -8px; right: -8px; top: 50%; height: 44px; transform: translateY(-50%); }
  .kt-switch::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
  .kt-iconbtn::after { content: ''; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
}

/* hidden сильнее display у компонентов */
.kt-body [hidden] { display: none !important; }

/* ---------- Каркас родителя (PR 5) ---------- */
/* Телефон: брендовая полоса + плашка «Кабинет родителя», без вкладок; десктоп — та же колонка ≤ 640 px по центру. */
.kt-pmain { max-width: 640px; margin: 0 auto; padding: 12px 12px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.kt-ptop { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 0 4px; }
.kt-ppill { font-size: 12px; font-weight: 600; color: var(--kt-muted); background: rgba(255,255,255,.72); border: 1px solid var(--kt-line); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.kt-pfoot { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 16px 0; text-align: center; font-size: 12px; line-height: 1.45; color: var(--kt-muted); }
.kt-body a.kt-pfoot__out { display: flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: 13px; color: var(--kt-muted); text-decoration: none; }
.kt-body a.kt-pfoot__out:hover { color: var(--kt-ink); }
/* Баннер предпросмотра тьютора */
.kt-pbanner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 10px 16px; border-radius: 16px; background: var(--kt-confirm); font-size: 14px; }
.kt-body a.kt-pbanner__back { display: flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; text-decoration: none; }
@media (min-width: 900px) {
  .kt-pmain { padding: 32px 24px 64px; gap: 16px; }
}

/* ---------- Компоненты тренажёра (T1): карточка задания, поле ответа, отклик ---------- */
/* Карточка одного задания: шапка (плитка с номером, название, тема, действие справа), текст, блок ответа. */
.kt-task {
  background: var(--kt-card); border: 1px solid var(--kt-line); border-radius: 22px;
  padding: 22px 26px; display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.kt-task.is-correct { border-color: var(--kt-success); box-shadow: 0 0 0 1px var(--kt-success); }
.kt-task.is-wrong { border-color: #B42318; box-shadow: 0 0 0 1px #B42318; }
.kt-task__head { display: flex; align-items: center; gap: 12px; }
.kt-task__tile { font-family: var(--kt-serif); font-size: 20px; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.kt-task__titles { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kt-task__name { font-size: 15px; font-weight: 600; }
.kt-task__topic { font-size: 13px; color: var(--kt-muted); overflow-wrap: anywhere; }
.kt-task__text { max-width: 700px; font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.kt-task__img { max-width: 100%; height: auto; border-radius: 14px; align-self: flex-start; }
/* Звезда «в избранное»: кнопка 44 px, закрашивается, когда нажата */
.kt-task__fav {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1px solid rgba(22,24,29,.1); background: var(--kt-card); color: var(--kt-muted);
  display: flex; align-items: center; justify-content: center;
}
.kt-task__fav:hover { color: var(--kt-ink); }
.kt-task__fav[aria-pressed="true"] { background: var(--kt-butter); border-color: var(--kt-butter); color: var(--kt-ink); }
.kt-task__fav[aria-pressed="true"] svg { fill: currentColor; }

.kt-answer { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--kt-line-row); }
.kt-answer__label { font-size: 14px; font-weight: 600; }
.kt-answer__input {
  width: 100%; max-width: 360px; height: 52px; border-radius: 12px; border: 1px solid rgba(22,24,29,.16);
  background: var(--kt-card); padding: 0 16px;
  font-family: var(--kt-serif); font-size: 22px; font-weight: 600; letter-spacing: .12em; color: var(--kt-ink);
  font-variant-numeric: lining-nums tabular-nums;
}
.kt-answer__input:focus { outline: none; border-color: var(--kt-accent); box-shadow: 0 0 0 4px var(--kt-accent-soft); }
.kt-answer__input::placeholder { font-family: var(--kt-sans); font-size: 15px; font-weight: 400; letter-spacing: 0; }

/* Отклик на ответ: «верно», «неверно», пояснение. Панель на месте, без оверлея. */
.kt-feedback { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 16px; font-size: 15px; line-height: 1.5; background: var(--kt-soft); }
.kt-feedback--ok { background: rgba(217,243,110,.45); }
.kt-feedback--bad { background: rgba(245,209,218,.6); }
.kt-feedback__row { display: flex; align-items: center; gap: 10px; }
.kt-feedback__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.kt-feedback__text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Панель «Ошибка в задании?» (partials/task_report.html): на месте поверх страницы, без затемнения.
   Низ и max-height выставляет JS (--kt-report-bottom / --kt-report-maxh): над таб-баром и экранной клавиатурой. */
.kt-report {
  position: fixed; z-index: 55; left: 8px; right: 8px;
  bottom: var(--kt-report-bottom, calc(12px + env(safe-area-inset-bottom)));
  max-height: var(--kt-report-maxh, 80vh);
  display: flex; flex-direction: column;
  background: var(--kt-card); border: 1px solid var(--kt-line-input); border-radius: 22px;
  box-shadow: var(--kt-shadow-menu); outline: none;
}
.kt-report[hidden] { display: none; }
.kt-report__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 8px; flex-shrink: 0; }
.kt-report__head .kt-iconbtn { font-size: 26px; line-height: 1; margin: -4px -6px 0 0; }
.kt-report__title { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.kt-report__sub { margin-top: 2px; font-size: 13px; color: var(--kt-muted); overflow-wrap: anywhere; }
.kt-report__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 18px 12px; display: flex; flex-direction: column; gap: 12px; }
.kt-report__form { display: flex; flex-direction: column; gap: 12px; }
.kt-report__cats { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kt-report__cats legend { padding: 0; margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.kt-report__cat { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--kt-line-input); font-size: 15px; cursor: pointer; }
.kt-report__cat:has(input:checked) { border-color: var(--kt-accent); background: var(--kt-accent-soft); }
.kt-report__cat input { accent-color: var(--kt-accent); width: 18px; height: 18px; margin: 0; flex-shrink: 0; }
.kt-report__text { width: 100%; box-sizing: border-box; min-height: 76px; resize: vertical; font: inherit; }
.kt-report__err { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(245,209,218,.6); font-size: 14px; line-height: 1.45; }
.kt-report__actions { display: flex; gap: 8px; padding: 10px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--kt-line-row); flex-shrink: 0; }
.kt-report__actions .kt-btn { flex: 1; }
@media (min-width: 640px) {
  .kt-report { left: auto; right: 24px; width: 380px; bottom: var(--kt-report-bottom, 24px); }
  .kt-report__actions { padding-bottom: 14px; }
}

@media (max-width: 899px) {
  .kt-task { padding: 18px; gap: 12px; }
  .kt-task__text { font-size: 15px; line-height: 1.5; }
  .kt-answer__input { max-width: none; }
}
