/* ============================================================
   course.css — Viewport Flex App Architecture & Content Styles
   ============================================================ */

:root {
  --accent: #FA541C;
  --accent-dark: #d94010;
  --accent-soft: #fff3ec;
  --ink: #1a1a2e;
  --ink-2: #16213e;
  --text: #1a1a1a;
  --muted: #666;
  --line: #eee;
  --code-bg: #1e1e3f;
  --code-bg-deep: #0d1117;
  --font-ui: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-code: 'Consolas', 'Courier New', monospace;
}

* { 
  box-sizing: border-box; 
}

/* 1. Global Screen Canvas Lockdown */
html.course-mode, body.course-mode { 
  margin: 0 !important; 
  padding: 0 !important;
  background: #f7f9fc;
  color: var(--text);
  font-family: var(--font-ui);
}

/* 2. Top Navigation Bar Anchor */
#header-wrapper {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 94px !important; /* 56px top bar + 38px tech bar */
  z-index: 1000 !important;
}

/* 3. Horizontal Master App Shell Layout Wrapper */
.workspace-layout {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  width: 100% !important;
  margin-top: 94px !important; /* Steps down below the absolute fixed headers */
  padding: 0 !important;
}

/* 4. MAIN BODY READING CONTENT */
#body-content {
  flex: 1 !important;          /* Fluidly expands between left and right layout sidebars */
  min-width: 0;                /* Guarantees wide snippets don't break flex horizontal sizing */
  background: #fff;
  font-size: 19px;
  line-height: 1.85;
  color: var(--text);
  padding: 40px clamp(16px, 3vw, 40px) 80px;
  -webkit-overflow-scrolling: touch;
}

/* ── Template: Title Block ── */
#body-content > h1:first-child,
#body-content > h2:first-child,
.content-area > h1:first-of-type,
.content-area > h2:first-of-type,
.es-block-title {
  font-size: 28px !important;
  font-weight: 800 !important;
  color: #111 !important;
  margin-top: 48px !important;
  margin-bottom: 24px !important;
  text-align: center !important;
  position: relative !important;
  padding-bottom: 12px !important;
}
#body-content > h1:first-child::after,
#body-content > h2:first-child::after,
.content-area > h1:first-of-type::after,
.content-area > h2:first-of-type::after,
.es-block-title::after {
  content: '' !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 60px !important;
  height: 4px !important;
  background: #FA541C !important;
  border-radius: 2px !important;
}

/* ── Template: Table Block ── */
.es-block-table { overflow-x: auto; margin: 40px auto; max-width: 800px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); border: 1px solid #f0f0f0; background: #fff; position: relative; overflow: hidden; } 
.es-block-table::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, #FA541C, #ff7a45); }
.es-table-title { background: #fff; padding: 20px 24px; font-weight: 800; color: #0f172a; font-size: 17px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; gap: 8px; } 
.es-table-title::before { content: '📊'; font-size: 20px; }
.es-block-table table { width: 100%; border-collapse: collapse; } 
.es-block-table th, .es-block-table td { padding: 18px 24px; border-bottom: 1px solid #f1f5f9; text-align: left; font-size: 15px; color: #334155; line-height: 1.6; vertical-align: top; } 
.es-block-table th { background: #f8fafc; font-weight: 800; color: #FA541C; text-transform: uppercase; letter-spacing: 1px; font-size: 13px; } 
.es-block-table tbody tr { transition: background 0.2s ease; }
.es-block-table tr:last-child td { border-bottom: none; } 
.es-block-table tbody tr:hover { background: #fff5f0; }

/* Desktop: scrollable body panel (do NOT override main.css overflow-y:auto) */
@media (min-width: 1200px) {
  html.course-mode, body.course-mode {
    height: auto !important;
    overflow: visible !important;
  }
  .workspace-layout {
    min-height: calc(100vh - 94px) !important;
    height: auto !important;
    overflow: visible !important;
  }
  #sidebar-wrapper, #rightpanel-wrapper {
    position: sticky !important;
    top: 94px !important;
    height: calc(100vh - 94px) !important;
    overflow-y: auto !important;
  }
  #body-content {
    height: auto !important;
    overflow: visible !important;
    overflow: visible !important;
  }
}

/* Mobile: normal document flow */
@media (max-width: 1199.98px) {
  #body-content {
    height: auto;
    overflow: visible;
    padding: 24px clamp(24px, 5vw, 40px) 60px;
    font-size: 17px; /* Slightly reduced for readability on smaller screens */
  }
}

/* Elegant scrollbar styling for the reading panel */
#body-content::-webkit-scrollbar {
  width: 8px;
}
#body-content::-webkit-scrollbar-track {
  background: #f1f5f9;
}
#body-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
#body-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

#body-content * { max-width: 100%; }
#body-content img { display: block; margin: 0 auto; max-width: 100%; cursor: pointer; transition: transform 0.2s; }
#body-content img:hover { transform: scale(1.02); }

/* Lightbox Styles */
.image-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}
.image-lightbox-overlay.active {
  opacity: 1;
}
.image-lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}
.image-lightbox-overlay.active .image-lightbox-img {
  transform: scale(1);
}
.image-lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: transparent;
  border: none;
  color: white;
  font-size: 48px;
  cursor: pointer;
  z-index: 10000;
  transition: color 0.2s;
  line-height: 1;
}
.image-lightbox-close:hover {
  color: var(--accent);
}

/* Content Separation Borders */
#body-content ul {
  padding: 8px 16px 16px 36px;
  margin: 16px 0;
}
#body-content ul li {
  margin-bottom: 10px;
}
#body-content .es-block-desc {
  padding: 0;
  font-size: 19px;
  color: #222;
  line-height: 1.85;
  margin-bottom: 24px;
}

/* Beautiful Tables */
#body-content table {
  width: max-content;
  min-width: 60%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 32px auto;
  font-size: 15px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  display: block;
  overflow-x: auto;
}
#body-content table th {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 16px 20px;
  text-align: left;
  border: none;
}
#body-content table td {
  padding: 16px 20px;
  color: #333;
  border: none;
  border-bottom: 1px solid #f0f0f0;
}
#body-content table tr:last-child td {
  border-bottom: none;
}
#body-content table tbody tr:nth-child(even) {
  background: #fafafa;
}
#body-content table tbody tr:hover {
  background: var(--accent-soft);
}

/* Footer is now inside #body-content and scrolls naturally, so we don't hide it. */

/* ============================================================
   Lesson Component Layout Render Engines
   ============================================================ */

.lesson-top-bar {
  padding: 20px 0 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.lesson-top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
}

.lesson-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  margin: 16px 0 16px;
  line-height: 1.3;
  text-align: center;
}

/* Nav buttons */
.btn-nav {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background .15s;
  white-space: nowrap;
  text-decoration: none;
  color: #fff;
}
.btn-nav.disabled {
  opacity: .5;
  cursor: not-allowed;
  background: #999;
  pointer-events: none;
  color: #fff;
}
.btn-nav-home { background: #444; }
.btn-nav-home:hover { background: #222; }
.btn-nav-prev { background: #555; }
.btn-nav-prev:hover { background: #333; }
.btn-nav-next { background: var(--accent); }
.btn-nav-next:hover { background: var(--accent-dark); }

/* Bottom nav */
.nav-buttons-bottom {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.example-block {
  background: #fff; border: 1px solid #e5e9f2;
  border-left: 5px solid var(--accent); border-radius: 12px;
  padding: 28px 32px; margin-bottom: 34px;
  box-shadow: 0 3px 14px rgba(0,0,0,.06);
}
.example-block h3 { font-size: 20px; font-weight: 700; color: var(--ink); margin: 0 0 14px; }
.example-block p { font-size: 17px; color: #222; line-height: 1.95; margin: 0 0 18px; }
.example-block p strong { color: var(--accent); }

/* ── Code Wrap: Premium Dark IDE Theme ── */
.code-wrap {
  position: relative;
  margin: 24px 0 12px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  border: 1px solid #2a2a4a;
  background: #1e1e3f;
}
.example-block.has-code-next {
  margin-bottom: 0 !important;
  padding-bottom: 16px !important;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-bottom: none !important;
}
.example-block.has-code-next > *:last-child {
  margin-bottom: 0 !important;
}
.example-block.has-code-next + .code-wrap {
  margin-top: 0 !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  border-top: none !important;
  border-left: 5px solid var(--accent) !important;
}
.code-label {
  background: #12122a;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 10px 18px;
  border-bottom: 1px solid #252542;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.code-label-left { display: flex; align-items: center; gap: 10px; }
.code-lang-badge {
  background: rgba(250,84,28,0.15);
  color: var(--accent);
  border: 1px solid rgba(250,84,28,0.25);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
}
.code-dots { display: flex; gap: 6px; }
.code-dots span { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }

.try-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.4px;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}
.try-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(250,84,28,0.35);
  color: #fff;
}

/* Line-numbered code blocks via CSS counters */
.code-wrap pre,
#body-content pre {
  background: #1e1e3f !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
  font-size: 14px !important;
  line-height: 1.75 !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  counter-reset: line-num;
}
.code-wrap pre code,
#body-content pre code {
  font-family: var(--font-code) !important;
  background: none !important;
  color: #cdd6f4 !important;
  display: block;
  padding: 16px 20px !important;
  position: relative;
}
/* Line number gutter via a numbered border trick */
.code-wrap .code-body {
  position: relative;
  overflow-x: auto;
}
.code-wrap pre {
  padding-left: 0 !important;
}

/* Output console — distinct, terminal-green aesthetic */
.code-wrap .output-block {
  background: #0d0e19 !important;
  border-top: 1px solid #252542 !important;
  padding: 4px 16px 10px !important;
  font-family: var(--font-code) !important;
  font-size: 13.5px !important;
  line-height: 1.5 !important;
  color: #4ade80 !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  position: relative;
  border-bottom-left-radius: 12px !important;
  border-bottom-right-radius: 12px !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  margin: 0 !important;
}
.output-block {
  background: #0d0e19;
  border: 1px solid #252542;
  border-radius: 12px;
  padding: 4px 16px 10px;
  font-family: var(--font-code);
  font-size: 13.5px;
  line-height: 1.5;
  color: #4ade80;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
  margin: 14px 0;
}
.output-block p,
.output-block pre,
.output-block code,
.output-block div:not(.output-label),
.output-block span,
.code-wrap .output-block p,
.code-wrap .output-block pre,
.code-wrap .output-block code,
.code-wrap .output-block div:not(.output-label),
.code-wrap .output-block span {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.5 !important;
  color: #4ade80 !important;
  background: transparent !important;
}
.output-block {
  color: #4ade80 !important;
}
.code-wrap:has(+ .output-block) {
  margin-bottom: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-bottom: none !important;
}
.code-wrap + .output-block {
  margin-top: 0 !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  border-top: 1px solid #252542 !important;
  border-bottom-left-radius: 12px !important;
  border-bottom-right-radius: 12px !important;
  margin-bottom: 28px !important;
}
.output-label {
  font-size: 10px;
  color: #4ade80;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 2px !important;
  margin-bottom: 2px !important;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.85;
}
.output-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 6px #4ade80;
}

/* 5. Responsive Design Rules */
/* Sidebar toggle button — hidden by default (desktop) */
.sidebar-toggle {
  display: none;
}

/* Dark overlay shown when drawer is open */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999;
}
.sidebar-overlay.active {
  display: block;
}

@media (max-width: 1200px) {
  html.course-mode, body.course-mode {
    overflow: auto !important; /* Re-enables full vertical scroll for mobile web browsers */
    height: auto !important;
    width: auto !important;
  }
  /* Header wrapper inherits fixed position and height from desktop */
  .workspace-layout {
    display: block !important;
    height: auto !important;
    /* margin-top inherits 94px from desktop so content sits below fixed header */
  }
  #body-content {
    height: auto !important;
    overflow: visible !important;
    padding: 16px !important;
  }

  /* Show the Topics button on this breakpoint */
  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    margin: 16px 0 8px 0;
    background: var(--accent, #e8490f);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(232,73,15,0.3);
    position: sticky;
    top: 104px; /* 94px header + 10px spacing */
    z-index: 990;
  }

  .sidebar-toggle:hover {
    background: var(--accent-dark, #c43b07);
  }
}

/* ================================================================
   INLINE QUIZ COMPONENT — .quiz-block
   Injected at the end of every lesson by lesson_builder.py
   ================================================================ */

.quiz-block { background: #ffffff; border: 1px solid #f0f0f0; border-radius: 16px; padding: 32px; margin: 40px 0; box-shadow: 0 10px 30px rgba(0,0,0,0.04); position: relative; overflow: hidden; } 
.quiz-header { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 20px; text-align: center; } 
.quiz-icon { font-size: 32px; } 
.quiz-header h3 { margin: 0; font-size: 22px; color: #111; } 
.quiz-subtitle { margin: 4px 0 0; color: #64748b; font-size: 14px; } 
.quiz-progress-bar { height: 8px; background: #f1f5f9; border-radius: 4px; margin-bottom: 28px; overflow: hidden; } 
.quiz-progress-fill { height: 100%; background: linear-gradient(90deg, #FA541C, #ff7a45); width: 0%; transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); } 
.quiz-question { display: none; } 
.quiz-question.active { display: block; animation: fadeIn 0.4s ease-out; } 
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.quiz-q-label { font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; color: #FA541C; font-weight: 800; margin-bottom: 12px; } 
.quiz-q-text { font-size: 19px; color: #0f172a; font-weight: 700; margin-bottom: 24px; line-height: 1.5; } 
.quiz-options { display: flex; flex-direction: column; gap: 14px; } 
.quiz-opt { display: flex; align-items: center; text-align: left; background: #ffffff; border: 2px solid #e2e8f0; padding: 14px 18px; border-radius: 12px; font-size: 16px; color: #334155; cursor: pointer; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 2px 4px rgba(0,0,0,0.02); } 
.quiz-opt:hover { background: #fff5f0; border-color: #FA541C; color: #111; transform: translateY(-2px); box-shadow: 0 6px 12px rgba(250,84,28,0.1); } 
.quiz-opt.correct { background: #f0fdf4; border-color: #22c55e; color: #15803d; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15); } 
.quiz-opt.wrong { background: #fef2f2; border-color: #ef4444; color: #b91c1c; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); } 
.quiz-opt:disabled { cursor: not-allowed; transform: none; box-shadow: none; } 
.quiz-opt-letter { display: inline-flex; justify-content: center; align-items: center; width: 32px; height: 32px; background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 8px; margin-right: 14px; font-size: 15px; font-weight: 800; color: #64748b; transition: all 0.2s; } 
.quiz-opt:hover .quiz-opt-letter { background: #FA541C; color: #fff; border-color: #FA541C; }
.quiz-opt.correct .quiz-opt-letter { background: #dcfce7; border-color: #86efac; color: #166534; }
.quiz-opt.wrong .quiz-opt-letter { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.quiz-feedback { margin-top: 20px; font-weight: 800; font-size: 16px; min-height: 24px; animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); } 
@keyframes popIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.quiz-next-btn { margin-top: 24px; background: #FA541C; color: #fff; border: none; padding: 12px 28px; font-size: 16px; font-weight: 700; border-radius: 8px; cursor: pointer; display: none; box-shadow: 0 4px 12px rgba(250,84,28,0.25); transition: all 0.2s; } 
.quiz-next-btn:hover { background: #e04a17; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(250,84,28,0.35); } 
.quiz-results { display: none; text-align: center; padding: 32px 0; } 
.quiz-results.active { display: block; animation: fadeIn 0.5s ease-out; } 
.quiz-results-score { font-size: 56px; font-weight: 900; background: linear-gradient(135deg, #FA541C, #ff7a45); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 16px; } 
.quiz-results-msg { font-size: 20px; color: #334155; margin-bottom: 32px; font-weight: 600; } 
.quiz-retry-btn { background: #ffffff; border: 2px solid #FA541C; color: #FA541C; padding: 12px 32px; font-size: 16px; font-weight: 700; border-radius: 8px; cursor: pointer; transition: all 0.2s; } 
.quiz-retry-btn:hover { background: #FA541C; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(250,84,28,0.2); }

/* ── Dynamic Navigation Rows ──────────────────────────────────────── */
.nav-row {
  display: flex;
  justify-content: space-between;
}
.nav-top {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.nav-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Reduce excessive padding and margin on mobile to fit more content */
  #body-content {
    padding: 16px 12px 60px !important; /* Minimized horizontal padding */
    font-size: 17px !important; /* Reduced text size as requested */
    line-height: 1.65 !important; 
  }
  
  .code-wrap pre, .code-wrap code, #body-content pre code {
    font-size: 18px !important; /* Increased text size for readability */
    line-height: 1.5 !important;
    padding: 8px 6px !important; /* Extremely tight padding for mobile */
  }
  .code-wrap {
    margin: 8px 0 6px !important;
  }
  .code-label {
    padding: 4px 8px !important;
  }
  .code-wrap pre {
    padding: 0 !important; /* Let the code element handle padding */
  }
  .output-block {
    padding: 8px 10px !important;
    font-size: 15px !important;
  }
  
  /* Target the main title (either explicitly or via the fallback selector) */
  #body-content > h1:first-child,
  #body-content > h2:first-child,
  .es-block-title {
    margin-top: 16px !important;
    margin-bottom: 12px !important;
    padding-bottom: 8px !important;
    font-size: 24px !important;
  }
  
  .nav-top {
    margin-bottom: 12px;
    padding-bottom: 12px;
  }
  .nav-bottom {
    margin-top: 24px;
    padding-top: 16px;
  }
  .sidebar-toggle {
    margin: 8px 0 12px 0;
  }
  .es-block, .es-block-note, .es-block-warning, .es-block-tip, .es-block-realworld, .es-block-usecase {
    margin: 12px 0 !important;
    padding: 10px 12px !important;
  }
  .example-block {
    padding: 8px 6px !important;
    margin-bottom: 24px !important;
    border-radius: 8px !important;
  }
  .quiz-block { padding: 16px 12px 20px; margin: 24px 0 16px; }
  .quiz-q-text { font-size: 15px; }
  .quiz-opt { padding: 11px 14px; font-size: 13px; }
}

/* ── Code Wrap: Premium Dark IDE Theme ── */
.code-wrap {
  position: relative;
  margin: 16px 0 12px;
  background: #1a1a2e; border-radius: 8px; overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2); font-family: var(--font-code);
  border: 1px solid #2a2a40;
}
.code-label { background: #161625; padding: 6px 12px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #2a2a40; }
.code-label-left { display: flex; align-items: center; gap: 8px; color: #a5b4fc; font-size: 11px; font-weight: 700; letter-spacing: 1px; font-family: var(--font-ui); }
.code-dots { display: flex; gap: 6px; }
.code-dots span { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }
.try-btn { background: var(--accent); color: #fff; text-decoration: none; padding: 4px 12px; border-radius: 4px; font-size: 11px; font-family: var(--font-ui); font-weight: bold; cursor: pointer; transition: 0.2s; }
.try-btn:hover { background: #e04a16; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(250,84,28,0.4); }
.code-wrap pre { margin: 0; padding: 0 !important; overflow: auto; max-height: 450px; font-size: 14.5px; line-height: 1.6; color: #e4e4e4; white-space: pre-wrap; word-break: break-word; }
.code-wrap code { padding: 12px 14px !important; display: block; }
.output-block { background: #0f0f1a; padding: 10px 14px; color: #4ade80; font-size: 14px; border-top: 1px solid #2a2a40; overflow: auto; max-height: 300px; }
.output-label { color: #555; font-size: 11px; text-transform: uppercase; font-family: var(--font-ui); margin-bottom: 4px; font-weight: 600; letter-spacing: 1px; }

/* ================================================================
   INTERVIEW Q&A COMPONENT — .es-interview-qa
   Accordion-style, card-based Q&A block for interview lessons.
   ================================================================ */
.es-interview-qa-section {
  margin: 32px 0;
}
.es-interview-qa-section-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}
.es-interview-qa {
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.es-interview-qa:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  border-color: #d0d9e8;
}
.es-interview-qa[open] {
  border-color: rgba(250,84,28,0.3);
  box-shadow: 0 6px 24px rgba(250,84,28,0.06);
}
.es-interview-qa summary {
  padding: 18px 24px;
  font-weight: 700;
  font-size: 16.5px;
  color: #0f172a;
  background: #f8fafc;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: background 0.2s;
  user-select: none;
  line-height: 1.45;
}
.es-interview-qa summary::-webkit-details-marker { display: none; }
.es-interview-qa[open] summary { background: #fff8f5; color: var(--accent); }
.es-interview-qa summary .qa-num {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 30px;
  height: 30px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
}
.es-interview-qa[open] summary .qa-num {
  background: var(--accent);
  color: #fff;
}
.es-interview-qa summary .qa-chevron {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e8edf5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #64748b;
  transition: transform 0.3s ease, background 0.2s;
  flex-shrink: 0;
}
.es-interview-qa[open] summary .qa-chevron {
  transform: rotate(180deg);
  background: var(--accent);
  color: #fff;
}
.es-interview-qa .qa-body {
  padding: 20px 24px 24px;
  border-top: 1px solid #f0f4f8;
  background: #fff;
  animation: qa-slide-in 0.2s ease;
}
@keyframes qa-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.es-interview-qa .qa-body p {
  color: #334155;
  line-height: 1.8;
  font-size: 15.5px;
  margin: 0 0 14px;
}
.es-interview-qa .qa-body p:last-child { margin-bottom: 0; }
.es-interview-qa .qa-body ul,
.es-interview-qa .qa-body ol {
  color: #334155;
  font-size: 15px;
  line-height: 1.8;
  padding-left: 24px;
}
.es-interview-qa .qa-body li { margin-bottom: 8px; }
.es-interview-qa .qa-body code {
  background: #f1f5f9;
  color: #be123c;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 13.5px;
  font-family: var(--font-code);
}
.es-interview-qa .qa-body pre {
  background: var(--code-bg) !important;
  border-radius: 10px !important;
  padding: 18px 20px !important;
  margin: 16px 0 !important;
  font-size: 13.5px !important;
  line-height: 1.7 !important;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.es-interview-qa .qa-body pre code {
  background: none !important;
  color: #cdd6f4 !important;
  padding: 0 !important;
  font-family: var(--font-code) !important;
}
.es-interview-qa .qa-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 14px;
}

/* Interview Take-Test CTA */
.es-quiz-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(135deg, #fff8f5 0%, #fff3ec 100%);
  border: 2px solid rgba(250,84,28,0.2);
  border-radius: 16px;
  padding: 24px 28px;
  margin: 40px 0 20px;
  box-shadow: 0 4px 20px rgba(250,84,28,0.06);
}
.es-quiz-cta-content { flex: 1; }
.es-quiz-cta-content h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
}
.es-quiz-cta-content p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}
.es-quiz-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(250,84,28,0.3);
}
.es-quiz-cta-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(250,84,28,0.35);
  color: #fff;
}
@media (max-width: 600px) {
  .es-quiz-cta { flex-direction: column; align-items: flex-start; }
  .es-interview-qa summary { font-size: 15px; padding: 14px 16px; }
  .es-interview-qa .qa-body { padding: 14px 16px 18px; }
}
/* ================================================================
   LESSON CONCEPT CARDS � .es-concept-card
   Beautifully styled containers for listing concepts/types
   ================================================================ */
.es-concept-card {
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 16px;
  padding: 28px 32px;
  margin: 32px 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}
.es-concept-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent) 0%, #ff7a45 100%);
}
.es-concept-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  border-color: #d0d9e8;
}
.es-concept-card h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 16px;
}
.es-concept-card-num {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 34px;
  height: 34px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 10px;
  font-size: 16px;
  font-weight: 900;
  flex-shrink: 0;
}
.es-concept-card p {
  font-size: 16.5px;
  color: #334155;
  line-height: 1.7;
  margin: 0 0 16px;
}
.es-concept-card p:last-child {
  margin-bottom: 0;
}
.es-concept-example {
  background: #f8fafc;
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-size: 15.5px;
  color: #475569;
  margin: 20px 0 0;
}
.es-concept-example strong {
  color: #0f172a;
  font-weight: 700;
}

/* Missing es-block-steps styles */
.es-block-steps { margin: 24px 0; display: flex; flex-direction: column; gap: 16px; }
.es-step { display: flex; gap: 16px; align-items: flex-start; background: #fafafa; padding: 16px; border-radius: 8px; border: 1px solid #eee; }
.es-step-num { flex-shrink: 0; width: 32px; height: 32px; background: #FA541C; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 16px; }
.es-step p { margin: 0; padding-top: 4px; line-height: 1.6; }

