/* ========================================
   LEARN MODULE — bobkov.cc courses
   ======================================== */

/* --- Auth pages --- */
.learn-auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #f5f5f7);
  padding: 20px;
}
.learn-auth-container {
  width: 100%;
  max-width: 420px;
}
.learn-auth-card {
  background: var(--card, #fff);
  border: 1px solid var(--card-border, rgba(0,0,0,0.06));
  border-radius: 20px;
  padding: 40px 32px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.learn-auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-bottom: 32px;
  justify-content: center;
}
.learn-logo-icon { flex-shrink: 0; }
.learn-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1, #1d1d1f);
}
.learn-logo-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  color: #fff;
  margin-left: 6px;
}
.learn-auth-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
  color: var(--text-1);
}
.learn-auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-3, rgba(0,0,0,0.5));
}

/* --- Form elements --- */
.learn-form { display: flex; flex-direction: column; gap: 16px; }
.learn-field { display: flex; flex-direction: column; gap: 6px; }
.learn-field-row { display: flex; justify-content: space-between; align-items: center; }
.learn-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2, rgba(0,0,0,0.65));
}
.learn-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--card-border, rgba(0,0,0,0.08));
  border-radius: 10px;
  font-size: 15px;
  background: var(--bg, #f5f5f7);
  color: var(--text-1);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.learn-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.learn-hint {
  font-size: 12px;
  color: var(--text-3);
}
.learn-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
}
.learn-link {
  font-size: 14px;
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}
.learn-link:hover { text-decoration: underline; }

/* --- Buttons --- */
.learn-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
  text-decoration: none;
  white-space: nowrap;
}
.learn-btn--primary {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.learn-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
}
.learn-btn--ghost {
  background: var(--card, #fff);
  color: var(--text-1);
  border: 1px solid var(--card-border);
}
.learn-btn--ghost:hover { background: var(--bg); }
.learn-btn--full { width: 100%; justify-content: center; }
.learn-btn--lg { padding: 14px 28px; font-size: 16px; }
.learn-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Alerts --- */
.learn-toast {
  position: fixed;
  top: 72px;
  right: 24px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  animation: toast-in 0.5s cubic-bezier(0.32, 0.72, 0, 1) both, toast-out 0.4s cubic-bezier(0.32, 0.72, 0, 1) 3.5s both;
  pointer-events: none;
}
.learn-toast--success { background: rgba(52,199,89,0.15); color: #34c759; border: 1px solid rgba(52,199,89,0.2); }
.learn-toast--error { background: rgba(255,59,48,0.15); color: #ff3b30; border: 1px solid rgba(255,59,48,0.2); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(0.96); }
}

/* --- Nav --- */
.learn-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--glass, rgba(255,255,255,0.72));
  border-bottom: 1px solid var(--card-border, rgba(0,0,0,0.06));
  height: 64px;
}
.learn-nav__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}
.learn-nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  color: var(--text-1);
}
.learn-nav__links {
  display: flex;
  gap: 8px;
  margin-left: 16px;
}
.learn-nav__link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: all 0.2s;
}
.learn-nav__link:hover { background: var(--bg); color: var(--text-1); }
.learn-nav__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.learn-xp-badge, .learn-streak-badge, .learn-level-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: var(--card);
  border: 1px solid var(--card-border);
}
.learn-nav__theme {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.learn-nav__theme:hover { color: var(--text-1); background: var(--bg); }
.learn-nav__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}
.learn-nav__dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 8px;
  min-width: 160px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.learn-nav__dropdown a {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-1);
  text-decoration: none;
  border-radius: 8px;
}
.learn-nav__dropdown a:hover { background: var(--bg); }
.learn-lang { position: relative; }
.learn-nav__lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--card);
  cursor: pointer;
  transition: background 0.2s;
}
.learn-nav__lang-btn:hover { background: var(--bg); }
.learn-nav__dropdown a.active { font-weight: 700; }
.learn-nav__dropdown a { display: flex; align-items: center; gap: 8px; }
.learn-nav__user { position: relative; }

/* --- Main --- */
.learn-main {
  padding-top: 80px;
  min-height: 100vh;
  background: var(--bg);
}

/* --- Dashboard --- */
.dash { max-width: 1200px; margin: 0 auto; padding: 0 24px 60px; display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.dash__main { min-width: 0; }
.dash__side { display: flex; flex-direction: column; gap: 16px; }

/* Hero */
.dash-hero { border-radius: 20px; background: linear-gradient(135deg, #4338ca, #6d28d9, #7c3aed); margin-bottom: 16px; overflow: hidden; }
.dash-hero__inner { padding: 32px; border-radius: 20px; position: relative; }
.dash-hero__inner::before { content: ""; position: absolute; top: -40%; right: -10%; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%); pointer-events: none; }
.dash-hero__inner::after { content: ""; position: absolute; bottom: -30%; left: 10%; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%); pointer-events: none; }
.dash-hero__avatar { width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,0.2); color: #fff; font-weight: 800; font-size: 26px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 3px solid rgba(255,255,255,0.3); margin-bottom: 16px; position: relative; z-index: 1; }
.dash-hero__info { position: relative; z-index: 1; margin-bottom: 20px; }
.dash-hero__info h1 { font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -0.02em; margin-bottom: 4px; }
.dash-hero__info p { font-size: 14px; color: rgba(255,255,255,0.6); margin-bottom: 4px; }
.dash-hero__role { display: inline-block; font-size: 12px; color: rgba(255,255,255,0.5); font-weight: 500; }
.dash-hero__pills { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.dash-hero__pill { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 14px; min-width: 120px; }
.dash-hero__pill--xp { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.2); color: #22c55e; }
.dash-hero__pill--streak { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.2); color: #ef4444; }
.dash-hero__pill--level { background: rgba(250,204,21,0.15); border: 1px solid rgba(250,204,21,0.2); color: #facc15; }
.dash-hero__pill-label { display: block; font-size: 11px; opacity: 0.8; font-weight: 500; margin-bottom: 2px; }
.dash-hero__pill strong { font-size: 20px; font-weight: 800; color: #fff; }

/* Level Progress */
.dash-level { padding: 18px 24px; border-radius: 16px; background: var(--card); border: 1px solid var(--card-border); margin-bottom: 20px; }
.dash-level__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dash-level__title { font-size: 15px; font-weight: 700; color: var(--text-1); }
.dash-level__info { font-size: 13px; color: var(--text-3); font-weight: 500; }
.dash-level__bar { display: flex; align-items: center; gap: 12px; }
.dash-level__label { font-size: 13px; font-weight: 700; color: #6366f1; white-space: nowrap; }
.dash-level__track { flex: 1; height: 10px; background: var(--card-border); border-radius: 5px; overflow: hidden; }
.dash-level__fill { height: 100%; background: linear-gradient(90deg, #6366f1, #8b5cf6); border-radius: 5px; transition: width 0.8s cubic-bezier(0.32, 0.72, 0, 1); }

/* Section title */
.dash-section { font-size: 17px; font-weight: 700; color: var(--text-1); margin: 0 0 14px; }

/* Course cards — grid */
.dash-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 32px; }
.dash-course-card { border-radius: 16px; background: var(--card); border: 1px solid var(--card-border); overflow: hidden; display: flex; flex-direction: column; gap: 0; transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1); text-decoration: none; color: inherit; cursor: pointer; }
.dash-course-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,0.1); }
.dash-course-card__head { padding: 18px 18px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.dash-course-card__head h3 { font-size: 14px; font-weight: 700; color: var(--text-1); line-height: 1.3; }
.dash-course-card__pct { font-size: 13px; font-weight: 700; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }
.dash-course-card__img { padding: 14px 18px; display: flex; align-items: center; justify-content: center; flex: 1; }
.dash-course-card__img img { width: 88px; height: 88px; object-fit: cover; border-radius: 14px; }
.dash-course-card__bar { margin: 8px 18px 0; height: 5px; background: var(--card-border); border-radius: 3px; overflow: hidden; }
.dash-course-card__bar-fill { height: 100%; border-radius: 3px; transition: width 0.6s cubic-bezier(0.32, 0.72, 0, 1); }
.dash-course-card__btn { display: block; margin: 16px 18px 18px; padding: 11px; border-radius: 10px; text-align: center; color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; transition: opacity 0.2s; }
.dash-course-card__btn:hover { opacity: 0.85; }

/* Recommended */
.dash-recs { display: flex; flex-direction: column; gap: 12px; }
.dash-rec { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 16px; background: var(--card); border: 1px solid var(--card-border); transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1); }
.dash-rec:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.06); }
.dash-rec__img { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.dash-rec__img img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.dash-rec__info { flex: 1; min-width: 0; }
.dash-rec__info h4 { font-size: 14px; font-weight: 600; color: var(--text-1); margin-bottom: 6px; }
.dash-rec__tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-rec__meta { font-size: 11px; color: var(--text-3); font-weight: 500; }
.dash-rec__diff { font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: 6px; white-space: nowrap; }
.dash-rec__diff--beginner { background: rgba(34,197,94,0.12); color: #22c55e; }
.dash-rec__diff--intermediate { background: rgba(245,158,11,0.12); color: #f59e0b; }
.dash-rec__diff--advanced { background: rgba(239,68,68,0.12); color: #ef4444; }
.dash-rec__btn { padding: 8px 18px; border-radius: 10px; background: #6366f1; color: #fff; font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; flex-shrink: 0; transition: background 0.2s; }
.dash-rec__btn:hover { background: #4f46e5; }

/* === Sidebar === */
.dash-widget { padding: 20px; border-radius: 16px; background: var(--card); border: 1px solid var(--card-border); }
.dash-widget__title { font-size: 14px; font-weight: 700; color: var(--text-1); display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.dash-widget__empty { font-size: 13px; color: var(--text-3); }

/* Heatmap */
.dash-heatmap { display: flex; flex-direction: column; gap: 8px; }
.dash-heatmap__grid { display: grid; grid-template-rows: repeat(7, 14px); grid-auto-flow: column; grid-auto-columns: 14px; gap: 3px; }
.dash-heatmap__cell { width: 14px; height: 14px; border-radius: 3px; transition: transform 0.15s; }
.dash-heatmap__cell:hover { transform: scale(1.3); z-index: 2; }
.dash-heatmap__cell--empty { visibility: hidden; }
.dash-heatmap__cell--0 { background: var(--card-border); }
.dash-heatmap__cell--1 { background: rgba(34,197,94,0.3); }
.dash-heatmap__cell--2 { background: rgba(34,197,94,0.6); }
.dash-heatmap__cell--3 { background: #22c55e; }
.dash-heatmap__footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.dash-heatmap__footer > span { font-size: 11px; color: var(--text-3); }
.dash-heatmap__legend { display: flex; align-items: center; gap: 3px; }
.dash-heatmap__legend span { font-size: 10px; color: var(--text-3); }
.dash-heatmap__legend .dash-heatmap__cell { width: 10px; height: 10px; }
.dash-heatmap__legend .dash-heatmap__cell:hover { transform: none; }

/* Achievements — circular */
.dash-achievements { display: flex; gap: 6px; flex-wrap: wrap; }
.dash-ach { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 0 0 calc(20% - 5px); text-align: center; }
.dash-ach__circle { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: transform 0.2s; }
.dash-ach__circle:hover { transform: scale(1.1); }
.dash-ach span { font-size: 9px; font-weight: 600; color: var(--text-3); line-height: 1.2; }

/* Leaderboard */
.dash-leaders { display: flex; flex-direction: column; gap: 4px; }
.dash-leader { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; transition: background 0.15s; }
.dash-leader:hover { background: var(--bg); }
.dash-leader--me { background: rgba(99,102,241,0.08); }
.dash-leader__rank { width: 22px; height: 22px; border-radius: 6px; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--text-3); flex-shrink: 0; }
.dash-leader__rank--gold { background: rgba(245,158,11,0.15); color: #f59e0b; }
.dash-leader__rank--silver { background: rgba(148,163,184,0.15); color: #94a3b8; }
.dash-leader__rank--bronze { background: rgba(217,119,6,0.15); color: #d97706; }
.dash-leader__avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; font-weight: 700; font-size: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dash-leader__name { flex: 1; font-size: 13px; font-weight: 600; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-leader__xp { font-size: 11px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.dash-leader__lvl { font-size: 11px; font-weight: 600; color: var(--text-3); white-space: nowrap; }

/* --- Progress bar (used in course items inside learn views) --- */
.learn-progress-bar__track {
  height: 8px;
  background: var(--card-border);
  border-radius: 4px;
  overflow: hidden;
}
.learn-progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #8b5cf6);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.32, 0.72, 0, 1);
}
.learn-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  margin: 32px 0 16px;
}

/* --- Courses Hero --- */
.courses-hero {
  position: relative;
  overflow: hidden;
  padding: 160px 0 100px;
  background: var(--bg);
}
.courses-hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.courses-hero__floating {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.courses-hero__code {
  position: absolute;
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--card, #fff);
  border: 1px solid var(--card-border, rgba(0,0,0,0.06));
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 13px;
  color: var(--text-3);
  opacity: 0.45;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  animation: code-float 20s ease-in-out infinite alternate;
}
.courses-hero__code--1 { top: 18%; left: 8%; animation-delay: 0s; }
.courses-hero__code--2 { top: 30%; right: 10%; animation-delay: -3s; }
.courses-hero__code--3 { bottom: 28%; left: 5%; animation-delay: -6s; }
.courses-hero__code--4 { top: 15%; right: 18%; animation-delay: -9s; }
.courses-hero__code--5 { bottom: 20%; right: 6%; animation-delay: -12s; }
.courses-hero__code--6 { bottom: 35%; left: 18%; animation-delay: -15s; }
@keyframes code-float {
  0% { transform: translateY(0) rotate(-1deg); }
  25% { transform: translateY(-12px) rotate(1deg); }
  50% { transform: translateY(4px) rotate(-0.5deg); }
  75% { transform: translateY(-8px) rotate(0.5deg); }
  100% { transform: translateY(2px) rotate(-1deg); }
}
.courses-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(139,92,246,0.1));
  color: #8b5cf6;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  border: 1px solid rgba(139,92,246,0.15);
}
.courses-hero__title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text-1, #1d1d1f);
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-1, #1d1d1f) 0%, #3b82f6 50%, #8b5cf6 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 6s ease-in-out infinite alternate;
}
@keyframes gradient-shift {
  0% { background-position: 0% center; }
  100% { background-position: 100% center; }
}
.courses-hero__subtitle {
  font-size: 1.15rem;
  color: var(--text-2);
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.6;
}
.courses-hero__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Stats bar --- */
.courses-stats-bar {
  position: relative;
  z-index: 3;
  margin-top: -32px;
  padding-bottom: 32px;
}
.courses-stats-bar__inner {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 28px;
  border-radius: 20px;
  background: var(--card, #fff);
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}
.courses-stats-bar__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}
.courses-stats-bar__item + .courses-stats-bar__item {
  border-left: 1px solid var(--card-border);
}
.courses-stats-bar__num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-1);
}
.courses-stats-bar__label {
  font-size: 13px;
  color: var(--text-3);
}

/* --- Section titles --- */
.courses-section-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-1);
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.courses-section-subtitle {
  font-size: 16px;
  color: var(--text-2);
  text-align: center;
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.5;
}

/* --- Features --- */
.courses-features {
  padding: 80px 0;
}
.courses-features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}
.courses-feature-card {
  padding: 28px;
  border-radius: 20px;
  background: var(--card, #fff);
  border: 1px solid var(--card-border);
  transition: all 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.courses-feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.06);
}
.courses-feature-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.courses-feature-card__img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 12px;
  border-radius: 12px;
}
.courses-feature-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 8px;
}
.courses-feature-card p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.55;
}

/* --- Badges section --- */
.courses-badges-section {
  padding: 80px 0;
}
.courses-badges-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}
.courses-badges-grid > * {
  flex: 0 0 160px;
}
.courses-badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px;
  border-radius: 20px;
  background: var(--card, #fff);
  border: 1px solid var(--card-border);
  text-align: center;
  transition: all 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.courses-badge-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 40px rgba(245,158,11,0.1);
}
.courses-badge-card__img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.courses-badge-card:hover .courses-badge-card__img {
  transform: scale(1.1) rotate(5deg);
}
.courses-badge-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(249,115,22,0.1));
  color: #f59e0b;
}
.courses-badge-card__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
}
.courses-badge-card__desc {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}

/* --- CTA section --- */
.courses-cta-section {
  padding: 40px 0 100px;
}
.courses-cta-card {
  position: relative;
  text-align: center;
  padding: 56px 48px;
  border-radius: 28px;
  background: var(--card, #fff);
  border: 1px solid var(--card-border);
  overflow: hidden;
}
.courses-cta-card__glow {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,0.08), transparent 70%);
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.courses-cta-card h3 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-1);
  margin: 16px 0 8px;
  letter-spacing: -0.02em;
}
.courses-cta-card p {
  color: var(--text-2);
  margin-bottom: 28px;
  font-size: 16px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* --- FAQ --- */
.courses-faq-section {
  padding: 80px 0;
}
.courses-faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}
.courses-faq-item {
  border-radius: 16px;
  background: var(--card, #fff);
  border: 1px solid var(--card-border);
  overflow: hidden;
  transition: box-shadow 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.courses-faq-item[open] {
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.courses-faq-item__q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.courses-faq-item__q::-webkit-details-marker { display: none; }
.courses-faq-item__q i {
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}
.courses-faq-item[open] .courses-faq-item__q i {
  transform: rotate(180deg);
}
.courses-faq-item__a {
  padding: 0 24px 20px;
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.6;
}

/* --- Course cards (catalog) --- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.course-card {
  background: var(--card, #fff);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 28px;
  transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.08);
}
.course-card__illustration {
  display: flex;
  justify-content: center;
  margin: -28px -28px 16px;
  padding: 20px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(135deg, rgba(var(--course-color-rgb, 119,123,180), 0.06), transparent);
  overflow: hidden;
}
.course-card__illustration img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}
.course-card:hover .course-card__illustration img {
  transform: scale(1.06) translateY(-4px);
}
.course-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.course-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.course-card__badges { display: flex; gap: 6px; align-items: center; }
.course-card__lang {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.course-card__diff {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.course-card__diff--beginner { background: rgba(52,199,89,0.1); color: #34c759; }
.course-card__diff--intermediate { background: rgba(255,149,0,0.1); color: #ff9500; }
.course-card__diff--advanced { background: rgba(255,59,48,0.1); color: #ff3b30; }
.course-card__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.course-card__desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}
.course-card__meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 20px;
}
.course-card__meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.course-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
}
.course-card__students {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-3);
}

/* --- Course stats --- */
.course-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.course-stat {
  text-align: center;
  padding: 20px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
}
.course-stat__num {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-1);
  display: block;
}
.course-stat__label {
  font-size: 13px;
  color: var(--text-3);
}

/* --- Course Show Page — Hero --- */
.course-hero {
  position: relative;
  padding: 140px 0 72px;
  background: var(--bg);
  overflow: hidden;
}
.course-hero::before {
  content: "";
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, var(--course-color, #2563eb) 0%, transparent 70%);
  opacity: 0.06;
  pointer-events: none;
}
.course-hero__inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}
.course-hero__breadcrumb { margin-bottom: 28px; }
.course-hero__breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s;
}
.course-hero__breadcrumb a:hover { color: var(--text-1); }
.course-hero__badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.course-hero__lang {
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--course-color, #2563eb);
  color: #fff;
}
.course-hero__diff {
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}
.course-hero__diff--beginner { background: rgba(52,199,89,0.1); color: #34c759; }
.course-hero__diff--intermediate { background: rgba(255,149,0,0.1); color: #ff9500; }
.course-hero__diff--advanced { background: rgba(255,59,48,0.1); color: #ff3b30; }
.course-hero__meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--card, #fff);
  border: 1px solid var(--card-border, rgba(0,0,0,0.06));
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}
.course-hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-1);
  margin-bottom: 16px;
}
.course-hero__desc {
  font-size: 1.1rem;
  color: var(--text-2);
  line-height: 1.65;
  max-width: 600px;
  margin: 0 auto 36px;
}
.course-hero__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Course Show Page — Sections --- */
.course-section {
  padding: 72px 0;
}
.course-section--alt {
  background: var(--card, #fff);
  border-top: 1px solid var(--card-border, rgba(0,0,0,0.06));
  border-bottom: 1px solid var(--card-border, rgba(0,0,0,0.06));
}
.course-section__inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}
.course-section__title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-1);
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.course-section__subtitle {
  font-size: 15px;
  color: var(--text-3);
  text-align: center;
  margin-bottom: 36px;
}

/* --- Course Show — What You'll Learn --- */
.course-learn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.course-learn-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--bg, #f5f5f7);
  border: 1px solid var(--card-border, rgba(0,0,0,0.06));
  font-size: 15px;
  color: var(--text-1);
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.course-learn-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

/* --- Course Show — Course Includes --- */
.course-includes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.course-includes-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--card, #fff);
  border: 1px solid var(--card-border, rgba(0,0,0,0.06));
  font-size: 15px;
  font-weight: 500;
  color: var(--text-1);
  transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.course-includes-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.04);
}

/* --- Course Show — Requirements --- */
.course-req {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--card, #fff);
  border: 1px solid var(--card-border, rgba(0,0,0,0.06));
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.6;
}
.course-req p { margin: 0; }

/* --- Course Show — FAQ --- */
.course-faq {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.course-faq__item {
  border-radius: 14px;
  background: var(--bg, #f5f5f7);
  border: 1px solid var(--card-border, rgba(0,0,0,0.06));
  overflow: hidden;
  transition: box-shadow 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.course-faq__item[open] {
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.course-faq__item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color 0.2s;
}
.course-faq__item summary::-webkit-details-marker { display: none; }
.course-faq__item summary::marker { display: none; }
.course-faq__item summary:hover { color: var(--course-color, #2563eb); }
.course-faq__answer {
  padding: 0 22px 20px;
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.65;
  animation: faq-open 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes faq-open {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Course Show — CTA --- */
.course-cta {
  text-align: center;
  padding: 56px 48px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(37,99,235,0.04), rgba(139,92,246,0.04));
  border: 1px solid var(--card-border, rgba(0,0,0,0.06));
  position: relative;
  overflow: hidden;
}
.course-cta::before {
  content: "";
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--course-color, #2563eb) 0%, transparent 70%);
  opacity: 0.04;
  pointer-events: none;
}
.course-cta h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-1);
  margin: 16px 0 8px;
  letter-spacing: -0.02em;
}
.course-cta p {
  font-size: 16px;
  color: var(--text-2);
  max-width: 480px;
  margin: 0 auto 28px;
  line-height: 1.5;
}

/* --- Curriculum --- */
.course-curriculum { display: flex; flex-direction: column; gap: 16px; }
.course-module-card {
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  overflow: hidden;
}
.course-module-card__header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
}
.course-module-card__num {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.course-module-card__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
}
.course-module-card__desc {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 4px;
}
.course-module-card__lessons {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--card-border);
}
.course-module-card__lessons li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px 12px 76px;
  font-size: 14px;
  color: var(--text-2);
  border-bottom: 1px solid var(--card-border);
}
.course-module-card__lessons li:last-child { border-bottom: none; }
.course-module-card__xp {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: #f59e0b;
}

/* --- Learn course view --- */
.learn-course-view__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px;
  margin-bottom: 24px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--card-border);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.learn-course-view__header h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-1);
}
.learn-course-view { max-width: 900px; margin: 0 auto; padding: 0 24px 60px; }
.learn-progress-ring {
  width: 64px;
  height: 64px;
  position: relative;
}
.learn-progress-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.learn-progress-ring span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
}

/* --- Modules in learn view --- */
.learn-modules { display: flex; flex-direction: column; gap: 20px; }
.learn-module {
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  overflow: hidden;
}
.learn-module__header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--card-border);
}
.learn-module__header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
}
.learn-module__num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.learn-module__progress { margin-left: auto; }
.learn-module__lessons { list-style: none; padding: 0; margin: 0; }
.learn-lesson-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  text-decoration: none;
  color: var(--text-1);
  border-bottom: 1px solid var(--card-border);
  transition: background 0.15s;
}
.learn-lesson-link:hover { background: var(--bg); }
.learn-lesson-link:last-child { border-bottom: none; }
.learn-lesson-link--done { opacity: 0.6; }
.learn-lesson-link__icon { flex-shrink: 0; color: var(--text-3); }
.learn-lesson-link__title { font-size: 14px; font-weight: 500; flex: 1; }
.learn-lesson-link__xp { font-size: 12px; font-weight: 600; color: #f59e0b; }

/* --- Lesson view --- */
.learn-lesson {
  display: flex;
  min-height: calc(100vh - 64px);
}
.learn-lesson__sidebar {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--card-border);
  background: var(--card);
  overflow-y: auto;
  position: fixed;
  top: 64px;
  bottom: 0;
  left: 0;
  z-index: 50;
}
.learn-lesson__sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
}
.learn-lesson__sidebar-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.learn-lesson__back {
  color: var(--text-3);
  display: flex;
  align-items: center;
}
.learn-lesson__nav { padding: 12px 0; }
.learn-lesson__nav-module { margin-bottom: 8px; }
.learn-lesson__nav-module-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  padding: 4px 20px;
  display: block;
}
.learn-lesson__nav-module ul { list-style: none; padding: 0; margin: 0; }
.learn-lesson__nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  transition: background 0.15s;
}
.learn-lesson__nav-item:hover { background: var(--bg); }
.learn-lesson__nav-item--active {
  background: rgba(37,99,235,0.08);
  color: #2563eb;
  font-weight: 600;
}
.learn-lesson__nav-item--done { color: var(--text-3); }

.learn-lesson__content {
  flex: 1;
  margin-left: 280px;
  padding: 32px 48px 60px;
  max-width: 900px;
}
.learn-lesson__sidebar-toggle {
  display: none;
  border: none;
  background: var(--card);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  color: var(--text-2);
  margin-bottom: 16px;
}
.learn-lesson__header { margin-bottom: 32px; }
.learn-lesson__type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}
.learn-lesson__type--theory { background: rgba(37,99,235,0.08); color: #2563eb; }
.learn-lesson__type--practice { background: rgba(52,199,89,0.08); color: #34c759; }
.learn-lesson__type--quiz { background: rgba(255,149,0,0.08); color: #ff9500; }
.learn-lesson__header h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.02em;
}
.learn-lesson__body { margin-bottom: 48px; }

/* --- Exercise --- */
.learn-exercise {
  margin-bottom: 32px;
  padding: 24px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
}
.learn-exercise__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.learn-exercise__header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.learn-exercise__header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.learn-exercise__diff {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.learn-exercise__diff--easy { background: rgba(52,199,89,0.1); color: #34c759; }
.learn-exercise__diff--medium { background: rgba(255,149,0,0.1); color: #ff9500; }
.learn-exercise__diff--hard { background: rgba(255,59,48,0.1); color: #ff3b30; }
.learn-exercise__instructions {
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}
.learn-exercise__expected {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 13px;
  color: var(--text-2);
}
.learn-exercise__expected code {
  font-family: ui-monospace, monospace;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--card-border);
}
.learn-exercise__editor {
  margin-bottom: 16px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
}
/* --- HTML Preview split --- */
.learn-exercise__editor-split {
  display: grid;
  grid-template-columns: 1fr 6px 1fr;
  gap: 0;
  margin-bottom: 16px;
}
.learn-exercise__editor-split .learn-exercise__editor {
  margin-bottom: 0;
  border-radius: 12px 0 0 12px;
}
.learn-exercise__preview {
  border: 1px solid var(--card-border, rgba(0,0,0,0.06));
  border-left: none;
  border-radius: 0 12px 12px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--card, #fff);
}
.learn-exercise__preview-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg, #f5f5f7);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3, rgba(0,0,0,0.5));
  border-bottom: 1px solid var(--card-border, rgba(0,0,0,0.06));
  letter-spacing: 0.02em;
}
.learn-exercise__preview-frame {
  flex: 1;
  width: 100%;
  min-height: 300px;
  border: none;
  background: #fff;
  border-radius: 0 0 12px 0;
}

/* --- Resizer handle --- */
.learn-exercise__resizer {
  width: 12px;
  margin: 0 -3px;
  cursor: col-resize;
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.learn-exercise__resizer::before {
  content: "";
  width: 4px;
  height: 40px;
  border-radius: 4px;
  background: var(--card-border, rgba(0,0,0,0.12));
  transition: background 0.2s, height 0.2s, width 0.2s;
}
.learn-exercise__resizer:hover::before {
  background: #2563eb;
  height: 56px;
  width: 5px;
}
.learn-exercise__editor-split--dragging {
  user-select: none;
  cursor: col-resize;
}
.learn-exercise__editor-split--dragging .learn-exercise__resizer::before {
  background: #2563eb;
  height: 100%;
  width: 3px;
  border-radius: 0;
}

/* --- Expand button --- */
.learn-exercise__expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--card-border, rgba(0,0,0,0.06));
  background: var(--card, #fff);
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.learn-exercise__expand:hover {
  background: var(--bg);
  color: var(--text-1);
}

/* --- Fullscreen expanded mode --- */
.learn-exercise--expanded {
  position: fixed;
  inset: 0;
  z-index: 1000;
  margin: 0;
  border-radius: 0;
  border: none;
  background: var(--bg, #f5f5f7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  animation: exercise-expand 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes exercise-expand {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.learn-exercise--expanded .learn-exercise__header {
  padding: 16px 24px;
  margin: 0;
  border-bottom: 1px solid var(--card-border);
  background: var(--card, #fff);
  flex-shrink: 0;
}
.learn-exercise--expanded .learn-exercise__instructions {
  padding: 0 24px;
  margin: 12px 0 8px;
  flex-shrink: 0;
  max-height: 80px;
  overflow-y: auto;
  font-size: 13px;
}
.learn-exercise--expanded .learn-exercise__editor-split {
  flex: 1;
  margin: 0;
  min-height: 0;
  border-radius: 0;
  grid-template-columns: 1fr 6px 1fr;
}
.learn-exercise--expanded .learn-exercise__editor-split .learn-exercise__editor {
  border-radius: 0;
  border: none;
  border-right: none;
}
.learn-exercise--expanded .learn-exercise__editor-split .learn-exercise__editor,
.learn-exercise--expanded .learn-exercise__editor-split .learn-exercise__preview {
  min-height: 0;
  height: 100%;
}
.learn-exercise--expanded .learn-exercise__preview {
  border-radius: 0;
  border: none;
  border-left: none;
}
.learn-exercise--expanded .learn-exercise__preview-frame {
  border-radius: 0;
  min-height: 0;
  flex: 1;
}
.learn-exercise--expanded .learn-exercise__editor {
  border-radius: 0;
  border: none;
  margin: 0;
}
.learn-exercise--expanded .learn-exercise__actions {
  padding: 10px 24px;
  margin: 0;
  border-top: 1px solid var(--card-border);
  background: var(--card, #fff);
  flex-shrink: 0;
}
.learn-exercise--expanded .learn-exercise__output {
  margin: 0 24px 8px;
  flex-shrink: 0;
  max-height: 120px;
  overflow-y: auto;
}
.learn-exercise--expanded .learn-exercise__hint {
  margin: 0 24px 8px;
  flex-shrink: 0;
}
.learn-exercise--expanded .learn-exercise__expected {
  margin: 0 24px 8px;
  flex-shrink: 0;
}
.learn-exercise--expanded .learn-exercise__passed {
  margin: 0 24px 8px;
  flex-shrink: 0;
}
.learn-exercise--expanded .learn-exercise__resizer {
  display: block;
}
.learn-exercise--expanded > .learn-exercise__editor {
  flex: 1;
  margin: 0;
  border-radius: 0;
  border: none;
  min-height: 0;
}
.learn-exercise--expanded .learn-exercise__expand i[data-lucide="maximize-2"] {
  display: none;
}
.learn-exercise--expanded .learn-exercise__expand::before {
  content: "✕";
  font-size: 14px;
}

.learn-exercise__actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.learn-exercise__output {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  margin-bottom: 12px;
}
.learn-exercise__output-header {
  padding: 8px 14px;
  background: var(--bg);
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--card-border);
}
.learn-exercise__output pre {
  padding: 14px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  color: var(--text-1);
  white-space: pre-wrap;
  overflow-x: auto;
  margin: 0;
}
.learn-output-status { text-transform: uppercase; letter-spacing: 0.05em; }
.status--running { color: #2563eb; }
.status--success { color: var(--text-2); }
.status--error { color: #ff3b30; }
.status--passed { color: #34c759; }
.status--failed { color: #ff9500; }

.learn-exercise__hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255,149,0,0.06);
  border: 1px solid rgba(255,149,0,0.12);
  font-size: 14px;
  color: var(--text-2);
}
.learn-exercise__passed {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(52,199,89,0.08);
  color: #34c759;
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
}

.learn-lesson__nav-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
}
.learn-lesson__done-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #34c759;
  font-weight: 600;
  font-size: 14px;
}

/* --- Leaderboard --- */
.learn-leaderboard {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px 60px;
}
.learn-leaderboard__header {
  margin-bottom: 24px;
}
.learn-leaderboard__header h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.learn-leaderboard__table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.learn-leaderboard__row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  transition: all 0.2s;
}
.learn-leaderboard__row--me {
  background: rgba(37,99,235,0.04);
  border-color: rgba(37,99,235,0.2);
}
.learn-leaderboard__row--top3 {
  background: rgba(245,158,11,0.04);
  border-color: rgba(245,158,11,0.15);
}
.learn-leaderboard__rank {
  width: 40px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-3);
}
.learn-leaderboard__user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.learn-leaderboard__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.learn-leaderboard__name { font-weight: 600; font-size: 15px; color: var(--text-1); }
.learn-leaderboard__level { font-size: 12px; color: var(--text-3); margin-left: 6px; }
.learn-leaderboard__stats {
  display: flex;
  gap: 16px;
}
.learn-leaderboard__xp, .learn-leaderboard__streak {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

/* --- Profile --- */
.prof { max-width: 1000px; margin: 0 auto; padding: 0 24px 60px; }

/* Hero */
.prof-hero { border-radius: 20px; background: linear-gradient(135deg, #2563eb, #4f46e5, #7c3aed); padding: 2px; margin-bottom: 24px; }
.prof-hero__inner { display: flex; align-items: center; gap: 24px; padding: 28px 32px; border-radius: 18px; background: linear-gradient(135deg, rgba(37,99,235,0.92), rgba(79,70,229,0.92), rgba(124,58,237,0.92)); }
.prof-hero__avatar { position: relative; width: 80px; height: 80px; flex-shrink: 0; }
.prof-hero__ring { position: absolute; inset: -10px; width: 100px; height: 100px; }
.prof-hero__avatar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,0.18); color: #fff; font-weight: 800; font-size: 28px; border: 3px solid rgba(255,255,255,0.25); }
.prof-hero__info h1 { font-size: 26px; font-weight: 800; color: #fff; letter-spacing: -0.02em; margin-bottom: 4px; }
.prof-hero__info p { font-size: 14px; color: rgba(255,255,255,0.65); }

/* Stat cards */
.prof-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 28px; }
.prof-stat { padding: 20px; border-radius: 16px; background: var(--card); border: 1px solid var(--card-border); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1); }
.prof-stat:hover { transform: translateY(-3px); }
.prof-stat--xp i { color: #f59e0b; }
.prof-stat--level i { color: #6366f1; }
.prof-stat--streak i { color: #ef4444; }
.prof-stat__num { font-size: 22px; font-weight: 800; color: var(--text-1); }
.prof-stat__label { font-size: 12px; font-weight: 500; color: var(--text-3); }
.prof-stat__sub { font-size: 11px; color: var(--text-3); opacity: 0.8; }
.prof-stat__level-info { flex: 1; width: 100%; }
.prof-stat__level-bar { width: 100%; height: 8px; background: var(--card-border); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.prof-stat__level-fill { height: 100%; background: linear-gradient(90deg, #2563eb, #8b5cf6); border-radius: 4px; transition: width 0.8s cubic-bezier(0.32, 0.72, 0, 1); }

/* Grid layout */
.prof__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.prof__left, .prof__right { min-width: 0; }
.prof-section { font-size: 17px; font-weight: 700; color: var(--text-1); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }

/* Badges */
.prof-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.prof-badge { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--card-border); text-align: center; transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1); }
.prof-badge:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.05); }
.prof-badge--locked { opacity: 0.45; filter: grayscale(0.5); }
.prof-badge--locked:hover { opacity: 0.55; transform: none; box-shadow: none; }
.prof-badge__icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.prof-badge--locked .prof-badge__icon { background: var(--card-border); color: var(--text-3); }
.prof-badge__name { font-size: 12px; font-weight: 600; color: var(--text-1); }
.prof-badge__desc { font-size: 10px; color: var(--text-3); line-height: 1.3; }

/* Course progress */
.prof-courses { display: flex; flex-direction: column; gap: 10px; }
.prof-course { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--card-border); transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1); }
.prof-course:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.05); }
.prof-course__img { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.prof-course__img img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.prof-course__info { flex: 1; min-width: 0; }
.prof-course__info h4 { font-size: 14px; font-weight: 600; color: var(--text-1); margin-bottom: 6px; }
.prof-course__bar { display: flex; align-items: center; gap: 10px; }
.prof-course__bar-track { flex: 1; height: 6px; background: var(--card-border); border-radius: 3px; overflow: hidden; }
.prof-course__bar-fill { height: 100%; border-radius: 3px; transition: width 0.6s cubic-bezier(0.32, 0.72, 0, 1); }
.prof-course__bar span { font-size: 12px; font-weight: 600; color: var(--text-3); flex-shrink: 0; }
.prof-course__cert { width: 32px; height: 32px; border-radius: 8px; background: rgba(34,197,94,0.1); color: #22c55e; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.2s; }
.prof-course__cert:hover { background: rgba(34,197,94,0.2); }

/* Mini statistics */
.prof-mini-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.prof-mini { padding: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--card-border); text-align: center; transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1); }
.prof-mini:hover { transform: translateY(-2px); }
.prof-mini__num { display: block; font-size: 24px; font-weight: 800; color: var(--text-1); margin-bottom: 2px; }
.prof-mini__label { font-size: 12px; color: var(--text-3); font-weight: 500; }

/* --- XP popup --- */
.xp-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  animation: xp-pop 2s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}
.xp-popup span {
  display: block;
  padding: 12px 28px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 8px 32px rgba(245,158,11,0.4);
}
@keyframes xp-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  40% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(0.9); }
}

/* --- Badge popup --- */
.badge-popup {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  animation: badge-slide 4s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}
.badge-popup span { font-size: 15px; font-weight: 700; color: var(--text-1); }
@keyframes badge-slide {
  0% { opacity: 0; transform: translateY(20px); }
  10% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* --- Certificate --- */
.cert-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #faf9f6 0%, #f0eeeb 40%, #e8e4df 100%);
  padding: 32px 16px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

.cert-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.cert-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.cert-btn--print {
  background: #1d1d1f;
  color: #fff;
}
.cert-btn--print:hover { background: #333; transform: translateY(-1px); }
.cert-btn--share {
  background: #fff;
  color: #1d1d1f;
  border: 1px solid #d1d1d6;
}
.cert-btn--share:hover { background: #f5f5f7; transform: translateY(-1px); }

.cert-page {
  width: 860px;
  max-width: 100%;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 40px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  padding: 12px;
}

.cert-border {
  border: 2px solid #c5a55a;
  border-radius: 2px;
  padding: 6px;
}

.cert-inner {
  border: 1px solid rgba(197,165,90,0.3);
  padding: 48px 56px;
}

/* Header */
.cert-header {
  text-align: center;
  margin-bottom: 8px;
}
.cert-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.cert-logo__text {
  font-size: 16px;
  font-weight: 700;
  color: #1d1d1f;
  letter-spacing: 0.02em;
}

/* Ornaments */
.cert-ornament {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
}
.cert-ornament span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c5a55a 20%, #c5a55a 80%, transparent);
}

/* Main */
.cert-main {
  text-align: center;
  padding: 8px 0 4px;
}
.cert-title {
  font-size: 28px;
  font-weight: 300;
  color: #c5a55a;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin: 0 0 20px;
  font-family: Georgia, "Times New Roman", serif;
}
.cert-subtitle {
  font-size: 13px;
  color: #86868b;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cert-student {
  font-size: 40px;
  font-weight: 800;
  color: #1d1d1f;
  margin: 12px 0 16px;
  letter-spacing: -0.01em;
  font-family: Georgia, "Times New Roman", serif;
}
.cert-course-label {
  font-size: 13px;
  color: #86868b;
  margin: 0 0 6px;
}
.cert-course {
  font-size: 22px;
  font-weight: 700;
  color: #1d1d1f;
  margin: 0 0 12px;
}
.cert-date-main {
  font-size: 13px;
  color: #86868b;
  margin: 0;
}

/* Stats */
.cert-stats {
  margin: 8px 0 4px;
}
.cert-stats__title {
  font-size: 11px;
  font-weight: 600;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: center;
  margin: 0 0 16px;
}
.cert-stats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.cert-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  background: #faf9f6;
  border-radius: 12px;
  border: 1px solid rgba(197,165,90,0.12);
}
.cert-stat svg { color: #c5a55a; }
.cert-stat__value {
  font-size: 24px;
  font-weight: 800;
  color: #1d1d1f;
  line-height: 1;
}
.cert-stat__label {
  font-size: 11px;
  color: #86868b;
  text-align: center;
  line-height: 1.3;
}

/* Curriculum */
.cert-curriculum {
  margin: 8px 0;
}
.cert-curriculum__title {
  font-size: 11px;
  font-weight: 600;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: center;
  margin: 0 0 12px;
}
.cert-curriculum__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cert-module {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #faf9f6;
  border-radius: 8px;
  border: 1px solid rgba(197,165,90,0.08);
}
.cert-module__num {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #c5a55a, #d4b96a);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}
.cert-module__name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
}
.cert-module__lessons {
  font-size: 12px;
  color: #86868b;
  white-space: nowrap;
}

/* Footer */
.cert-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 16px;
}
.cert-footer__col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cert-footer__col--center { align-items: center; }
.cert-footer__col--right { align-items: flex-end; }
.cert-footer__label {
  font-size: 10px;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cert-footer__value {
  font-size: 13px;
  font-weight: 600;
  color: #1d1d1f;
}
.cert-footer__mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.cert-verify {
  text-align: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(197,165,90,0.15);
}
.cert-verify__label {
  font-size: 10px;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cert-verify__link {
  font-size: 11px;
  color: #2563eb;
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, monospace;
  word-break: break-all;
}
.cert-verify__link:hover { text-decoration: underline; }

/* Certificate print */
@media print {
  .cert-body { background: #fff !important; padding: 0 !important; }
  .cert-page { box-shadow: none !important; width: 100% !important; padding: 8px !important; }
  .cert-stat { background: #f9f9f7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cert-module { background: #f9f9f7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cert-module__num { background: #c5a55a !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cert-border { border-color: #c5a55a !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Certificate mobile */
@media (max-width: 640px) {
  .cert-inner { padding: 32px 24px; }
  .cert-title { font-size: 20px; letter-spacing: 0.12em; }
  .cert-student { font-size: 28px; }
  .cert-course { font-size: 18px; }
  .cert-stats__grid { grid-template-columns: repeat(2, 1fr); }
  .cert-footer { flex-direction: column; gap: 12px; align-items: center; text-align: center; }
  .cert-footer__col, .cert-footer__col--right { align-items: center; }
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .learn-lesson__sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .learn-lesson__sidebar--open {
    transform: translateX(0);
  }
  .learn-lesson__content {
    margin-left: 0;
    padding: 24px 16px 60px;
  }
  .learn-lesson__sidebar-toggle { display: flex; }
  .course-stats { grid-template-columns: repeat(2, 1fr); }
  .dash { grid-template-columns: 1fr; }
  .dash__side { flex-direction: row; flex-wrap: wrap; }
  .dash-widget { flex: 1; min-width: 260px; }
  .dash-hero__inner { padding: 24px; }
  .dash-hero__pills { flex-direction: column; }
  .dash-hero__pill { min-width: unset; }
  .dash-hero__info h1 { font-size: 20px; }
  .dash-courses { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .dash-heatmap__grid { grid-auto-columns: 11px; gap: 2px; }
  .dash-heatmap__cell { width: 11px; height: 11px; }
  .dash-recs { grid-template-columns: 1fr; }
  .prof-hero__inner { flex-direction: column; text-align: center; }
  .prof-hero__avatar { margin: 0 auto; }
  .prof-stats { grid-template-columns: 1fr; }
  .prof__grid { grid-template-columns: 1fr; }
  .prof-badges { grid-template-columns: repeat(3, 1fr); }
  .prof-mini-stats { grid-template-columns: repeat(2, 1fr); }
  .learn-nav__links { display: none; }
  .course-grid { grid-template-columns: 1fr; }
  .courses-badges-grid > * { flex: 0 0 calc(50% - 8px); }
  .courses-hero { padding: 120px 0 60px; }
  .courses-hero__floating { display: none; }
  .courses-stats-bar__inner { flex-direction: column; align-items: center; gap: 16px; }
  .courses-stats-bar__item + .courses-stats-bar__item { border-left: none; border-top: 1px solid var(--card-border); padding-top: 12px; }
  .courses-features__grid { grid-template-columns: 1fr; }
  .courses-badges-grid { grid-template-columns: repeat(2, 1fr); }
  .courses-cta-card { padding: 36px 24px; }
  .course-hero { padding: 120px 0 48px; }
  .course-hero__desc { font-size: 1rem; }
  .course-section { padding: 48px 0; }
  .course-learn-grid { grid-template-columns: 1fr; }
  .course-includes-grid { grid-template-columns: 1fr; }
  .course-cta { padding: 36px 24px; }
  .course-module-card__lessons li { padding-left: 24px; }
  .learn-exercise__editor-split { grid-template-columns: 1fr; }
  .learn-exercise__resizer { display: none; }
  .learn-exercise__preview { border-left: 1px solid var(--card-border); border-radius: 12px; }
  .learn-exercise__editor-split .learn-exercise__editor { border-radius: 12px; }
  .learn-exercise__preview-frame { min-height: 200px; border-radius: 0 0 12px 12px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .courses-features__grid { grid-template-columns: repeat(2, 1fr); }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .courses-badges-grid > * { flex: 0 0 160px; }
}

/* --- Admin code textarea --- */
.form-control--code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 13px;
  tab-size: 2;
}
