/* notes-page.css — extracted from the embedded <style> block in notes/python.html */
  /* ═══════════════════════════════════════
     Python Notes — page styles
  ═══════════════════════════════════════ */
  .course-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: calc(100dvh - var(--nav-h));
  }

  /* ── SIDEBAR ── */
  .sidebar {
    position: sticky;
    top: var(--nav-h);
    height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
    background: var(--bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }

  /* FIX C5: sidebar-head sticky within sidebar scroll */
  .sidebar-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg);
    padding: 20px 16px 14px;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-course-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
  }

  .sb-progress-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-weight: 500;
  }
  .sb-progress-row span:last-child { color: var(--primary); font-weight: 700; }

  .sb-track {
    height: 5px;
    background: var(--border);
    border-radius: var(--r-full);
    overflow: hidden;
  }
  /* FIX B1: no hardcoded width — JS is sole source of truth */
  .sb-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--r-full);
    width: 0%;
    transition: width .4s ease;
  }

  /* Search inside scrollable area */
  .sb-search {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 12px 4px;
    padding: 6px 10px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    flex-shrink: 0;
  }
  .sb-search svg.lucide { font-size: 13px; color: var(--text-light); flex-shrink: 0; }
  .sb-search input {
    border: none; outline: none; background: transparent;
    font-family: var(--font); font-size: 0.77rem; color: var(--text); width: 100%;
  }
  .sb-search input::placeholder { color: var(--text-light); }

  /* No-results message */
  .sb-no-results {
    display: none;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 8px 20px;
    font-style: italic;
  }

  .sb-group { margin-bottom: 2px; }

  .sb-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 16px 7px 12px;
    cursor: pointer;
    user-select: none;
    transition: background .15s;
  }
  .sb-group-header:hover { background: var(--bg-2); }

  .sb-group-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.77rem;
    font-weight: 700;
    color: var(--text);
  }
  .sb-num {
    width: 18px; height: 18px; border-radius: 4px;
    background: var(--primary); color: #fff;
    font-size: 0.6rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .sb-chevron { font-size: 13px; color: var(--text-light); transition: transform .2s; }
  .sb-group.open .sb-chevron { transform: rotate(180deg); }

  .sb-items { display: none; }
  .sb-group.open .sb-items { display: block; }

  .sb-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 16px 6px 30px;
    font-size: 0.775rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color .15s, background .15s;
    border: none; background: none;
    text-align: left; width: 100%;
    font-family: var(--font);
    position: relative;
  }
  .sb-item:hover { color: var(--text); background: var(--bg-2); }
  .sb-item.active { color: var(--primary); background: var(--primary-light); font-weight: 600; }

  .sb-item-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--border); flex-shrink: 0;
  }
  .sb-item.active .sb-item-dot { background: var(--primary); }

  /* FIX B5: done check icon — only show when done but NOT active */
  .sb-item-check { margin-left: auto; font-size: 14px; color: #10B981; display: none; }
  .sb-item.done .sb-item-check { display: flex; }
  /* FIX B5: when active, hide check — show colored dot only */
  .sb-item.active .sb-item-check { display: none; }

  /* Active indicator right-side dot — only when active AND NOT done */
  .sb-item.active:not(.done)::after {
    content: '';
    position: absolute;
    right: 14px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--primary);
  }

  /* ── LECTURE AREA ── */
  .lecture-area { min-width: 0; display: flex; flex-direction: column; }

  .lecture { display: none; flex-direction: column; padding: 36px 48px 60px; flex: 1; }
  .lecture.active { display: flex; }

  .ch-badge {
    display: inline-flex; align-items: center;
    padding: 4px 12px;
    background: var(--primary-light); color: var(--primary);
    font-size: 0.72rem; font-weight: 700;
    border-radius: var(--r-full);
    width: max-content; margin-bottom: 18px;
  }

  .lec-title-row {
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: 24px; margin-bottom: 8px;
  }
  .lec-title {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 800; color: var(--text);
    letter-spacing: -.025em; line-height: 1.15;
  }
  .lec-hero-img {
    width: 100px; height: 100px; object-fit: contain; flex-shrink: 0;
    filter: drop-shadow(0 8px 24px rgba(108,99,255,.25));
  }
  .lec-desc { font-size: 0.88rem; color: var(--text-muted); line-height: 1.65; margin-bottom: 32px; }

  .lec-divider { height: 1px; background: var(--border); margin: 28px 0; }

  /* SEO FIX S8: section labels use H2 not H3 */
  .lec-section-label {
    display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  }
  .lec-section-label .label-icon {
    width: 30px; height: 30px; border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; flex-shrink: 0;
  }
  .label-icon.code-icon  { background: var(--primary-light); color: var(--primary); }
  .label-icon.exp-icon   { background: #EBF3FF; color: #3B82F6; }
  .label-icon.usage-icon { background: #EDFBF5; color: #10B981; }
  .label-icon.ex-icon    { background: #FFF8EC; color: #F59E0B; }
  [data-theme="dark"] .label-icon.exp-icon  { background: #0C1F3F; }
  [data-theme="dark"] .label-icon.usage-icon { background: #062016; }
  [data-theme="dark"] .label-icon.ex-icon   { background: #2D1F07; }
  [data-theme="dark"] .exercise-card { background: var(--card); border-color: var(--border); border-left-color: var(--orange); }
  [data-theme="dark"] .exercise-reveal { background: #1a1d26; border-color: rgba(255,255,255,.06); }
  [data-theme="dark"] .quiz-card { background: var(--card); border-color: var(--border); border-left-color: var(--primary); }
  [data-theme="dark"] .quiz-opt { background: #1a1d26; border-color: rgba(255,255,255,.06); color: var(--text); }
  [data-theme="dark"] .quiz-opt:hover:not(:disabled) { background: var(--primary-light); }
  [data-theme="dark"] .quiz-opt.correct { background: #0C2216; border-color: var(--green); }
  [data-theme="dark"] .quiz-opt.wrong   { background: #200C0C; border-color: var(--red); }
  [data-theme="dark"] .quiz-feedback.is-correct { background: #0C2216; color: #4ade80; }
  [data-theme="dark"] .quiz-feedback.is-wrong   { background: #200C0C; color: #f87171; }
  [data-theme="dark"] .quiz-complete { background: #0C2216; color: #4ade80; }

  .lec-section-label h2 { font-size: 1rem; font-weight: 700; color: var(--text); }

  /* Code block */
  .code-wrap { background: #14151f; border-radius: var(--r); overflow: hidden; margin-bottom: 4px; }
  .code-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 16px; background: #0e0f1a;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }
  .code-lang-tag { font-size: 0.7rem; color: #6b7280; font-family: 'Fira Code', monospace; }
  .copy-btn {
    display: flex; align-items: center; gap: 5px;
    background: none; border: none;
    color: #6b7280; font-size: 0.72rem;
    font-family: var(--font); cursor: pointer;
    padding: 3px 7px; border-radius: 4px;
    transition: color .2s, background .2s;
  }
  .copy-btn:hover { color: #c9d1e0; background: rgba(255,255,255,.06); }
  .copy-btn svg.lucide { font-size: 13px; }

  .code-body {
    display: grid; grid-template-columns: 36px 1fr;
    padding: 14px 0; overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.83rem; line-height: 1.75;
  }
  .ln { text-align: right; padding-right: 14px; color: #3d4155; user-select: none; border-right: 1px solid #1e2030; }
  .lc { padding-left: 16px; color: #c9d1e0; white-space: pre; }

  /* FIX C4: f-string prefix uses .sp not .bi */
  .kw  { color: #c792ea; }
  .fn  { color: #82aaff; }
  .str { color: #c3e88d; }
  .sp  { color: #89ddff; }   /* string prefix: f, b, r, u */
  .cm  { color: #4a5568; font-style: italic; }
  /* FIX C3: REPL prompt uses .prompt not .cm */
  .prompt { color: #6b8cba; font-weight: 500; font-style: normal; }
  .num { color: #f78c6c; }
  .bi  { color: #ffcb6b; }
  .out { color: #a8b5c8; }   /* output lines — visually distinct from code */

  /* Explanation */
  .exp-body { font-size: 0.875rem; color: var(--text); line-height: 1.75; }
  .exp-body p { margin-bottom: 10px; }
  .exp-body p:last-child { margin-bottom: 0; }

  .chip {
    display: inline-flex; align-items: center;
    padding: 1px 8px;
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: 5px;
    font-family: 'Fira Code', monospace; font-size: 0.8em;
    color: var(--text); white-space: nowrap;
  }

  /* How to use */
  .usage-list {
    display: flex; flex-direction: column; gap: 1px;
    border: 1px solid var(--border); border-radius: var(--r); overflow: hidden;
  }
  .usage-row {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 14px 16px; background: var(--bg);
    border-bottom: 1px solid var(--border);
  }
  .usage-row:last-child { border-bottom: none; }
  .usage-icon-wrap {
    width: 28px; height: 28px; border-radius: 50%;
    border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: var(--text-muted); flex-shrink: 0; margin-top: 1px;
  }
  .usage-text { font-size: 0.855rem; color: var(--text); line-height: 1.6; }
  .usage-text strong { font-weight: 700; }

  /* Example */
  .example-desc { font-size: 0.855rem; color: var(--text-muted); line-height: 1.65; margin-top: 12px; }
  .example-desc .chip { color: var(--text); }

  /* FIX C2: REPL note */
  .repl-note {
    display: flex; align-items: flex-start; gap: 8px;
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--r-sm); padding: 8px 12px;
    font-size: 0.78rem; color: var(--text-muted);
    margin-bottom: 10px; line-height: 1.5;
  }
  .repl-note svg.lucide { font-size: 14px; flex-shrink: 0; margin-top: 1px; color: var(--primary); }

  /* Prev/Next nav */
  .lec-nav {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: auto; padding-top: 32px; border-top: 1px solid var(--border);
  }
  .nav-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 20px; border: 1px solid var(--border);
    border-radius: var(--r-btn); background: var(--card);
    font-family: var(--font); font-size: 0.82rem; font-weight: 600;
    color: var(--text); cursor: pointer;
    transition: border-color .2s, color .2s, background .2s, transform .2s, box-shadow .2s;
    text-decoration: none;
  }
  .nav-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); transform: translateY(-1px); }
  .nav-btn .nav-label { font-size: 0.7rem; font-weight: 400; color: var(--text-muted); display: block; margin-bottom: 1px; }
  .nav-btn.next { background: var(--primary-grad); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(124,92,255,.3); }
  .nav-btn.next:hover { filter: brightness(1.05); box-shadow: 0 6px 20px rgba(124,92,255,.45); }
  .nav-btn.next .nav-label { color: rgba(255,255,255,.65); }
  .nav-btn:disabled { opacity: .38; pointer-events: none; }

  /* ═══════════════════════════════════
     PRACTICE EXERCISE
     Amber / hands-on — distinct from quiz so the two read as different modes
  ═══════════════════════════════════ */
  .exercise-card {
    background: var(--card); border: 1px solid var(--border);
    border-left: 3px solid var(--orange);
    border-radius: var(--r); padding: 22px 24px;
  }
  .exercise-prompt { font-size: 0.875rem; color: var(--text); line-height: 1.7; margin-bottom: 16px; }
  .exercise-prompt .chip { color: var(--text); }

  .exercise-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: none; border: none; cursor: pointer;
    font-family: var(--font); font-size: 0.8rem; font-weight: 600;
    color: var(--orange); padding: 0; margin-right: 18px;
  }
  .exercise-toggle:hover { text-decoration: underline; }
  .exercise-toggle [data-lucide] { font-size: 14px; }

  .exercise-reveal {
    margin-top: 14px; padding: 14px 16px;
    background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-sm);
    font-size: 0.84rem; color: var(--text-2); line-height: 1.65;
    display: none;
  }
  .exercise-reveal.open { display: block; }
  .exercise-reveal .code-wrap { margin-top: 10px; margin-bottom: 0; }

  /* ═══════════════════════════════════
     QUIZ
     Primary purple / check-yourself
  ═══════════════════════════════════ */
  .quiz-card {
    background: var(--card); border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--r); padding: 22px 24px;
  }
  .quiz-progress {
    font-size: 0.74rem; font-weight: 700; color: var(--text-light);
    text-transform: uppercase; letter-spacing: .04em; margin-bottom: 18px;
  }
  .quiz-q { margin-bottom: 26px; }
  .quiz-q:last-of-type { margin-bottom: 0; }
  .quiz-q-text { font-size: 0.875rem; font-weight: 600; color: var(--text); margin-bottom: 12px; line-height: 1.55; }

  .quiz-options { display: flex; flex-direction: column; gap: 8px; }
  .quiz-opt {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r-sm);
    background: var(--bg); cursor: pointer; text-align: left;
    font-family: var(--font); font-size: 0.83rem; color: var(--text);
    transition: border-color .15s, background .15s;
    width: 100%;
  }
  .quiz-opt:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-light); }
  .quiz-opt:disabled { cursor: default; }

  .quiz-opt-letter {
    width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
    border: 1.5px solid var(--border); background: var(--card);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
  }

  .quiz-opt.correct { border-color: var(--green); background: var(--green-light); }
  .quiz-opt.correct .quiz-opt-letter { border-color: var(--green); background: var(--green); color: #fff; }
  .quiz-opt.wrong { border-color: var(--red); background: var(--red-light); }
  .quiz-opt.wrong .quiz-opt-letter { border-color: var(--red); background: var(--red); color: #fff; }

  .quiz-feedback {
    display: none; align-items: flex-start; gap: 8px;
    margin-top: 10px; padding: 10px 14px;
    border-radius: var(--r-sm); font-size: 0.8rem; line-height: 1.55;
  }
  .quiz-feedback.show { display: flex; }
  .quiz-feedback.is-correct { background: var(--green-light); color: #0E7A3C; }
  .quiz-feedback.is-wrong   { background: var(--red-light);  color: #B91C1C; }
  .quiz-feedback [data-lucide] { font-size: 15px; flex-shrink: 0; margin-top: 1px; }

  .quiz-complete {
    display: none; align-items: center; gap: 10px;
    margin-top: 4px; padding: 14px 16px;
    background: var(--green-light); border-radius: var(--r-sm);
    font-size: 0.85rem; font-weight: 600; color: #0E7A3C;
  }
  .quiz-complete.show { display: flex; }
  .quiz-complete [data-lucide] { font-size: 18px; flex-shrink: 0; }
  .quiz-score { margin-left: auto; font-weight: 700; }

  /* Placeholder */
  .placeholder-wrap {
    text-align: center; padding: 60px 20px;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
  }
  .placeholder-icon {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center; font-size: 24px;
  }
  .placeholder-title { font-size: 1.3rem; font-weight: 700; color: var(--text); }
  .placeholder-desc  { font-size: 0.875rem; color: var(--text-muted); max-width: 380px; line-height: 1.6; }

  /* Mobile sidebar drawer */
  .sb-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 20px; right: 20px;
    z-index: 100;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--primary); color: #fff;
    border: none; cursor: pointer;
    box-shadow: 0 4px 16px rgba(108,99,255,.4);
    align-items: center; justify-content: center;
    font-size: 20px;
  }
  .sb-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 90;
    background: rgba(0,0,0,.4);
  }

  /* Dark theme tweaks */
  [data-theme="dark"] .code-wrap { background: #0d0e18; }
  [data-theme="dark"] .code-topbar { background: #07080f; }
  [data-theme="dark"] .usage-row { background: var(--bg-2); }

  /* Responsive */
  @media (max-width: 860px) {
    .course-shell { grid-template-columns: 1fr; }

    /* FIX P12: sidebar is a drawer on mobile */
    .sidebar {
      position: fixed;
      top: var(--nav-h); left: 0;
      height: calc(100dvh - var(--nav-h));
      width: 280px;
      transform: translateX(-100%);
      transition: transform .3s ease;
      z-index: 95;
      box-shadow: 4px 0 24px rgba(0,0,0,.15);
    }
    .sidebar.mobile-open { transform: translateX(0); }
    .sb-overlay.mobile-open { display: block; }
    .sb-mobile-toggle { display: flex; }
    .lecture { padding: 24px 20px 80px; }
  }
  @media (max-width: 520px) {
    .lec-title-row { flex-direction: column-reverse; }
    .lec-hero-img  { width: 64px; height: 64px; }
    .lec-nav { flex-direction: column; gap: 10px; }
    .nav-btn { width: 100%; justify-content: center; }
  }
  
