:root {
  --bg:         #0f1117;
  --surface-1:  #1a1d27;
  --surface-2:  #1e2130;
  --surface-3:  #242740;
  --surface-4:  #2c3050;
  --accent:     #7c6af7;
  --accent-dim: rgba(124, 106, 247, 0.12);
  --accent-muted: rgba(124, 106, 247, 0.35);
  --text:       #e4e6f0;
  --text-muted: #8b8fa8;
  --text-dim:   #55596e;
  --border:     #2a2d40;
  --border-light: #333650;
  --radius:     6px;
  --sidebar-w:  268px;
  --header-h:   52px;
  --yellow:     #c9a84c;
  --yellow-bg:  rgba(201, 168, 76, 0.08);
  --yellow-border: rgba(201, 168, 76, 0.25);
}

[data-theme="light"] {
  --bg:         #f4f5fb;
  --surface-1:  #ebedf5;
  --surface-2:  #ffffff;
  --surface-3:  #f0f1f8;
  --surface-4:  #e5e7f2;
  --accent:     #6b58e8;
  --accent-dim: rgba(107, 88, 232, 0.10);
  --accent-muted: rgba(107, 88, 232, 0.28);
  --text:       #1a1d2e;
  --text-muted: #5a5e7a;
  --text-dim:   #9094b0;
  --border:     #d8daea;
  --border-light: #ccd0e2;
  --yellow:     #a07028;
  --yellow-bg:  rgba(160, 112, 40, 0.08);
  --yellow-border: rgba(160, 112, 40, 0.25);
}

.theme-transition *, .theme-transition *::before, .theme-transition *::after {
  transition: background-color 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.25s !important;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ─────────────────────────────────── */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  z-index: 200;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  height: 100%;
}
.logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.3px;
  flex-shrink: 0;
}
.logo span { color: var(--accent); }
.logo:hover { text-decoration: none; }

/* Search */
.search-wrap {
  flex: 1;
  max-width: 380px;
  position: relative;
}
#search-input {
  width: 100%;
  padding: 7px 32px 7px 34px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2355596e' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 11px center;
}
#search-input::placeholder { color: var(--text-dim); }
#search-input:focus { border-color: var(--accent-muted); }
#search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.search-shortcut {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-family: inherit;
  font-size: 11px;
  line-height: 1;
  color: var(--text-dim);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 2px 5px;
  pointer-events: none;
  transition: opacity 0.15s;
  user-select: none;
}
#search-input:focus ~ .search-shortcut,
#search-input:not(:placeholder-shown) ~ .search-shortcut { opacity: 0; }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  min-width: max(100%, 420px);
  max-width: min(560px, calc(100vw - 24px));
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  max-height: 460px;
  overflow-y: auto;
  z-index: 300;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.search-results[hidden] { display: none; }

.search-filters {
  display: flex;
  gap: 6px;
  padding: 9px 12px 8px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface-1);
  z-index: 1;
}
.search-filter-chip {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 11px;
  font-family: inherit;
  padding: 3px 10px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  white-space: nowrap;
  line-height: 1.5;
}
.search-filter-chip:hover { background: var(--surface-4); color: var(--text); }
.search-filter-chip.active {
  background: var(--accent-dim);
  border-color: var(--accent-muted);
  color: var(--accent);
}

.search-result {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--surface-3); }
.search-result-title { font-size: 14px; font-weight: 500; color: var(--text); }
.search-result-meta  { font-size: 12px; margin-top: 2px; }
.meta-class   { color: var(--text-dim); }
.meta-sep     { color: var(--text-dim); margin: 0 5px; font-size: 10px; vertical-align: 1px; }
.meta-section { color: var(--text-muted); }
.search-result-snippet {
  font-size: 12px; color: var(--text-dim); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-no-results {
  padding: 18px; color: var(--text-muted); font-size: 14px; text-align: center;
}
mark.sh {
  background: rgba(201, 168, 76, 0.32);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
  font-style: normal;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 5px 10px;
  flex-shrink: 0;
}
.menu-toggle:hover { color: var(--text); border-color: var(--border-light); }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 30px;
  height: 30px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.theme-toggle:hover { background: var(--surface-3); border-color: var(--border-light); color: var(--text); }
.theme-toggle svg { position: absolute; transition: opacity 0.2s; }
.theme-icon-moon { opacity: 0; }
[data-theme="light"] .theme-icon-sun  { opacity: 0; }
[data-theme="light"] .theme-icon-moon { opacity: 1; }

/* ── Layout ──────────────────────────────────── */
.page-layout {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

.sidebar-class-name {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.sidebar-class-name a { color: var(--text-muted); }
.sidebar-class-name a:hover { color: var(--text); text-decoration: none; }

.sidebar-section { border-bottom: 1px solid var(--border); }

/* Section header (accordion toggle) */
.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.1s, color 0.1s;
  gap: 8px;
}
.sidebar-section-header:hover { background: var(--surface-3); color: var(--text); }
.sidebar-section-header.active { color: var(--text); }

/* Section link (no accordion — for class page) */
.sidebar-section-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.1s, color 0.1s;
  text-decoration: none;
}
.sidebar-section-link:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.sidebar-section-meta { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }

.sidebar-section-count {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.progress-done { color: var(--accent); }
.sidebar-chevron {
  font-size: 10px;
  transition: transform 0.15s;
  display: inline-block;
}
.sidebar-section-header.open .sidebar-chevron { transform: rotate(90deg); }

.sidebar-lessons { display: none; }
.sidebar-lessons.open { display: block; }

.sidebar-lesson {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 14px 5px 26px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.45;
  transition: background 0.1s, color 0.1s;
}
.sidebar-lesson:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.sidebar-lesson.current {
  background: var(--accent-dim);
  color: var(--text);
  border-right: 2px solid var(--accent);
}

.lesson-dot {
  /* Fixed at 14px, scaled down to ~8px default */
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--text-dim);
  flex-shrink: 0;
  margin-top: 3px;
  cursor: pointer;
  position: relative;
  transform: scale(0.57);
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-radius 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
  user-select: none;
}

/* Checkmark drawn via ::after at full 14px scale */
.lesson-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3.5px;
  height: 6.5px;
  border-right: 1.5px solid rgba(255,255,255,0.4);
  border-bottom: 1.5px solid rgba(255,255,255,0.4);
  transform: translate(-65%, -65%) rotate(45deg);
  opacity: 0;
  transition: opacity 0.13s ease;
  pointer-events: none;
}

/* Row hover: expand to squircle, show dim checkmark */
.sidebar-lesson:hover .lesson-dot:not(.done) {
  transform: scale(1);
  border-radius: 4px;
}
.sidebar-lesson:hover .lesson-dot:not(.done)::after { opacity: 1; }

/* Direct dot hover: add accent tint */
.lesson-dot:hover:not(.done) {
  border-color: var(--accent-muted);
}

/* Done state: filled squircle + solid checkmark */
.lesson-dot.done {
  transform: scale(1);
  border-radius: 4px;
  background: var(--accent);
  border-color: var(--accent);
}
.lesson-dot.done::after {
  border-color: rgba(255,255,255,0.88);
  opacity: 1;
}

/* ── Content area ────────────────────────────── */
.content {
  flex: 1;
  min-width: 0;
  padding: 36px 48px 64px;
}
.content-inner { max-width: 820px; }

/* ── Breadcrumb ──────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); text-decoration: none; }
.breadcrumb-sep { color: var(--text-dim); }
.breadcrumb span:last-child { color: var(--text-muted); }

/* ── Page titles ─────────────────────────────── */
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 6px; }
.page-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }

/* ── Prev/Next nav ───────────────────────────── */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 28px;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  max-width: 46%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.nav-btn:hover { background: var(--surface-4); color: var(--text); border-color: var(--border-light); text-decoration: none; }
.nav-btn-disabled { opacity: 0.28; pointer-events: none; }
.nav-next { margin-left: auto; }

/* ── Lesson header ───────────────────────────── */
.lesson-header { margin-bottom: 28px; }
.lesson-section-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
  margin-bottom: 7px;
}
.lesson-title {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.3;
}

/* ── Video stub banner ───────────────────────── */
.video-stub-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--yellow-bg);
  border: 1px solid var(--yellow-border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--yellow);
  line-height: 1.5;
}
.video-stub-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.video-stub-banner code {
  background: rgba(201,168,76,0.12);
  border: 1px solid var(--yellow-border);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ── Lesson body (rendered markdown) ────────── */
.lesson-body {
  font-size: 15px;
  line-height: 1.75;
}
.lesson-body > *:first-child { margin-top: 0 !important; }

.lesson-body h1, .lesson-body h2,
.lesson-body h3, .lesson-body h4 {
  font-weight: 650;
  letter-spacing: -0.2px;
  line-height: 1.35;
  margin: 32px 0 12px;
}
.lesson-body h1 { font-size: 22px; }
.lesson-body h2 { font-size: 19px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.lesson-body h3 { font-size: 16.5px; }
.lesson-body h4 { font-size: 14px; color: var(--text-muted); }

.lesson-body p { margin-bottom: 14px; }

.lesson-body ul, .lesson-body ol { padding-left: 22px; margin-bottom: 14px; }
.lesson-body li { margin-bottom: 5px; }
.lesson-body li > ul, .lesson-body li > ol { margin-top: 4px; margin-bottom: 4px; }

.lesson-body strong { font-weight: 650; color: #fff; }
.lesson-body em { font-style: italic; }

.lesson-body a { color: var(--accent); word-break: break-word; }

.lesson-body code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 13px;
  background: var(--surface-3);
  border: 1px solid var(--border-light);
  padding: 1px 5px;
  border-radius: 3px;
  color: #b8a9f5;
}
.lesson-body pre {
  background: var(--surface-3);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  margin-bottom: 16px;
  line-height: 1.55;
}
.lesson-body pre code { background: none; border: none; padding: 0; font-size: 13px; }

.lesson-body blockquote {
  border-left: 3px solid var(--accent-muted);
  padding: 4px 16px;
  margin: 0 0 14px;
  color: var(--text-muted);
}

.lesson-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 14px;
}
.lesson-body th, .lesson-body td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.lesson-body th { background: var(--surface-3); font-weight: 600; }
.lesson-body tr:nth-child(even) td { background: rgba(255,255,255,0.015); }

.lesson-body hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

.lesson-body img { max-width: 100%; border-radius: var(--radius); }

/* ── Mark as Complete button ─────────────────── */
.lesson-complete-wrap {
  display: flex;
  justify-content: center;
  padding: 36px 0 4px;
}

.complete-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 22px;
  background: transparent;
  border: 1.5px solid var(--border-light);
  border-radius: 24px;
  color: var(--text-muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  user-select: none;
}
.complete-btn:hover {
  border-color: var(--accent-muted);
  color: var(--text);
}
.complete-btn.done {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}
.complete-btn.done:hover {
  background: rgba(124, 106, 247, 0.2);
}
.complete-btn.pop {
  animation: complete-pop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes complete-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.09); }
  75%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}

.complete-icon {
  font-size: 15px;
  line-height: 1;
  display: inline-block;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.complete-btn.done .complete-icon { transform: scale(1.15); }

/* ── Links panel ─────────────────────────────── */
.links-panel {
  margin-top: 44px;
  border-top: 1px solid var(--border);
  padding-top: 4px;
}
.links-panel-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  padding: 14px 0;
  cursor: pointer;
  text-align: left;
}
.links-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.links-count-badge {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--text-muted);
}
.links-chevron {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  transition: transform 0.15s;
}
.links-panel-toggle[aria-expanded="false"] .links-chevron { transform: rotate(180deg); }
.links-panel-body { padding-bottom: 32px; }
.links-panel-body.hidden { display: none; }

.links-group { margin-bottom: 20px; }
.links-group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 7px;
}
.links-group-count {
  background: var(--surface-3);
  border-radius: 8px;
  padding: 0px 6px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 400;
}

.link-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 4px;
  font-size: 13px;
  transition: background 0.1s, border-color 0.1s;
  word-break: break-word;
}
.link-item:hover { background: var(--surface-3); border-color: var(--border-light); }
.link-item a { color: var(--accent); }
.link-item a:hover { text-decoration: underline; }

.link-internal { color: var(--text-muted) !important; }
.link-internal::before { content: '→ '; color: var(--accent); }
.link-unresolved { color: var(--text-dim); font-style: italic; }

/* YouTube embed */
.yt-wrap { width: 100%; }
.yt-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin-top: 8px;
  border-radius: var(--radius);
  overflow: hidden;
}
.yt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

/* ── Homepage ────────────────────────────────── */
.classes-page {
  padding-top: calc(var(--header-h) + 48px);
  padding-bottom: 64px;
  max-width: 900px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}
.classes-hero { margin-bottom: 36px; }
.classes-title { font-size: 30px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 6px; }
.classes-sub { font-size: 14px; color: var(--text-muted); }

.class-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.class-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.class-card:hover { border-color: var(--accent-muted); background: var(--surface-3); transform: translateY(-1px); text-decoration: none; }
.class-card-name { font-size: 17px; font-weight: 600; color: var(--text); line-height: 1.4; }
.class-card-stats { display: flex; gap: 18px; font-size: 13px; color: var(--text-muted); }
.class-card-stats strong { color: var(--text); }
.class-card-arrow { font-size: 18px; color: var(--accent); margin-top: auto; }

/* ── Section cards ───────────────────────────── */
.section-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 720px;
}
.section-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.section-card:hover { border-color: var(--accent-muted); background: var(--surface-3); text-decoration: none; }
.section-card-index {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  width: 28px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.section-card-body { flex: 1; min-width: 0; }
.section-card-name { font-size: 14px; font-weight: 500; }
.section-progress { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.section-progress-done { color: var(--accent); }
.section-card-arrow { color: var(--text-dim); font-size: 18px; flex-shrink: 0; }

/* ── Lesson list (section page) ──────────────── */
.lesson-list { display: flex; flex-direction: column; gap: 4px; max-width: 720px; }
.lesson-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.lesson-list-item:hover { border-color: var(--accent-muted); background: var(--surface-3); text-decoration: none; }
.lesson-list-item.visited { border-left: 2px solid var(--accent); }
.lesson-list-num { font-size: 12px; color: var(--text-dim); width: 24px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.lesson-list-title { flex: 1; font-size: 14px; }
.lesson-list-badge { font-size: 11px; color: var(--accent); flex-shrink: 0; }

/* ── Scrollbar (webkit) ──────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444868; }

/* ── Mobile ──────────────────────────────────── */
@media (max-width: 800px) {
  .menu-toggle { display: block; }
  .sidebar {
    position: fixed;
    left: -290px;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    z-index: 150;
    width: 290px;
    transition: left 0.22s ease;
    box-shadow: none;
  }
  .sidebar.open {
    left: 0;
    box-shadow: 6px 0 24px rgba(0,0,0,0.5);
  }
  .content { padding: 24px 18px 48px; }
  .classes-page { padding: 80px 18px 48px; }
  .lesson-title { font-size: 22px; }
  .search-wrap { max-width: 180px; }
  .nav-btn { font-size: 12px; padding: 5px 10px; }
}
@media (max-width: 480px) {
  .class-cards { grid-template-columns: 1fr; }
}
