/* =========================================================================
   imartside school — design system
   Светлая тема: синий + голубой, мягкие тени, читаемая типографика.
   ========================================================================= */

:root {
  color-scheme: dark;

  /* Палитра — мягкий тёмно-серый (Notion/Linear dark, не navy-black) */
  --bg: #15171c;
  --bg-soft: #1a1d24;
  --surface: #21252e;
  --surface-soft: #272c38;
  --surface-tint: #2e3444;
  --text: #e8ecf4;
  --text-soft: #b0bdd4;
  --muted: #8fa3c0;
  --muted-soft: #6478a0;
  --line: #323848;
  --line-soft: #252b38;

  --primary: #3b7ef8;
  --primary-hover: #5592ff;
  --primary-strong: #7aabff;
  --primary-soft: rgba(59, 126, 248, 0.25);
  --primary-tint: rgba(59, 126, 248, 0.12);

  /* Theme toggle */
  --theme-icon-dark: "☀️";
  --theme-icon-light: "🌙";

  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.16);

  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.16);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.18);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.16);

  --gold: #f59e0b;
  --gold-soft: rgba(245, 158, 11, 0.18);
  --purple: #a78bfa;
  --purple-soft: rgba(167, 139, 250, 0.16);

  /* Радиусы и тени */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.28);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.24);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.22), 0 12px 36px rgba(0, 0, 0, 0.16);
  --shadow-lg: 0 16px 56px rgba(0, 0, 0, 0.36);
  --shadow-blue: 0 12px 32px rgba(59, 126, 248, 0.28);

  /* Borders — unified token used everywhere */
  --border: rgba(255, 255, 255, 0.09);

  /* Типографика */
  --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Спейсинг */
  --gap-1: 4px;
  --gap-2: 8px;
  --gap-3: 12px;
  --gap-4: 16px;
  --gap-5: 20px;
  --gap-6: 24px;
  --gap-8: 32px;
}

/* =========================================================================
   СВЕТЛАЯ ТЕМА
   ========================================================================= */
[data-theme="light"] {
  color-scheme: light;

  --bg: #f0f4f8;
  --bg-soft: #e8edf5;
  --surface: #ffffff;
  --surface-soft: #f5f7fb;
  --surface-tint: #edf1f8;
  --text: #0f1a2e;
  --text-soft: #3a506e;
  --muted: #5d7494;
  --muted-soft: #8da4be;
  --line: #d8e2ef;
  --line-soft: #e5ecf5;

  --primary: #1d55d4;
  --primary-hover: #1a4bc2;
  --primary-strong: #163fa8;
  --primary-soft: rgba(37, 99, 235, 0.14);
  --primary-tint: rgba(37, 99, 235, 0.08);

  --accent: #0284c7;
  --accent-soft: rgba(2, 132, 199, 0.12);

  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.12);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.12);

  --gold: #d97706;
  --gold-soft: rgba(217, 119, 6, 0.12);
  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, 0.12);

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 12px 36px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 16px 56px rgba(0, 0, 0, 0.12);
  --shadow-blue: 0 8px 24px rgba(37, 99, 235, 0.22);

  /* Borders */
  --border: rgba(0, 0, 0, 0.10);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Skip-to-content link (visible only on focus) */
.skip-link {
  position: absolute;
  top: -9999px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 8px 20px;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  z-index: 9999;
  white-space: nowrap;
}
.skip-link:focus {
  top: 0;
}

::selection {
  color: #fff;
  background: var(--primary);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: transparent;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.005em;
}

h4 {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* =========================================================================
   APP SHELL
   ========================================================================= */

.app {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

.app.public {
  grid-template-columns: 1fr;
}

.app.collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

/* SIDEBAR */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 14px 18px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 14px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  flex: 0 0 auto;
  box-shadow: var(--shadow-blue);
}

.brand-text {
  display: grid;
  min-width: 0;
}

.brand-text strong {
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.sidebar-toggle {
  display: grid;
  place-items: center;
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  flex: 0 0 auto;
}

.sidebar-toggle:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.sidebar-section-title {
  padding: 14px 10px 6px;
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  width: 100%;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}

.nav-item:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 700;
  position: relative;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 14px;
  flex: 0 0 auto;
  color: inherit;
}

.nav-item.active .nav-icon {
  color: var(--primary);
}

.nav-item .nav-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 8px 0;
  padding: 4px;
  background: var(--surface-soft);
  border-radius: 10px;
}

.role-button {
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.role-button.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.streak-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(56, 189, 248, 0.12));
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.streak-card-emoji {
  font-size: 22px;
}

.streak-card strong {
  display: block;
  font-size: 13px;
  color: var(--text);
}

.streak-card small {
  color: var(--muted);
  font-size: 11px;
}

/* Collapsed sidebar */
.app.collapsed .nav-item span:not(.nav-icon),
.app.collapsed .brand-text,
.app.collapsed .sidebar-section-title,
.app.collapsed .role-switch,
.app.collapsed .streak-card small,
.app.collapsed .streak-card strong {
  display: none;
}

.app.collapsed .nav-item {
  justify-content: center;
  position: relative;
}

/* Tooltip в свёрнутом сайдбаре */
.app.collapsed .nav-item[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface-tint);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}

.app.collapsed .streak-card {
  justify-content: center;
  padding: 8px;
}

.app.collapsed .sidebar-head {
  justify-content: center;
}

/* MAIN */
.main {
  min-width: 0;
  padding: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  height: 60px;
  background: var(--bg-soft);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

[data-theme="dark"] .topbar {
  background: rgba(9, 15, 30, 0.94);
}

.topbar-title {
  flex: 0 0 auto;
  max-width: 240px;
  min-width: 0;
  overflow: hidden;
}

.topbar-title h1 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.topbar-title small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 400px;
  height: 38px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.topbar-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.topbar-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-soft);
}

.icon-button:hover {
  background: var(--primary-tint);
  color: var(--primary);
}

.icon-button .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border: 2px solid var(--surface);
  border-radius: 50%;
}

.xp-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-tint), var(--accent-soft));
  border: 1px solid var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 700;
  font-size: 13px;
}

.xp-pill .xp-emoji {
  font-size: 16px;
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  height: 44px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.profile-pill:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 800;
  font-size: 12px;
}

.avatar.lg {
  width: 48px;
  height: 48px;
  font-size: 16px;
  border-radius: 14px;
}

.avatar.xl {
  width: 80px;
  height: 80px;
  font-size: 28px;
  border-radius: 22px;
}

.profile-pill .name {
  display: grid;
  line-height: 1.1;
}

.profile-pill .name strong {
  font-size: 13px;
  white-space: nowrap;
}

.profile-pill .name small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.content {
  padding: 28px;
  display: grid;
  gap: 18px;
}

@media (max-width: 720px) {
  .content {
    padding: 18px;
  }
  .topbar {
    padding: 12px 18px;
  }
}

/* =========================================================================
   КАРТОЧКИ И ПАНЕЛИ
   ========================================================================= */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: var(--line-soft);
  box-shadow: var(--shadow-sm);
}

.card.flush {
  padding: 0;
  overflow: hidden;
}

/* Горизонтальный разделитель с текстом */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.section-divider::before,
.section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.card-head h2,
.card-head h3 {
  margin: 0;
}

.card-head .muted {
  font-size: 13px;
}

/* =========================================================================
   КНОПКИ
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s, transform 0.05s;
}

.btn:active {
  transform: scale(0.98);
}

/* ── Focus visible ─────────────────────────────────────────────── */
.btn:focus-visible,
.tab:focus-visible,
.btn-icon:focus-visible,
.icon-button:focus-visible,
.chip:focus-visible,
.chip-link:focus-visible,
.sidebar-item:focus-visible,
.bottom-nav-item:focus-visible,
.brand:focus-visible,
.oauth-btn:focus-visible,
.role-option input:focus-visible,
[data-toggle-theme]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-blue);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.btn-secondary:hover {
  background: var(--surface-soft);
  border-color: var(--primary-soft);
  color: var(--primary);
}

.btn-soft {
  background: var(--primary-tint);
  color: var(--primary);
  border-color: transparent;
}

.btn-soft:hover {
  background: var(--primary-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.btn-ghost:hover {
  background: var(--surface-soft);
  border-color: var(--primary-soft);
  color: var(--primary);
}

.btn-ghost:hover {
  background: var(--surface-soft);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #15803d;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-lg {
  height: 48px;
  padding: 0 22px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* =========================================================================
   БЕЙДЖИ И ЧИПЫ
   ========================================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--surface-soft);
  color: var(--muted);
}

.badge-primary {
  background: var(--primary);
  color: #fff;
}

.badge-success {
  background: #22c55e;
  color: #fff;
}

.badge-warning {
  background: #f59e0b;
  color: #fff;
}

.badge-danger {
  background: var(--danger);
  color: #fff;
}

.badge-purple {
  background: var(--purple);
  color: #fff;
}

.badge-gold {
  background: var(--gold);
  color: #fff;
}

.badge-dot::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* =========================================================================
   ФОРМЫ
   ========================================================================= */

.form-field {
  display: grid;
  gap: 6px;
}

.form-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  outline: 0;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
}

.input-hint {
  font-size: 12px;
  color: var(--muted);
}

.input-error {
  font-size: 12px;
  color: var(--danger);
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: background 0.12s, border-color 0.12s;
}

.checkbox:hover {
  background: var(--surface-soft);
  border-color: var(--primary-soft);
}

.checkbox.checked {
  background: var(--primary-tint);
  border-color: var(--primary-soft);
}

.checkbox-input {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  transition: background 0.12s, border-color 0.12s;
}

.checkbox.checked .checkbox-input {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.checkbox.checked .checkbox-input::after {
  content: "✓";
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.checkbox-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-soft);
}

/* Toggle */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle-track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  transition: background 0.12s;
}

.toggle-track::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: transform 0.12s;
}

.toggle.on .toggle-track {
  background: var(--primary);
}

.toggle.on .toggle-track::before {
  transform: translateX(16px);
}

/* =========================================================================
   ПРОГРЕСС
   ========================================================================= */

.progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Цветовые уровни прогресса */
.progress.danger > span  { background: linear-gradient(90deg, var(--danger), #f87171); }
.progress.warning > span { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.progress.success > span { background: linear-gradient(90deg, var(--success), #4ade80); }

.progress > span::after {
  content: "";
  position: absolute;
  top: 0; left: -100%; bottom: 0;
  width: 60%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  animation: shimmer 2.2s infinite;
}

@keyframes shimmer {
  0%   { left: -60%; }
  100% { left: 160%; }
}

.progress.thick {
  height: 12px;
}

.progress.thin {
  height: 6px;
}

.progress.success > span {
  background: linear-gradient(90deg, var(--success), #4ade80);
}

.progress.gold > span {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* Stepper в шапке урока */
.lesson-stepper {
  display: flex;
  gap: 6px;
}

.lesson-stepper > span {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--line-soft);
  transition: background 0.2s;
}

.lesson-stepper > span.done {
  background: var(--success);
}

.lesson-stepper > span.current {
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* =========================================================================
   ТАБЫ
   ========================================================================= */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.12s;
}

.tab:hover {
  color: var(--primary);
}

.tab.active {
  color: var(--primary);
}

.tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}

.tab .tab-status {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--line-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.tab.active .tab-status {
  background: var(--primary-soft);
  color: var(--primary);
}

.tab .tab-status.done {
  background: var(--success);
  color: #fff;
}

/* Приоритетные табы — стандартный размер, контрастные.
   Вторичные — компактнее и приглушённее, чтобы не отвлекали. */
.tab-primary {
  font-weight: 700;
}

.tab-secondary {
  padding: 12px 12px;
  font-size: 13px;
  color: var(--muted-soft);
  font-weight: 500;
}

.tab-secondary:hover {
  color: var(--text-soft);
}

.tab-secondary.active {
  color: var(--primary);
  font-weight: 700;
}

.tab-divider {
  align-self: center;
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 6px;
  flex: 0 0 auto;
}

/* =========================================================================
   ПУБЛИЧНЫЕ СТРАНИЦЫ (LANDING / AUTH / PRICING)
   ========================================================================= */

.public-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 36px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}

.public-nav .brand {
  font-weight: 800;
}

.public-nav-links {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

.public-nav-links a {
  color: var(--text-soft);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
}

.public-nav-links a:hover {
  background: var(--surface-soft);
  color: var(--primary);
  text-decoration: none;
}

.public-nav-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.theme-toggle-btn {
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: var(--surface);
  transition: background 0.15s, border-color 0.15s;
}

.theme-toggle-btn:hover {
  background: var(--surface-soft);
  border-color: var(--line-soft);
}

.public-content {
  display: grid;
  gap: 0;
}

.hero {
  position: relative;
  padding: 36px 36px 60px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 0%, rgba(37, 99, 235, 0.28), transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(37, 99, 235, 0.12), transparent 60%);
  z-index: -1;
}

/* Фоновый QA-текст бренда */
.hero-brand-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -54%);
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.hero-qa-bg {
  font-size: clamp(180px, 28vw, 320px);
  font-weight: 900;
  letter-spacing: -0.06em;
  color: rgba(37, 99, 235, 0.06);
  display: block;
  line-height: 1;
}

/* Hero живая точка */
.hero-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.28);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.28); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12); }
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #4ade80;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 18px;
}

.hero h1 {
  max-width: 900px;
  margin: 0 auto 16px;
  font-size: clamp(36px, 5.5vw, 64px);
  letter-spacing: -0.03em;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  max-width: 640px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  max-width: 720px;
  margin: 0 auto;
}

.hero-stat {
  text-align: center;
}

.hero-stat strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.hero-stat span {
  font-size: 13px;
  color: var(--muted);
}

.hero-mockup {
  max-width: 1000px;
  margin: 50px auto 0;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-tint), var(--accent-soft));
  border: 1px solid var(--primary-soft);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

.hero-mockup-window {
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-mockup-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.hero-mockup-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.hero-mockup-content {
  padding: 18px;
}

.section {
  padding: 70px 36px;
}

.section.alt {
  background: var(--surface);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 40px;
}

.section-head h2 {
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-head p {
  color: var(--muted);
  font-size: 16px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.feature {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}

.feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary-soft);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 14px;
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 20px;
}

.feature h3 {
  font-size: 17px;
  margin-bottom: 6px;
}

.feature p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.program-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 1100px;
  margin: 0 auto;
}

.program-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.program-num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
  flex: 0 0 auto;
}

.program-item-text strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.program-item-text small {
  color: var(--muted);
  font-size: 13px;
}

/* ── Cineskope section ─────────────────────────────────────── */
.cineskope-section { overflow: hidden; }

.cineskope-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 48px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}

.cineskope-logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.cineskope-icon {
  font-size: 36px;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  background: var(--primary-tint);
  border-radius: 16px;
  flex-shrink: 0;
}

.cineskope-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.cineskope-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.cineskope-desc {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-soft);
  margin-bottom: 20px;
}

.cineskope-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.ctag {
  padding: 5px 12px;
  background: var(--primary-tint);
  color: var(--primary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(37,99,235,0.15);
}

.cineskope-bullets {
  display: grid;
  gap: 10px;
}

.cbullet {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-soft);
}

.cbullet-icon {
  width: 20px;
  height: 20px;
  background: var(--success-tint, rgba(34,197,94,0.12));
  color: var(--success, #16a34a);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Cineskope architecture diagram */
.cineskope-diagram {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
}

.cdiag-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 18px;
  text-align: center;
}

.cdiag-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.cdiag-client {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.cdiag-services {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
}

.cdiag-infra {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
}

.cdiag-cicd {
  width: 100%;
}

.cdiag-cicd-box {
  width: 100% !important;
  justify-content: center;
  background: var(--surface-soft) !important;
  border-style: dashed !important;
}

.cdiag-box {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  white-space: nowrap;
}

.cdiag-blue {
  background: var(--primary-tint);
  border-color: rgba(37,99,235,0.2);
  color: var(--primary);
}

.cdiag-gateway {
  background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(56,189,248,0.08));
  border-color: rgba(37,99,235,0.25);
  color: var(--primary);
  padding: 10px 24px;
  font-size: 12px;
}

.cdiag-svc {
  background: var(--surface-soft);
}

.cdiag-infra-box {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.2);
  color: var(--warning, #d97706);
  font-size: 10px;
}

.cdiag-arrow-down {
  font-size: 11px;
  color: var(--muted);
  line-height: 1;
}

/* ── Reviews ────────────────────────────────────────────────── */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.review-card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.12s, box-shadow 0.12s;
}

.review-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.review-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.review-stars {
  color: #f59e0b;
  font-size: 14px;
  letter-spacing: 1px;
}

.review-date {
  font-size: 11px;
  color: var(--muted);
}

.review-highlight {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-tint);
  padding: 3px 10px;
  border-radius: 999px;
  align-self: flex-start;
}

.review-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-soft);
  flex: 1;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.review-author strong {
  display: block;
  font-size: 13px;
}

.review-author small {
  color: var(--muted);
  font-size: 11px;
}

/* Legacy (keep in case still referenced) */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
}

.testimonial {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.testimonial p {
  font-size: 14.5px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.testimonial-author strong {
  display: block;
  font-size: 13px;
}

.testimonial-author small {
  color: var(--muted);
  font-size: 12px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.plan {
  position: relative;
  padding: 32px 28px 28px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}

.plan:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.plan.featured:hover {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-tint);
}

.plan .btn-block {
  margin-top: auto;
}

.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.plan-price-note {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.plan h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.plan-tagline {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}

.plan-price {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.plan-period {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: grid;
  gap: 8px;
  flex: 1;
}

.plan-features li {
  display: flex;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.5;
}

.plan-features li::before {
  content: "✓";
  color: var(--success);
  font-weight: 800;
  flex: 0 0 auto;
}

.faq-grid {
  display: grid;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
}

.faq-item {
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.faq-item summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 22px;
  color: var(--primary);
  transition: transform 0.12s;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* .cta-banner base replaced by landing-specific block below */

.public-footer {
  padding: 32px 36px;
  background: var(--surface);
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

/* AUTH */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 3fr 2fr;
}

.auth-form {
  display: grid;
  align-content: center;
  padding: 60px 48px;
  gap: 16px;
  max-width: 540px;
  margin: 0 auto;
  width: 100%;
}

.auth-form .brand {
  margin-bottom: 24px;
}

.auth-form h1 {
  font-size: 30px;
  margin-bottom: 6px;
}

.auth-form .lead {
  color: var(--muted);
  margin-bottom: 18px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin: 6px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.oauth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

.oauth-btn:hover {
  background: var(--surface-soft);
  border-color: var(--primary-soft);
}

.role-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.role-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
}

.role-option:has(input:checked),
.role-option.selected {
  border-color: var(--primary);
  background: var(--primary-tint);
  color: var(--primary);
}

.role-option input[type="radio"] {
  display: none;
}

.auth-aside {
  position: relative;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 56px;
  display: grid;
  align-items: center;
  color: #fff;
  overflow: hidden;
}

.auth-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.14), transparent 40%);
}

.auth-aside-content {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

.auth-aside h2 {
  font-size: 32px;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.auth-aside p {
  font-size: 16px;
  line-height: 1.6;
  opacity: 0.92;
  margin-bottom: 28px;
}

.auth-perks {
  display: grid;
  gap: 12px;
}

.auth-perk {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
}

.auth-perk-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 14px;
  flex: 0 0 auto;
}

@media (max-width: 880px) {
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-aside {
    display: none;
  }
}

/* =========================================================================
   ДАШБОРД СТУДЕНТА
   ========================================================================= */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.radar-chart-wrap {
  display: flex;
  justify-content: center;
  padding: 2px 0 4px;
  overflow: hidden;
}

.radar-chart {
  display: block;
  width: min(100%, 520px);
  height: auto;
  max-height: 330px;
}

.continue-card {
  display: grid;
  gap: 16px;
  padding: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-blue);
  position: relative;
  overflow: hidden;
}

.continue-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.5), transparent 60%);
}

.continue-card .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.continue-card h2 {
  font-size: 20px;
  letter-spacing: -0.01em;
  position: relative;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.continue-card .module-info {
  font-size: 14px;
  opacity: 0.86;
  position: relative;
}

.continue-card .progress {
  background: rgba(255, 255, 255, 0.2);
  position: relative;
}

.continue-card .progress > span {
  background: linear-gradient(90deg, #fff, var(--accent-soft));
}

.continue-card-actions {
  display: flex;
  gap: 10px;
  position: relative;
  flex-wrap: wrap;
}

.continue-card .btn-primary {
  background: #fff;
  color: var(--primary);
  border-color: #fff;
}

.continue-card .btn-primary:hover {
  background: var(--primary-tint);
  color: var(--primary-strong);
}

.continue-card .btn-ghost {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.continue-card .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.metric-card:hover {
  border-color: var(--primary-soft);
  box-shadow: 0 0 0 1px var(--primary-tint), var(--shadow-xs);
}

.metric-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
}

.metric-trend.up {
  color: var(--success);
}

.metric-trend.down {
  color: var(--danger);
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 14px;
}

.streak-widget {
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(56, 189, 248, 0.1));
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.streak-widget-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.streak-widget-emoji {
  font-size: 32px;
}

.streak-widget-title {
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
}

.streak-widget-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.streak-days {
  display: flex;
  gap: 4px;
}

.streak-day {
  flex: 1;
  text-align: center;
}

.streak-day .dot {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.14);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.streak-day.active .dot {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
}

.streak-day.today .dot {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.streak-day small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.activity-calendar {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 4px;
  margin-top: 16px;
}

.activity-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--surface-soft);
}

.activity-cell.l1 { background: rgba(37, 99, 235, 0.25); }
.activity-cell.l2 { background: rgba(37, 99, 235, 0.48); }
.activity-cell.l3 { background: rgba(37, 99, 235, 0.72); }
.activity-cell.l4 { background: var(--primary); }

.activity-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--muted);
}

.activity-legend .activity-cell {
  width: 10px;
  height: 10px;
}

/* Goal */
.daily-goal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 18px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}

.daily-goal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  align-self: stretch;
}

.daily-goal-head strong {
  font-size: 14px;
}

.daily-goal-circle {
  --val: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--surface) 62%, transparent 63%),
    conic-gradient(var(--primary) calc(var(--val) * 1%), var(--surface-soft) 0);
  margin: 4px auto;
}

.daily-goal-circle strong {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.daily-goal-circle small {
  display: block;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Уровень */
.level-card {
  padding: 18px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.12), rgba(37, 99, 235, 0.12));
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--radius);
}

.level-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.level-badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--purple), var(--primary));
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.level-card .progress {
  background: rgba(124, 58, 237, 0.15);
}

.level-card .progress > span {
  background: linear-gradient(90deg, var(--purple), var(--primary));
}

/* =========================================================================
   КАТАЛОГ КУРСОВ И УРОКОВ
   ========================================================================= */

.catalog-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.catalog-aside {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 80px;
}

.catalog-filters {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.catalog-filters h4 {
  margin-bottom: 12px;
  font-size: 13px;
}

.catalog-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

/* Сетка статистики курса */
.course-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.course-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 8px 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
}

.course-stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 3px;
}

.course-stat-label {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.2;
}

.course-features {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.course-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-soft);
  padding: 4px 2px;
}

.course-feature-item span {
  color: var(--text);
  font-weight: 500;
}

.filter-group {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  cursor: pointer;
}

.filter-row .badge {
  font-size: 10px;
}

/* Module list */
.module-list {
  display: grid;
  gap: 12px;
}

.module {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}

/* Статусы модулей */
.module--done {
  border-color: rgba(34, 197, 94, 0.35);
}

.module--done .module-header {
  background: rgba(34, 197, 94, 0.04);
}

.module--active {
  border-color: rgba(37, 99, 235, 0.35);
}

.module--locked {
  opacity: 0.72;
}

.module-locked-desc {
  padding: 0 20px 12px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.module-locked-desc p { margin: 0 0 8px; }

.module-locked-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
}

.module-locked-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.module-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 20px 12px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-tint);
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}

.module-toggle-btn:hover { opacity: 0.8; }

.module-lessons--hidden { display: none !important; }

/* Collapsible dashboard cards */
.collapsible-head {
  cursor: default;
  user-select: none;
  margin-bottom: 0 !important;
}
.collapsible-card {
  padding: 0;
  overflow: hidden;
}
.collapsible-card .collapsible-head {
  padding: 14px 20px;
  border-radius: var(--radius);
}
.collapsible-card .collapsible-body {
  padding: 0 20px 18px;
}
.collapse-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--primary);
  transition: transform 0.2s ease, background 0.15s;
  flex-shrink: 0;
  cursor: pointer;
}
.collapse-chevron:hover {
  background: var(--primary-tint);
}
.collapse-chevron.open {
  transform: rotate(180deg);
}

.module--locked .module-emoji {
  filter: grayscale(1);
}

/* Иконка-эмодзи модуля — варианты */
.module-emoji.done {
  background: rgba(34, 197, 94, 0.14);
}

.module-emoji.locked {
  background: var(--surface-tint);
}

/* Бейджи статуса модуля */
.module-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.module-status-badge.done {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.module-status-badge.active {
  background: var(--primary-tint);
  color: var(--primary-strong);
  border: 1px solid var(--primary-soft);
}

.module-status-badge.open {
  background: var(--surface-tint);
  color: var(--muted);
  border: 1px solid var(--line);
}

.module-status-badge.locked {
  background: var(--surface-tint);
  color: var(--muted-soft);
  border: 1px solid var(--line-soft);
}

.module-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  cursor: pointer;
  transition: background 0.12s;
}

.module-header:hover {
  background: var(--surface-soft);
}

.module-emoji {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-tint);
  font-size: 20px;
  flex: 0 0 auto;
}

.module-title {
  flex: 1;
}

.module-title strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.module-title small {
  color: var(--muted);
  font-size: 13px;
}

.module-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.module-progress-mini {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 4px;
  min-width: 80px;
}

.module-progress-mini .progress {
  width: 80px;
  height: 6px;
}

.module-progress-mini small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.module-lessons {
  padding: 0 16px 16px;
  display: grid;
  gap: 5px;
}

.lesson-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}

.lesson-row:hover:not(:disabled) {
  border-left-color: var(--primary);
  background: var(--surface-soft);
}

.lesson-row.completed {
  background: rgba(34, 197, 94, 0.05);
  border-left-color: var(--success);
}

.lesson-row.current {
  border-left-color: var(--primary);
  background: var(--primary-tint);
}

.lesson-row:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lesson-row-status {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.lesson-row.completed .lesson-row-status {
  background: var(--success);
  color: #fff;
}

.lesson-row.current .lesson-row-status {
  background: var(--primary);
  color: #fff;
}

.lesson-row-text strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  line-height: 1.3;
  color: var(--text);
}

/* Lesson row chips */
.lr-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.lr-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 500;
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}

.lr-chip--green  { background: rgba(34, 197, 94, 0.12); color: #4ade80; border-color: rgba(34, 197, 94, 0.25); }
.lr-chip--blue   { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border-color: rgba(59, 130, 246, 0.25); }
.lr-chip--orange { background: rgba(249, 115, 22, 0.12); color: #fb923c; border-color: rgba(249, 115, 22, 0.25); }
.lr-chip--muted  { opacity: 0.65; }

.lr-dot {
  font-size: 10px;
  opacity: 0.55;
  line-height: 1;
}

/* Status badge inside lesson row */
.lr-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.lr-status-badge.done   { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.lr-status-badge.open   { background: var(--primary-tint); color: var(--primary); }
.lr-status-badge.locked { background: var(--surface-soft); color: var(--muted); }

/* =========================================================================
   СТРАНИЦА УРОКА
   ========================================================================= */

.lesson-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.lesson-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

/* Aside — теперь overlay-панель с тогглом */
.lesson-aside-toggle-wrap {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}

.lesson-aside-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}

.lesson-aside-toggle:hover {
  background: var(--surface-tint);
  color: var(--primary);
  border-color: var(--primary-soft);
}

.lesson-aside-toggle-label {
  font-size: 12px;
}

.lesson-aside {
  width: 300px;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  animation: tab-fade-in 0.16s ease;
}

.lesson-aside-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

/* Когда aside открыт — убираем отдельный border у карточек внутри */
.lesson-aside .aside-card {
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--line-soft);
}

.lesson-hero {
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.lesson-hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.lesson-hero h1 {
  font-size: 26px;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.lesson-hero-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.lesson-hero-progress .progress {
  flex: 1;
  height: 6px;
}

.lesson-content-card {
  padding: 12px 24px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 400px;
  animation: tab-fade-in 0.18s ease;
}

@keyframes tab-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Lesson timer */
.lesson-timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-tint);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.lesson-timer svg {
  opacity: 0.7;
}

/* Completion pulse */
@keyframes complete-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70%  { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.btn-success:not(:disabled) {
  animation: complete-pulse 1.2s ease-out 1;
}

/* Floating XP gain */
.xp-float {
  position: fixed;
  bottom: 80px;
  right: 28px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  pointer-events: none;
  z-index: 9999;
  animation: xp-float-up 1.8s ease-out forwards;
}

@keyframes xp-float-up {
  0%   { opacity: 0; transform: translateY(16px) scale(0.8); }
  20%  { opacity: 1; transform: translateY(0) scale(1.05); }
  60%  { opacity: 1; transform: translateY(-8px) scale(1); }
  100% { opacity: 0; transform: translateY(-32px) scale(0.9); }
}

.video-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.video-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-tint);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-bottom: 22px;
}

.video-meta-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.video-wrapper .lesson-video {
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: 0;
}

.lesson-video {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 22px;
  display: grid;
  place-items: center;
}

.lesson-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.video-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.2), transparent 60%);
}

.video-play {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--primary);
  font-size: 24px;
  z-index: 1;
  margin-bottom: 12px;
  box-shadow: var(--shadow-lg);
  transition: transform 0.12s;
}

.video-placeholder:hover .video-play {
  transform: scale(1.06);
}

.video-placeholder strong {
  position: relative;
  z-index: 1;
  font-size: 16px;
}

.video-placeholder small {
  position: relative;
  z-index: 1;
  opacity: 0.86;
}

/* Theory header */
.theory-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.theory-reading-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-tint);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

/* Markdown */
.markdown {
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--text-soft);
  max-width: 72ch;
}

.markdown h2 {
  font-size: 24px;
  margin: 32px 0 14px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.markdown h2:first-child {
  margin-top: 0;
}

.markdown h3 {
  font-size: 18px;
  margin: 24px 0 10px;
  color: var(--text);
}

.markdown p {
  margin-bottom: 12px;
}

.markdown ul,
.markdown ol {
  padding-left: 22px;
  margin-bottom: 14px;
}

.markdown li {
  margin-bottom: 6px;
}

.markdown code {
  padding: 2px 6px;
  background: var(--surface-soft);
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--primary-strong);
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

.markdown pre {
  padding: 18px 20px;
  background: #060e1e;
  border: 1px solid var(--line);
  color: #8ecfff;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.65;
  margin: 16px 0;
}

.markdown pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.markdown strong {
  color: var(--text);
  font-weight: 700;
}

.markdown h1 {
  font-size: 28px;
  margin: 4px 0 12px;
  color: var(--text);
  letter-spacing: -0.02em;
  font-weight: 800;
}

.markdown h4 {
  font-size: 15px;
  margin: 18px 0 8px;
  color: var(--text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.markdown hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}

.markdown a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.markdown a:hover {
  opacity: 0.8;
}

.markdown em {
  font-style: italic;
  color: var(--text-soft);
}

.markdown u {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.markdown blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--primary-tint);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  color: var(--text);
}

/* Callout boxes */
.md-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.md-callout-info  { background: var(--primary-tint); border-color: var(--primary); }
.md-callout-tip   { background: #f0fdf4; border-color: #22c55e; }
.md-callout-warning { background: #fffbeb; border-color: #f59e0b; }
.md-callout-error { background: #fef2f2; border-color: #ef4444; }
.md-callout-note  { background: #f8fafc; border-color: var(--line); }
.md-callout-success { background: #f0fdf4; border-color: #22c55e; }

@media (prefers-color-scheme: dark) {
  .md-callout-tip, .md-callout-success { background: rgba(34,197,94,0.1); border-color: #22c55e; color: #d1fae5; }
  .md-callout-warning { background: rgba(245,158,11,0.1); border-color: #f59e0b; color: #fef3c7; }
  .md-callout-error { background: rgba(239,68,68,0.1); border-color: #ef4444; color: #fee2e2; }
  .md-callout-note  { background: var(--surface-soft); }
  .md-callout-info  { color: #bfdbfe; }
}

[data-theme="dark"] .md-callout-tip,
[data-theme="dark"] .md-callout-success { background: rgba(34,197,94,0.12); border-color: #22c55e; color: #d1fae5; }
[data-theme="dark"] .md-callout-warning { background: rgba(245,158,11,0.12); border-color: #f59e0b; color: #fef3c7; }
[data-theme="dark"] .md-callout-error   { background: rgba(239,68,68,0.12);  border-color: #ef4444; color: #fee2e2; }
[data-theme="dark"] .md-callout-note    { background: var(--surface-soft); color: var(--text-soft); }
[data-theme="dark"] .md-callout-info    { color: #bfdbfe; }
[data-theme="dark"] .md-callout         { color: var(--text); }

.md-callout-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.md-callout-body {
  flex: 1;
  min-width: 0;
}

.md-callout-body > *:last-child { margin-bottom: 0; }
.md-callout-body p { margin-bottom: 6px; }

/* ── Mentor Hero ────────────────────────────────────────────── */
.hero-mentor {
  position: relative;
  padding: 80px 36px 70px;
  overflow: hidden;
}

.hero-mentor::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 0%, rgba(37,99,235,0.22), transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(56,189,248,0.14), transparent 55%);
  z-index: 0;
  pointer-events: none;
}

.hero-mentor-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-mentor-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-tint);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: 100px;
  padding: 4px 14px;
  margin-bottom: 20px;
}

.hero-mentor h1 {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-mentor .lead {
  font-size: 18px;
  color: var(--text-soft);
  line-height: 1.6;
  margin-bottom: 32px;
}

.hero-mentor-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.mentor-stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.mentor-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.mentor-stat-accent {
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  border-color: transparent;
}

.mentor-stat-accent .mentor-stat-num,
.mentor-stat-accent .mentor-stat-label {
  color: #fff;
}

.mentor-stat-num {
  font-size: 32px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 6px;
}

.mentor-stat-label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 860px) {
  .hero-mentor-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero-mentor {
    text-align: center;
  }
  .hero-cta {
    justify-content: center;
  }
}

/* ── Mentor About Section ───────────────────────────────────── */
.mentor-about-layout {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  align-items: start;
}

.mentor-about-avatar-col {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.mentor-avatar-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  align-self: center;
}

.mentor-avatar {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 900;
  z-index: 1;
}

.mentor-avatar-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  opacity: 0.25;
}

.mentor-name-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mentor-name-block strong {
  font-size: 20px;
  font-weight: 800;
}

.mentor-name-block span {
  font-size: 13px;
  color: var(--muted);
}

.mentor-socials {
  width: 100%;
}

.mentor-about-text-col h2 {
  margin-bottom: 16px;
}

.mentor-about-text-col p {
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 16px;
}

.mentor-creds {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mentor-cred {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--text-soft);
}

.mentor-cred-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Mentor chips ───────────────────────────────────────────── */
.mentor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.mentor-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

@media (max-width: 860px) {
  .mentor-about-layout {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .mentor-about-avatar-col {
    align-items: center;
  }
  .mentor-cred {
    justify-content: center;
  }
}

/* ── Student Results ────────────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.result-card-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.result-emoji {
  font-size: 28px;
  width: 52px;
  height: 52px;
  background: var(--primary-tint);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.result-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.result-meta strong {
  font-size: 16px;
  font-weight: 700;
}

.result-story {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.6;
  text-align: center;
}

.result-numbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.result-num-item {
  background: var(--surface-soft);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}

.result-num-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
  line-height: 1.1;
}

.result-num-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.result-num-sep { display: none; }

.results-summary {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 32px;
  background: var(--surface-soft);
  border-radius: 20px;
  flex-wrap: wrap;
}

.results-summary-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.results-summary-item strong {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
}

.results-summary-item span {
  font-size: 13px;
  color: var(--muted);
}

/* ── Tools Section ──────────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  transition: transform 0.15s, border-color 0.15s;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.tool-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.tool-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.tool-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.tools-also {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.tools-also p {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.7;
}

/* ── Reviews source badge ───────────────────────────────────── */
.review-source {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

/* ── Mentor photo ───────────────────────────────────────────── */
.mentor-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  z-index: 1;
}

/* ── Hero checks ────────────────────────────────────────────── */
.hero-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}

.hero-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.5;
}

.hero-check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(37,99,235,0.12);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Process steps ──────────────────────────────────────────── */
.process-steps {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.process-step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 24px 0;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.15s;
}

.process-step:last-child {
  border-bottom: none;
}

.process-step:hover {
  background: none;
}

.process-step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

.process-step-body {
  flex: 1;
}

.process-step-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.process-step-desc {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.6;
}

/* Tables */
.md-table-wrap {
  overflow-x: auto;
  margin: 18px 0;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

.md-table th,
.md-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.md-table th {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* First and last th rounded corners */
.md-table thead tr th:first-child { border-radius: 9px 0 0 0; }
.md-table thead tr th:last-child  { border-radius: 0 9px 0 0; }

.md-table tr:last-child td { border-bottom: none; }
.md-table tbody tr:hover td { background: var(--primary-tint); }

.key-points {
  margin-top: 20px;
  padding: 18px;
  background: var(--primary-tint);
  border-radius: 12px;
  border-left: 3px solid var(--primary);
}

.key-points strong {
  display: block;
  font-size: 13px;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.key-points ul {
  margin: 0;
  padding-left: 20px;
}

.key-points li {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.55;
}

.lesson-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 24px;
  margin-top: 32px;
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
  background: var(--surface);
  z-index: 10;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

.lesson-actions .btn {
  flex: 0 0 auto;
}

/* Lesson aside (right column) */
.aside-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.aside-card h4 {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
}

.lesson-mini-list {
  display: grid;
  gap: 4px;
}

.lesson-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
  width: 100%;
}

.lesson-mini:hover:not(:disabled) {
  background: var(--surface-soft);
}

.lesson-mini.active {
  background: var(--primary-tint);
}

.lesson-mini:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lesson-mini-status {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  flex: 0 0 auto;
}

.lesson-mini.completed .lesson-mini-status {
  background: var(--success);
  color: #fff;
}

.lesson-mini.active .lesson-mini-status {
  background: var(--primary);
  color: #fff;
}

.lesson-mini-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.lesson-mini-text strong {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lesson-mini-text small {
  font-size: 11px;
  color: var(--muted);
}

/* =========================================================================
   ПРАКТИКА
   ========================================================================= */

.practice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.assignment-card {
  padding: 20px;
  background: linear-gradient(135deg, var(--primary-tint), var(--accent-soft));
  border: 1px solid var(--primary-soft);
  border-radius: var(--radius);
}

.assignment-scenario {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.55;
}

.assignment-task {
  font-size: 15px;
  line-height: 1.55;
  font-weight: 600;
  color: var(--text);
}

.rubric {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(37, 99, 235, 0.15);
}

.rubric-title {
  font-size: 11px;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.rubric ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-soft);
}

.rubric li {
  margin-bottom: 4px;
}

.practice-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
}

.practice-status.draft {
  background: var(--warning-soft);
  color: #fbbf24;
}

.practice-status.review {
  background: var(--primary-tint);
  color: var(--primary);
}

.practice-status.accepted {
  background: var(--success-soft);
  color: #4ade80;
}

.feedback-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.feedback-card h4 {
  margin-bottom: 8px;
}

.feedback-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
}

.feedback-mentor {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.feedback-mentor small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

/* Steps - стейтус практики */
.steps-list {
  display: grid;
  gap: 8px;
}

.step-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.12s, background 0.12s;
}

.step-row.done {
  background: var(--success-soft);
  border-color: rgba(34, 197, 94, 0.28);
}

.step-row-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  flex: 0 0 auto;
}

.step-row.done .step-row-num {
  background: var(--success);
  color: #fff;
}

.step-row-text strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 2px;
}

.step-row-text small {
  font-size: 12px;
  color: var(--muted);
}

/* =========================================================================
   ТЕСТЫ
   ========================================================================= */

.test-card {
  padding: 28px;
}

.test-question {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-soft);
}

.test-question:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.test-q-num {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.test-question h3 {
  font-size: 17px;
  margin-bottom: 14px;
  line-height: 1.4;
}

.test-options {
  display: grid;
  gap: 8px;
}

.test-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.test-option:hover {
  background: var(--surface-soft);
  border-color: var(--primary-soft);
}

.test-option.selected {
  background: var(--primary-tint);
  border-color: var(--primary);
}

.test-option.correct {
  background: var(--success-soft);
  border-color: rgba(34, 197, 94, 0.3);
}

.test-option.wrong {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.3);
}

.test-option-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  flex: 0 0 auto;
  margin-top: 1px;
}

.test-option.selected .test-option-mark {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.test-option.correct .test-option-mark {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.test-option.wrong .test-option-mark {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.test-option-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
}

.test-explanation {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--primary-tint);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.55;
}

.test-explanation strong {
  color: var(--primary);
  font-weight: 700;
}

.test-result {
  text-align: center;
  padding: 32px;
}

.test-result-score {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 8px;
}

.test-result-score.passed {
  color: var(--success);
}

.test-result-score.failed {
  color: var(--danger);
}

.test-result-status {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 18px;
}

.test-result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* =========================================================================
   ЧЕК-ЛИСТЫ И ПЕСОЧНИЦА
   ========================================================================= */

.checklist-card {
  padding: 22px 24px;
}

.checklist-progress {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.checklist-progress small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.checklist-items {
  display: grid;
  gap: 8px;
}

.bug-form {
  padding: 24px;
  display: grid;
  gap: 14px;
}

.bug-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.bug-preview {
  margin-top: 10px;
  padding: 16px;
  border-radius: var(--radius);
  background: #060e1e;
  border: 1px solid var(--line);
  color: #8ecfff;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.bug-preview strong {
  color: #fbbf24;
}

/* =========================================================================
   АЧИВКИ / ЛИДЕРБОРД / СЕРТИФИКАТЫ
   ========================================================================= */

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.achievement {
  position: relative;
  padding: 22px 18px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.15s, box-shadow 0.15s;
}

.achievement:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.achievement.unlocked {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.14), var(--surface));
  border-color: rgba(245, 158, 11, 0.3);
}

.achievement.locked {
  opacity: 0.55;
  filter: grayscale(0.6);
}

.achievement-emoji {
  font-size: 40px;
  margin-bottom: 10px;
}

.achievement strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.achievement small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.achievement-xp {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}

/* Лидерборд */
.leaderboard {
  padding: 0;
  overflow: hidden;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.12s;
}

.leaderboard-row:hover {
  background: var(--surface-soft);
}

.leaderboard-row:last-child {
  border-bottom: 0;
}

.leaderboard-row.you {
  background: var(--primary-tint);
}

.leaderboard-row.you:hover {
  background: var(--primary-soft);
}

.leaderboard-rank {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
}

.leaderboard-row.gold .leaderboard-rank {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.leaderboard-row.silver .leaderboard-rank {
  background: linear-gradient(135deg, #d1d5db, #9ca3af);
  color: #fff;
}

.leaderboard-row.bronze .leaderboard-rank {
  background: linear-gradient(135deg, #fb923c, #ea580c);
  color: #fff;
}

.leaderboard-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.leaderboard-user .name strong {
  display: block;
  font-size: 14px;
}

.leaderboard-user .name small {
  color: var(--muted);
  font-size: 12px;
}

.leaderboard-stat {
  text-align: right;
}

.leaderboard-stat strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
}

.leaderboard-stat small {
  color: var(--muted);
  font-size: 11px;
}


/* =========================================================================
   Q&A И РАСПИСАНИЕ
   ========================================================================= */

/* Q&A — старые классы (для совместимости с глобальным Q&A ментора) */
.qa-list {
  display: grid;
  gap: 12px;
}

.qa-item {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

[data-theme="dark"] .qa-item {
  background: var(--surface);
  border-color: rgba(255,255,255,0.12);
}

.qa-question {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.qa-author {
  flex: 1;
  display: grid;
}

.qa-author strong { font-size: 13px; }
.qa-author small  { color: var(--muted); font-size: 11px; }

.qa-text {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
}

.qa-answer {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--surface-soft);
  border-radius: 10px;
  border-left: 3px solid var(--primary);
}

.qa-answer-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.qa-answer-head .badge { margin-left: auto; }
.qa-answer-text { font-size: 14px; line-height: 1.55; color: var(--text-soft); }

/* Q&A — новый тред-вид (в уроке) */
.qa-tab {
  display: grid;
  gap: 20px;
}

.qa-ask-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.qa-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
}

.qa-thread-list {
  display: grid;
  gap: 14px;
}

.qa-thread {
  display: grid;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.qa-thread.answered {
  border-color: rgba(34, 197, 94, 0.25);
}

.qa-thread.pending {
  border-color: rgba(245, 158, 11, 0.25);
}

/* Пузырь вопроса */
.qa-bubble {
  padding: 14px 16px;
}

.qa-bubble.mentor {
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
}

.qa-bubble-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.qa-bubble-meta .muted {
  font-size: 11px;
  font-weight: 400;
}

.avatar.sm {
  width: 26px;
  height: 26px;
  font-size: 10px;
  font-weight: 700;
}

.mentor-avatar {
  background: linear-gradient(135deg, var(--purple), var(--primary));
}

.qa-bubble-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
  padding-left: 34px; /* отступ под аватар */
}

.qa-bubble.mentor .qa-bubble-text {
  color: var(--text);
}

/* "Набирает ответ" */
.qa-awaiting {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-soft);
  border-top: 1px solid var(--line-soft);
  font-style: italic;
}

.qa-awaiting-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warning);
  animation: pulse-dot 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

/* Schedule */
.schedule-list {
  display: grid;
  gap: 10px;
}

.schedule-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.schedule-date {
  text-align: center;
  padding: 6px;
  border-radius: 10px;
  background: var(--primary-tint);
  color: var(--primary);
}

.schedule-date strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
}

.schedule-date small {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.schedule-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.schedule-text .badge {
  align-self: flex-start;
  width: fit-content;
}

.schedule-text strong {
  display: block;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-text small {
  color: var(--muted);
  font-size: 12px;
}

/* =========================================================================
   КАБИНЕТ МЕНТОРА
   ========================================================================= */

.mentor-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.7fr);
  gap: 16px;
  align-items: start;
}

.stats-modules-card {
  min-width: 0;
}

.stats-module-list {
  display: grid;
  gap: 12px;
  padding: 2px 0;
}

.stats-module-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
}

.stats-module-emoji {
  font-size: 20px;
}

.stats-module-title {
  margin-bottom: 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.stats-module-meta {
  min-width: 74px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.stats-module-pct {
  min-width: 40px;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.stats-week-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 0 4px;
}

.stats-week-day {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stats-week-bar {
  width: 100%;
  border-radius: 4px;
  transition: height 0.3s;
}

.stats-week-day span {
  color: var(--muted);
  font-size: 10px;
}

.stats-week-day span.today {
  color: var(--primary);
  font-weight: 800;
}

.stats-caption {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.mentor-stat {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.mentor-stat-head {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.mentor-stat-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.mentor-stat-foot {
  font-size: 12px;
  color: var(--muted);
}

.students-table {
  padding: 0;
  overflow: hidden;
}

.students-row {
  display: grid;
  grid-template-columns: 2fr 72px 2fr 72px 100px;
  gap: 0;
  padding: 7px 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}

.students-row > * {
  min-width: 0;
  overflow: hidden;
  padding: 0 8px;
}

/* прогресс — центр */
.students-row > div:nth-child(2) {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* плашка % — компактная */
.students-row > div:nth-child(2) .badge {
  font-size: 11px;
  height: 20px;
  padding: 0 8px;
  min-width: 38px;
  text-align: center;
  justify-content: center;
}

/* заголовки */
.students-row.head > div:nth-child(2),
.students-row.head > div:nth-child(4) {
  text-align: center;
}

.students-row.head > div:nth-child(5) {
  text-align: right;
}

/* стрик — по центру */
.students-row > div:nth-child(4) {
  text-align: center;
  font-size: 12px;
}

/* кнопка — вправо */
.students-row > div:nth-child(5) {
  display: flex;
  justify-content: flex-end;
}

.students-row:hover:not(.head) {
  background: var(--surface-soft);
}

.students-row:last-child {
  border-bottom: 0;
}

.students-row.head {
  background: var(--surface-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 800;
  padding: 7px 16px;
}

.students-row .progress {
  width: 100%;
  height: 6px;
}

/* имя студента */
.students-row > div:nth-child(1) strong {
  font-size: 13px;
  display: block;
}

/* Review page — новая очередь */
.review-page {
  display: grid;
  gap: 14px;
}

.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 16px 20px;
}

.review-header-stats {
  display: flex;
  gap: 28px;
}

.review-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-stat-num {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

.review-stat.warn .review-stat-num {
  color: var(--warning);
}

.review-stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.review-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Очередь ревью — список */
.review-queue {
  display: grid;
  gap: 8px;
}

.rq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.12s;
}

.rq-item.open {
  border-color: var(--primary);
}

.rq-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.1s;
}

.rq-item-row:hover {
  background: var(--surface-tint);
}

.rq-item-info {
  flex: 1;
  min-width: 0;
}

.rq-item-info strong {
  display: block;
  font-size: 14px;
}

.rq-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.rq-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.rq-chevron {
  color: var(--muted);
  transition: transform 0.15s;
}

.rq-item.open .rq-chevron {
  transform: rotate(90deg);
}

/* Развёрнутый блок */
.rq-expanded {
  border-top: 1px solid var(--line);
  padding: 20px 18px;
  display: grid;
  gap: 16px;
  animation: tab-fade-in 0.16s ease;
}

.rq-answer {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.rq-answer-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}

.rq-answer-text {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-soft);
  white-space: pre-wrap;
}

.rq-actions {
  display: grid;
  gap: 12px;
}

.rq-grade-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rq-btns {
  display: flex;
  gap: 10px;
}

.rq-accepted-block {
  padding: 4px 0;
}

/* Конструктор уроков */
.builder-page {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.builder-sidebar {
  padding: 0;
  overflow: hidden;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.builder-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.builder-module-list {
  padding: 8px 0;
}

.builder-module {
  padding-bottom: 4px;
}

.builder-module-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.builder-lesson-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 18px 9px 32px;
  font-size: 13px;
  color: var(--text-soft);
  transition: background 0.1s, color 0.1s;
  border: none;
  background: none;
  cursor: pointer;
  user-select: none;
}

.chip-link {
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 11px;
  padding: 3px 10px;
  min-height: 28px;
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  transition: background 0.1s;
}

.chip-link:hover {
  background: var(--primary-tint);
  border-color: var(--primary);
}

.builder-lesson-row:hover {
  background: var(--surface-tint);
  color: var(--text);
}

.builder-lesson-row.has-edits {
  color: var(--warning);
}

.builder-lesson-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-tint);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.builder-lesson-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-lesson-chips {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.chip {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-tint);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.4;
}

.chip-warn {
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.3);
  background: var(--warning-soft);
}

.builder-arrow {
  color: var(--muted);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.1s;
}

.builder-lesson-row:hover .builder-arrow {
  opacity: 1;
}

.builder-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: var(--text-soft);
}

/* Редактор урока */
.lesson-editor {
  display: grid;
  gap: 14px;
}

.lesson-editor-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.lesson-editor-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
}

.editor-unsaved-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  flex-shrink: 0;
}

.editor-form {
  display: grid;
  gap: 16px;
}

/* Theory split editor */
.editor-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: 500px;
}

.editor-write,
.editor-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor-write-head,
.editor-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
}

/* Panel headers (new style) */
.editor-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}

.editor-panel-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Markdown toolbar */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 5px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: none;
  flex-wrap: wrap;
  gap: 2px;
}

.editor-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  flex-shrink: 0;
}

.editor-toolbar-btn svg {
  pointer-events: none;
}

.editor-toolbar-btn:hover {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--text);
}

.editor-toolbar-btn:active {
  background: var(--primary-tint);
  border-color: rgba(99, 133, 255, 0.4);
  color: var(--primary);
}

.editor-toolbar-sep {
  width: 1px;
  height: 16px;
  background: var(--line);
  margin: 0 4px;
  flex-shrink: 0;
}

.editor-textarea {
  flex: 1;
  min-height: 420px;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", "Courier New", monospace;
  font-size: 13.5px;
  line-height: 1.8;
  resize: vertical;
  border-radius: 0 0 8px 8px;
  border-top: none;
  padding: 16px 18px;
  tab-size: 2;
}

.editor-textarea-compact {
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.65;
  min-height: 110px;
  border-radius: 0 0 8px 8px;
  border-top: none;
  padding: 12px 14px;
}

.editor-write-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 8px 8px;
  gap: 8px;
}

.editor-word-count {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.editor-read-time {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}

.editor-preview {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.editor-preview-body {
  flex: 1;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.75;
}

/* =========================================================================
   ACCESS TABLE (mentor plan management)
   ========================================================================= */

.access-table {
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

.access-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  gap: 0;
  padding: 7px 16px;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}

.access-row > * {
  min-width: 0;
  overflow: hidden;
  padding: 0 8px;
}

.access-row > div:last-child {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow: hidden;
}

.access-row > div:last-child .btn {
  flex-shrink: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.access-row:hover:not(.access-head) {
  background: var(--surface-soft);
}

.access-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  padding: 6px 16px;
  background: var(--surface-soft);
}

@media (max-width: 640px) {
  .chip-link {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 12px;
  }

  .access-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px;
  }
  .access-row > div:nth-child(3) { display: none; }
  .access-row > div:last-child {
    grid-column: 1 / -1;
    flex-wrap: wrap;
  }
  .access-head { display: none; }
}

/* =========================================================================
   TEST BUILDER
   ========================================================================= */

.test-builder {
  display: grid;
  gap: 14px;
}

.test-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--surface-soft);
  border: 2px dashed var(--line);
  border-radius: 12px;
  text-align: center;
  gap: 4px;
  color: var(--muted);
}

.test-empty strong { font-size: 14px; color: var(--text-soft); }
.test-empty small  { font-size: 12px; }

.tq-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.tq-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.tq-num {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

.tq-type-group {
  display: flex;
  gap: 3px;
  flex: 1;
}

.tq-type-btn {
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}

.tq-type-btn.active {
  background: var(--primary-tint);
  border-color: rgba(99, 133, 255, 0.4);
  color: var(--primary);
}

.tq-type-btn:hover:not(.active) {
  background: var(--surface);
  color: var(--text-soft);
}

.tq-del-btn {
  color: var(--muted);
  opacity: 0.6;
  transition: opacity 0.12s, color 0.12s;
}

.tq-del-btn:hover { opacity: 1; color: var(--danger, #f87171); }

.tq-text-input {
  display: block;
  width: 100%;
  margin: 12px 14px 0;
  width: calc(100% - 28px);
  font-weight: 600;
  font-size: 13.5px;
}

.tq-options {
  display: grid;
  gap: 6px;
  padding: 10px 14px 14px;
}

.tq-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tq-correct-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.12s;
}

.tq-correct-btn.active { color: var(--success); }
.tq-correct-btn:hover  { color: var(--text); }

.tq-opt-input {
  flex: 1;
  font-size: 13px;
}

.tq-del-opt-btn {
  color: var(--muted);
  opacity: 0.5;
  transition: opacity 0.12s, color 0.12s;
}

.tq-del-opt-btn:hover { opacity: 1; color: var(--danger, #f87171); }

.tq-add-opt-btn {
  margin-top: 2px;
  align-self: flex-start;
  font-size: 12px;
  color: var(--muted);
  gap: 5px;
  display: flex;
  align-items: center;
}

.tq-add-opt-btn:hover { color: var(--primary); }

.tq-free-hint {
  padding: 10px 14px 14px;
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
}

.tq-add-q-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed var(--line);
  background: transparent;
  padding: 12px;
  font-size: 13px;
  color: var(--muted);
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.tq-add-q-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-tint);
}

/* Rubric editor */
.rubric-editor {
  display: grid;
  gap: 6px;
}

.rubric-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rubric-bullet {
  color: var(--primary);
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
}

.rubric-input {
  flex: 1;
  font-size: 13px;
}

.rubric-del {
  color: var(--muted);
  opacity: 0.5;
  transition: opacity 0.12s, color 0.12s;
}

.rubric-del:hover { opacity: 1; color: var(--danger, #f87171); }

.rubric-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  padding: 6px 4px;
  margin-top: 2px;
}

.rubric-add-btn:hover { color: var(--primary); }

/* Label hints */
.label-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}

/* Shared icon-button */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}

.btn-icon:hover {
  background: var(--surface-soft);
}

/* =========================================================================
   CHECKLIST EDITOR
   ========================================================================= */

.cl-editor {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.cl-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cl-bullet {
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.cl-item-input {
  flex: 1;
  font-size: 13.5px;
}

.cl-del-btn {
  color: var(--muted);
  opacity: 0.5;
  transition: opacity 0.12s, color 0.12s;
}
.cl-del-btn:hover { opacity: 1; color: var(--danger); }

.cl-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  padding: 6px 4px;
}
.cl-add-btn:hover { color: var(--primary); }

.cl-preview {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.cl-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-soft);
}

/* =========================================================================
   MATERIALS EDITOR
   ========================================================================= */

.mat-editor {
  display: grid;
  gap: 10px;
}

.mat-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.12s;
}

.mat-row:focus-within { border-color: var(--primary); }

.mat-type-select {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.mat-type-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, border-color 0.1s;
  opacity: 0.45;
}

.mat-type-btn.active {
  opacity: 1;
  background: var(--primary-tint);
  border-color: rgba(99, 133, 255, 0.35);
}

.mat-type-btn:hover:not(.active) {
  opacity: 0.8;
  background: var(--surface-soft);
}

.mat-fields {
  flex: 1;
  display: grid;
  gap: 6px;
}

.mat-url-input {
  font-size: 12.5px;
  color: var(--muted);
}

.mat-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed var(--line);
  background: transparent;
  padding: 12px;
  font-size: 13px;
  color: var(--muted);
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.mat-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-tint);
}

/* =========================================================================
   THEME TOGGLE BUTTON
   ========================================================================= */

.theme-toggle-btn {
  transition: transform 0.2s;
}
.theme-toggle-btn:hover { transform: rotate(20deg); }

/* Light theme specific overrides for elements that need adjustments */
[data-theme="light"] .sidebar { border-right-color: var(--line); }
[data-theme="light"] .topbar  { border-bottom-color: var(--line); }
[data-theme="light"] .card    { box-shadow: var(--shadow-xs); }
[data-theme="light"] .editor-textarea { background: #fafbfd; }
[data-theme="light"] .editor-panel-head { background: var(--surface-soft); }
[data-theme="light"] .input   { background: #fff; }
[data-theme="light"] .select  { background: #fff; }
[data-theme="light"] .textarea { background: #fff; }
[data-theme="light"] body { background: var(--bg); }

/* =========================================================================
   TOAST
   ========================================================================= */

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 260px;
  max-width: 440px;
  padding: 13px 18px;
  background: var(--primary);
  border: none;
  color: #fff;
  border-radius: 40px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(.34,1.56,.64,1), opacity 0.18s;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 14px;
  flex: 0 0 auto;
  color: #fff;
}

.toast.success {
  background: var(--success);
  color: #fff;
}

.toast.error {
  background: var(--danger);
  color: #fff;
}

.toast.info {
  background: var(--primary);
  color: #fff;
}

.toast.warn,
.toast.warning {
  background: var(--warning);
  color: #fff;
}

/* =========================================================================
   MODAL
   ========================================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.18s ease;
}

.modal {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* =========================================================================
   EMPTY STATE
   ========================================================================= */

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state .emoji {
  font-size: 36px;
  opacity: 0.6;
  margin-bottom: 6px;
}

.empty-state strong {
  color: var(--text);
  font-size: 16px;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */

@media (max-width: 1100px) {
  .dashboard-grid,
  .practice-grid,
  .lesson-page,
  .catalog-grid,
  .features-grid,
  .testimonial-grid,
  .pricing-grid,
  .program-grid,
  .reviews-grid,
  .mentor-overview,
  .builder-page,
  .editor-split {
    grid-template-columns: 1fr;
  }

  .lesson-aside,
  .catalog-aside,
  .builder-sidebar {
    position: static;
    max-height: none;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.18s;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 49;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
  }

  .topbar-search {
    display: none;
  }

  .public-nav {
    padding: 14px 18px;
    flex-wrap: wrap;
  }

  .public-nav-links {
    display: none;
  }

  .hero {
    padding: 50px 20px 40px;
  }

  .section {
    padding: 50px 20px;
  }

  .features-grid,
  .testimonial-grid,
  .pricing-grid,
  .reviews-grid {
    grid-template-columns: 1fr;
  }

  .program-grid {
    grid-template-columns: 1fr;
  }

  .cineskope-layout {
    grid-template-columns: 1fr;
  }

  .cdiag-services {
    grid-template-columns: repeat(2, 1fr);
  }

  .bug-form-row {
    grid-template-columns: 1fr;
  }

  .students-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .students-row.head {
    display: none;
  }

  .leaderboard-row {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px 14px;
  }

  .leaderboard-rank {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .auth-form {
    padding: 32px 22px;
  }
}

/* =========================================================================
   MOBILE TOPBAR BURGER
   ========================================================================= */

.menu-burger {
  display: none;
}

@media (max-width: 720px) {
  .menu-burger {
    display: grid;
  }
  .topbar {
    padding: 12px 16px;
  }
}

/* =========================================================================
   PAGE HEADER
   ========================================================================= */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.page-header h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
}
.page-header p {
  margin: 0;
  font-size: 13px;
}

/* =========================================================================
   KANBAN BOARD
   ========================================================================= */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: start;
}

.tracker-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.tracker-summary-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tracker-summary-main strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.tracker-summary-main span:last-child {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.tracker-kicker {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tracker-summary-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.tracker-deliverable {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tracker-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.tracker-filters > .muted {
  font-size: 13px;
}

.tracker-filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tracker-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.tracker-detail-main,
.tracker-submit-panel {
  min-width: 0;
}

.tracker-detail-main {
  display: grid;
  gap: 10px;
}

.tracker-detail-tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.tracker-detail h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
}

.tracker-detail p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tracker-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.6fr);
  gap: 10px;
}

.tracker-detail-grid > div,
.tracker-submit-panel {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.tracker-detail-grid strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.tracker-detail-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tracker-criteria {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tracker-criteria span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 7px;
  background: var(--primary-tint);
  color: var(--text-soft);
  font-size: 12px;
}

.tracker-submit-panel {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.tracker-answer {
  min-height: 132px;
  resize: vertical;
}

.tracker-submit-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.tracker-submit-state {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.tracker-submit-state.success {
  color: var(--success);
}

.kanban-col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.kanban-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.kanban-col-hint {
  margin-top: 3px;
  padding-left: 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.kanban-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-tasks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  min-height: 120px;
}

.kanban-empty {
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}

.kanban-card {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  user-select: none;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.kanban-card:hover {
  border-color: var(--primary-soft);
  box-shadow: var(--shadow-xs);
}
.kanban-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.kanban-card-head {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.kanban-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.kanban-card-feature {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.kanban-card-desc {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

.kanban-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.kanban-move-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.kanban-move-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-soft);
}
.kanban-move-fwd {
  background: var(--primary-tint);
  border-color: var(--primary-soft);
  color: var(--primary);
}
.kanban-move-fwd:hover {
  background: var(--primary);
  color: #fff;
}

@media (max-width: 1100px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 720px) {
  .tracker-summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .tracker-summary-meta {
    justify-content: flex-start;
  }
  .tracker-filters {
    align-items: flex-start;
    flex-direction: column;
  }
  .tracker-detail,
  .tracker-detail-grid {
    grid-template-columns: 1fr;
  }
  .tracker-submit-actions {
    justify-content: stretch;
  }
  .tracker-submit-actions .btn {
    flex: 1 1 auto;
  }
  .kanban-board {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .kanban-col {
    flex: 0 0 260px;
    min-width: 260px;
    scroll-snap-align: start;
  }
}

/* =========================================================================
   ANALYTICS TABLE
   ========================================================================= */
.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.analytics-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.analytics-table tbody tr {
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.12s;
}
.analytics-table tbody tr:hover {
  background: var(--surface-soft);
}
.analytics-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.stats-table-card {
  overflow-x: auto;
}

.stats-lesson-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
}

.stats-lesson-emoji {
  font-size: 16px;
}

.stats-lesson-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.stats-lesson-module {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.stats-status {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.stats-status.done {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--success);
  font-weight: 800;
}

.stats-strong {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.stats-score {
  font-weight: 800;
}

.stats-mini-progress {
  width: 80px;
  height: 5px;
}

/* Badge variants */
.badge-ok {
  background: #22c55e;
  color: #fff;
}
.badge-danger {
  background: var(--danger);
  color: #fff;
}

/* ── Auth form error ────────────────────────────────────────── */
.form-error {
  display: none;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  width: 100%;
  box-sizing: border-box;
}

/* ── Materials grid ─────────────────────────────────────────── */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.material-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.material-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  transform: translateY(-2px);
  border-color: var(--primary-soft);
}

.material-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.material-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-tint);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.material-type-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.material-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
  color: var(--fg);
}

.material-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.material-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.material-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

/* ── Filter chips ───────────────────────────────────────────── */
.filter-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.filter-chip:hover {
  border-color: var(--primary-soft);
  color: var(--primary);
}
.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Clock icon inline ──────────────────────────────────────── */
.icon-clock { display:inline-flex; vertical-align:middle; }

/* =========================================================================
   BOTTOM NAVIGATION (mobile only)
   ========================================================================= */

.bottom-nav {
  display: none;
}

@media (max-width: 720px) {
  /* Push content up so it isn't hidden behind bottom-nav */
  .content {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Sidebar should cover full height including area behind bottom-nav */
  .sidebar {
    height: 100dvh;
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: var(--bg-card);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -2px 12px rgba(0,0,0,.08);
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    transition: color .15s;
    position: relative;
    min-height: 56px;
  }

  .bottom-nav-item:active {
    transform: scale(0.92);
  }

  .bottom-nav-item.active {
    color: var(--primary);
  }

  .bottom-nav-item.active svg {
    filter: drop-shadow(0 0 4px color-mix(in srgb, var(--primary) 40%, transparent));
  }

  .bottom-nav-label {
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0.01em;
  }

  .bottom-nav-badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 14px);
    background: var(--danger, #ef4444);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 1.5px solid var(--bg-card);
  }

  /* Hide sidebar toggle in topbar on mobile (we have burger now) */
  .sidebar-toggle {
    display: none;
  }

  /* Dashboard grid → single column */
  .dashboard-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* Mentor overview stats */
  .mentor-overview {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Auth page: hide decorative aside */
  .auth-page aside {
    display: none;
  }
  .auth-page {
    grid-template-columns: 1fr;
  }

  /* Student card row → stacked */
  .student-card-row {
    grid-template-columns: 1fr;
  }

  /* Materials grid → single column */
  .materials-grid {
    grid-template-columns: 1fr;
  }

  /* Lesson list compact */
  .lesson-row {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
  }

  /* Module cards → single column */
  .modules-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   NPS MODAL
   ============================================================================= */

.nps-scores {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
}

.nps-score-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: grid;
  place-items: center;
}

.nps-score-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-tint);
}

.nps-score-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 35%, transparent);
}

/* Цвет кнопок NPS по значению: 1-6 красный, 7-8 оранжевый, 9-10 зелёный */
.nps-score-btn[data-nps-score="1"].active,
.nps-score-btn[data-nps-score="2"].active,
.nps-score-btn[data-nps-score="3"].active,
.nps-score-btn[data-nps-score="4"].active,
.nps-score-btn[data-nps-score="5"].active,
.nps-score-btn[data-nps-score="6"].active {
  background: #ef4444;
  border-color: #ef4444;
}

.nps-score-btn[data-nps-score="7"].active,
.nps-score-btn[data-nps-score="8"].active {
  background: #f59e0b;
  border-color: #f59e0b;
}

.nps-score-btn[data-nps-score="9"].active,
.nps-score-btn[data-nps-score="10"].active {
  background: #22c55e;
  border-color: #22c55e;
}

/* =============================================================================
   REFERRAL BLOCK (profile page)
   ============================================================================= */

.referral-card {
  background: linear-gradient(135deg, var(--primary-tint) 0%, color-mix(in srgb, var(--accent) 10%, var(--surface)) 100%);
  border: 1.5px solid var(--primary-soft);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  gap: 12px;
}

.referral-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.referral-link-input {
  flex: 1;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--mono);
  color: var(--text);
  cursor: text;
}

/* =============================================================================
   PUSH NOTIFICATIONS TOGGLE
   ============================================================================= */

.push-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.push-toggle-row:last-child {
  border-bottom: none;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-track {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(20px);
}

/* =============================================================================
   CTA BANNER — new structure (.cta-inner, .cta-label, .cta-actions)
   ============================================================================= */

.cta-banner {
  padding: 80px 36px;
  text-align: center;
  background: linear-gradient(135deg, #1d55d4, #0ea5e9);
  color: #fff;
}

.cta-inner {
  max-width: 620px;
  margin: 0 auto;
}

.cta-label {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.30);
  border-radius: var(--radius-pill);
  padding: 5px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.cta-banner h2 {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.cta-banner p {
  font-size: 17px;
  opacity: 0.88;
  margin-bottom: 32px;
  line-height: 1.55;
}

.cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* CTA white / ghost-white buttons */
.btn-white {
  background: #fff;
  color: #1d55d4;
  border: none;
  font-weight: 700;
}

.btn-white:hover {
  background: #f0f4ff;
  color: #163fa8;
}

.btn-ghost-white {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.55);
  font-weight: 600;
}

.btn-ghost-white:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.8);
  text-decoration: underline;
}

/* =============================================================================
   TOOLS TAGS — tag cloud
   ============================================================================= */

.tools-tags {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
}

.tools-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: center;
}

.tools-tag {
  display: inline-flex;
  align-items: center;
  background: var(--surface-soft);
  border: 1.5px solid var(--line);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.tools-tag:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
  background: var(--primary-tint);
}

/* =============================================================================
   ABOUT — new layout (.about-inner, .about-top, .about-stats-row)
   ============================================================================= */

.about-inner {
  max-width: 900px;
  margin: 0 auto;
}

.about-top {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: flex-start;
  margin-bottom: 48px;
}

@media (max-width: 640px) {
  .about-top {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

.about-photo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.about-photo-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.about-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--primary-soft);
}

.about-photo-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
}

.about-photo-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}

.about-photo-role {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.4;
}

.about-photo-companies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 2px;
}

.about-company-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-tint);
  color: var(--primary-strong);
  border: 1px solid var(--primary-soft);
}

.about-bio-col h2 {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.about-lead {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 12px;
}

.about-text {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 12px;
}

.about-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-top: 32px;
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 700px) {
  .about-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 400px) {
  .about-stats-row {
    grid-template-columns: 1fr 1fr;
  }
}

.about-stat {
  background: var(--surface-soft);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
  transition: border-color 0.18s, background 0.18s;
}

.about-stat:hover {
  border-color: var(--primary-soft);
  background: var(--primary-tint);
}

.about-stat-val {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 800;
  color: var(--primary-strong);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.about-stat-label {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 4px;
  line-height: 1.3;
}

/* =============================================================================
   REVIEWS MANAGER — mentor panel
   ============================================================================= */

.reviews-manager {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.reviews-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.reviews-manager-head h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.reviews-manager-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-manager-item {
  background: var(--surface-soft);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.18s;
}

.review-manager-item:hover {
  border-color: var(--line-soft);
}

.review-manager-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.review-manager-meta strong {
  font-size: 14px;
  font-weight: 700;
}

.review-manager-meta small {
  font-size: 12px;
  color: var(--text-soft);
  display: block;
}

.review-manager-text {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.review-manager-actions {
  display: flex;
  gap: 8px;
}

/* =============================================================================
   OFERTA PAGE — договор-оферта
   ============================================================================= */

.oferta-page {
  max-width: 800px;
  margin: 0 auto;
}

.oferta-inner {
  max-width: 720px;
  margin: 0 auto;
}

.oferta-title {
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.3;
}

.oferta-meta {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-soft);
}

.oferta-section {
  margin-bottom: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line-soft);
}

.oferta-section:last-child {
  border-bottom: none;
}

.oferta-section h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}

.oferta-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-strong);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 20px 0 10px;
}

.oferta-section p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-soft);
  margin-bottom: 10px;
}

.oferta-section ul,
.oferta-section ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

.oferta-section li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.oferta-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
}

.oferta-table th {
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--line);
}

.oferta-table td {
  padding: 10px 14px;
  border: 1px solid var(--line);
  color: var(--text-soft);
  vertical-align: top;
}

.oferta-table tr:hover td {
  background: var(--surface-soft);
}

.oferta-req-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.oferta-req-grid > div {
  background: var(--surface-soft);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.oferta-req-grid span {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.oferta-req-grid strong {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.oferta-req-grid a {
  color: var(--primary-strong);
}

/* ── Print styles for oferta page ── */
@media print {
  nav, .public-nav, .public-footer, #print-oferta-btn, [data-route] {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .oferta-inner {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .oferta-section {
    page-break-inside: avoid;
  }
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 11px;
    color: #555;
  }
}

/* ── Bug report mentor review ── */
.rq-bug-block {
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.rq-bug-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.rq-bug-pre {
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0;
  color: var(--text);
}
