﻿/* 04-tutor.css — part 04/10 of the ordered bp bundle (the former single bp.css,
   split by surface; the content is UNREORDERED). ORDER IS LOAD-BEARING: cascade ties
   resolve by document order, so hosts must link 01→10 in exactly this sequence —
   CssHygieneTests pins both the list and the order in both hosts. */

/* ── Главная тьютора (/home/tutor) — wave 3 Task 4, Главная тьютора.dc.html ─────────────────────
   Two DOM trees toggled by the shell's 768px breakpoint (.rp-th-desktop / .rp-th-mobile), not one
   grid reflowed by CSS: the mobile screen genuinely restructures the day (a single hero lesson +
   compact rows + a one-line grading summary) rather than just narrowing the desktop card. Both trees
   read the same TutorHome.TutorState — no duplicated business logic, only markup. */

.rp-th-head {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}

.rp-th-head .rp-ph { flex: 1; }

.rp-th-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Кнопка «+ Занятие» остаётся и на телефоне: это тот же единственный вход в композер, что и в
   тулбаре /schedule, и держат её на главной ровно затем, чтобы самое частое действие не стоило
   перехода на другую страницу — на узком экране этот переход дороже всего. Ряд шапки переносит её
   на свою строку (flex-wrap выше), где она занимает всю ширину: 44px и во всю строку — цель для
   пальца, а не 30-пиксельная кнопка в углу. */
@media (max-width: 768px) {
  .rp-th-actions { width: 100%; }
  .rp-th-actions .rp-newlesson-btn { flex: 1; height: 44px; }
}

/* ── Блок состояния сайта (SiteStateBlock) — спека 2026-09-04-cabinet-home-design ──────────────
   Занял место чеклиста «Начало работы». Два лица: карточка «Ваш сайт готов» и полоса «не
   дозаполнен». Полоса собрана из общих rp-banner-card__* (они объявлены в 09-admin.css, то есть
   НИЖЕ по порядку загрузки — свои одноимённые по весу правила проиграли бы им тай), поэтому
   здесь только то, чего у общей полосы нет: место под CTA и её несжимаемость. */
.rp-site-ready {
  display: flex;
  align-items: flex-start;
  gap: 26px;
  padding: 22px;
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  margin-bottom: 18px;
}

.rp-site-ready-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rp-site-ready-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--success);
}

.rp-site-ready-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

.rp-site-ready-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.rp-site-ready-lead {
  margin: 0;
  max-width: 520px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted-foreground);
  text-wrap: pretty;
}

/* Адрес — в моноширинном, как всё, что диктуют вслух или сверяют по буквам. */
.rp-site-ready-url {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  height: 38px;
  padding: 0 6px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--muted);
}

.rp-site-ready-host {
  font-family: var(--font-mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 13px;
}

.rp-site-ready-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.rp-site-ready-hide {
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--muted-foreground);
}

/* «Скрыть блок» уезжает под действия, когда для колонки справа места уже нет. */
@media (max-width: 768px) {
  .rp-site-ready { flex-direction: column; gap: 14px; padding: 18px; }
  .rp-site-ready-title { font-size: 18px; }
  .rp-site-ready-hide { align-self: flex-start; }
}

.rp-site-unfinished { align-items: center; margin-bottom: 18px; }
.rp-site-unfinished-cta { flex-shrink: 0; }

@media (max-width: 768px) {
  .rp-site-unfinished { flex-wrap: wrap; }
  .rp-site-unfinished-cta { order: 3; width: 100%; justify-content: center; }
}

/* Desktop grid — hidden entirely on mobile (see file-header rationale). */
.rp-th-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  align-items: start;
}

.rp-th-col-main, .rp-th-col-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rp-th-link {
  font-size: 12.5px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.rp-th-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--warning-muted);
  color: var(--warning-muted-foreground);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* «Сегодня» card rows */
.rp-th-today-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}

.rp-th-today-row:last-child { border-bottom: 0; }

.rp-th-today-row--live { background: color-mix(in srgb, var(--success-muted) 45%, transparent); }

/* Clickable timeline rows (they open the lesson dialog). They stay divs — each already contains its own
   enter button, and an <a>/<button> wrapper would nest interactive elements — so the affordance is spelled
   out here: pointer, hover tint, and a real focus ring for the role="button" + tabindex keyboard path.
   The --live row keeps its own success tint on hover (a later, more specific rule). */
.rp-th-today-row--click,
.rp-th-mcompact--click,
.rp-th-mhero--click { cursor: pointer; }

.rp-th-today-row--click:hover { background: var(--muted); }
.rp-th-today-row--live.rp-th-today-row--click:hover {
  background: color-mix(in srgb, var(--success-muted) 70%, transparent);
}

.rp-th-mcompact--click:hover,
.rp-th-mhero--click:hover { border-color: var(--primary); }

.rp-th-today-row--click:focus-visible,
.rp-th-mcompact--click:focus-visible,
.rp-th-mhero--click:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

.rp-th-today-time { width: 52px; flex-shrink: 0; }
.rp-th-today-time-val { font-size: 14px; font-weight: 700; }
.rp-th-today-time-dur { font-size: 11px; color: var(--muted-foreground); }

.rp-th-today-bar {
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  background: var(--border);
}

.rp-th-today-bar--live { background: var(--success); }
.rp-th-today-bar--planned { background: var(--primary); }

.rp-th-today-body { flex: 1; min-width: 0; }
.rp-th-today-who { font-size: 13.5px; font-weight: 600; }

/* Бейдж роли строки «Сегодня» — ВЕДУ / УЧУСЬ (спека 2026-09-04, развилка 2). Рисуется на КАЖДОЙ
   строке, а не только когда день смешанный: лента, где бейдж появляется лишь иногда, читается как
   ошибка разметки. «УЧУСЬ» намеренно приглушён — эта строка ничего не требует от преподавателя и
   не открывается по клику. */
.rp-th-role {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  margin-right: 6px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  vertical-align: 1px;
}
.rp-th-role--teach { background: var(--info-muted); color: var(--info-muted-foreground); }
.rp-th-role--learn { background: var(--muted); color: var(--muted-foreground); }

/* На мобильном бейдж стои́т в строке времени, а не перед именем — там уже есть «идёт»/«скоро». */
.rp-th-mhero-top .rp-th-role { margin-right: 0; }
.rp-th-today-what { font-size: 12.5px; color: var(--muted-foreground); }
/* Spec 11.5: «Курс „X" · Поток „Y"» — optional third line, shared by the desktop row and the mobile
   compact row (both use this class). */
.rp-th-today-ctx { font-size: 11.5px; color: var(--muted-foreground); opacity: 0.8; }

.rp-th-live-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  /* <a> or <button> depending on external-link vs in-platform room — see .rp-th-mhero-btn. */
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.rp-th-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7EE2A8;
  flex-shrink: 0;
}

.rp-th-today-empty {
  padding: 20px 18px;
  font-size: 13.5px;
  color: var(--muted-foreground);
}

.rp-th-today-foot {
  padding: 11px 18px;
  font-size: 12.5px;
  color: var(--muted-foreground);
}

/* «На проверке» grading queue rows */
.rp-th-grading-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--foreground);
}

.rp-th-grading-row:last-child { border-bottom: 0; }
.rp-th-grading-row:hover { background: var(--secondary); }

.rp-th-grading-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.rp-th-grading-body { flex: 1; min-width: 0; }
.rp-th-grading-name { font-size: 13.5px; font-weight: 600; }

.rp-th-grading-task {
  font-size: 12.5px;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-th-grading-age {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.rp-th-grading-age--warn { color: var(--warning-muted-foreground); }

.rp-th-grading-empty {
  padding: 20px 18px;
  font-size: 13.5px;
  color: var(--muted-foreground);
}

/* «Новая заявка» card — shared markup between the desktop rail and the mobile stream. */
.rp-th-request {
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  border-radius: var(--radius-lg);
  background: var(--info-muted);
  padding: 16px 18px;
}

.rp-th-request-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--info-muted-foreground);
}

.rp-th-request-title { font-size: 13.5px; font-weight: 700; color: var(--info-muted-foreground); }
.rp-th-request-name { font-size: 13.5px; font-weight: 600; }
.rp-th-request-note { font-size: 12.5px; color: var(--info-muted-foreground); margin: 2px 0 12px; }

/* Три кнопки заявки («Подтвердить» · «Настроить занятие…» · «Отклонить») не помещаются в 360px:
   без переноса «Отклонить» вылезала за экран (документ прокручивался вбок на 4px, а сама кнопка
   обрезалась краем). Перенос, а не сжатие: подписи здесь — глаголы решения, ужимать их нечем. */
.rp-th-request-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.rp-th-request-accept {
  flex: 1;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.rp-th-request-decline {
  height: 34px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--info-muted-foreground);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

/* «Заявка на занятие» card (Task 5, 2026-08-25 trial-signup-funnel) reuses the same .rp-th-request
   shell + name/note/actions classes above, one row per pending lesson-time request — this rule only
   adds the separator between stacked rows when more than one request shares the card. */
.rp-th-request-row + .rp-th-request-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
}

/* «Закончился баланс» rows */
.rp-th-debtor-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.rp-th-debtor-row:last-child { border-bottom: 0; }

.rp-th-debtor-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--destructive-muted);
  color: var(--destructive-muted-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.rp-th-debtor-body { flex: 1; }
.rp-th-debtor-name { font-size: 13.5px; font-weight: 600; }
.rp-th-debtor-note { font-size: 12px; color: var(--destructive-muted-foreground); }

.rp-th-debtor-remind {
  font-size: 12.5px;
  color: var(--primary);
  font-weight: 600;
  flex-shrink: 0;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

/* Карточка приехала на телефон вместе с мобильной главной, а «Напомнить» здесь — текстовая кнопка
   высотой в строку (15px). Пальцем в неё не попасть, поэтому на грубом указателе ей дают настоящую
   цель, растягивая ПОЛЕ, а не рисунок: цвет, вес и размер шрифта те же. */
@media (pointer: coarse) {
  .rp-th-debtor-remind { min-height: 44px; padding: 0 4px; }
}

.rp-th-debtor-foot {
  padding: 11px 18px;
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.5;
}

/* ── Слот «Следующий шаг / Осваиваемся» (NextStepSlot) ─────────────────────────────────────────
   Один слот с двумя лицами (спека 2026-09-04, развилка 8). Оформление у обоих одно намеренно: это
   ОДНО место на странице, которое учит, — меняется только заголовок и содержимое. Живёт и на главной
   преподавателя, и на главной ученика, поэтому классы не завязаны на rp-th-*. */
.rp-nss { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }

.rp-nss-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* Счётчик прогресса — приглушён сильнее заголовка: он справочный, а не заголовочный. */
.rp-nss-progress { font-size: 11px; font-weight: 600; letter-spacing: 0; opacity: 0.75; }

.rp-nss-title { font-size: 15px; font-weight: 700; line-height: 1.35; text-wrap: pretty; }
.rp-nss-body { font-size: 13px; line-height: 1.5; color: var(--muted-foreground); text-wrap: pretty; }

.rp-nss-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 2px; }

/* Mobile stream — hidden on desktop (see file-header rationale). */
.rp-th-mobile { display: none; }

@media (max-width: 768px) {
  .rp-th-desktop { display: none; }
  .rp-th-mobile { display: flex; flex-direction: column; gap: 10px; }
}

.rp-th-mhero {
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 14px 16px;
}

.rp-th-mhero-top { display: flex; align-items: center; gap: 8px; }
.rp-th-mhero-time { font-size: 14.5px; font-weight: 700; }

.rp-th-mhero-soon {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--success-muted);
  color: var(--success-muted-foreground);
}

/* «идёт» (lesson in progress) — same pill, stronger fill + a live dot, matching the schedule. */
.rp-th-mhero-soon--live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--state-success);
  color: #06120C;
}

/* «не отмечено» — the lesson's slot has passed but it is still «запланировано». Same pill, warning
   tint: it is a nudge to open the row and mark it conducted, not a success state. */
.rp-th-mhero-soon--warn {
  background: var(--warning-muted);
  color: var(--warning-muted-foreground);
}

.rp-th-mhero-who { font-size: 14px; font-weight: 600; margin-top: 4px; }
/* Spec 11.5, review fix round 1: «Курс „X" · Поток „Y"» — same formula/class family as
   .rp-th-today-ctx; wraps rather than truncates (ACCEPTED per-surface choice — this is the
   dashboard's most prominent lesson card, no ellipsis-hidden context here). */
.rp-th-mhero-ctx { font-size: 11.5px; color: var(--muted-foreground); opacity: 0.8; margin-top: 2px; }

.rp-th-mhero-btn {
  margin-top: 12px;
  height: 44px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  /* Renders as either <a> (external meeting link) or <button> (in-platform room) — reset the button
     chrome so the two are indistinguishable. Same for .rp-th-live-btn on the desktop row. */
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.rp-th-mcompact {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.rp-th-mcompact-time { width: 52px; flex-shrink: 0; }
.rp-th-mcompact-body { flex: 1; min-width: 0; }

.rp-th-mgrading-link {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--foreground);
}

.rp-th-mgrading-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--warning-muted);
  color: var(--warning-muted-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rp-th-mgrading-body { flex: 1; min-width: 0; }
.rp-th-mgrading-title { font-size: 14px; font-weight: 600; }
.rp-th-mgrading-sub { font-size: 12px; color: var(--muted-foreground); }
.rp-th-mgrading-chev { color: var(--muted-foreground); }

.rp-th-mempty {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--muted-foreground);
}

/* ── Task 7 (wave 3): «Ученики» hub — /students. Roster table + cards, groups grid, invitations
   list, filters. Dialog chrome is reused from rp-sched-dlg* (see header note); this block is
   students-specific layout only. Single mobile switch at 640px mirrors rp-tabs-underline/chips. */
.rp-stu-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.rp-stu-toolbar .rp-ph { margin-bottom: 0; }
.rp-stu-toolbar-spacer { flex: 1; }
.rp-stu-btn {
  height: 38px;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font-size: 13px;
  white-space: nowrap;
}
.rp-stu-btn:hover { background: var(--secondary); }
/* Icon-collapse «+ Пригласить» на узком экране — только тулбарная кнопка (caption-span);
   кнопки пустых состояний остаются с полной подписью. */
@media (max-width: 560px) {
  .rp-stu-toolbar .rp-stu-btn { padding: 0 10px; }
  .rp-stu-toolbar .rp-stu-btn-caption { display: none; }
}
.rp-stu-btn--primary { border: 0; background: var(--primary); color: var(--primary-foreground); font-weight: 600; }
.rp-stu-btn--primary:hover { background: var(--primary); opacity: 0.92; }


/* filters row (Ученики tab) */
.rp-stu-filters { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.rp-stu-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--muted-foreground);
  width: 260px;
  max-width: 100%;
}
.rp-stu-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.rp-stu-filter {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

/* roster table (desktop) */
.rp-stu-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}
.rp-stu-thead,
.rp-stu-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.4fr 1.3fr 40px;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.rp-stu-thead--archived,
.rp-stu-row--archived { grid-template-columns: 2fr 1fr auto; }
.rp-stu-thead {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}
.rp-stu-row { text-decoration: none; color: var(--foreground); }
.rp-stu-row:last-child { border-bottom: 0; }
a.rp-stu-row:hover { background: var(--secondary); }
.rp-stu-row--pending { background: color-mix(in srgb, var(--info-muted) 30%, transparent); }
.rp-stu-user { display: flex; align-items: center; gap: 11px; min-width: 0; }
.rp-stu-avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 600;
}
.rp-stu-name { font-size: 13.5px; font-weight: 600; }
.rp-stu-muted { font-size: 12.5px; color: var(--muted-foreground); }
.rp-stu-chev { color: var(--muted-foreground); text-align: right; }
.rp-stu-bal {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}
.rp-stu-bal--danger  { background: var(--destructive-muted); color: var(--destructive-muted-foreground); }
.rp-stu-bal--warning { background: var(--warning-muted);     color: var(--warning-muted-foreground); }
.rp-stu-bal--success { background: var(--success-muted);     color: var(--success-muted-foreground); }
.rp-stu-rowact { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.rp-stu-pending-actions { display: flex; gap: 8px; }
.rp-stu-pact {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.rp-stu-pact:disabled { opacity: 0.6; cursor: default; }
.rp-stu-pact--accept { border: 0; background: var(--primary); color: var(--primary-foreground); font-weight: 600; }
.rp-stu-pact--decline { color: var(--muted-foreground); }

/* roster cards (mobile) */
.rp-stu-cards { display: none; flex-direction: column; gap: 10px; }
.rp-stu-card {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--foreground);
}
.rp-stu-card-main { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }
.rp-stu-card-name { font-size: 14px; font-weight: 600; }
.rp-stu-card-sub { font-size: 12px; color: var(--muted-foreground); }

/* groups grid */
.rp-stu-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: start; }
.rp-stu-gcard {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 18px 20px;
}
.rp-stu-gcard-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rp-stu-gcard-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.rp-stu-gcard-name { font-size: 15px; font-weight: 700; }
.rp-stu-gcard-spacer { flex: 1; }
.rp-stu-gcard-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted-foreground); }
.rp-stu-gedit {
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.rp-stu-gnew {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--muted-foreground);
  padding: 24px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}
.rp-stu-gnew:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.rp-stu-gnew:disabled { opacity: 0.6; cursor: default; }
.rp-stu-upsell {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--info-muted);
  color: var(--info-muted-foreground);
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* invitations list */
.rp-stu-inv {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}
.rp-stu-inv-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.rp-stu-inv-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--muted);
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rp-stu-inv-main { flex: 1; min-width: 0; }
.rp-stu-inv-email { font-size: 13.5px; font-weight: 600; }
.rp-stu-inv-meta { font-size: 12px; color: var(--muted-foreground); }
.rp-stu-inv-act {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.rp-stu-inv-act:disabled { opacity: 0.6; cursor: default; }
.rp-stu-inv-act--danger { color: var(--destructive); }
.rp-stu-inv-foot { padding: 12px 18px; font-size: 12.5px; color: var(--muted-foreground); }

/* dialog helpers (chrome itself is rp-sched-dlg*) */
.rp-stu-field { margin-bottom: 14px; }
.rp-stu-err { display: block; font-size: 12.5px; color: var(--destructive); margin-top: 6px; }
.rp-stu-hint { font-size: 12.5px; color: var(--muted-foreground); margin-bottom: 14px; }
.rp-stu-check { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--foreground); margin-bottom: 14px; cursor: pointer; }
.rp-stu-members { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.rp-stu-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
}
.rp-stu-member-remove { border: 0; background: transparent; color: var(--destructive); font: inherit; font-size: 12.5px; cursor: pointer; }
.rp-stu-member-remove:disabled { opacity: 0.6; cursor: default; }
.rp-stu-addrow { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.rp-stu-addrow .rp-sched-dlg-input { flex: 1; }
.rp-stu-schedlink { display: inline-block; font-size: 12.5px; color: var(--primary); text-decoration: none; }
.rp-stu-schedlink:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .rp-stu-table { display: none; }
  .rp-stu-cards { display: flex; }
  .rp-stu-groups { grid-template-columns: 1fr; }
}

/* ── Student card — /students/{id} (Карточка ученика.dc.html, Task 8) ───────
   Section cards reuse the same border/radius/token language as the rest of bp.css; the balance
   history rows are the reused rp-balhist* block wrapped in rp-scard-hist. Единый мобильный
   брейкпоинт 768px складывает грид в столбик (П-16). */
.rp-scard { max-width: 1080px; }
.rp-scard-loading { display: flex; justify-content: center; padding: 48px 0; }

.rp-scard-crumb { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 13px; }
.rp-scard-crumb-link { color: var(--muted-foreground); text-decoration: none; }
.rp-scard-crumb-link:hover { color: var(--foreground); text-decoration: underline; }
.rp-scard-crumb-sep { color: var(--muted-foreground); }
.rp-scard-crumb-cur { font-weight: 600; color: var(--foreground); }

.rp-scard-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}
.rp-scard-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}
.rp-scard-head-main { flex: 1; min-width: 0; }
.rp-scard-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rp-scard-name { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.rp-scard-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.rp-scard-btn {
  height: 38px;
  gap: 8px;
  padding: 0 15px;
  font-size: 13.5px;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font-family: inherit;
}
.rp-scard-btn:disabled { opacity: 0.6; cursor: default; }
.rp-scard-btn--ghost { color: var(--foreground); }
.rp-scard-btn--primary { border: 0; background: var(--primary); color: var(--primary-foreground); font-weight: 600; }

.rp-scard-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
/* The gap ABOVE the tab body comes from the strip (01-core.css); this owns the two the page
   cannot: BETWEEN the body's own blocks — «Посещаемость» and «Финансы» each put a full-width card
   under the two-column grid — and below it, where the page-level «Платежи по ученику…» plate is a
   sibling with no margin of its own. */
.rp-scard-tabbody { display: flex; flex-direction: column; gap: 16px; margin-bottom: 18px; }
.rp-scard-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.rp-scard-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}
.rp-scard-card--pad { padding: 16px 18px; }
.rp-scard-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.rp-scard-card-title { font-size: 14.5px; font-weight: 700; }
.rp-scard-card-title--inline { margin-bottom: 10px; }
.rp-scard-card-spacer { flex: 1; }
.rp-scard-card-foot { padding: 11px 18px; }
.rp-scard-card-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}
.rp-scard-card-link:hover { text-decoration: underline; }
.rp-scard-card-link:disabled { opacity: 0.6; cursor: default; }
/* «Скачать PDF» in the «История занятий» head: on a phone the head's title, caption and this
   button compete for one row, and a flex item wraps its own words before a neighbour gives way —
   the label broke into «Скачать / PDF». The action stays whole; the caption is what wraps. */
.rp-scard-card-link--nowrap { white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; }
.rp-scard-card-link--danger { color: var(--destructive); }

.rp-scard-topup {
  height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.rp-scard-bal-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.rp-scard-bal-num { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.rp-scard-bal-cap { font-size: 12.5px; color: var(--muted-foreground); line-height: 1.45; }

/* rp-scard-bal-row packs ONE number+caption pair; the «Посещаемость» card needs three
   (был/опоздал/пропустил) side by side, so it gets its own row with each pair stacked
   num-over-caption — reusing bal-row's flat gap would leave all three captions equally
   spaced from every number, ambiguous about which caption belongs to which count. */
.rp-scard-att-row {
  display: flex;
  gap: 22px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.rp-scard-att-stat { display: flex; flex-direction: column; gap: 2px; }
.rp-scard-att-num { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.rp-scard-att-cap { font-size: 12.5px; color: var(--muted-foreground); line-height: 1.3; }

.rp-scard-hist { padding: 6px 18px; }

.rp-scard-empty { padding: 16px 18px; font-size: 13px; color: var(--muted-foreground); }

.rp-scard-lesson {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.rp-scard-lesson:last-child { border-bottom: 0; }
.rp-scard-lesson-when { width: 92px; flex-shrink: 0; }
.rp-scard-lesson-day { font-size: 13px; font-weight: 700; }
.rp-scard-lesson-time { font-size: 11.5px; color: var(--muted-foreground); }
.rp-scard-lesson-topic { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; }

.rp-scard-crs { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.rp-scard-crs:last-child { border-bottom: 0; }
.rp-scard-crs-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rp-scard-crs-name { font-size: 13.5px; font-weight: 600; flex: 1; min-width: 0; }
.rp-scard-crs-count { font-size: 12px; color: var(--muted-foreground); flex-shrink: 0; }
.rp-scard-prog { height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; margin-bottom: 8px; }
.rp-scard-prog-fill { height: 100%; border-radius: 999px; background: var(--primary); }
.rp-scard-crs-foot { font-size: 12px; }

.rp-scard-work {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.rp-scard-work:last-child { border-bottom: 0; }
.rp-scard-work-main { flex: 1; min-width: 0; }
.rp-scard-work-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-scard-work-kind { font-size: 11.5px; color: var(--muted-foreground); }

.rp-scard-parent { display: flex; align-items: center; gap: 11px; }
.rp-scard-parent + .rp-scard-parent { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.rp-scard-parent-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--muted);
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 600;
  flex-shrink: 0;
}
.rp-scard-parent-main { flex: 1; min-width: 0; }
.rp-scard-parent-name { font-size: 13.5px; font-weight: 600; }
.rp-scard-parent-email { font-size: 12px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; }

.rp-scard-note {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--muted);
  padding: 14px 18px;
  font-size: 12.5px;
  color: var(--muted-foreground);
  line-height: 1.55;
}

.rp-scard-danger {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.rp-scard-danger-text { flex: 1; min-width: 0; }
.rp-scard-danger-title { font-size: 13.5px; font-weight: 700; }
.rp-scard-danger-sub { font-size: 12.5px; color: var(--muted-foreground); margin-top: 2px; }
.rp-scard-danger-btn {
  height: 36px;
  padding: 0 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--destructive);
  background: transparent;
  color: var(--destructive);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.rp-scard-danger-btn:disabled { opacity: 0.6; cursor: default; }

/* «Начислить» dialog body (chrome — label/input/actions/btn — reused from rp-sched-dlg*) */
.rp-scard-dlg { max-width: 420px; }
.rp-scard-dlg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rp-scard-dlg-title { font-size: 17px; font-weight: 700; }
.rp-scard-dlg-spacer { flex: 1; }
.rp-scard-dlg-x { width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted-foreground); font-size: 18px; cursor: pointer; }
.rp-scard-dlg-sub { font-size: 13px; color: var(--muted-foreground); margin: 0 0 16px; line-height: 1.5; }
.rp-scard-dlg-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.rp-scard-dlg-field { min-width: 0; }
.rp-scard-dlg-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 16px;
  background: var(--muted);
  border-radius: var(--radius-md);
  font-size: 13px;
}
.rp-scard-dlg-preview-label { color: var(--muted-foreground); }
.rp-scard-dlg-preview-val { font-weight: 600; }
.rp-scard-dlg-preview--danger { background: var(--destructive-muted); }
.rp-scard-dlg-preview--danger .rp-scard-dlg-preview-label,
.rp-scard-dlg-preview--danger .rp-scard-dlg-preview-val { color: var(--destructive-muted-foreground); }

/* Student card, wave 1 (spec 2026-09-06-student-card-redesign): the page became /stats scoped to
   one person, so its period bar, KPI tiles and risk chips are the rp-stats-* ones REUSED, not
   re-cut. Only what is specific to one student lives below. */

.rp-scard-head-facts { font-size: 12.5px; color: var(--muted-foreground); margin-top: 4px; }
.rp-scard-signals { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.rp-scard-kpis { margin: 14px 0 18px; }
.rp-scard-card-cap { font-size: 11.5px; color: var(--muted-foreground); }
.rp-scard-lesson-charge { font-size: 11.5px; color: var(--muted-foreground); flex-shrink: 0; }

/* Regularity heatmap. Colours follow the /stats convention exactly — primary «был», brand-orange
   «опоздал», destructive «пропустил» — so the two pages never disagree on what a colour means. */
.rp-scard-heat-wrap { display: flex; gap: 8px; padding: 16px 18px; overflow-x: auto; }
.rp-scard-heat-days { display: flex; flex-direction: column; gap: 3px; flex-shrink: 0; }
.rp-scard-heat-day { height: 13px; font-size: 10px; line-height: 13px; color: var(--muted-foreground); }
.rp-scard-heat-grid { display: flex; gap: 3px; }
.rp-scard-heat-col { display: flex; flex-direction: column; gap: 3px; }
.rp-scard-heat-cell { width: 13px; height: 13px; border-radius: 3px; background: var(--muted); }
.rp-scard-heat-cell--none { background: var(--muted); }
.rp-scard-heat-cell--out { background: transparent; }
.rp-scard-heat-cell--attended { background: var(--primary); }
.rp-scard-heat-cell--late { background: var(--brand-orange); }
.rp-scard-heat-cell--missed { background: var(--destructive); }
.rp-scard-heat-cell--cancelled { background: var(--border); }
.rp-scard-heat-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 18px 16px;
  font-size: 11.5px;
  color: var(--muted-foreground);
}
.rp-scard-heat-key { display: inline-flex; align-items: center; gap: 5px; }
.rp-scard-heat-key .rp-scard-heat-cell { width: 9px; height: 9px; border-radius: 2px; }
.rp-scard-heat-gap { font-size: 11.5px; color: var(--muted-foreground); }

/* Line charts — the test trend and the balance remainder share this frame. */
.rp-scard-trend { display: flex; gap: 8px; padding: 16px 18px 6px; }
.rp-scard-trend-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 150px;
  font-size: 10.5px;
  color: var(--muted-foreground);
  flex-shrink: 0;
}
.rp-scard-trend-plot { position: relative; flex: 1; min-width: 0; height: 150px; color: var(--primary); }
.rp-scard-trend-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; }
.rp-scard-trend-grid > div { border-top: 1px solid var(--border); height: 0; }
.rp-scard-trend-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rp-scard-area { fill: var(--accent); opacity: .55; }
.rp-scard-trend-dot { position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--primary); }
.rp-scard-trend-dot-label {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
}
.rp-scard-trend-ticks { display: flex; gap: 4px; padding: 0 18px 14px; }
.rp-scard-trend-tick { flex: 1; min-width: 0; font-size: 10.5px; color: var(--muted-foreground); text-align: center; }
.rp-scard-trend-single { display: flex; align-items: baseline; gap: 10px; padding: 16px 18px; }
.rp-scard-trend-single-num { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.rp-scard-trend-single-cap { font-size: 12.5px; color: var(--muted-foreground); }
.rp-scard-topup-mark { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--brand-orange); }
.rp-scard-topup-label {
  position: absolute;
  top: -2px;
  left: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-orange);
  white-space: nowrap;
}

/* Weekly stacked bars. */
.rp-scard-legend { display: inline-flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--muted-foreground); }
.rp-scard-legend-key { display: inline-flex; align-items: center; gap: 4px; }
.rp-scard-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.rp-scard-dot--attended { background: var(--primary); }
.rp-scard-dot--late { background: var(--brand-orange); }
.rp-scard-dot--missed { background: var(--destructive); }
.rp-scard-dot--cancelled { background: var(--border); }
.rp-scard-bars { display: flex; align-items: flex-end; gap: 6px; padding: 16px 18px; }
.rp-scard-bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rp-scard-bar-stack { display: flex; flex-direction: column; justify-content: flex-end; width: 100%; max-width: 34px; height: 130px; }
.rp-scard-bar { display: block; width: 100%; }
.rp-scard-bar--attended { background: var(--primary); border-radius: 0 0 3px 3px; }
.rp-scard-bar--late { background: var(--brand-orange); }
.rp-scard-bar--missed { background: var(--destructive); }
.rp-scard-bar--cancelled { background: var(--border); border-radius: 3px 3px 0 0; }
.rp-scard-bar-tick {
  font-size: 10.5px;
  color: var(--muted-foreground);
  border-top: 1px solid var(--border);
  width: 100%;
  text-align: center;
  padding-top: 5px;
  min-height: 17px;
}

/* Weekday distribution. */
.rp-scard-dows-title { padding: 0 18px; font-size: 12px; color: var(--muted-foreground); }
.rp-scard-dows { display: flex; align-items: flex-end; gap: 8px; padding: 10px 18px 16px; }
.rp-scard-dow { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 96px; justify-content: flex-end; }
.rp-scard-dow-bar { width: 100%; max-width: 30px; background: var(--primary); border-radius: 3px 3px 0 0; opacity: .85; }
.rp-scard-dow-cap { font-size: 10.5px; color: var(--muted-foreground); }

/* Revisions proportion — a ring rather than a bar, so it reads as a share of the list beneath it. */
.rp-scard-revisions { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.rp-scard-donut {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(var(--brand-orange) var(--rp-donut-deg, 0deg), var(--primary) 0);
  -webkit-mask: radial-gradient(circle, transparent 54%, #000 55%);
  mask: radial-gradient(circle, transparent 54%, #000 55%);
}
.rp-scard-revisions-text { font-size: 12.5px; color: var(--muted-foreground); line-height: 1.45; }

/* Заметки об ученике (волна 2). The card is padded (rp-scard-card--pad), so rows carry their own
   separators rather than the full-bleed borders the list cards use. */
.rp-scard-card-head--flush { padding: 0 0 10px; border-bottom: 0; }
.rp-scard-note-empty { font-size: 12.5px; color: var(--muted-foreground); line-height: 1.5; }
.rp-scard-note-row { padding: 12px 0; border-top: 1px solid var(--border); }
.rp-scard-note-row:first-of-type { border-top: 0; }
.rp-scard-note-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.rp-scard-note-when { font-size: 11.5px; font-weight: 600; color: var(--muted-foreground); }
.rp-scard-note-author { font-size: 11.5px; color: var(--muted-foreground); }
.rp-scard-note-text { font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.rp-scard-note-act {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 11.5px;
  color: var(--muted-foreground);
  cursor: pointer;
}
.rp-scard-note-act:hover { color: var(--foreground); text-decoration: underline; }
.rp-scard-note-act--danger:hover { color: var(--destructive); }
.rp-scard-note-act:disabled { opacity: .6; cursor: default; }

.rp-scard-note-edit { padding: 4px 0 12px; }
.rp-scard-note-input {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 66px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}
.rp-scard-note-input:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.rp-scard-note-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.rp-scard-note-count { font-size: 11px; color: var(--muted-foreground); margin-right: auto; }
.rp-scard-note-save { height: 32px; padding: 0 14px; font-size: 12.5px; }

/* «Переписка» — a two-message tail, not a chat: no bubbles, no composer, just who said what. */
.rp-scard-msg { display: flex; gap: 9px; padding: 9px 0; }
.rp-scard-msg + .rp-scard-msg { border-top: 1px solid var(--border); }
.rp-scard-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 600;
}
.rp-scard-msg--mine .rp-scard-msg-avatar { background: var(--accent); color: var(--accent-foreground); }
.rp-scard-msg-main { min-width: 0; flex: 1; }
.rp-scard-msg-text { font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
.rp-scard-msg-when { font-size: 11px; color: var(--muted-foreground); margin-top: 2px; }

/* Period totals + balance ledger. */
.rp-scard-totals { display: flex; flex-wrap: wrap; gap: 18px; padding: 16px 18px; }
.rp-scard-total { flex: 1 1 120px; display: flex; flex-direction: column; gap: 3px; }
.rp-scard-total-cap { font-size: 12px; color: var(--muted-foreground); }
.rp-scard-total-num { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.rp-scard-ledger {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.rp-scard-ledger:last-child { border-bottom: 0; }
.rp-scard-ledger-date { width: 96px; flex-shrink: 0; color: var(--muted-foreground); font-size: 12px; }
.rp-scard-ledger-desc { flex: 1; min-width: 0; }
.rp-scard-ledger-after { font-size: 12px; color: var(--muted-foreground); flex-shrink: 0; }
.rp-scard-ledger-delta { width: 44px; text-align: right; font-weight: 700; flex-shrink: 0; }
.rp-scard-ledger-delta--up { color: var(--success-muted-foreground); }

@media (max-width: 768px) {
  .rp-scard-grid { grid-template-columns: 1fr; }
  .rp-scard-head { flex-wrap: wrap; }
  .rp-scard-actions { flex-basis: 100%; }
  .rp-scard-actions .rp-scard-btn { flex: 1; justify-content: center; }
  .rp-scard-dlg-fields { grid-template-columns: 1fr; }
  .rp-scard-danger { flex-wrap: wrap; }
  .rp-scard-danger-btn { flex-basis: 100%; }
}

@media (max-width: 640px) {
  /* The ledger and the lesson rows become two-line cards rather than a squeezed four-column row —
     the project rule is that the narrow tree may not LOSE a block, not that it must keep the shape. */
  .rp-scard-ledger { flex-wrap: wrap; row-gap: 2px; }
  .rp-scard-ledger-date { width: auto; order: 1; }
  .rp-scard-ledger-delta { order: 2; margin-left: auto; }
  .rp-scard-ledger-desc { order: 3; flex-basis: 100%; }
  .rp-scard-ledger-after { order: 4; flex-basis: 100%; }
  .rp-scard-lesson-charge { flex-basis: 100%; }
  /* The heatmap stays a horizontal scroll: it IS a weeks-by-days grid and there is nothing to
     collapse it into (the /stats group-journal rule). */
  .rp-scard-heat-wrap { padding-bottom: 10px; }
  .rp-scard-trend-tick:not(:first-child):not(:last-child) { display: none; }
}

/* ── Task 9 (wave 3): «Домашние задания» grading queue — /grading (Домашние задания.dc.html, top
   screen). Two DOM trees toggled by the shell's 768px breakpoint (.rp-gq-desktop / .rp-gq-mobile),
   same rationale as .rp-th-desktop/.rp-th-mobile (TutorHome) — don't merge into one responsive tree. */
.rp-gq-desktop { display: block; }
.rp-gq-mobile { display: none; }

.rp-gq-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.rp-gq-toolbar-spacer { flex: 1; }

.rp-gq-tabs { display: flex; gap: 6px; }

.rp-gq-tab {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.rp-gq-tab--active {
  border-color: transparent;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
}

.rp-gq-filters { display: flex; gap: 8px; }

.rp-gq-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.rp-gq-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}

.rp-gq-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--foreground);
}

.rp-gq-row:last-child { border-bottom: 0; }
.rp-gq-row:hover { background: var(--secondary); }

.rp-gq-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.rp-gq-body { flex: 1; min-width: 0; }
.rp-gq-title { font-size: 13.5px; }
.rp-gq-student { font-weight: 600; }
.rp-gq-task { font-weight: 500; }

.rp-gq-sub {
  font-size: 12.5px;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-gq-files {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.rp-gq-age {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.rp-gq-age--warn {
  background: var(--warning-muted);
  color: var(--warning-muted-foreground);
}

.rp-gq-chev { color: var(--muted-foreground); }

/* Mobile (≤768px) — header badge + scrollable chip tabs + card-per-row */
.rp-gq-mhead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.rp-gq-mtitle { font-size: 17px; font-weight: 700; }

.rp-gq-mbadge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--warning-muted);
  color: var(--warning-muted-foreground);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rp-gq-mtabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 2px;
}

.rp-gq-mtab {
  flex-shrink: 0;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.rp-gq-mtab--active {
  border-color: transparent;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
}

.rp-gq-mempty {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 20px 16px;
  font-size: 13.5px;
  color: var(--muted-foreground);
  text-align: center;
}

.rp-gq-mcard {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.rp-gq-mcard-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rp-gq-mcard-body { flex: 1; min-width: 0; }
.rp-gq-mcard-name { font-size: 13.5px; font-weight: 600; }

.rp-gq-mcard-task {
  font-size: 12px;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-gq-mcard-btn {
  display: block;
  width: 100%;
  height: 40px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 40px;
  text-decoration: none;
}

@media (max-width: 768px) {
  .rp-gq-desktop { display: none; }
  .rp-gq-mobile { display: block; }
  /* The mobile tree carries its own compact head (rp-gq-mhead) — hiding the page-level
     RpPageHeader avoids the doubled «Домашние задания» title (wave-9 visual audit). */
  .rp-gq > .rp-ph { display: none; }
}

/* ── Task 10 (wave 3): /grading/{SubmissionId} homework review page ─────────── */
.rp-grev-loading { display: flex; justify-content: center; padding: 48px 0; }

.rp-grev-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.rp-grev-head-spacer { flex: 1; }
.rp-grev-crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.rp-grev-crumb-link { color: var(--muted-foreground); text-decoration: none; flex-shrink: 0; }
.rp-grev-crumb-link:hover { color: var(--foreground); text-decoration: underline; }
.rp-grev-crumb-sep { color: var(--muted-foreground); flex-shrink: 0; }
.rp-grev-crumb-cur {
  font-weight: 600;
  color: var(--foreground);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rp-grev-pos { font-size: 12.5px; color: var(--muted-foreground); flex-shrink: 0; }
.rp-grev-nav {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--card);
  flex-shrink: 0;
}
.rp-grev-navbtn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
}
.rp-grev-navbtn + .rp-grev-navbtn { border-left: 1px solid var(--border); }
.rp-grev-navbtn:not(.rp-grev-navbtn--disabled):hover { color: var(--foreground); background: var(--muted); }
.rp-grev-navbtn--disabled { color: var(--border); cursor: default; }

.rp-grev-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.rp-grev-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.rp-grev-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 18px 20px;
}
.rp-grev-card--muted { background: var(--muted); }
.rp-grev-card--pad { padding: 16px 18px; }
.rp-grev-card-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin-bottom: 8px;
}
.rp-grev-card-title { font-size: 14.5px; font-weight: 700; margin-bottom: 10px; }
.rp-grev-muted { font-size: 13px; color: var(--muted-foreground); }
.rp-grev-hint { margin-bottom: 12px; }

.rp-grev-answer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rp-grev-answer-head .rp-grev-card-label { margin-bottom: 0; }
.rp-grev-answer-spacer { flex: 1; }
.rp-grev-attempt {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--warning-muted);
  color: var(--warning-muted-foreground);
  flex-shrink: 0;
  white-space: nowrap;
}
.rp-grev-answer-text { font-size: 14px; line-height: 1.7; }

.rp-grev-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rp-grev-file {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--foreground);
  text-decoration: none;
  max-width: 100%;
}
.rp-grev-file:hover { border-color: var(--primary); }
.rp-grev-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-grev-file-size { color: var(--muted-foreground); flex-shrink: 0; }

.rp-grev-score {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: var(--muted);
  color: var(--foreground);
}
.rp-grev-quiz-q { padding: 10px 0; border-bottom: 1px solid var(--border); }
.rp-grev-quiz-q:last-child { border-bottom: 0; padding-bottom: 0; }
.rp-grev-quiz-prompt { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; font-weight: 500; }
.rp-grev-quiz-answer { font-size: 12.5px; color: var(--muted-foreground); margin-top: 5px; }
.rp-grev-quiz-correct { font-size: 12.5px; margin-top: 3px; }
.rp-grev-quiz-expl { font-size: 12.5px; color: var(--muted-foreground); margin-top: 3px; font-style: italic; white-space: pre-line; }

.rp-grev-prev-text { font-size: 13px; line-height: 1.6; color: var(--muted-foreground); }

.rp-grev-conflict {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background: var(--warning-muted);
  color: var(--warning-muted-foreground);
  font-size: 13px;
  font-weight: 500;
}

.rp-grev-verdict { padding: 12px 14px; border-radius: var(--radius-md); }
.rp-grev-verdict--success { background: var(--success-muted); color: var(--success-muted-foreground); }
.rp-grev-verdict--warning { background: var(--warning-muted); color: var(--warning-muted-foreground); }
.rp-grev-verdict--danger { background: var(--destructive-muted, var(--muted)); color: var(--destructive); }
.rp-grev-verdict-label { font-size: 13.5px; font-weight: 700; }
.rp-grev-verdict-text { font-size: 13px; line-height: 1.55; margin-top: 4px; }

.rp-grev-field-label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.rp-grev-textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  resize: vertical;
  box-sizing: border-box;
}
.rp-grev-textarea:focus { outline: none; border-color: var(--primary); }

.rp-grev-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.rp-grev-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.rp-grev-btn:disabled { opacity: 0.6; cursor: default; }
.rp-grev-btn--accept {
  height: 44px;
  border: 0;
  background: var(--success);
  color: var(--success-foreground);
  font-size: 14px;
  font-weight: 600;
}
.rp-grev-btn--outline {
  height: 40px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font-size: 13.5px;
  font-weight: 500;
}
.rp-grev-reject {
  align-self: center;
  margin-top: 2px;
  border: 0;
  background: transparent;
  color: var(--destructive);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
}
.rp-grev-reject:hover { text-decoration: underline; }
.rp-grev-reject:disabled { opacity: 0.6; cursor: default; }

.rp-grev-stats { font-size: 12.5px; color: var(--muted-foreground); line-height: 1.7; }
.rp-grev-cardlink {
  display: inline-block;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.rp-grev-cardlink:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .rp-grev-grid { grid-template-columns: 1fr; }
  .rp-grev-head { flex-wrap: wrap; }
  .rp-grev-crumb { order: 1; width: 100%; }
  .rp-grev-head-spacer { display: none; }
}

/* ── Тесты (/tests) gradebook — Task 11, wave 3, Тесты.dc.html ──────────────────────────────
   Matrix is TRANSPOSED vs the contract: rows = students, columns = tests. Sticky first column +
   sticky header via position:sticky (a table, not the mockup's grid, so the corner cell stays
   pinned on both axes). All tokens so dark mode flips for free. */
.rp-tm-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.rp-tm-toolbar-spacer { flex: 1; }
.rp-tm-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* Student-name search (second echelon of the pagination sweep) — same geometry as .rp-tm-filter next
   to it in the toolbar, just wider so a name isn't clipped mid-typing. */
.rp-tm-search {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  width: 220px;
  max-width: 100%;
}
.rp-tm-search::placeholder { color: var(--muted-foreground); }
.rp-tm-filter {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
}
.rp-tm-inactive {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted-foreground);
  cursor: pointer;
}
.rp-tm-inactive input { accent-color: var(--primary); }

.rp-tm-btn {
  height: 38px;
  gap: 7px;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
}
/* Icon-collapse «+ Тест» на узком экране — только тулбарная кнопка (caption-span);
   кнопка пустого состояния остаётся с полной подписью. */
@media (max-width: 560px) {
  .rp-tm-toolbar .rp-tm-btn { padding: 0 10px; }
  .rp-tm-toolbar .rp-tm-btn-caption { display: none; }
}
.rp-tm-btn--primary { border: 0; background: var(--primary); color: var(--primary-foreground); }
.rp-tm-btn--ghost { border: 0; background: transparent; color: var(--muted-foreground); }
.rp-tm-btn:disabled { opacity: 0.6; cursor: default; }

.rp-tm-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.rp-tm { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.rp-tm th, .rp-tm td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 11px 14px;
  vertical-align: middle;
}
.rp-tm tbody tr:last-child th, .rp-tm tbody tr:last-child td { border-bottom: 0; }

/* Sticky header row + sticky first column; corner is pinned on both axes. */
.rp-tm thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card);
  text-align: left;
  vertical-align: top;
}
.rp-tm-corner {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 3;
  min-width: 190px;
  background: var(--card);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}
.rp-tm-rowhead {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 190px;
  background: var(--card);
  text-align: left;
}

.rp-tm-colhead { min-width: 150px; }
.rp-tm-colhead--inactive { opacity: 0.55; }
.rp-tm-colhead-inner { display: flex; align-items: flex-start; gap: 6px; }
.rp-tm-colhead-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: var(--foreground);
}
.rp-tm-colhead-main:hover .rp-tm-colhead-name { color: var(--primary); }
.rp-tm-colhead-name { font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.rp-tm-colhead-meta { font-size: 11px; color: var(--muted-foreground); }

.rp-tm-badge {
  align-self: flex-start;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--info-muted);
  color: var(--info-muted-foreground);
}
.rp-tm-badge--muted { background: var(--muted); color: var(--muted-foreground); }

.rp-tm-kebab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}
.rp-tm-kebab:hover { background: var(--secondary); color: var(--foreground); }

.rp-tm-student { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--foreground); }
.rp-tm-student-name { font-size: 13px; font-weight: 600; }
.rp-tm-student:hover .rp-tm-student-name { color: var(--primary); }
.rp-tm-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.rp-tm-cell { cursor: pointer; }
.rp-tm-cell:hover { background: var(--secondary); }
.rp-tm-chip {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  padding: 3px 10px;
  border-radius: 999px;
  border: none;
}
/* Mobile cards render the chip as a <button> (result cells open the attempts dialog, П-11 fix);
   the desktop matrix still renders it as a plain <span> — both share this class. */
button.rp-tm-chip { cursor: pointer; }
button.rp-tm-chip:disabled { cursor: default; }
.rp-tm-chip--passed { background: var(--success-muted); color: var(--success-muted-foreground); }
.rp-tm-chip--failed { background: var(--destructive-muted); color: var(--destructive-muted-foreground); }
.rp-tm-chip--scored { background: var(--muted); color: var(--foreground); }
.rp-tm-chip--assigned { background: var(--warning-muted); color: var(--warning-muted-foreground); }
.rp-tm-assigned { font-size: 11.5px; font-weight: 600; color: var(--warning-muted-foreground); }
/* Marks a result chip whose test was re-assigned on top of the existing result — a fresh open
   assignment is waiting even though the cell still shows the last score. */
.rp-tm-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); display: inline-block; margin-left: 5px; vertical-align: middle; }
.rp-tm-dash { font-size: 12.5px; color: var(--muted-foreground); }

.rp-tm-hint { font-size: 12px; color: var(--muted-foreground); margin: 12px 2px 0; line-height: 1.6; }

.rp-tm-more--mobile { display: none; }

/* Mobile card view (per test). Hidden on desktop; the matrix is hidden ≤768px. */
.rp-tm-cards { display: none; flex-direction: column; gap: 10px; }
.rp-tm-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); padding: 14px 16px; }
.rp-tm-card--inactive { opacity: 0.6; }
.rp-tm-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.rp-tm-card-name { font-size: 14px; font-weight: 700; flex: 1; text-decoration: none; color: var(--foreground); }
.rp-tm-card-meta { font-size: 12px; color: var(--muted-foreground); margin-bottom: 10px; }
.rp-tm-card-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-tm-card-empty { font-size: 12px; color: var(--muted-foreground); }

/* Create-test dialog body (rendered inside BbDialogContent). */
.rp-tm-dlg { max-width: 420px; }
.rp-tm-dlg-title { font-size: 17px; font-weight: 700; }
.rp-tm-dlg-sub { font-size: 13.5px; color: var(--muted-foreground); margin: 4px 0 16px; }
.rp-tm-dlg-field { margin-bottom: 14px; }
.rp-tm-dlg-label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.rp-tm-dlg-input {
  height: 42px;
  font: inherit;
  font-size: 13.5px;
}
.rp-tm-dlg-thr { position: relative; }
.rp-tm-dlg-thr-unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--muted-foreground); }
.rp-tm-dlg-help { font-size: 12px; color: var(--muted-foreground); margin-top: 6px; }
.rp-tm-dlg-switchrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 18px;
  cursor: pointer;
}
.rp-tm-dlg-switchtext { flex: 1; font-size: 13.5px; }
.rp-tm-dlg-actions { display: flex; align-items: center; gap: 8px; }
.rp-tm-dlg-spacer { flex: 1; }

/* Pill switch (shared by the create dialog + the editor parameters card). */
/* Unified switch geometry (owner feedback: toggles varied in size + off-colour across screens).
   Canonical = 36×21 track, 16px thumb, off = var(--border), on = var(--primary); shared by every
   rp-*-switch/-toggle so they read as one control. */
/* .rp-tm-sw / --on / -thumb geometry is in the canonical toggle block (global controls section). */

.rp-tm-err { font-size: 12.5px; color: var(--destructive); margin-bottom: 10px; }

/* Cell-results popup body. */
.rp-tm-res-head { font-size: 14.5px; font-weight: 600; margin-bottom: 12px; }
.rp-tm-res-list { display: flex; flex-direction: column; gap: 8px; }
.rp-tm-res-item { display: flex; flex-direction: column; gap: 6px; }
.rp-tm-res-row { display: flex; align-items: center; gap: 12px; }
.rp-tm-res-date { font-size: 12.5px; color: var(--muted-foreground); }
.rp-tm-res-spacer { flex: 1; }
/* Per-attempt «Разбор» expander toggle — reuses the rp-quiz-review-* question-card look (Task 8). */
.rp-tm-res-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 0;
  padding: 2px 4px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--muted-foreground);
}
.rp-tm-res-toggle:hover { color: var(--foreground); }
.rp-tm-res-review.rp-quiz-review { margin-top: 8px; }

/* ── Редактор теста (/tests/{Id}) — Task 11, wave 3 ─────────────────────────────────────────── */
.rp-ted-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.rp-ted-head-spacer { flex: 1; }
.rp-ted-crumb { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rp-ted-crumb-link { font-size: 13px; color: var(--muted-foreground); text-decoration: none; }
.rp-ted-crumb-link:hover { color: var(--primary); }
.rp-ted-crumb-sep { color: var(--muted-foreground); }
.rp-ted-crumb-cur { font-size: 15px; font-weight: 700; }
.rp-ted-status { font-size: 12.5px; }
.rp-ted-status--ok { color: var(--success-muted-foreground); }
.rp-ted-status--pending { color: var(--muted-foreground); }
.rp-ted-status--warn { color: var(--warning-muted-foreground); }

.rp-ted-btn {
  height: 38px;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  text-decoration: none;
}
.rp-ted-btn--primary { border: 0; background: var(--primary); color: var(--primary-foreground); }

.rp-ted-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.rp-ted-questions { display: flex; flex-direction: column; gap: 12px; }
.rp-ted-side { display: flex; flex-direction: column; gap: 16px; }

.rp-ted-field { display: flex; flex-direction: column; gap: 6px; }
.rp-ted-label { font-size: 12.5px; font-weight: 600; }
.rp-ted-input {
  height: 42px;
  font: inherit;
  font-size: 13.5px;
}
.rp-ted-alert {
  font-size: 13px;
  color: var(--destructive-muted-foreground);
  background: var(--destructive-muted);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.rp-ted-qcard { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); padding: 16px 18px; }
.rp-ted-qhead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rp-ted-qnum {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--muted);
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.rp-ted-qtype {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 12.5px;
}
.rp-ted-qspacer { flex: 1; }
.rp-ted-opt-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}
.rp-ted-opt-del:hover { background: var(--secondary); color: var(--destructive); }

/* Kebab triggers of a question card and of an option row. Same 28×28 box the trash button had, so the
   row's right edge does not move; the option kebab is a touch smaller, matching its 14px neighbours. */
.rp-ted-qkebab, .rp-ted-optkebab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: none;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}
.rp-ted-qkebab:hover, .rp-ted-optkebab:hover { background: var(--secondary); color: var(--foreground); }

/* Drag-and-drop of questions and options. The grip is the ONLY drag source — a draggable card would
   turn a shaky click inside the question's textarea into a reorder. Lines carry their own height and
   cancel it with a negative margin, so appearing at dragstart does not push the list under the cursor.
   The margin has to cancel the HOST's flex gap too, not just the line's own height: .rp-ted-questions
   (the .rp-ted-drop host) is a column flex with gap: 12px, while .rp-ted-qcard (the .rp-ted-optdrop
   host) is plain block flow with no gap, so the two lines need different margins even though they
   share the same 9px height — copying one figure into a gapped container without re-deriving it
   reintroduces the layout jump this rule exists to avoid. */
.rp-ted-grip {
  flex: none;
  display: inline-flex;
  align-items: center;
  color: var(--input);
  cursor: grab;
}
.rp-ted-grip:active { cursor: grabbing; }
.rp-ted-qcard:hover .rp-ted-grip, .rp-ted-opt:hover .rp-ted-grip { color: var(--muted-foreground); }
.rp-ted-qcard--dragging { opacity: 0.5; }
.rp-ted-drop, .rp-ted-optdrop {
  height: 9px;
  border-radius: 2px;
}
.rp-ted-optdrop { margin: -4px 0; }
.rp-ted-drop { margin: -10px 0; }
.rp-ted-drop--over, .rp-ted-optdrop--over { box-shadow: inset 0 2px 0 var(--primary); }

.rp-ted-qtext {
  width: 100%;
  min-height: 60px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}

.rp-ted-opt { display: flex; align-items: center; gap: 9px; padding: 4px 0; }
.rp-ted-opt-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 1.5px solid var(--input);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--primary-foreground);
  cursor: pointer;
}
.rp-ted-opt-mark--radio { border-radius: 50%; }
.rp-ted-opt-mark--on { border-color: var(--success); background: var(--success); }
.rp-ted-opt .rp-ted-input { height: 36px; }

/* Composite question sub-forms (spec 2026-08-05): a gap-question card wraps one gap's own accepted
   answers (rp-ted-opt rows, reused as-is) under a "Пропуск N" label; the match row reuses rp-ted-opt
   too, so only the dash between its two inputs needs a rule of its own. Order-question rows need
   nothing new — rp-ted-qnum/rp-ted-optkebab/rp-ted-opt-del are all reused verbatim. */
.rp-ted-gapcard { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; margin: 8px 0; }
.rp-ted-gaphead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.rp-ted-gaplabel { font-size: 12.5px; font-weight: 600; color: var(--muted-foreground); }
.rp-ted-pairdash { color: var(--muted-foreground); flex-shrink: 0; }

.rp-ted-addopt {
  align-self: flex-start;
  margin-top: 4px;
  /* .rp-ted-qcard is a plain block, so two of these («+ Вариант» / «+ Пояснение к ответу») share a
     line as inline-blocks — without this they render glued together with zero gap between the links. */
  margin-right: 16px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}
/* Разбор правильного ответа в карточке вопроса: подпись + textarea (сама textarea — rp-ted-qtext). */
.rp-ted-expl { margin-top: 8px; }
.rp-ted-expl-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted-foreground);
}
.rp-ted-expl .rp-ted-qtext { margin-bottom: 0; }
.rp-ted-addq {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--muted-foreground);
  padding: 16px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}
.rp-ted-addq:hover { border-color: var(--primary); color: var(--primary); }
.rp-ted-ai {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: flex-start;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.rp-ted-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); padding: 16px 18px; }
.rp-ted-card-title { display: flex; align-items: center; font-size: 14.5px; font-weight: 700; margin-bottom: 12px; }
.rp-ted-card-spacer { flex: 1; }
.rp-ted-card-count { font-size: 12px; font-weight: 500; color: var(--muted-foreground); }

.rp-ted-thr { position: relative; }
.rp-ted-thr-unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--muted-foreground); }

.rp-ted-prow { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.rp-ted-prow-key { color: var(--muted-foreground); }
.rp-ted-prow-val { font-weight: 600; }

.rp-ted-switchrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.rp-ted-switchrow:last-child { border-bottom: 0; }
.rp-ted-sharelink { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 4px; }
.rp-ted-switchtext { flex: 1; font-size: 13.5px; }

.rp-ted-empty { font-size: 13px; color: var(--muted-foreground); }
.rp-ted-batch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
.rp-ted-batch-aud { font-size: 13px; font-weight: 600; }
.rp-ted-batch-meta { font-size: 12px; color: var(--muted-foreground); }
.rp-ted-reslabel { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-foreground); margin: 12px 0 6px; }
.rp-ted-resrow { display: flex; align-items: center; gap: 11px; padding: 7px 0; }
.rp-ted-resname { flex: 1; font-size: 13px; font-weight: 600; }

@media (max-width: 768px) {
  .rp-tm-wrap, .rp-tm-hint, .rp-tm-more--desktop { display: none; }
  .rp-tm-cards { display: flex; }
  .rp-tm-more--mobile { display: block; }
  .rp-ted-grid { grid-template-columns: 1fr; }
}

/* ── Statistics — /stats (spec 2026-09-06-tutor-stats-redesign) · rp-stats-* ──────────────── */
.rp-stats { display: flex; flex-direction: column; gap: 16px; }
/* The page IS the stack here, so every block on it — the tab body included — is spaced by that gap.
   The strip's own bottom margin (01-core.css) would add to it rather than replace it: a margin
   inside a gap-managed container double-counts. Same reason as .rp-adm-tabrow's neutralizer. */
.rp-stats > .rp-tabs-underline,
.rp-stats > .rp-tabs-chips,
.rp-stats > .rp-tabs-seg { margin-bottom: 0; }

/* Period bar: named windows, prev/current/next, the window's own name, «сравнение с …». */
.rp-stats-period { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rp-stats-period-dash { color: var(--muted-foreground); }
.rp-stats-period-spacer { flex: 1; }
.rp-stats-period-label { font-size: 15px; font-weight: 600; }
.rp-stats-period-prev { font-size: 12.5px; color: var(--muted-foreground); }
.rp-stats-seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--card); }
.rp-stats-seg-btn { height: 34px; padding: 0 14px; border: 0; background: var(--card); color: var(--muted-foreground); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.rp-stats-seg-btn + .rp-stats-seg-btn { border-left: 1px solid var(--border); }
.rp-stats-seg-btn--active { background: var(--accent); color: var(--accent-foreground); font-weight: 600; }

/* The unmarked caveat. It stands ABOVE the numbers it qualifies — under them it reads as a
   footnote nobody sees, and the numbers it qualifies are computed without those lessons. */
.rp-stats-caveat { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border: 1px solid var(--border); border-left: 3px solid var(--warning); border-radius: var(--radius-lg); background: var(--card); font-size: 13px; color: var(--muted-foreground); }
.rp-stats-caveat-text { flex: 1; min-width: 200px; }

/* Card shell shared by every block on the page. */
.rp-stats-card-block { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow-xs); }
.rp-stats-block-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.rp-stats-block-title { flex: 0 0 auto; font-size: 15px; font-weight: 600; margin: 0; }
.rp-stats-block-meta { font-size: 12.5px; color: var(--muted-foreground); }
.rp-stats-block-body { padding: 18px; }
.rp-stats-empty { color: var(--muted-foreground); font-size: 13px; }
.rp-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 16px; }

/* Risk list — «Требуют внимания». */
.rp-stats-risk { border-left: 3px solid var(--warning); }
.rp-stats-risk-rows { display: flex; flex-direction: column; }
.rp-stats-risk-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 18px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; flex-wrap: wrap; }
.rp-stats-risk-row:hover { background: var(--muted); }
.rp-stats-risk-who { display: flex; flex-direction: column; gap: 4px; flex: 1 1 180px; min-width: 0; }
.rp-stats-risk-name { font-size: 14px; font-weight: 600; }
.rp-stats-risk-meta { font-size: 12px; color: var(--muted-foreground); }
.rp-stats-risk-signals { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 200px; }
.rp-stats-risk-bar { display: block; flex: 0 0 90px; height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.rp-stats-risk-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--warning); }
.rp-stats-risk-bar-fill--high { background: var(--destructive); }

.rp-stats-avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--secondary); color: var(--secondary-foreground); font-size: 12.5px; font-weight: 700; }
.rp-stats-avatar--sm { width: 26px; height: 26px; font-size: 11px; }
.rp-stats-who { display: inline-flex; align-items: center; gap: 10px; }

.rp-stats-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--secondary); color: var(--muted-foreground); }
.rp-stats-chip--danger { background: var(--destructive-muted); color: var(--destructive-muted-foreground); }
.rp-stats-chip--warn { background: var(--warning-muted); color: var(--warning-muted-foreground); }

/* KPI tiles. */
.rp-stats-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 10px; }
.rp-stats-kpi { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow-xs); }
.rp-stats-kpi-label { font-size: 12px; color: var(--muted-foreground); }
.rp-stats-kpi-row { display: flex; align-items: baseline; gap: 8px; }
.rp-stats-kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.rp-stats-kpi-delta { font-size: 12px; font-weight: 600; }
.rp-stats-kpi-delta--up { color: var(--success-muted-foreground); }
.rp-stats-kpi-delta--down { color: var(--destructive-muted-foreground); }
.rp-stats-kpi-note { font-size: 11.5px; color: var(--muted-foreground); }
.rp-stats-spark { display: flex; align-items: flex-end; gap: 3px; height: 26px; }
.rp-stats-spark-bar { flex: 1; min-width: 3px; border-radius: 2px 2px 0 0; background: var(--primary); opacity: .8; }

/* Column charts — attendance, load, revenue all share this geometry. */
.rp-stats-cols { display: flex; align-items: flex-end; gap: 10px; }
.rp-stats-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.rp-stats-col-pct { font-size: 11.5px; font-weight: 600; color: var(--muted-foreground); }
.rp-stats-col-stack { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; width: 100%; max-width: 42px; height: 148px; }
.rp-stats-col-seg { display: block; width: 100%; }
.rp-stats-col-seg--att { border-radius: 0 0 4px 4px; background: var(--primary); }
.rp-stats-col-seg--late { background: var(--brand-orange); }
.rp-stats-col-seg--miss { border-radius: 4px 4px 0 0; background: var(--destructive); }
.rp-stats-col-seg--peak { background: var(--brand-orange); }
.rp-stats-col-stack > .rp-stats-col-seg--att:only-child { border-radius: 5px 5px 0 0; }
.rp-stats-col-label { font-size: 11.5px; color: var(--muted-foreground); border-top: 1px solid var(--border); width: 100%; text-align: center; padding-top: 6px; }
.rp-stats-legend { display: inline-flex; gap: 12px; font-size: 11.5px; color: var(--muted-foreground); flex-wrap: wrap; }
.rp-stats-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.rp-stats-swatch { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.rp-stats-swatch--att { background: var(--primary); }
.rp-stats-swatch--late { background: var(--brand-orange); }
.rp-stats-swatch--miss { background: var(--destructive); }
.rp-stats-facts { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.rp-stats-fact { flex: 1 1 160px; }
.rp-stats-fact-label { font-size: 12px; color: var(--muted-foreground); margin-bottom: 4px; }
.rp-stats-fact-value { font-size: 14px; font-weight: 600; }

/* Students table (desktop) and its card twin (mobile). Both markups are in the DOM; the media
   query below picks one — the project rule that the mobile tree may not lose a desktop block. */
.rp-stats-desktop { display: block; }
.rp-stats-mobile { display: none; flex-direction: column; }
.rp-stats-table-wrap { overflow-x: auto; }
.rp-stats-table { border-collapse: collapse; min-width: 480px; width: 100%; }
.rp-stats-table th, .rp-stats-table td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: .92rem; }
.rp-stats-table th { font-size: 12px; font-weight: 600; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .04em; }
.rp-stats-row { cursor: pointer; }
.rp-stats-row:hover { background: var(--muted); }
.rp-stats-mark { text-align: center; }
.rp-stats-total { font-weight: 600; }
.rp-stats-att { display: inline-flex; align-items: center; gap: 9px; }
.rp-stats-att-bar { display: block; width: 100%; max-width: 56px; height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.rp-stats-att-fill { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.rp-stats-att-fill--ok { background: var(--primary); }
.rp-stats-att-fill--warn { background: var(--brand-orange); }
.rp-stats-att-fill--bad { background: var(--destructive); }
.rp-stats-att-pct { font-weight: 600; font-variant-numeric: tabular-nums; }
.rp-stats-mrow { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 13px 16px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rp-stats-mrow-head { display: flex; align-items: center; gap: 10px; }
.rp-stats-mrow-name { flex: 1; font-weight: 600; font-size: 14px; }
.rp-stats-mrow .rp-stats-att-bar { max-width: none; }
.rp-stats-mrow-facts { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted-foreground); }
.rp-stats-journal { min-width: 620px; }
.rp-stats-groupsel { min-width: 210px; }

/* Debt list. Stated in lessons — see the spec's «Честность чисел». */
.rp-stats-debt-rows { display: flex; flex-direction: column; }
.rp-stats-debt-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rp-stats-debt-name { flex: 1 1 140px; border: 0; background: transparent; padding: 0; font: inherit; font-size: 13.5px; font-weight: 600; color: inherit; text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.rp-stats-debt-detail { font-size: 12.5px; color: var(--muted-foreground); }
.rp-stats-debt-action { flex-shrink: 0; }

@media (max-width: 640px) {
  .rp-stats-desktop { display: none; }
  .rp-stats-mobile { display: flex; }
  .rp-stats-grid { grid-template-columns: 1fr; }
  .rp-stats-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .rp-stats-period-spacer { display: none; }
  .rp-stats-period { gap: 8px 10px; }
  .rp-stats-seg { width: 100%; }
  .rp-stats-seg-btn { flex: 1; padding: 0 8px; }
  .rp-stats-risk-row { gap: 10px; }
  .rp-stats-risk-bar { flex-basis: 100%; }
  .rp-stats-cols { gap: 5px; }
  .rp-stats-col-stack { height: 110px; }
  .rp-stats-col-label { font-size: 10px; }
}


/* Join-link card on the students hub invitations tab (spec 2026-09-02). */
.rp-jl-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.rp-jl-card-title { font-weight: 600; margin-bottom: 12px; }
.rp-jl-row { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; }
.rp-jl-main { flex: 1; min-width: 0; }
.rp-jl-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.rp-jl-url { width: 100%; font-family: ui-monospace, monospace; font-size: 12px;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--muted); color: var(--foreground); }
.rp-jl-meta { font-size: 12px; color: var(--muted-foreground); margin-top: 4px; }
.rp-jl-note { font-size: 12px; color: var(--muted-foreground); margin-top: 12px; }
.rp-jl-kebab {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex-shrink: 0; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted-foreground); cursor: pointer;
}
.rp-jl-kebab:hover { background: var(--secondary); color: var(--foreground); }
.rp-menu .rp-jl-item--danger { color: var(--destructive); }
.rp-menu .rp-jl-item--danger:hover { background: var(--destructive-muted, var(--secondary)); color: var(--destructive); }
@media (max-width: 640px) {
  .rp-jl-row { flex-wrap: wrap; }
  .rp-jl-copy { flex: 1; }
}

/* ── Экран для проектора (/promo/screen/{code}, spec 2026-09-07) ─────────────────────────────────
   Живёт здесь, а не в одиннадцатом файле бандла: порядок 01→10 несущий и пришит к обоим хостам
   плюс к CssHygieneTests, а страница преподавательская — это её раздел. */
.rp-reach-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px; padding: 24px; text-align: center;
  background: var(--background);
  /* Под FocusLayout страница И ЕСТЬ кадр: 70vh оставляли 415px мёртвого поля под адресом на
     1080p — на проекторе это читается как обрезанная страница. dvh ради мобильных браузеров,
     где адресная строка съедает часть vh. */
  min-height: 100vh; min-height: 100dvh;
}
.rp-reach-screen:fullscreen { justify-content: center; }

.rp-reach-screen__stage {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  width: 100%; max-width: 720px;
}
.rp-reach-screen__title {
  margin: 0; font-size: clamp(22px, 4vw, 44px); font-weight: 700; line-height: 1.15;
  color: var(--foreground);
}

/* 🔒 Белая плашка задана ЯВНО, а не токеном темы: инвертированный QR читают не все сканеры, и
   тёмная тема кабинета не имеет права дотянуться до кода. Отсюда же собственный тёмный alt-цвет. */
.rp-reach-screen__plate {
  background: #fff; padding: 16px; border-radius: var(--radius-md);
  line-height: 0; color: #000;
}
.rp-reach-screen__qr {
  /* Верхняя граница поднята под проектор: код смотрят с задних рядов, а вертикали теперь хватает. */
  display: block; width: clamp(200px, 52vh, 600px); height: auto;
}

.rp-reach-screen__address {
  margin: 0; font-size: clamp(16px, 2.4vw, 30px); font-weight: 700; letter-spacing: 0.01em;
  color: var(--foreground); word-break: break-all;
}
.rp-reach-screen__actions { display: flex; gap: 8px; }
.rp-reach-screen:fullscreen .rp-reach-screen__actions { opacity: 0.25; }
.rp-reach-screen:fullscreen .rp-reach-screen__actions:hover { opacity: 1; }

.rp-reach-screen__empty { max-width: 420px; color: var(--muted-foreground); }
.rp-reach-screen__empty-title { margin: 0 0 6px; font-size: 18px; font-weight: 600; color: var(--foreground); }
.rp-reach-screen__empty-text { margin: 0; font-size: 14px; }

/* ── Раздел «Продвижение» (/promo, spec 2026-09-07) ──────────────────────────────────────────── */
/* 🔒 Префикс `rp-reach-`, а НЕ `rp-promo-`: последний уже занят промокодами в 06-finance.css, а тот
   файл сортируется позже и молча переопределил бы эти правила. Поймано CssHygieneTests. */
/* «Как о вас узнают» — чеклист над списком целей (префикс тот же, см. заметку ниже). */
.rp-reach-check {
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px;
  background: var(--muted); margin: 0 0 16px; max-width: 70ch;
}
.rp-reach-check__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rp-reach-check__title { font-weight: 600; font-size: 15px; color: var(--foreground); }
.rp-reach-check__count { font-size: 12px; color: var(--muted-foreground); white-space: nowrap; }
.rp-reach-check__lead { margin: 6px 0 10px; font-size: 13px; color: var(--muted-foreground); }
.rp-reach-check__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.rp-reach-check__item { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--foreground); }
/* Сделанный пункт гасится, а не вычёркивается: зачёркнутый текст читается как «отменено». */
.rp-reach-check__item--done { color: var(--muted-foreground); }
.rp-reach-check__mark { color: var(--primary); flex: none; margin-top: 2px; display: inline-flex; }
.rp-reach-check__dot {
  flex: none; width: 13px; height: 13px; margin-top: 3px;
  border: 1.5px solid var(--border); border-radius: 50%;
}
.rp-reach-check__text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
/* Внешние шаги — отдельным списком под чеклистом и НИКОГДА не в счётчике: проверить их нечем. */
.rp-reach-check__more { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.rp-reach-check__moretitle { font-size: 12px; font-weight: 600; color: var(--muted-foreground); }
.rp-reach-check__morelist {
  margin: 6px 0 0; padding-left: 18px; font-size: 13px;
  display: flex; flex-direction: column; gap: 4px;
}
.rp-reach-check__morelink { color: var(--primary); text-decoration: underline; }

.rp-reach-lead { margin: 0 0 16px; color: var(--muted-foreground); font-size: 14px; max-width: 70ch; }

.rp-reach-list { display: flex; flex-direction: column; gap: 12px; }
.rp-reach-card {
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px;
  background: var(--card); display: flex; flex-direction: column; gap: 10px;
}
.rp-reach-card__title { font-weight: 600; font-size: 15px; color: var(--foreground); }
.rp-reach-card__note { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; }

.rp-reach-card__channels { display: flex; flex-direction: column; gap: 4px; }
.rp-reach-chan { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.rp-reach-chan__name { color: var(--foreground); min-width: 64px; }
.rp-reach-chan__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted-foreground);
}
.rp-reach-chan__opens { color: var(--muted-foreground); }

.rp-reach-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.rp-reach-empty { max-width: 60ch; color: var(--muted-foreground); }
.rp-reach-empty-title { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--foreground); }
.rp-reach-empty-text { margin: 0; font-size: 14px; }

.rp-reach-elsewhere { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.rp-reach-elsewhere__title { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.rp-reach-elsewhere__list {
  margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted-foreground);
  display: flex; flex-direction: column; gap: 4px;
}

/* Вкладка «Продвижение» на /stats. */
.rp-reach-stats__row { margin-bottom: 14px; }
.rp-reach-stats__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rp-reach-stats__name { font-size: 13px; color: var(--foreground); }
.rp-reach-stats__total { font-size: 15px; font-weight: 600; color: var(--foreground); }
.rp-reach-stats__bars { display: flex; align-items: flex-end; gap: 2px; height: 48px; margin-top: 6px; }
.rp-reach-stats__bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.rp-reach-stats__bar > span { display: block; width: 100%; background: var(--primary); border-radius: 2px; }
.rp-reach-stats__empty,
.rp-reach-stats__caveat { margin: 0; font-size: 12px; color: var(--muted-foreground); }
.rp-reach-stats__caveat { margin-top: 10px; }
