body { background: var(--dark); color: var(--text); font-family: var(--font-body); margin: 0; }

.lms-course-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-deep);
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lms-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lms-progress-bar {
  width: 120px;
  height: 6px;
  background: #e8eef6;
  border-radius: 50px;
  overflow: hidden;
}
.lms-progress-fill { height: 100%; background: var(--gradient); border-radius: 50px; transition: width 0.4s; }
.lms-progress-wrap span { font-size: 0.78rem; color: var(--muted); font-weight: 600; }

/* LAYOUT */
.lms-layout { display: flex; margin-top: var(--topbar-height); min-height: calc(100vh - var(--topbar-height)); }

/* SIDEBAR — navy chrome */
.lms-sidebar {
  width: 280px;
  background: linear-gradient(180deg, rgba(7,17,31,.94) 0%, rgba(10,28,52,.9) 100%);
  backdrop-filter: saturate(160%) blur(24px);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
  border-right: 1px solid rgba(255,255,255,.08);
  box-shadow: 8px 0 32px rgba(7,17,31,.12);
  position: fixed;
  top: var(--topbar-height); bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.lms-sidebar::-webkit-scrollbar { width: 4px; }
.lms-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.lms-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.lms-nav-item {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  transition: all 0.2s;
}
.lms-nav-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9); }
.lms-nav-item.active { background: rgba(11,95,255,0.28); color: #fff; font-weight: 600; }

/* MODULE TREE */
#moduleTree { flex: 1; padding: 12px 0; }

.tree-module { border-bottom: 1px solid rgba(255,255,255,0.06); }
.tree-module-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: background 0.2s;
}
.tree-module-title:hover { background: rgba(255,255,255,0.04); }

.tree-lessons.collapsed { display: none; }

.tree-lesson {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 28px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: all 0.2s;
}
.tree-lesson:hover { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.85); }
.tree-lesson.active { background: rgba(11,95,255,0.22); color: #fff; font-weight: 600; }
.tree-lesson.done { color: #34d399; }

/* MAIN — light surface */
.lms-main { margin-left: 280px; flex: 1; padding: 36px 40px; max-width: 900px; }

.lms-view { display: none; }
.lms-view.active { display: block; }

/* LESSON */
.lesson-header { margin-bottom: 24px; }
.lesson-breadcrumb { font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
.lesson-title { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; color: var(--ink); letter-spacing: -.4px; }

.lesson-video-box {
  background: linear-gradient(160deg, #07111f 0%, #0a2748 100%);
  border: 1px solid #0b2a5e;
  border-radius: var(--radius);
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.video-placeholder { text-align: center; color: rgba(226,236,250,.75); }
.video-placeholder span {
  display: block;
  font-size: 3rem;
  margin-bottom: 10px;
  color: #8ec5ff;
  background: none;
  -webkit-text-fill-color: #8ec5ff;
}
.video-placeholder p { font-size: 0.88rem; }

.lesson-desc { color: var(--text); }
.lesson-type-row { display: flex; gap: 10px; margin-bottom: 16px; }
.lesson-type-tag {
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
}
.lesson-dur-tag {
  background: #eef2f7;
  color: var(--muted);
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 50px;
}
.lesson-desc h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.lesson-desc p { font-size: 0.9rem; color: var(--muted); line-height: 1.7; margin-bottom: 20px; }

.btn-complete {
  background: var(--brand-soft);
  border: 1px solid #c9dbff;
  color: var(--brand-deep);
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.btn-complete:hover { background: #dbe7ff; }
.done-btn { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.35); color: #059669; }

.lesson-nav-btns {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
}
.btn-lesson-nav {
  background: #fff;
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.btn-lesson-nav:hover { background: var(--brand-soft); border-color: #c9dbff; color: var(--brand-deep); }
.btn-lesson-nav.primary { background: var(--gradient); color: white; border: none; box-shadow: 0 8px 22px rgba(11,95,255,.25); }

/* VIEW HEADER */
.view-header { margin-bottom: 28px; }
.view-header h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--ink); }

/* LMS CARDS */
.lms-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  box-shadow: 0 2px 10px rgba(7,17,31,.04);
}
.lms-card-top { flex: 1; }
.lms-card-top h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--ink); margin: 8px 0 6px; }
.lms-card-top p { font-size: 0.85rem; color: var(--muted); }
.lms-card-meta { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; font-size: 0.8rem; color: var(--muted); }

.lms-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  margin-bottom: 6px;
}
.assign-b { background: rgba(245,158,11,0.15); color: #b45309; }
.quiz-b   { background: var(--brand-soft); color: var(--brand-deep); }
.project-b{ background: rgba(16,185,129,0.12); color: #059669; }
.resource-b{ background: #e8f0ff; color: #0739a8; }

.btn-start {
  background: var(--gradient);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 16px rgba(11,95,255,.22);
  transition: opacity 0.2s;
  white-space: nowrap;
}
.btn-start:hover { opacity: 0.88; }

.stack-info { font-size: 0.8rem; color: var(--brand-deep); margin-top: 6px; }
.resource-link { display: inline-block; font-size: 0.82rem; color: var(--primary); margin-top: 6px; }
.empty-lms { padding: 40px; text-align: center; color: var(--muted); font-size: 0.9rem; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); }

/* QUIZ MODAL */
.quiz-q-block { margin-bottom: 24px; }
.quiz-q-text { font-size: 0.92rem; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--dark);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  transition: background 0.2s;
}
.quiz-option:hover { background: rgba(11,95,255,0.1); border-color: rgba(11,95,255,0.3); }
.quiz-timer { font-size: 0.85rem; color: #f59e0b; font-weight: 600; margin-top: 4px; }

.quiz-result {
  text-align: center;
  padding: 24px;
  border-radius: var(--radius);
  margin-top: 16px;
}
.quiz-result.pass { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); }
.quiz-result.fail { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); }
.result-score { font-size: 3rem; font-weight: 900; color: var(--ink); }
.quiz-result h3 { font-size: 1.2rem; font-weight: 700; color: var(--ink); margin: 8px 0; }
.quiz-result p { font-size: 0.88rem; color: var(--muted); }

/* =====================================================
   LESSON BLOG LAYOUT
   ===================================================== */
.lesson-blog {
  padding: 4px 0 40px;
}

/* Meta row */
.lb-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.lb-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 50px;
  border: 1px solid;
}
.lb-dur {
  font-size: 0.76rem;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  padding: 4px 12px;
  border-radius: 50px;
}
.lb-module {
  font-size: 0.74rem;
  color: var(--muted);
  margin-left: auto;
}

/* Intro card */
.lb-intro-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, rgba(11,95,255,0.12), rgba(37,99,235,0.08));
  border: 1px solid rgba(11,95,255,0.2);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 28px;
}
.lb-intro-icon {
  font-size: 2rem;
  width: 56px;
  height: 56px;
  background: rgba(11,95,255,0.15);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lb-intro-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 5px;
  line-height: 1.3;
}
.lb-intro-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

/* Sections */
.lb-section {
  margin-bottom: 28px;
}
.lb-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Key points */
.lb-keypoints {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lb-keypoints li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.6;
  padding: 10px 14px;
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.15);
  border-radius: 10px;
}
.lb-keypoints li::before {
  content: '✓';
  color: #10b981;
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Content body */
.lb-content-body {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 22px 24px;
}
.lb-content-body p {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.85;
  margin: 0 0 14px;
}
.lb-content-body p:last-child { margin-bottom: 0; }

/* Video link */
.lb-video-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #ef4444;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s;
}
.lb-video-link:hover { background: rgba(239,68,68,0.2); }
.lb-video-link span { font-size: 1.1rem; }

/* Notes */
.lb-notes-section { }
.lb-notes-input {
  width: 100%;
  min-height: 100px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--ink);
  font-size: 0.88rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  line-height: 1.6;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.lb-notes-input:focus { border-color: rgba(11,95,255,0.5); }
.lb-notes-input::placeholder { color: rgba(255,255,255,0.2); }

/* Complete row */
.lb-complete-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 8px;
}
.lb-done-msg {
  font-size: 0.82rem;
  color: #10b981;
  font-weight: 600;
}

/* =====================================================
   RICH LESSON CONTENT RENDERER
   ===================================================== */
.lb-rich-content {
  font-size: 0.93rem;
  color: var(--text);
  line-height: 1.85;
}

/* Headings */
.lb-rich-content h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(11,95,255,0.3);
}
.lb-rich-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 24px 0 10px;
}
.lb-rich-content h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary-light);
  margin: 18px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Paragraphs */
.lb-rich-content p {
  margin: 0 0 16px;
  color: var(--text);
}

/* Lists */
.lb-rich-content ul, .lb-rich-content ol {
  padding-left: 20px;
  margin: 0 0 18px;
}
.lb-rich-content li {
  margin-bottom: 8px;
  line-height: 1.7;
  color: var(--text);
}
.lb-rich-content ul li::marker { color: var(--primary-light); }

/* Code blocks */
.lb-rich-content pre {
  background: #0d1117;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 20px 22px;
  overflow-x: auto;
  margin: 18px 0;
  position: relative;
}
.lb-rich-content pre code {
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.85rem;
  color: #e6edf3;
  line-height: 1.7;
  background: none;
  padding: 0;
}
.lb-rich-content code {
  background: rgba(11,95,255,0.15);
  color: var(--primary-light);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: 'Fira Code', monospace;
  font-size: 0.83em;
}

/* Blockquote */
.lb-rich-content blockquote {
  border-left: 4px solid rgba(11,95,255,0.6);
  background: rgba(11,95,255,0.07);
  margin: 18px 0;
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
  color: var(--text);
  font-style: italic;
}
.lb-rich-content blockquote p { margin: 0; }

/* Tables */
.lb-rich-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 0.87rem;
  border-radius: 10px;
  overflow: hidden;
}
.lb-rich-content th {
  background: rgba(11,95,255,0.2);
  color: var(--ink);
  font-weight: 700;
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(11,95,255,0.3);
}
.lb-rich-content td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--text);
}
.lb-rich-content tr:last-child td { border-bottom: none; }
.lb-rich-content tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* Callout boxes */
.lb-rich-content .callout {
  border-radius: 12px;
  padding: 16px 18px;
  margin: 18px 0;
  border-left: 4px solid;
}
.lb-rich-content .callout.info {
  background: rgba(59,130,246,0.08);
  border-color: #3b82f6;
  color: #93c5fd;
}
.lb-rich-content .callout.warning {
  background: rgba(245,158,11,0.08);
  border-color: #f59e0b;
  color: #fcd34d;
}
.lb-rich-content .callout.tip {
  background: rgba(16,185,129,0.08);
  border-color: #10b981;
  color: #6ee7b7;
}
.lb-rich-content .callout p { margin: 0; }
.lb-rich-content .callout strong { display: block; margin-bottom: 5px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.8px; }

/* Concept cards */
.lb-rich-content .concept-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(11,95,255,0.2);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 14px 0;
}
.lb-rich-content .concept-card h4 {
  color: var(--primary-light);
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 7px;
  text-transform: none;
  letter-spacing: 0;
}
.lb-rich-content .concept-card p { margin: 0; font-size: 0.87rem; color: var(--muted); }

/* Mermaid diagrams */
.lb-rich-content .mermaid {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 20px;
  margin: 18px 0;
  text-align: center;
  overflow-x: auto;
}

/* Strong / em */
.lb-rich-content strong { color: var(--ink); font-weight: 700; }
.lb-rich-content em { color: var(--primary-light); font-style: italic; }

/* Empty state */
.lb-empty-content {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 12px;
}

/* ── LMS Mobile ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .lms-layout { flex-direction: column; }

  .lms-sidebar {
    position: fixed;
    left: -300px;
    width: 280px;
    top: 64px; bottom: 0;
    z-index: 300;
    transition: left 0.3s ease;
  }
  .lms-sidebar.mobile-open { left: 0; }

  .lms-main { margin-left: 0 !important; }
  .lesson-content { padding: 20px 16px; }

  .lms-topbar-course { max-width: 160px; font-size: 0.78rem; }
  .lms-progress-bar  { width: 80px; }
}

@media (max-width: 480px) {
  .lesson-content { padding: 16px 12px; }
  .lesson-content h1 { font-size: 1.2rem; }
  .lesson-content h2 { font-size: 1rem; }
  .lesson-content pre { font-size: 0.75rem; overflow-x: auto; }
}

/* ── Module Materials in lesson view ── */
.lb-materials-list { display: flex; flex-direction: column; gap: 8px; }
.lb-material-item { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; padding: 10px 14px; }
.lb-material-icon { font-size: 1.1rem; }
.lb-material-title { flex: 1; font-size: 0.88rem; font-weight: 600; color: #e2e8f0; }
.lb-material-type { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: #64748b; background: rgba(255,255,255,0.06); padding: 2px 8px; border-radius: 50px; }
.lb-material-link { font-size: 0.8rem; font-weight: 700; color: #38bdf8; text-decoration: none; padding: 4px 10px; background: rgba(14,165,233,0.1); border-radius: 6px; }
.lb-material-link:hover { background: rgba(14,165,233,0.2); }

/* ── Module Quiz in lesson view ── */
.lb-quiz-block { display: flex; flex-direction: column; gap: 16px; }
.lb-quiz-question { background: rgba(139,92,246,0.07); border: 1px solid rgba(139,92,246,0.2); border-radius: 10px; padding: 14px 16px; }
.lb-quiz-q-text { font-size: 0.92rem; color: #e2e8f0; margin-bottom: 10px; line-height: 1.5; }
.lb-quiz-options { display: flex; flex-direction: column; gap: 8px; }
.lb-quiz-option { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 8px 12px; border-radius: 7px; border: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.03); transition: background 0.15s; font-size: 0.87rem; color: #cbd5e1; }
.lb-quiz-option:hover { background: rgba(139,92,246,0.12); border-color: rgba(139,92,246,0.3); }
.lb-quiz-option input { accent-color: #0b5fff; }
.lb-quiz-feedback { margin-top: 8px; font-size: 0.85rem; min-height: 20px; }

/* ═══════════════════════════════════════════════════════════
   VIDEO PLAYER COMPONENT
   ═══════════════════════════════════════════════════════════ */
.video-player-container {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Custom video controls */
.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  padding: 40px 16px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.3s;
}

.video-player-container:hover .video-controls {
  opacity: 1;
}

.video-controls.visible {
  opacity: 1;
}

.video-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.video-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0b5fff, #60a5fa);
  width: 0%;
  transition: width 0.1s;
}

.video-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.2s;
}

.video-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.video-time {
  font-size: 0.78rem;
  color: #fff;
  font-family: 'Fira Code', monospace;
  min-width: 90px;
}

.video-speed-select {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
}

.video-speed-select option {
  background: #1e293b;
  color: #fff;
}

.video-spacer {
  flex: 1;
}

/* Video header */
.video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(11, 95, 255, 0.1), rgba(124, 58, 237, 0.1));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.video-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.video-duration-badge {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 50px;
  color: #fff;
}

/* Bookmarks */
.video-bookmarks {
  background: rgba(7, 17, 31, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 16px;
}

.video-bookmarks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.video-bookmarks-header h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: #e2e8f0;
  margin: 0;
}

.btn-add-bookmark {
  background: rgba(11, 95, 255, 0.2);
  border: 1px solid rgba(11, 95, 255, 0.4);
  color: #60a5fa;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-add-bookmark:hover {
  background: rgba(11, 95, 255, 0.3);
}

.bookmark-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bookmark-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.bookmark-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.bookmark-time {
  font-family: 'Fira Code', monospace;
  font-size: 0.78rem;
  color: #60a5fa;
  background: rgba(11, 95, 255, 0.15);
  padding: 4px 8px;
  border-radius: 4px;
}

.bookmark-label {
  flex: 1;
  font-size: 0.85rem;
  color: #e2e8f0;
}

.bookmark-delete {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.bookmark-delete:hover {
  opacity: 1;
}

/* Resume watching overlay */
.resume-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
}

.resume-overlay h3 {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.resume-progress {
  font-size: 0.9rem;
  color: #94a3b8;
}

.btn-resume {
  background: linear-gradient(135deg, #0739a8, #0b5fff);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 24px rgba(11, 95, 255, 0.4);
  transition: transform 0.2s;
}

.btn-resume:hover {
  transform: scale(1.05);
}

.btn-start-over {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* Placeholder when no video */
.video-placeholder-box {
  background: linear-gradient(160deg, #07111f 0%, #0a2748 100%);
  border: 1px solid #0b2a5e;
  border-radius: 12px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.video-placeholder-content {
  text-align: center;
  color: rgba(226, 236, 250, 0.75);
}

.video-placeholder-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  color: #8ec5ff;
}

.video-placeholder-text {
  font-size: 0.88rem;
}

/* ═══════════════════════════════════════════════════════════
   CERTIFICATE CELEBRATION MODAL
   ═══════════════════════════════════════════════════════════ */
#certCelebration {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-celebration-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 17, 31, 0.85);
  backdrop-filter: blur(12px);
}

.cert-celebration-modal {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 24px;
  padding: 48px 56px;
  text-align: center;
  max-width: 480px;
  box-shadow: 0 32px 100px rgba(7, 17, 31, 0.4);
  animation: certModalIn 0.4s ease-out;
}

@keyframes certModalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.cert-confetti {
  font-size: 3rem;
  margin-bottom: 16px;
  animation: confettiBounce 0.6s ease-out;
}

@keyframes confettiBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.cert-celebration-modal h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: #07111f;
  margin: 0 0 8px;
}

.cert-celebration-modal > p {
  font-size: 1rem;
  color: #64748b;
  margin: 0 0 24px;
}

.cert-preview {
  background: linear-gradient(135deg, rgba(11, 95, 255, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
  border: 1px solid rgba(11, 95, 255, 0.2);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.cert-badge {
  font-size: 2.5rem;
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
}

.cert-info {
  text-align: left;
}

.cert-id {
  font-size: 0.88rem;
  color: #07111f;
  margin-bottom: 4px;
}

.cert-id strong {
  font-family: 'Fira Code', monospace;
  color: #0b5fff;
}

.cert-date {
  font-size: 0.8rem;
  color: #64748b;
}

.cert-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-cert-view {
  background: linear-gradient(135deg, #0739a8, #0b5fff);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 24px rgba(11, 95, 255, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-cert-view:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(11, 95, 255, 0.45);
}

.btn-cert-close {
  background: #fff;
  color: #07111f;
  border: 1px solid #e2e8f0;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.btn-cert-close:hover {
  background: #f8fafc;
}

/* ═══════════════════════════════════════════════════════════
   DISCUSSION FORUM
   ═══════════════════════════════════════════════════════════ */
.discussion-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Thread List View */
.discussion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.discussion-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.btn-new-thread {
  background: linear-gradient(135deg, #0739a8, #0b5fff);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 20px rgba(11, 95, 255, 0.3);
  transition: transform 0.2s;
}

.btn-new-thread:hover {
  transform: translateY(-2px);
}

.thread-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.thread-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.thread-card:hover {
  border-color: rgba(11, 95, 255, 0.3);
  box-shadow: 0 4px 16px rgba(7, 17, 31, 0.08);
}

.thread-card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.thread-votes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 50px;
}

.vote-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px;
  transition: color 0.2s;
}

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

.vote-btn.voted {
  color: var(--primary);
}

.vote-count {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.thread-meta {
  flex: 1;
}

.thread-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.4;
}

.thread-preview {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thread-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--muted);
}

.thread-author {
  display: flex;
  align-items: center;
  gap: 6px;
}

.thread-avatar {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.thread-badge {
  padding: 3px 8px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
}

.badge-answered {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.badge-open {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

/* Thread Detail View */
.thread-detail {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
}

.thread-detail-header {
  padding: 24px;
  border-bottom: 1px solid var(--card-border);
}

.thread-detail-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 16px;
  line-height: 1.4;
}

.thread-detail-content {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.8;
  white-space: pre-wrap;
}

.thread-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
}

/* Replies */
.replies-section {
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.02);
}

.replies-header {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
}

.reply-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}

.reply-card.is-answer {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}

.answer-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.reply-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.reply-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.reply-author {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.88rem;
}

.reply-time {
  color: var(--muted);
  font-size: 0.78rem;
}

.reply-content {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.reply-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--card-border);
}

.reply-action-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.reply-action-btn:hover {
  color: var(--primary);
}

/* Reply Form */
.reply-form {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
}

.reply-form-header {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}

.reply-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.reply-textarea:focus {
  border-color: var(--primary);
}

.reply-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

/* New Thread Modal */
.thread-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.thread-modal.active {
  display: flex;
}

.thread-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 17, 31, 0.6);
  backdrop-filter: blur(8px);
}

.thread-modal-box {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(7, 17, 31, 0.3);
}

.thread-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.thread-modal-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.thread-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
}

.thread-form-field {
  margin-bottom: 20px;
}

.thread-form-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.thread-form-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  box-sizing: border-box;
}

.thread-form-input:focus {
  border-color: var(--primary);
}

.thread-form-textarea {
  min-height: 150px;
  resize: vertical;
}

/* Empty state */
.discussion-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--card-bg);
  border: 1px dashed var(--card-border);
  border-radius: 12px;
}

.discussion-empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.discussion-empty h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.discussion-empty p {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Back button */
.btn-back-threads {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 0;
}

.btn-back-threads:hover {
  text-decoration: underline;
}

/* High-contrast quiz palette for the light LMS surface. */
.lb-quiz-question { background: #f8faff; border-color: #cbd5e1; padding: 20px; }
.lb-quiz-q-text, .quiz-q-text { color: #172b4d; font-weight: 650; }
.lb-quiz-option, .quiz-option { color: #253858; background: #ffffff; border: 1px solid #b8c5d6; align-items: flex-start; padding: 12px 14px; line-height: 1.65; }
.lb-quiz-option input, .quiz-option input { flex-shrink: 0; margin-top: 5px; accent-color: #0b5fff; width: 18px; height: 18px; }
.lb-quiz-option:hover, .quiz-option:hover { background: #eef4ff; border-color: #3976df; }
.lb-quiz-option:has(input:checked), .quiz-option:has(input:checked) { background: #e8f0ff; border-color: #0b5fff; color: #123c82; }
.lb-quiz-option:focus-within, .quiz-option:focus-within { outline: 3px solid #90b5ff; outline-offset: 2px; }
.lb-quiz-option:has(input:disabled), .quiz-option:has(input:disabled) { opacity: 1; cursor: default; }
.lb-quiz-option.is-correct { background: #e9f7ef; border-color: #237b4b; color: #14532d; }
.lb-quiz-option.is-incorrect { background: #fff0ef; border-color: #be3434; color: #8c2020; }
.lb-quiz-feedback { color: #334155; }
.lb-quiz-feedback .answer-correct { color: #166534; font-weight: 700; }
.lb-quiz-feedback .answer-incorrect { color: #a52222; font-weight: 700; }
.quiz-timer { color: #8c4800; }
.quiz-result.pass { background: #e9f7ef; border-color: #237b4b; color: #14532d; }
.quiz-result.fail { background: #fff0ef; border-color: #be3434; color: #8c2020; }
.lb-quiz-option.is-correct:has(input) { background: #e9f7ef; border-color: #237b4b; color: #14532d; }
.lb-quiz-option.is-incorrect:has(input) { background: #fff0ef; border-color: #be3434; color: #8c2020; }
.lb-material-title { color: #253858; }
/* Company case library */
.case-hero { padding: 36px; border-radius: 24px; background: #102d50; color: #fff; margin-bottom: 24px; }
.case-eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
.case-hero .case-eyebrow { color: #8de4db; }
.case-hero h1 { color: #fff; font-size: clamp(2rem,4vw,3.3rem); line-height: 1.12; margin: 18px 0; }
.case-hero p { max-width: 720px; color: #d8e5f4; line-height: 1.8; }
.case-stats { display:flex; flex-wrap:wrap; gap:30px; margin-top:26px; color:#d8e5f4; font-size:.85rem; }
.case-stats strong { display:block; color:#fff; font-size:1.5rem; }
.case-toolbar { display:flex; flex-wrap:wrap; gap:18px; justify-content:space-between; align-items:center; margin:24px 0; }
.case-toolbar label { color:#1e3653; font-size:.85rem; font-weight:700; }
.case-toolbar select { display:block; margin-top:8px; padding:12px 40px 12px 14px; border:1px solid #b9c9da; border-radius:10px; color:#1e3653; background:#fff; font:inherit; }
.case-toolbar p,.case-caption { color:#53657b; font-size:.82rem; line-height:1.7; }
.company-case-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr)); gap:20px; }
.company-case-card { display:flex; flex-direction:column; text-align:left; border:1px solid #d4dfeb; border-radius:18px; padding:24px; background:#fff; color:#23374f; font:inherit; cursor:pointer; transition:transform .15s,box-shadow .15s; }
.company-case-card[hidden] { display:none; }
.company-case-card:hover { transform:translateY(-3px); box-shadow:0 10px 28px #17365214; border-color:#86a8cc; }
.company-case-card:focus-visible { outline:3px solid #0b5fff; outline-offset:4px; }
.case-card-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:22px; }
.case-logo { display:inline-flex; position:relative; align-items:center; justify-content:center; width:58px; height:58px; background:#f1f5fa; border:1px solid #d8e1eb; border-radius:14px; flex-shrink:0; overflow:hidden; }
.case-logo span { color:#365472; font-size:1rem; font-weight:800; }
.case-logo img { position:absolute; width:36px; height:36px; object-fit:contain; background:#f1f5fa; }
.case-logo img[hidden] { display:none; }
.case-number { color:#6a7b90; font-size:.7rem; letter-spacing:.1em; font-weight:700; }
.case-domain { display:inline-block; color:#126352; font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; font-weight:800; }
.company-case-card h2 { font-size:1.5rem; color:#142d4b; margin:9px 0; }
.company-case-card h3 { font-size:.96rem; color:#334d69; margin:0 0 12px; line-height:1.5; }
.company-case-card p { font-size:.87rem; line-height:1.8; margin-bottom:22px; }
.case-open { margin-top:auto; color:#0b50bc; font-size:.85rem; font-weight:800; display:flex; justify-content:space-between; width:100%; }
.case-detail { margin-top:40px; border:1px solid #cedbe9; border-radius:22px; overflow:hidden; background:#fff; color:#253c57; scroll-margin-top:100px; }
.case-detail-header { padding:32px; background:#f0f5fb; border-bottom:1px solid #d8e2ee; }
.case-detail-brand { display:flex; gap:18px; align-items:center; }
.case-detail-header h2 { color:#112d4b; font-size:2rem; margin:4px 0; }
.case-detail-header p { margin:16px 0; font-size:1.1rem; }
.case-source-pill { display:inline-block; padding:7px 12px; border:1px solid #c8d8e8; border-radius:30px; background:#fff; font-size:.75rem; }
.case-outcome { padding:26px 32px; background:#e9f6f0; border-bottom:1px solid #c8e6d8; color:#14513d; }
.case-outcome p { font-size:1.25rem; line-height:1.7; font-weight:700; margin:12px 0; }
.case-outcome small { display:block; font-size:.85rem; line-height:1.8; }
.case-detail-section { display:grid; grid-template-columns:34px minmax(0,1fr); gap:16px; padding:28px 32px; border-bottom:1px solid #e0e7ef; }
.case-section-number { color:#537ca3; font-size:.8rem; font-weight:800; margin-top:5px; }
.case-detail-section h3 { color:#143250; font-size:1.25rem; margin:0 0 14px; }
.case-detail-section h4 { color:#234464; font-size:.9rem; margin-bottom:8px; }
.case-detail-section p,.case-detail-section li { line-height:1.85; font-size:.93rem; }
.case-detail-section ul { padding-left:20px; }
.case-flow { list-style:none; padding:0; display:flex; flex-wrap:wrap; gap:10px; margin:20px 0; }
.case-flow li { flex:1 1 120px; background:#f1f6fc; border:1px solid #d4e1ee; border-radius:12px; padding:14px; }
.case-flow li span { display:block; color:#0b50bc; font-weight:800; }
.case-evidence-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:18px; }
.case-evidence-grid > div { background:#f7f9fc; padding:18px; border-radius:12px; border:1px solid #e1e7f0; }
.case-source-link { display:inline-block; color:#0a50b8; font-weight:700; margin-top:20px; }
.case-lesson { border-left:3px solid #1b836b; padding:14px 18px; background:#f0f8f5; }
.case-task { padding:18px; border-radius:12px; background:#edf3ff; border:1px solid #cadcf9; }
.case-agenda { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); gap:14px; margin-top:18px; }
.case-agenda > div { padding:16px; border:1px solid #d9e3ef; border-radius:12px; }
.case-agenda span { color:#0a50b8; font-size:.75rem; font-weight:800; }
.case-agenda h4 { margin:10px 0; }.case-agenda p { font-size:.82rem; }
.case-rubric { width:100%; border-collapse:collapse; margin:20px 0; font-size:.85rem; }.case-rubric th,.case-rubric td { text-align:left; border-bottom:1px solid #d9e3ef; padding:12px; }.case-rubric th { background:#edf3f9; }
#caseLearningLog { display:block; width:100%; box-sizing:border-box; margin:12px 0 16px; padding:16px; font:inherit; font-size:.9rem; line-height:1.8; border:1px solid #b4c7dc; border-radius:12px; background:#fff; color:#203950; resize:vertical; }
#caseLearningLog:focus { outline:3px solid #aecbff; border-color:#0b5fff; }
#caseLogStatus { color:#166534; font-weight:700; }
.case-detail-footer { padding:24px 32px; background:#f7f9fc; font-size:.85rem; line-height:1.9; }
@media(max-width:600px) { .case-hero { padding:24px; }.case-detail-header,.case-outcome { padding:24px; }.case-detail-section { padding:24px 18px; gap:10px; grid-template-columns:25px minmax(0,1fr); }.case-detail-header h2 { font-size:1.5rem; } }
/* Visual-first course lessons */
.visual-lesson-card { margin:24px 0; padding:24px; border:1px solid #cbdde9; border-radius:18px; background:#fff; color:#203b52; }
.visual-label { color:#116653; font-size:.7rem; font-weight:800; letter-spacing:.1em; }
.visual-lesson-card h3 { color:#123756; margin:12px 0 20px; font-size:1.35rem; }
.visual-lesson-card figure { margin:0; }
.visual-lesson-card figure img { display:block; width:100%; max-height:470px; height:auto; object-fit:contain; background:#fff; border-radius:10px; border:1px solid #e2e8f0; padding:12px; box-sizing:border-box; }
.visual-lesson-card figcaption { color:#566b80; font-size:.75rem; line-height:1.7; margin:10px 0 22px; }
.visual-lesson-card a { color:#0754ba; }
.visual-lesson-card h4 { color:#143a5a; font-size:1rem; margin:20px 0 8px; }
.visual-lesson-card ol { padding-left:23px; }.visual-lesson-card li { margin:8px 0; line-height:1.8; }
.visual-check { background:#edf6f3; border-left:3px solid #218169; border-radius:0 8px 8px 0; padding:14px 16px; margin:20px 0 0; line-height:1.8; }
.visual-tool-detail,.visual-code,.visual-extra { margin:14px 0; border:1px solid #d2dfed; border-radius:12px; background:#f8faff; color:#233f5a; padding:16px 18px; }
.visual-tool-detail summary,.visual-code summary,.visual-extra summary { cursor:pointer; font-weight:700; color:#123f70; line-height:1.7; }
.visual-tool-detail summary span { display:block; font-size:.78rem; color:#536a81; font-weight:400; margin-left:18px; }
.visual-tool-detail[open] summary,.visual-code[open] summary,.visual-extra[open] summary { margin-bottom:20px; }
.visual-extra img { max-width:100%; height:auto; }
@media(max-width:600px) { .visual-lesson-card { padding:18px; }.visual-lesson-card figure img { padding:6px; }.visual-lesson-card h3 { font-size:1.15rem; } }

/* Sourced lesson figures, kept beside the corresponding concept. */
.rag-inline-figure{margin:28px 0;padding:18px;border:1px solid #c5dced;border-radius:16px;background:#f4f9ff;color:#183b58}
.rag-inline-figure img{display:block;width:100%;height:auto;max-height:550px;object-fit:contain;background:#fff;border-radius:10px}
.rag-inline-figure figcaption{font-size:.86rem;line-height:1.7;padding-top:16px;color:#34536e}.rag-inline-figure strong{color:#123b63;font-size:1.05rem}.rag-inline-figure p{margin:8px 0}.rag-inline-figure a{color:#0754ba}
@media(max-width:600px){.rag-inline-figure{padding:12px;margin:20px 0}}

/* Session-specific visual study flows, with credited source illustrations. */
.session-visual-flow{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;list-style:none!important;padding:0!important;margin:18px 0 24px!important;counter-reset:none}
.session-visual-flow li{position:relative;display:flex;flex-direction:column;gap:10px;margin:0!important;padding:16px 14px;min-height:90px;box-sizing:border-box;border:1px solid #c4dced;border-radius:12px;background:linear-gradient(145deg,#edf7ff,#fff);line-height:1.45!important;color:#163d63}
.session-visual-flow li:not(:last-child):after{content:'→';position:absolute;right:-13px;top:42%;z-index:1;font-size:19px;color:#2379ae}
.session-visual-flow span{font-size:.7rem;letter-spacing:.1em;color:#176c9a;font-weight:700}.session-visual-flow strong{font-size:.86rem;color:#173b60}
.session-visual-card figure{padding:14px;border:1px solid #dce7ef;border-radius:12px;background:#fff}.session-visual-card figure img{max-height:420px;border:0;padding:0}.session-visual-card figcaption{margin:16px 0 0;font-size:.8rem}.session-visual-card figcaption strong{font-size:1.05rem;color:#123b63}.session-visual-card figcaption p{margin:8px 0;font-size:.88rem;line-height:1.75}
.session-visual-exercise{margin-top:16px;border-top:1px solid #dce7ef;padding-top:14px}.session-visual-exercise summary{font-weight:600;color:#14598c;cursor:pointer}.session-visual-exercise p{font-size:.86rem;line-height:1.75}
@media(max-width:650px){.session-visual-flow{grid-template-columns:repeat(2,minmax(0,1fr))}.session-visual-flow li{min-height:100px}.session-visual-flow li:nth-child(2):after{display:none}.session-visual-card figure{padding:8px}}
@media(prefers-reduced-motion:no-preference){.session-visual-flow li{transition:transform .2s,border-color .2s}.session-visual-flow li:hover{transform:translateY(-3px);border-color:#3288bf}}
