/* 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;
}

@media (max-width: 768px) {
  .rp-th-actions { display: none; }
}

/* 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; }
.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; }

.rp-th-request-actions { display: flex; 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;
}

/* «Закончился баланс» 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;
}

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

/* «Эта неделя» card — its content sits directly inside .rp-card (no .rp-card-header/-body
   wrappers), and .rp-card itself carries no padding, so the card pads itself. */
.rp-th-week { padding: 16px 18px; }

.rp-th-week-title { font-size: 14.5px; font-weight: 700; margin-bottom: 12px; }

.rp-th-week-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rp-th-week-num { font-size: 20px; font-weight: 700; }
.rp-th-week-label { font-size: 12px; color: var(--muted-foreground); }

/* 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; }

.rp-stu-panel { padding-top: 20px; }

/* 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; }
.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; }
.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-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); }

@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%; }
}

/* ── 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; }
}

