/* Панель репетитора — поверх общих стилей сайта */

.wide { padding: 30px 20px 80px; }

.conn-error {
  background: var(--surface-alt); color: var(--red); font-weight: 800; font-size: var(--text-caption);
  border-radius: 14px; padding: 12px 18px; margin-bottom: 18px;
}

/* карточка ученика */
.stu-card { margin-bottom: 12px; padding: 18px 20px; }
.stu-main { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.stu-id { display: flex; align-items: center; gap: 12px; }
.stu-name { font-size: var(--text-body-sm); font-weight: 900; }
.stu-level { display: flex; align-items: center; gap: 10px; }

.seen.good { color: var(--green); font-weight: 800; }
.seen.bad { color: var(--red); font-weight: 800; }

.stu-bars { margin: 14px 0 4px; }
.stu-bar-row .xp-bar { margin-top: 6px; }

.stu-hw { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hw-chip {
  background: var(--accent-soft); color: var(--accent-dark);
  font-size: var(--text-caption); font-weight: 800; border-radius: 20px; padding: 4px 11px;
}
.hw-chip-done { background: var(--accent-soft); color: var(--green); }

.stu-weak { margin-top: 12px; }
.stu-weak summary {
  cursor: pointer; font-weight: 800; font-size: var(--text-caption); color: var(--muted);
  padding: 4px 0;
}
.stu-weak summary:hover { color: var(--accent-dark); }
.weak-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.weak-word {
  background: var(--surface-alt); color: var(--ink); font-size: var(--text-caption); font-weight: 700;
  border-radius: 10px; padding: 4px 10px;
}
.weak-word i { color: var(--muted); font-weight: 600; }
.weak-word b { color: var(--red); }

/* Полный словарь ученика в карточке: поиск + метка статуса слова. */
.stu-dict-search { width: 100%; margin: 8px 0; }
.dw { font-weight: 800; font-size: 11px; }
/* Тот же --green, что у всех меток «выучено» на сайте (.d-status.learned,
   .hw-chip-done): ночью он переключается в акцент, литерал оставался дневным. */
.dw-learned { color: var(--green); }
.dw-learning { color: var(--accent-dark); }
.dw-new { color: var(--muted); }

/* Словарь ученика: кнопка удаления слова и форма добавления (волна 2 —
   репетитор ведёт словарь и вне урока). */
.dict-del {
  border: 0; background: none; cursor: pointer; color: var(--muted);
  font-size: 13px; padding: 2px 6px; border-radius: 6px;
}
.dict-del:hover { color: var(--red); background: var(--accent-soft); }

/* Разбор недели в карточке ученика (платный тариф): акцентная карточка,
   чтобы не сливалась со статистикой */
.week-digest {
  margin-top: 18px;
  border-left: 3px solid var(--accent-line);
}
.week-digest-text { margin: 6px 0 0; line-height: 1.55; }
.stu-dict-add { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.stu-dict-add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stu-dict-add-row .type-input { flex: 1; min-width: 120px; }

.stu-del { margin-top: 12px; font-size: var(--text-caption); }
.link-btn.danger { color: var(--red); font-weight: 800; }

/* группы */
.group-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.group-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.group-chip { border-left: 4px solid var(--gc, var(--accent)); }
.group-chip.active { background: var(--accent); color: var(--surface); }
.group-chip b { opacity: .7; margin-left: 3px; }
.group-add { display: flex; gap: 6px; }
.group-add input {
  font-family: inherit; font-size: var(--text-caption); padding: 8px 12px; width: 150px;
  border: 2px solid var(--border); border-radius: 11px; outline: none; background: var(--surface);
}
.group-add input:focus { border-color: var(--accent); }

.stu-group {
  font-family: inherit; font-size: var(--text-caption); font-weight: 700; color: var(--muted);
  padding: 4px 8px; border: 2px solid var(--border); border-radius: 9px;
  background: var(--surface); outline: none; max-width: 130px;
}
.stu-group:focus { border-color: var(--accent); }
.stu-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.stu-actions .stu-del { margin-top: 0; }

/* карточка ученика */
.modal {
  position: fixed; inset: 0; z-index: 300; background: rgba(45,42,38,.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; backdrop-filter: blur(3px);
}
.modal-box {
  position: relative; background: var(--bg); border-radius: 22px;
  padding: 28px; max-width: 720px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-close {
  position: absolute; top: 16px; right: 18px; background: none; border: none;
  font-size: var(--text-subheading); cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 8px;
}
.modal-close:hover { background: var(--accent-soft); color: var(--ink); }
.modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.modal-head .cat-avatar { margin: 0; }
.modal-head h2 { font-weight: 900; font-size: var(--text-heading-sm); }

.act-strip { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 6px; }
.act { width: 15px; height: 15px; border-radius: 4px; background: var(--surface-alt); display: block; }
.act-1 { background: var(--surface-alt); } .act-2 { background: var(--accent-line); } .act-3 { background: var(--accent-dark); }

.learned-word {
  background: var(--accent-soft); color: var(--green); font-size: var(--text-caption); font-weight: 700;
  border-radius: 10px; padding: 4px 10px;
}

/* выданные домашки */
.task-card { margin-bottom: 12px; padding: 18px 20px; }
.task-card.task-overdue { border-left: 5px solid var(--red); }
.task-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.task-title { font-size: var(--text-body-sm); font-weight: 900; }
.task-stat { text-align: right; }
.task-stat b { display: block; font-size: var(--text-body); font-weight: 900; color: var(--accent-dark); }
.task-rows { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 8px; }
.task-pupil { font-size: var(--text-caption); font-weight: 700; border-radius: 20px; padding: 4px 10px; background: var(--bg); }
.task-pupil.ok { background: var(--accent-soft); color: var(--green); }
.task-pupil.no { background: var(--surface-alt); color: var(--ink-soft); }
.task-words { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.task-word { font-size: var(--text-caption); font-weight: 700; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 3px 8px; }

/* форма домашки */
.hw-form { padding: 22px 24px; }
.hw-form .vs-row label { min-width: 160px; }
.hw-form input[type="text"], .hw-form input[type="date"], .hw-form select {
  flex: 1; min-width: 170px; font-family: inherit; font-size: var(--text-caption); font-weight: 600;
  padding: 9px 12px; border: 2px solid var(--border); border-radius: 11px;
  background: var(--surface); outline: none;
}
.hw-form input:focus, .hw-form select:focus { border-color: var(--accent); }

.hw-pick-controls { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.hw-words {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px; max-height: 320px; overflow-y: auto; padding: 4px;
  background: var(--bg); border-radius: 14px;
}
.hw-word {
  display: flex; align-items: center; gap: 9px; text-align: left;
  font-family: inherit; background: var(--surface); border: 2px solid var(--border);
  border-radius: 12px; padding: 8px 10px; cursor: pointer; transition: all .12s;
}
.hw-word:hover { border-color: var(--accent); }
.hw-word.picked { border-color: var(--green); background: var(--accent-soft); }
.hw-word-art {
  width: 32px; height: 32px; border-radius: 9px; font-size: var(--text-body);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.hw-word-en { font-weight: 900; font-size: var(--text-caption); }
.hw-word-ru { color: var(--muted); font-weight: 600; font-size: var(--text-caption); margin-left: auto; }

.hw-selected { margin: 14px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hw-selected p { width: 100%; margin-bottom: 4px; }
.picked-chip {
  background: var(--accent-soft); color: var(--accent-dark); font-weight: 800;
  font-size: var(--text-caption); border-radius: 20px; padding: 5px 12px; cursor: pointer;
}
.picked-chip i { color: var(--muted); font-weight: 600; }
.picked-chip:hover { background: var(--accent-soft); }

/* ссылка-приглашение */
.invite-card { padding: 24px; }
.invite-card p { font-weight: 600; margin-bottom: 14px; }
.invite-link { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.invite-link input {
  flex: 1; min-width: 240px; font-family: inherit; font-size: var(--text-caption); font-weight: 700;
  padding: 12px 14px; border: 2px solid var(--border); border-radius: 12px;
  background: var(--bg); outline: none; color: var(--ink);
}
#invite-code { font-size: var(--text-body); color: var(--accent-dark); letter-spacing: 2px; }

@media (max-width: 720px) {
  .stu-main { flex-direction: column; align-items: flex-start; }
  .hw-form .vs-row { flex-direction: column; align-items: stretch; }
  .hw-form .vs-row label { min-width: 0; }
  /* на телефоне поля не должны делить строку — текст обрезался */
  .msg-form .vs-row { flex-direction: column; align-items: stretch; }
  .msg-form input[type="text"], .msg-form select { width: 100%; }
  .msg-row { flex-wrap: wrap; }
  .group-bar { flex-direction: column; align-items: stretch; }
  .group-add input { width: 100%; }
  .modal { padding: 16px 10px; }
  .modal-box { padding: 20px 16px; }
  .task-head { flex-direction: column; }
  .task-stat { text-align: left; }
}

/* сообщения ученикам */
.msg-form { padding: 20px 22px; margin-bottom: 18px; }
.msg-form .vs-row { gap: 8px; }
.msg-form input[type="text"] { flex: 2; }
.msg-form select { flex: 1; min-width: 150px; }
.msg-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-top: 1px solid var(--border); font-size: var(--text-caption);
}
.msg-to {
  background: var(--accent-soft); color: var(--accent-dark); font-weight: 800;
  font-size: var(--text-caption); border-radius: 20px; padding: 3px 10px; white-space: nowrap;
}
.msg-text { flex: 1; font-weight: 600; }

/* --- Фото домашки в панели --- */
.photo-grid { display: grid; gap: 14px; }
.photo-item {
  background: var(--surface); border-radius: 18px; padding: 16px 18px;
  border: 1px solid var(--line);
}
.photo-item.unseen { border-color: var(--accent); }
.photo-item-head {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.photo-student { font-weight: 900; }
.photo-when { color: var(--muted); font-weight: 700; font-size: var(--text-caption); }
.photo-new {
  background: var(--accent); color: var(--surface); font-weight: 900;
  font-size: var(--text-caption); padding: 3px 9px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .05em;
}
.photo-thumb {
  max-width: 100%; border-radius: 12px; display: block;
  margin: 10px 0; cursor: zoom-in;
}
.photo-item .photo-mistakes li { background: var(--surface-alt); }

/* --- Пароль и восстановление --- */
.auth-forgot {
  display: block; margin: 12px auto 0; font-size: var(--text-caption);
}
.reset-note {
  color: var(--muted); font-weight: 600; font-size: var(--text-caption);
  line-height: 1.55; margin-bottom: 14px;
}
.recovery-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: var(--text-heading-sm); font-weight: 800; letter-spacing: .08em;
  text-align: center; background: var(--accent-soft); color: var(--accent);
  border: 2px dashed var(--accent-line); border-radius: var(--radius-card);
  padding: 18px 12px; margin: 4px 0 18px; user-select: all;
}
.modal {
  position: fixed; inset: 0; background: rgba(28, 22, 16, .55);
  display: grid; place-items: center; padding: 22px; z-index: 60;
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--surface); border-radius: 22px; padding: 26px 24px;
  max-width: 420px; width: 100%;
}
.modal-card h3 { font-weight: 900; font-size: var(--text-subheading); margin-bottom: 10px; }

/* --- Подписка --- */
.plan-chip {
  background: var(--accent-soft); color: var(--accent-dark);
  font-weight: 800; font-size: var(--text-caption); padding: 5px 11px; border-radius: 999px;
}
.plan-chip.plan-full { background: var(--surface-alt); color: var(--err, var(--red)); }
.plan-card { background: var(--surface); border-radius: 20px; padding: 22px 24px; border: 1px solid var(--line); }
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.plan-name { font-size: var(--text-heading-sm); font-weight: 900; }
.plan-count { font-size: var(--text-heading); font-weight: 900; white-space: nowrap; }
.plan-count span { font-size: var(--text-caption); font-weight: 700; color: var(--muted); }
.plan-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.plan-table { margin-top: 18px; display: grid; gap: 8px; }
.plan-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px;
}
.plan-row.current { border-color: var(--accent); background: var(--surface-alt); }
.plan-row-name { font-weight: 900; flex: 1; }
.plan-row-lim { color: var(--muted); font-weight: 700; font-size: var(--text-caption); }
.plan-row-price { font-weight: 900; white-space: nowrap; }
.xp-bar-fill.full { background: var(--err, var(--red)); }

/* --- Письма на почту (в той же вкладке, ниже тарифа) --- */
.notify-card { margin-top: 18px; }
.notify-card .plan-name { margin-bottom: 4px; }
/* Галочка по верхнему краю: подпись в две-три строки, и центрированная
   галочка уезжает к середине абзаца — та же причина, что у .consent-row */
.notify-row { align-items: flex-start; margin: 10px 0 0; }
.notify-row input { margin-top: 2px; }
.notify-row span { font-weight: 500; line-height: 1.45; }
.notify-row span b { font-weight: 800; }

/* --- Пароль и код --- */
.pass-meter { display: block; height: 5px; background: var(--surface-alt); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.pass-meter-fill { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .2s; background: var(--err, var(--red)); }
.pass-meter-fill[data-level="2"] { background: var(--soft-clay); }
.pass-meter-fill[data-level="3"] { background: var(--accent-line); }
.pass-meter-fill[data-level="4"] { background: var(--accent); }
.pass-hint, .plan-hint { display: block; font-size: var(--text-caption); font-weight: 700; color: var(--muted); margin-top: 6px; }
.code-input {
  font-size: var(--text-heading); font-weight: 900; letter-spacing: .35em; text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.type-feedback.ok { color: var(--ok, var(--green)); }

/* --- Состояние подписки --- */
.access-bar {
  background: var(--accent-soft); color: var(--ink-soft); font-weight: 800; font-size: var(--text-caption);
  padding: 12px 22px; text-align: center; line-height: 1.45;
}
.access-bar.warn { background: var(--accent-soft); }
.access-bar.stop { background: var(--surface-alt); color: var(--err, var(--red)); }
#paywall-plan .plan-name { font-size: var(--text-heading-sm); margin-bottom: 4px; }
.photo-kind { font-size: var(--text-caption); font-weight: 800; color: var(--muted); }
.photo-item .rd-score { font-size: var(--text-heading-sm); font-weight: 900; margin-bottom: 8px; }
.photo-item .rd-score span { font-size: var(--text-caption); font-weight: 700; color: var(--muted); }

/* --- Код восстановления ученика --- */
.restore-box {
  background: var(--surface-alt); border: 1px dashed var(--accent-line); border-radius: 16px;
  padding: 14px 18px; margin-bottom: 18px;
}
.restore-label {
  font-size: var(--text-caption); font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); margin-bottom: 4px;
}
.restore-code-val {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: var(--text-subheading); font-weight: 800; letter-spacing: .1em;
  color: var(--accent); user-select: all; margin-bottom: 6px;
}

/* --- Первые шаги --- */
.onboard {
  background: var(--surface-alt); border: 1px solid var(--line-soft); border-radius: 20px;
  padding: 20px 22px; margin-bottom: 26px;
}
.ob-head { font-weight: 900; font-size: var(--text-body-sm); margin-bottom: 14px; }
/* Приветствие первого входа: заголовок + одна строка «как это работает» */
.ob-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ob-top .ob-head { margin-bottom: 6px; }
.ob-lead { color: var(--muted); font-weight: 600; font-size: var(--text-caption); line-height: 1.5; margin-bottom: 12px; }
.ob-hide { flex-shrink: 0; font-size: var(--text-caption); color: var(--muted); }
/* «Дальше — по желанию»: не шаг, а хвост; кружок без заливки, ссылки в ряд */
.ob-num-soft { background: transparent; color: var(--accent); border: 2px solid var(--accent-line); }
.ob-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.ob-links .link-btn { font-size: var(--text-caption); }
.ob-step { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; }
.ob-step + .ob-step { border-top: 1px solid var(--line-soft); }
.ob-num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: var(--surface); font-weight: 900; font-size: var(--text-caption);
  display: grid; place-items: center;
}
.ob-step.done .ob-num { background: var(--accent); }
.ob-step.done .ob-title { color: var(--muted); }
.ob-title { font-weight: 800; margin-bottom: 2px; }
.ob-text { color: var(--muted); font-weight: 600; font-size: var(--text-caption); line-height: 1.5; margin-bottom: 8px; }

/* ===== Проверка домашек ===== */
/* Плашка «разбор выключен» — та же карточка, но с акцентной кромкой слева:
   должна читаться первой, а не теряться среди прайса */
.check-suspended { border-left: 4px solid var(--accent); margin-bottom: 14px; }
.check-suspended p { margin: 0 0 8px; line-height: 1.5; }
.check-suspended p:last-child { margin-bottom: 0; }
.pack-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.pack-card {
  border: 2px solid var(--line-control); border-radius: 14px;
  padding: 14px; text-align: center; background: var(--surface);
}
.pack-name { font-weight: 800; color: var(--ink); }
.pack-price { font-size: var(--text-heading-sm); font-weight: 800; color: var(--accent-dark); margin: 4px 0; }
.pack-limit { font-size: var(--text-caption); font-weight: 600; color: var(--muted); }
.pack-total { font-size: var(--text-body); margin-bottom: 0; }

.check-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.check-who { display: flex; flex-direction: column; gap: 2px; }
.check-pick {
  font-family: inherit; font-size: var(--text-caption); font-weight: 700; padding: 9px 12px;
  border: 2px solid var(--line-control); border-radius: 12px; background: var(--surface); color: var(--ink);
}
.check-pick:disabled { opacity: .5; }

/* Подтверждение доплаты за место сверх тарифа.
   Выделяем рамкой акцентом: это единственное место в панели, где
   нажатие меняет сумму счёта, и оно должно читаться как отдельный
   шаг, а не как продолжение списка кнопок. */
.slot-confirm {
  margin-top: 14px;
  border: 2px solid var(--accent-line);
  background: var(--accent-soft);
}
.slot-confirm .plan-name { margin-bottom: 6px; }
.slot-confirm .muted-note { margin-bottom: 12px; }

/* h1 обёрнут вокруг кнопки «Савелий · панель»: заголовок нужен программе
   чтения, а выглядеть он должен ровно как раньше — поэтому у самого h1
   ни отступов, ни своего кегля, всё рисует .brand внутри. */
.brand-h1 { display: flex; align-items: center; margin: 0;
  font-size: inherit; font-weight: inherit; line-height: inherit; }

/* ==========================================================================
   ВЫБОР ИГРЫ ДЛЯ ДОМАШКИ
   --------------------------------------------------------------------------
   Был обычный select — и его никто не находил. Выпадающий список посреди
   формы не читается как «выбери, чем ученик будет тренировать»: это
   выглядит настройкой, а не действием.

   Сетка плиток — то, ради чего ходят в Wordwall: игры видно, а не
   написано списком. Значки те же, что у ученика в разделе тренировок,
   чтобы репетитор и ученик узнавали одну игру по одной картинке.
   ========================================================================== */
/* Строка «Чем тренировать»: подпись по верху, поле — на всю оставшуюся
   ширину. game-field нужен именно как flex-элемент с flex:1 и min-width:0 —
   сама сетка flex-элементом быть не должна: без явной ширины auto-fill
   считает колонки от минимальной ширины содержимого и даёт одну. */
.game-row { align-items: flex-start; }
.game-row > label { padding-top: var(--space-8); }
.game-field { flex: 1 1 260px; min-width: 0; }
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: var(--space-8);
  margin-top: var(--space-8);
}
.game-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 76px;
  padding: var(--space-12) var(--space-8);
  text-align: center;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-input, 12px);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease),
              background var(--dur) var(--ease);
}
.game-tile:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.game-tile:active { transform: translateY(0); }
/* Выбранная плитка отличается НЕ ТОЛЬКО цветом: рамка толще и фон другой.
   Одного цвета мало — при дальтонизме шалфейный и серый сливаются. */
.game-tile.picked {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--ink);
}
.game-tile-ico { display: block; color: var(--accent); }
.game-tile.picked .game-tile-ico { color: var(--accent-deep, var(--accent)); }
/* Длинные названия («Словообразование») в 132-пиксельную плитку не
   влезают и вылезали за рамку. hyphens: auto переносит по слогам —
   страница на русском, lang="ru" стоит на html, браузер умеет.
   overflow-wrap — запасной вариант там, где переносов нет. */
.game-tile-name {
  display: block;
  hyphens: auto;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .game-tile { min-height: 68px; font-size: 13px; }
}

/* ===== Свои задания — конструктор ===== */
.ts-card { padding: 16px 20px; margin-bottom: 10px; transition: box-shadow var(--dur) var(--ease); }
.ts-card.ts-just-saved { box-shadow: 0 0 0 3px var(--accent-line); }
.ts-card-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.ts-title { font-weight: 900; font-size: var(--text-body-sm); }
.ts-card-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ts-del { font-size: var(--text-caption); }
.ts-preview { color: var(--muted); font-weight: 600; font-size: var(--text-caption); margin-top: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-saved-note { margin: 0 0 14px; }

.ts-editor { padding: 22px 24px; margin-bottom: 18px; }
.ts-ed-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.ts-ed-head h3 { margin: 0; }
.ts-field { display: block; margin-bottom: 14px; }
.ts-field > span { display: block; font-weight: 800; font-size: var(--text-caption); color: var(--muted); margin-bottom: 6px; }
.ts-editor input[type="text"], .ts-editor textarea {
  width: 100%; font-family: inherit; font-size: var(--text-caption); font-weight: 600;
  padding: 9px 12px; border: 2px solid var(--border); border-radius: 11px;
  background: var(--surface); outline: none; color: var(--ink);
}
.ts-editor input[type="text"]:focus, .ts-editor textarea:focus { border-color: var(--accent); }
.ts-editor textarea { resize: vertical; line-height: 1.45; }
/* Вид задания — три плитки с описанием, как плитки игр в форме домашки */
.ts-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.ts-kind {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  font-family: inherit; padding: 12px 14px; cursor: pointer;
  background: var(--surface); border: 2px solid var(--border); border-radius: 12px; color: var(--ink-soft);
}
.ts-kind b { color: var(--ink); font-weight: 900; }
.ts-kind span { font-size: var(--text-caption); font-weight: 600; color: var(--muted); line-height: 1.4; }
.ts-kind.picked { border-color: var(--accent); background: var(--accent-soft); }
.ts-kind:disabled { opacity: .5; cursor: not-allowed; }
/* Вопросы: карточка на каждый, номер слева, «убрать» справа */
.ts-items { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 12px; }
.ts-item { background: var(--bg); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ts-item-head { display: flex; justify-content: space-between; align-items: center; }
.ts-num {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: var(--surface); font-weight: 900; font-size: var(--text-caption); flex-shrink: 0;
}
.ts-item-del { font-size: var(--text-caption); color: var(--muted); }
.ts-options { display: flex; flex-direction: column; gap: 6px; }
.ts-option { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; cursor: default; }
.ts-option input[type="radio"] { width: 18px; height: 18px; flex: none; accent-color: var(--accent); cursor: pointer; }
.ts-option input[type="text"] { flex: 1; width: auto; min-width: 0; }
.ts-option.right input[type="text"] { border-color: var(--accent-line); background: var(--accent-soft); }
.ts-opt-del { background: none; border: none; color: var(--muted); font-size: var(--text-body); cursor: pointer; padding: 0 6px; line-height: 1; }
.ts-opt-del:hover { color: var(--red); }
.ts-opt-add { font-size: var(--text-caption); align-self: flex-start; margin-left: 26px; }
.ts-gap-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.ts-item-pair { flex-direction: row; align-items: center; }
.ts-item-pair input { flex: 1; width: auto; min-width: 0; }
.ts-pair-dash { color: var(--muted); font-weight: 800; }
.ts-add-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.ts-paste summary { cursor: pointer; font-weight: 800; font-size: var(--text-caption); color: var(--accent-dark); }
.ts-paste p { margin: 8px 0; }
.ts-paste code { background: var(--surface-alt); padding: 1px 5px; border-radius: 6px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.ts-paste textarea { margin-bottom: 8px; }
.ts-ed-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ts-ed-foot .type-feedback { margin: 0; flex-basis: 100%; }
/* Строка выбора набора под плитками игр */
.hw-taskset-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.hw-taskset-row select { flex: 1; min-width: 220px; }
@media (max-width: 720px) {
  .ts-gap-row { grid-template-columns: 1fr; }
  .ts-item-pair { flex-wrap: wrap; }
}

/* ===== QR со ссылкой для учеников =====
   Код и пояснение стоят рядом: сам по себе чёрный квадрат ничего
   не объясняет, а репетитору важно понимать, что показывать ученикам. */
.invite-qr {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  margin: 18px 0 4px; padding: 18px;
  background: var(--surface-alt); border-radius: var(--radius-card);
}
.qr-box {
  width: 188px; height: 188px; flex: none;
  /* --bd-paper, а не --surface: QR сканируется только на светлой рамке,
     а --surface ночью тёмный. --bd-paper одинаков в обеих темах. */
  background: var(--bd-paper); border-radius: 12px; padding: 10px;
  box-shadow: 0 2px 10px rgba(43, 54, 48, .10);
}
.qr-box svg { display: block; width: 100%; height: 100%; }
.qr-side { flex: 1 1 260px; display: flex; flex-direction: column; gap: 8px; }
.qr-lead { font-weight: 900; font-size: var(--text-body); }
.qr-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* На телефоне репетитора код уезжает под текст — ставим его первым
   и во всю ширину, иначе он ужимается до нечитаемого. */
@media (max-width: 560px) {
  .invite-qr { gap: 14px; }
  .qr-box { width: 100%; height: auto; aspect-ratio: 1; }
}

/* Список досок для урока */
.board-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.board-main { flex: 1 1 260px; min-width: 0; }
.board-title { font-family: var(--font-display), sans-serif; font-weight: 900; font-size: 18px;
               display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.board-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.board-rename { flex: 1 1 100%; display: flex; gap: 8px; }
.board-rename-input { flex: 1; font: inherit; padding: 8px 10px; min-height: 40px;
  border: 1px solid var(--line-control); border-radius: 10px;
  background: var(--surface); color: var(--ink); }

/* ==========================================================================
   РАЗДЕЛЫ ПАНЕЛИ: одна строка, скользящая подсветка
   --------------------------------------------------------------------------
   Было: десять текстовых кнопок в два ряда. Они занимали треть первого
   экрана, переносились по-разному на каждой ширине, а активный раздел
   отличался только цветом — глазу не за что зацепиться.

   Стало: строка с горизонтальной прокруткой (кнопки не переносятся
   никогда), иконка у каждого пункта и подсветка, которая ЕЗДИТ между
   пунктами. Движение здесь не украшение: оно показывает, откуда и куда
   переехали, — связь между нажатием и сменой раздела перестаёт быть
   догадкой.
   ========================================================================== */
.tutor-body .nav { flex: 1 1 100%; min-width: 0; }

.nav-strip {
  position: relative;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;              /* полосу прокрутки прячем: строка узкая */
  padding: 4px 2px;
  /* Плавность прокрутки НЕ здесь, а в js/tutor-nav.js отдельным вызовом.
     С правилом scroll-behavior: smooth программная установка scrollLeft
     просто не срабатывала — полоса оставалась на месте, и выбранный
     раздел за краем экрана так и не показывался. */
  /* Края подтаивают — так видно, что строка продолжается за границей */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px,
                      #000 calc(100% - 18px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 18px,
                      #000 calc(100% - 18px), transparent 100%);
}
.nav-strip::-webkit-scrollbar { display: none; }

/* Десктоп: вкладки в ДВЕ строки без прокрутки (видео владельца — десять
   плашек одной строкой приходилось крутить). Переносом flex занимается
   сам раскладчик, маркер активного пункта получает Y в js/tutor-nav.js.
   На телефоне остаётся привычная прокрутка одной строкой с подтаиванием
   краёв — там она читается лучше, чем три ряда мелких кнопок. */
@media (min-width: 900px) {
  .nav-strip {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 2px;
    -webkit-mask-image: none;
            mask-image: none;
  }
}

.tutor-body .nav-btn {
  position: relative;
  z-index: 1;                         /* над подсветкой */
  display: inline-flex;
  align-items: center;
  gap: var(--space-8, 8px);
  white-space: nowrap;
  flex: none;
  padding: 9px 14px;
  border-radius: 12px;
  background: none;
  transition: color .18s ease, transform .18s ease;
}
.tutor-body .nav-btn:hover { background: none; transform: translateY(-1px); }
.tutor-body .nav-btn.active { background: none; color: var(--accent-dark); }
.tutor-body .nav-btn .nav-ico { flex: none; opacity: .75; transition: opacity .18s ease; }
.tutor-body .nav-btn.active .nav-ico,
.tutor-body .nav-btn:hover .nav-ico { opacity: 1; }

/* Подсветка активного пункта. Ездит через transform — он не вызывает
   пересчёт раскладки, поэтому движение остаётся плавным даже на слабом
   ноутбуке репетитора. */
.nav-marker {
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 0;
  border-radius: 12px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
  transform: translateX(0);
  transition: transform .34s cubic-bezier(.22, 1, .36, 1),
              width .34s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
  z-index: 0;
}
/* До первого измерения подсветки нет — иначе она прилетает из левого
   угла на глазах у пользователя при каждой загрузке страницы. */
.nav-marker.ready { opacity: 1; }
.nav-marker:not(.ready) { opacity: 0; }

/* Счётчик рядом с подписью: подпрыгивает, когда число изменилось —
   репетитор видит, что появилось новое фото тетради, не вчитываясь. */
.tutor-body .nav-btn .badge { transition: transform .2s ease; }
.tutor-body .nav-btn .badge.pop { animation: badge-pop .45s cubic-bezier(.22,1,.36,1); }
@keyframes badge-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* Появление раздела: короткий подъём с проявлением. Полсекунды здесь
   были бы уже задержкой — держим 220 мс. */
.tab-enter { animation: tab-enter .22s ease-out; }
@keyframes tab-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 820px) {
  .tutor-body .nav-btn { padding: 8px 11px; }
  .tutor-body .nav-btn .nav-label { font-size: 13px; }
}

/* Уважаем системную настройку «меньше движения»: подсветка просто
   переставляется, разделы появляются без подъёма. */
@media (prefers-reduced-motion: reduce) {
  .nav-marker { transition: none; }
  .tab-enter { animation: none; }
  .tutor-body .nav-btn:hover { transform: none; }
  .tutor-body .nav-btn .badge.pop { animation: none; }
}

/* --------------------------------------------------------------------------
   Телефон: у панели репетитора СВОЯ навигация, не ученическая
   --------------------------------------------------------------------------
   На узком экране .topbar .nav у сайта ученика превращается в нижнюю
   панель на пять равных кнопок — и это правильно ровно для пяти пунктов.
   У репетитора их десять: они слипались в кашу, подписи наезжали друг
   на друга и не читались вовсе.

   Поэтому здесь панель остаётся строкой сверху и просто листается вбок,
   как на большом экране. Репетитор работает за ноутбуком, а с телефона
   заходит посмотреть — листнуть строку ему проще, чем искать раздел
   среди десяти слипшихся значков. */
@media (max-width: 820px) {
  .tutor-body .topbar .nav {
    position: static;
    display: block;
    padding: 0;
    background: none;
    backdrop-filter: none;
    border-top: 0;
    z-index: auto;
  }
  .tutor-body .topbar .nav-btn {
    flex: none;                       /* иначе кнопки сжимаются в кашу */
    min-width: auto;
    text-align: left;
    padding: 9px 12px;
    /* Иконка слева от подписи, а не над ней: «столбиком» — раскладка
       ученической нижней панели, где пять кнопок делят ширину поровну.
       Здесь строка листается, и высокие двухэтажные кнопки только
       съедают экран. */
    flex-direction: row;
    gap: var(--space-8, 8px);
  }
  .tutor-body .topbar .nav-btn .nav-label { font-size: 13px; }
  /* Счётчик возвращается в строку: в ученической панели он висел
     уголком над иконкой, здесь для этого нет второго этажа. */
  .tutor-body .topbar .nav-btn .badge { position: static; margin-left: 0; }
  /* Отступ под нижнюю панель ученика тут не нужен: её нет */
  .tutor-body main { padding-bottom: var(--space-24, 24px); }
  .tutor-body .site-footer { margin-bottom: 0; }
}

/* --------------------------------------------------------------------------
   Телефон: компактная шапка панели
   --------------------------------------------------------------------------
   Было три ряда (марка; имя + пароль + приложение + выйти; вкладки) —
   ~40 % первого экрана до любого содержимого. Крупное сжато, « · панель»
   в марке спрятано; ссылки «пароль/приложение/выйти» вернули в шапку
   (откат группировки вкладок 357d1f90), но мелкими — не наравне с именем. */
@media (max-width: 720px) {
  /* Один ряд + полоса вкладок вторым рядом (wrap оставляем: у .nav
     стоит order: 3 в savely.css). Чтобы ряд помещался, всё крупное
     сжимаем, а « · панель» в марке прячем — слово несёт только
     церемониальный смысл, и так понятно, чья это панель. */
  :root:has(#screen-verify) .tutor-body .topbar-inner { gap: 8px; min-height: 56px; }
  .tutor-body .brand-sub { display: none; }
  .tutor-body .brand-h1 { min-width: 0; flex: 0 1 auto; overflow: hidden; }
  .tutor-body .brand-h1 .brand { white-space: nowrap; }
  .tutor-body .help-btn { width: 36px; height: 36px; flex: none; }
  .tutor-body .plan-chip { flex: none; font-size: 11px; padding: 3px 8px; }
  .tutor-body .user-chip { flex: none; min-width: 0; }
  /* Ссылки «пароль/приложение/выйти» мельче имени, но с воздухом:
     padding 0 склеивал их в одно подчёркнутое слово. */
  .tutor-body .user-chip .link-btn { font-size: 12px; padding: 0 6px; min-height: 36px; }
  .tutor-body #tutor-name {
    display: inline-block; max-width: 8ch; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
  }
}

/* Селектор уровня в карточке ученика: по размеру цифры, которую заменил */
.stu-level-select {
  font-weight: 800; font-size: var(--text-body-lg, 18px);
  padding: 4px 8px; margin: 2px 0 4px; width: auto; min-width: 130px;
  cursor: pointer;
}
.stu-level-select:hover { border-color: var(--accent); }
/* Подпись-кнопка у плитки уровня: без неё селект читался как цифра
   статистики, и было непонятно, что уровень здесь назначается */
.level-edit-hint {
  border: 0; background: none; padding: 0 2px; margin-left: 6px;
  font: inherit; font-size: var(--text-caption); font-weight: 700;
  color: var(--accent); cursor: pointer; text-decoration: underline dotted;
}
.level-edit-hint:hover { text-decoration-style: solid; }

/* ---------- Расписание уроков в карточке ученика ----------
   Ряд с датой и крестиком — как строки сообщений (.msg-row): тот же ритм,
   чтобы карточка не собиралась из разных почерков. Форма — те же поля,
   что везде (.type-input), только компактнее. */
.sched-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.sched-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 0; border-top: 1px solid var(--border);
  font-size: var(--text-caption); font-weight: 600;
}
.sched-row:first-child { border-top: 0; }
.sched-rep { color: var(--accent-dark); font-weight: 900; }
.sched-del { font-size: 12px; }
.sched-form {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-bottom: 6px;
}
.sched-form .type-input { flex: 1 1 auto; min-width: 0; width: auto; }
.sched-form input[type="date"] { max-width: 150px; }
.sched-form input[type="time"] { max-width: 90px; }
.sched-form select { max-width: 100px; }
.sched-weekly {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px;
  font-size: var(--text-caption); font-weight: 600; cursor: pointer;
}
.sched-weekly input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Пометка у доски во вкладке «Доски»: будущий урок привязан */
.board-lesson {
  display: inline-block; margin-left: 8px;
  font-size: var(--text-caption); font-weight: 800; color: var(--accent-dark);
  background: var(--accent-soft); border-radius: 20px; padding: 2px 10px;
}
