/* ────────────────────────────────────────────────────────────────
   OpsRabbit PS Training Portal — Design System
   Typefaces: DM Serif Display · Outfit · DM Mono
   ──────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Mono:wght@400;500&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ── TOKENS ─────────────────────────────────────────────────────── */
:root {
  /* Surface */
  --s0: #F8F6F1;
  --s1: #EFEDE6;
  --s2: #E5E2D8;
  --s3: #DAD8CE;

  /* Ink */
  --ink:       #0F0F0E;
  --ink-mid:   #3D3C3A;
  --ink-muted: #5A5956;
  --ink-ghost: #9B9892;

  /* Lines */
  --line:       rgba(15,15,14,0.09);
  --line-mid:   rgba(15,15,14,0.15);
  --line-strong:rgba(15,15,14,0.22);

  /* Brand accent */
  --or-accent:       #C4561A;
  --or-accent-mid:   #E07840;
  --or-accent-light: #F5EAE2;
  --or-accent-xlt:   #FBF3EE;

  /* Semantic colours */
  --c-green:  #1A6B3C; --c-green-l:  #E1F0E8;
  --c-blue:   #1A4570; --c-blue-l:   #E1EBF5;
  --c-purple: #4A2D7A; --c-purple-l: #EDE5F7;
  --c-amber:  #7A5209; --c-amber-l:  #FDF3E1;
  --c-red:    #8B1A1A; --c-red-l:    #F5E1E1;
  --c-teal:   #155F5F; --c-teal-l:   #E0F0F0;

  /* Depth complexity colours */
  --d-beginner:     #1A6B3C; --d-beginner-bg:     #E1F0E8;
  --d-intermediate: #1A4570; --d-intermediate-bg: #E1EBF5;
  --d-advanced:     #4A2D7A; --d-advanced-bg:     #EDE5F7;
  --d-all:          #7A5209; --d-all-bg:          #FDF3E1;

  /* Type */
  --ff-display: 'DM Serif Display', Georgia, serif;
  --ff-body:    'Outfit', sans-serif;
  --ff-mono:    'DM Mono', monospace;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Shadows */
  --sh-xs: 0 1px 2px rgba(0,0,0,0.05);
  --sh-sm: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --sh-md: 0 4px 14px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --sh-lg: 0 12px 32px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
  --sh-xl: 0 24px 48px rgba(0,0,0,0.12), 0 8px 20px rgba(0,0,0,0.08);

  /* Layout */
  --sidebar-w: 272px;
  --topbar-h:  58px;
  --content-max: 920px;
}

/* ── RESET ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
  font-family: var(--ff-body);
  background: var(--s0);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: var(--ff-body); cursor: pointer; }

/* ── SIDEBAR ────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--ink);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  background: linear-gradient(160deg, rgba(196,86,26,.10) 0%, transparent 70%);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 40px; height: 40px;
  background: var(--or-accent);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow:
    0 0 0 1px rgba(224,120,64,.30),
    0 0 18px rgba(196,86,26,.50),
    0 3px 10px rgba(0,0,0,.50);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-name {
  font-family: var(--ff-display);
  font-size: 18px;
  color: #F8F6F1;
  letter-spacing: .01em;
  line-height: 1;
  text-shadow: 0 0 24px rgba(248,246,241,.20);
}

.brand-sub {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(248,246,241,.38);
}

/* ── NAV ──────────────────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0 8px;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

.nav-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: rgba(248,246,241,.28);
  padding: 14px 20px 5px;
}

.nav-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 20px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background .12s, border-color .12s;
  position: relative;
  overflow: hidden; /* clip subtitle overflow at item boundary */
  min-width: 0;
}

.nav-item:hover { background: rgba(248,246,241,.05); }

.nav-item.active {
  background: rgba(196,86,26,.16);
  border-left-color: var(--or-accent-mid);
}

.nav-num {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  color: rgba(248,246,241,.30);
  width: 20px;
  flex-shrink: 0;
  padding-top: 2px;
  transition: color .12s;
}

.nav-item.active .nav-num { color: var(--or-accent-mid); }

.nav-item.done .nav-num {
  color: var(--c-green);
}

.nav-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  width: 0;
}

.nav-title {
  font-size: 12.5px;
  font-weight: 400;
  color: rgba(248,246,241,.72);
  line-height: 1.30;
  transition: color .12s;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.nav-item.active .nav-title { color: #F8F6F1; font-weight: 500; }

.nav-subtitle {
  font-size: 10px;
  color: rgba(248,246,241,.24);
  line-height: 1.30;
  margin-top: 1px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.nav-item.active .nav-subtitle { color: rgba(248,246,241,.38); }
.nav-item:hover  .nav-subtitle { color: rgba(248,246,241,.30); }

.nav-depth {
  font-size: 9.5px;
  font-weight: 600;
  padding: 1.5px 5px;
  border-radius: 10px;
  flex-shrink: 0;
  margin-top: 2px;
}

.depth-beginner    { background: rgba(26,107,60,.28);  color: #7DD4A2; }
.depth-intermediate{ background: rgba(26,69,112,.28);  color: #7AB4E0; }
.depth-advanced    { background: rgba(74,45,122,.28);  color: #B89AE0; }
.depth-all         { background: rgba(122,82,9,.32);   color: #E8B870; }

/* ── SIDEBAR FOOTER ─────────────────────────────────────────────── */
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}

.progress-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(248,246,241,.30);
}

.progress-pct {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: rgba(248,246,241,.40);
}

.progress-track {
  height: 2.5px;
  background: rgba(255,255,255,.10);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--or-accent-mid);
  border-radius: 2px;
  transition: width .4s ease;
}

/* ── TOPBAR ──────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: rgba(248,246,241,.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  gap: 16px;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--ink-muted);
  min-width: 0;
}

.topbar-breadcrumb .sep { color: var(--ink-ghost); }

.topbar-breadcrumb .current {
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── BUTTONS ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all .14s;
  white-space: nowrap;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-mid);
  color: var(--ink-muted);
}
.btn-ghost:hover { background: var(--s1); color: var(--ink); border-color: var(--line-strong); }

.btn-primary {
  background: var(--or-accent);
  color: #fff;
  border-color: var(--or-accent);
}
.btn-primary:hover { background: #A8441A; }

.btn-sm { padding: 5px 11px; font-size: 12px; }

/* ── MAIN LAYOUT ─────────────────────────────────────────────────── */
.layout {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-wrap {
  flex: 1;
  padding: 36px 36px 60px;
  max-width: 85%;
}

.content-wrap:has(.topic-page) {
  max-width: none;
  padding-left: 20px;
  padding-right: 20px;
}

/* ── CHAPTER HERO ────────────────────────────────────────────────── */
.chapter-hero {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

/* Top row: title left, stats right */
.hero-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.hero-left { flex: 1; min-width: 0; }

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}

.chapter-num-pill {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--or-accent);
  background: var(--or-accent-light);
  padding: 2px 9px;
  border-radius: 20px;
  letter-spacing: .04em;
}

.depth-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.depth-beginner     { background: var(--d-beginner-bg);     color: var(--d-beginner); }
.depth-intermediate { background: var(--d-intermediate-bg); color: var(--d-intermediate); }
.depth-advanced     { background: var(--d-advanced-bg);     color: var(--d-advanced); }
.depth-all          { background: var(--d-all-bg);          color: var(--d-all); }

.chapter-hero-title {
  font-family: var(--ff-display);
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: 3px;
}

.chapter-hero-subtitle {
  font-size: 12.5px;
  color: var(--ink-ghost);
  font-style: italic;
}

/* Stats cluster — right side of top row */
.hero-right {
  display: flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-xs);
  flex-shrink: 0;
  overflow: hidden;
}

.hero-stat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 18px;
  gap: 1px;
}

.hero-stat-num {
  font-family: var(--ff-mono);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}

.hero-stat-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-ghost);
}

.hero-stat-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
  flex-shrink: 0;
}

/* Outcome line */
.hero-outcome {
  font-size: 13.5px;
  color: var(--ink-mid);
  line-height: 1.6;
  margin-bottom: 14px;
  max-width: 680px;
}

/* Pill row — complexity + prerequisites */
.hero-pill-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.meta-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
  flex-shrink: 0;
}

.meta-pill-complexity {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.complexity-low    { background: var(--c-green-l);  color: var(--c-green);  border: 1px solid rgba(26,107,60,.15); }
.complexity-medium { background: var(--c-blue-l);   color: var(--c-blue);   border: 1px solid rgba(26,69,112,.15); }
.complexity-high   { background: var(--c-purple-l); color: var(--c-purple); border: 1px solid rgba(74,45,122,.15); }

.prereq-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: var(--ink-muted);
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2px 9px;
}

/* meta-strip, meta-card, meta-label, meta-value, meta-list — replaced by hero pill layout */

/* ── CHAPTER BODY (sections below hero) ─────────────────────────── */
.chapter-body {
  max-width: 85%;
}

/* ── SECTION ─────────────────────────────────────────────────────── */
.section {
  margin-bottom: 32px;
  animation: fadeUp .3s ease both;
}

.section:nth-child(1) { animation-delay: .04s; }
.section:nth-child(2) { animation-delay: .08s; }
.section:nth-child(3) { animation-delay: .12s; }
.section:nth-child(4) { animation-delay: .16s; }
.section:nth-child(5) { animation-delay: .20s; }
.section:nth-child(6) { animation-delay: .24s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}


.section-icon {
  width: 26px; height: 26px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  line-height: 1;
}

.icon-subch   { background: var(--s2); color: var(--ink-muted); }
.icon-visual  { background: var(--c-blue-l); color: var(--c-blue); }
.icon-video   { background: var(--c-purple-l); color: var(--c-purple); }
.icon-lab     { background: var(--c-green-l); color: var(--c-green); }
.icon-test    { background: var(--c-amber-l); color: var(--c-amber); }
.icon-cert    { background: var(--or-accent-light); color: var(--or-accent); }

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
}

/* ── SUBCHAPTERS ─────────────────────────────────────────────────── */
.subch-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.subch-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-xs);
  cursor: pointer;
  transition: border-color .14s, box-shadow .14s, transform .14s;
}

.subch-item:hover {
  border-color: var(--line-strong);
  box-shadow: var(--sh-sm);
  transform: translateX(2px);
}

.subch-idx {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--ink-ghost);
  width: 18px;
  flex-shrink: 0;
  padding-top: 1px;
}

.subch-body { flex: 1; }

.subch-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
}

.subch-note {
  font-size: 11.5px;
  color: var(--ink-ghost);
  font-style: italic;
  margin-top: 1px;
}

.subch-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--or-accent);
  background: var(--or-accent-xlt);
  border: 1px solid rgba(196,86,26,.18);
  border-radius: 20px;
  padding: 4px 11px;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background .13s, color .13s, border-color .13s;
}

.subch-item:hover .subch-cta {
  background: var(--or-accent);
  color: #fff;
  border-color: var(--or-accent);
}

.subch-placeholder {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-top: 8px;
  background: var(--s1);
  border: 1.5px dashed var(--line-mid);
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--ink-ghost);
  font-style: italic;
}

.subch-placeholder::before {
  content: '◦';
  font-size: 16px;
  opacity: .5;
}

/* ── VIDEOS ──────────────────────────────────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 13px;
}

.video-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-xs);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}

.video-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }

.video-thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(140deg, #1A1A18 0%, #2A2825 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.video-thumb.has-image {
  background: #1A1A18;
}

.video-thumb-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumb-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 24px 24px;
}

.video-thumb-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15,15,14,.08) 0%, rgba(15,15,14,.00) 34%, rgba(15,15,14,.45) 100%);
  z-index: 0;
}

.video-play {
  width: 44px; height: 44px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
  transition: background .15s, transform .15s;
  position: relative; z-index: 1;
}

.video-thumb.has-image .video-play {
  background: rgba(196,86,26,.88);
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
}

.video-card:hover .video-play {
  background: var(--or-accent);
  border-color: transparent;
  transform: scale(1.06);
}

.play-tri {
  width: 0; height: 0;
  border-style: solid;
  border-width: 7px 0 7px 13px;
  border-color: transparent transparent transparent #fff;
  margin-left: 2px;
}

.video-dur {
  position: absolute;
  bottom: 7px; right: 9px;
  font-family: var(--ff-mono);
  font-size: 10.5px;
  color: rgba(255,255,255,.75);
  background: rgba(0,0,0,.5);
  padding: 1.5px 5px;
  border-radius: 3px;
  z-index: 1;
}

.video-placeholder-badge {
  position: absolute;
  top: 7px; left: 9px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  z-index: 1;
}

.video-meta {
  padding: 11px 13px;
}

.video-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 3px;
  line-height: 1.35;
}

.video-desc {
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.45;
}

.video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.video-tag {
  font-size: 10.5px;
  padding: 1.5px 7px;
  background: var(--s1);
  color: var(--ink-muted);
  border-radius: 20px;
  border: 1px solid var(--line);
}

.video-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 13px;
  background: var(--c-blue-l);
  border-radius: var(--r-md);
  font-size: 12.5px;
  color: var(--c-blue);
  line-height: 1.5;
  margin-top: 12px;
}

.video-notice-icon { font-size: 15px; flex-shrink: 0; }

/* VISUALS */
.visual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.visual-debug-banner {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #FFF8E8;
  border: 1px solid rgba(122,82,9,.18);
  border-radius: var(--r-md);
}

.visual-debug-head {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-amber);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}

.visual-debug-list {
  display: grid;
  gap: 8px;
}

.visual-debug-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-top: 1px solid rgba(122,82,9,.12);
}

.visual-debug-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.visual-debug-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--c-amber-l);
  color: var(--c-amber);
  font-size: 11px;
  font-weight: 700;
}

.visual-debug-body {
  min-width: 0;
}

.visual-debug-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}

.visual-debug-path {
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.5;
  word-break: break-all;
}

.visual-debug-path a {
  color: var(--c-blue);
  text-decoration: underline;
}

.visual-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-xs);
}

.visual-frame {
  background: var(--s0);
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.visual-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
}

.zoomable-visual {
  cursor: zoom-in;
}

.visual-meta {
  padding: 14px 16px 16px;
}

.visual-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.visual-type {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--c-blue-l);
  color: var(--c-blue);
  border: 1px solid rgba(26,69,112,.12);
}

.visual-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.35;
}

.visual-caption {
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.55;
}

.chapter-figure {
  margin: 18px 0 22px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}

.chapter-figure-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--s0);
}

.chapter-figure figcaption {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.55;
}

.visual-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}

.visual-modal.open {
  display: block;
}

.visual-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,15,14,.72);
  backdrop-filter: blur(4px);
}

.visual-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  margin: 24px auto;
  padding: 18px;
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
}

.visual-modal-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 14px;
  min-height: 28px;
}

.visual-modal-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-modal-close {
  position: absolute;
  top: 0;
  right: 0;
  border: 1px solid var(--line-mid);
  background: var(--s0);
  color: var(--ink-muted);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}

.visual-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 1px solid rgba(15,15,14,.10);
  background: rgba(248,246,241,.88);
  color: rgba(15,15,14,.62);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  box-shadow: var(--sh-sm);
  backdrop-filter: blur(6px);
  transition: background .14s ease, color .14s ease, opacity .14s ease;
}

.visual-modal-nav:hover {
  background: rgba(248,246,241,.98);
  color: var(--ink);
}

.visual-modal-nav-prev {
  left: 14px;
}

.visual-modal-nav-next {
  right: 14px;
}

.visual-modal-nav:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.visual-modal-status {
  min-width: 72px;
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--ink-ghost);
  text-align: center;
}

.visual-modal-image {
  width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  display: block;
  border-radius: var(--r-md);
  background: var(--s0);
}

@media (max-width: 560px) {
  .visual-modal-toolbar {
    margin-bottom: 10px;
  }

  .visual-modal-status {
    min-width: 0;
    font-size: 10px;
  }

  .visual-modal-nav {
    width: 34px;
    height: 34px;
    font-size: 22px;
  }

  .visual-modal-nav-prev {
    left: 10px;
  }

  .visual-modal-nav-next {
    right: 10px;
  }
}

/* ── LABS ────────────────────────────────────────────────────────── */
.lab-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-xs);
  margin-bottom: 10px;
}

.lab-trigger {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  cursor: pointer;
  background: var(--s0);
  border-bottom: 1px solid var(--line);
  transition: background .12s;
}

.lab-trigger:hover { background: var(--s1); }

.lab-badge {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  font-weight: 500;
  background: var(--c-green-l);
  color: var(--c-green);
  padding: 2px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}

.lab-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  flex: 1;
}

.lab-toggle {
  font-size: 13px;
  color: var(--ink-ghost);
  transition: transform .2s;
  flex-shrink: 0;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
}

.lab-card.open .lab-toggle { transform: rotate(180deg); }

.lab-body {
  display: none;
  padding: 14px 16px;
}

.lab-card.open .lab-body { display: block; }

.lab-step {
  display: flex;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.lab-step:last-child { border-bottom: none; }

.step-num {
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--c-green-l);
  color: var(--c-green);
  font-size: 11px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-body { flex: 1; }
.step-title { font-size: 13px; font-weight: 500; color: var(--ink); }
.step-desc { font-size: 12px; color: var(--ink-muted); margin-top: 2px; line-height: 1.5; }

.lab-placeholder {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-top: 10px;
  background: var(--s0);
  border: 1.5px dashed var(--line-mid);
  border-radius: var(--r-md);
  font-size: 11.5px;
  color: var(--ink-ghost);
  font-style: italic;
}

.lab-placeholder::before { content: '◦'; font-size: 15px; opacity: .5; }

/* ── KNOWLEDGE TEST ──────────────────────────────────────────────── */
.test-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-xs);
}

.test-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--c-amber-l);
  border-bottom: 1px solid rgba(122,82,9,.11);
  cursor: pointer;
  user-select: none;
}

.test-chevron {
  font-size: 11px;
  color: var(--c-amber);
  opacity: .7;
  transition: transform .2s ease;
  display: flex;
  align-items: center;
}
.test-card:not(.open) .test-chevron { transform: rotate(-90deg); }
.test-card:not(.open) .test-head { border-bottom: none; }
.test-collapse-body { display: block; }
.test-card:not(.open) .test-collapse-body { display: none; }

.test-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.test-icon-wrap {
  width: 30px; height: 30px;
  background: var(--c-amber);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 13px;
  flex-shrink: 0;
  line-height: 1;
}

.test-head-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--c-amber);
}

.test-head-sub {
  font-size: 11.5px;
  color: rgba(122,82,9,.65);
  margin-top: 1px;
}

.test-body { padding: 18px; }

.q-block { margin-bottom: 22px; }
.q-block:last-child { margin-bottom: 0; }

.q-num {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  color: var(--ink-ghost);
  margin-bottom: 4px;
}

.q-text {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 9px;
  line-height: 1.5;
}

.q-options {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.q-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
  user-select: none;
  transition: border-color .11s, background .11s;
}

.q-option:hover { border-color: var(--c-amber); background: var(--c-amber-l); }

.q-option.selected { border-color: var(--c-amber); background: var(--c-amber-l); color: var(--c-amber); font-weight: 500; }
.q-option.correct  { border-color: var(--c-green); background: var(--c-green-l); color: var(--c-green); font-weight: 500; }
.q-option.wrong    { border-color: var(--c-red);   background: var(--c-red-l);   color: var(--c-red); }

.q-dot {
  width: 15px; height: 15px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  opacity: .45;
  transition: opacity .11s;
}

.q-option.selected .q-dot,
.q-option.correct .q-dot,
.q-option.wrong .q-dot { opacity: 1; }

.q-option.selected .q-dot::after,
.q-option.correct .q-dot::after,
.q-option.wrong .q-dot::after {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.q-feedback {
  display: none;
  margin-top: 8px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  line-height: 1.55;
}

.q-feedback.show { display: block; }
.q-feedback.correct-fb { background: var(--c-green-l); color: var(--c-green); }
.q-feedback.wrong-fb   { background: var(--c-red-l);   color: var(--c-red); }

.test-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.test-score-txt {
  font-size: 12.5px;
  color: var(--ink-muted);
}

.score-val {
  font-family: var(--ff-mono);
  font-weight: 500;
  color: var(--ink);
}

/* ── CERTIFICATION CARD ──────────────────────────────────────────── */
.cert-card {
  background: linear-gradient(140deg, #181816 0%, #242220 100%);
  border-radius: var(--r-xl);
  padding: 24px 24px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--sh-lg);
}

.cert-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 85% 15%, rgba(196,86,26,.20) 0%, transparent 55%),
    radial-gradient(ellipse at 15% 85%, rgba(74,45,122,.13) 0%, transparent 55%);
}

.cert-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  position: relative;
}

.cert-badge-circle {
  width: 48px; height: 48px;
  background: var(--or-accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(196,86,26,.22);
}

.cert-badge-text .cert-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(248,246,241,.36);
}

.cert-badge-text .cert-name {
  font-family: var(--ff-display);
  font-size: 18px;
  color: #F8F6F1;
  line-height: 1.2;
}

.cert-domains {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
  position: relative;
}

.cert-domain {
  background: rgba(248,246,241,.05);
  border: 1px solid rgba(248,246,241,.09);
  border-radius: var(--r-md);
  padding: 11px 13px;
}

.cert-domain-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(248,246,241,.30);
  margin-bottom: 5px;
}

.cert-domain-items {
  font-size: 11.5px;
  color: rgba(248,246,241,.65);
  line-height: 1.65;
}

.cert-req-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  position: relative;
}

.cert-req {
  flex: 1;
  background: rgba(248,246,241,.04);
  border: 1px solid rgba(248,246,241,.07);
  border-radius: var(--r-md);
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cert-req-name {
  font-size: 11.5px;
  color: rgba(248,246,241,.46);
}

.cert-req-status {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}

.status-locked { background: rgba(255,255,255,.06); color: rgba(255,255,255,.28); }
.status-done   { background: rgba(196,86,26,.28);   color: var(--or-accent-mid); }
.status-ready  { background: rgba(26,107,60,.28);   color: #7DD4A2; }

.cert-actions {
  display: flex;
  gap: 9px;
  position: relative;
}

.btn-cert {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 500;
  font-family: var(--ff-body);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .14s;
}

.btn-cert-primary {
  background: var(--or-accent);
  color: #fff;
}
.btn-cert-primary:hover { background: #A8441A; }

.btn-cert-ghost {
  background: transparent;
  border-color: rgba(248,246,241,.15);
  color: rgba(248,246,241,.6);
}
.btn-cert-ghost:hover { background: rgba(248,246,241,.07); color: rgba(248,246,241,.85); }

/* ── EMPTY / PLACEHOLDER STATES ─────────────────────────────────── */
.chapter-empty {
  padding: 12px 14px;
  background: var(--s1);
  border: 1.5px dashed var(--line-mid);
  border-radius: var(--r-md);
  font-size: 12.5px;
  color: var(--ink-ghost);
  font-style: italic;
}

.chapter-state {
  font-size: 13.5px;
  color: var(--ink-ghost);
  font-style: italic;
  line-height: 1.6;
}

/* ── MOBILE TOGGLE ───────────────────────────────────────────────── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 300;
  width: 36px; height: 36px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: 18px;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-md);
}

/* ── UTILITY ─────────────────────────────────────────────────────── */
.mono { font-family: var(--ff-mono); }
.nowrap { white-space: nowrap; }

/* tooltip — using native browser title attribute, no custom CSS needed */

/* ── NAV DONE CHECKMARK ──────────────────────────────────────────── */
.nav-item.done .nav-num::after {
  content: '✓';
  display: block;
  font-size: 9px;
  color: var(--c-green);
  margin-top: 1px;
}

.nav-item.done .nav-title {
  color: rgba(248,246,241,.45);
}

/* ── KEYBOARD FOCUS RING ─────────────────────────────────────────── */
.nav-item:focus-visible {
  outline: 2px solid var(--or-accent-mid);
  outline-offset: -2px;
}

.btn:focus-visible,
.btn-cert:focus-visible {
  outline: 2px solid var(--or-accent-mid);
  outline-offset: 2px;
}

/* ── SUBCHAPTER DONE STATE ───────────────────────────────────────── */
.subch-item.done .subch-name {
  color: var(--ink-ghost);
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
}

.subch-item.done .subch-cta { background: var(--c-green-l); color: var(--c-green); border-color: rgba(26,107,60,.18); }
.subch-item.done .subch-idx  { color: var(--c-green); }

/* ── SUBCHAPTER ACTIVE STATE ─────────────────────────────────────── */
.subch-item.active-topic {
  border-color: var(--or-accent);
  background: var(--or-accent-xlt);
}
.subch-item.active-topic .subch-name { color: var(--or-accent); }
.subch-item.active-topic .subch-idx  { color: var(--or-accent); }
.subch-item.active-topic .subch-note { color: var(--or-accent); opacity: .75; }
.subch-item.active-topic .subch-cta  { background: var(--or-accent); color: #fff; border-color: var(--or-accent); }

/* ── SCROLL HINT on sidebar-nav ─────────────────────────────────── */
.sidebar-nav {
  /* fade bottom to hint at scrollability */
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to bottom, black calc(100% - 28px), transparent 100%);
}

/* ── VIDEO CARD WATCHED STATE ───────────────────────────────────── */
.video-card.watched .video-thumb::after {
  content: '✓ Watched';
  position: absolute;
  bottom: 7px; left: 9px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: rgba(26,107,60,.85);
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: .04em;
  z-index: 2;
}

/* ── PROGRESS RING on cert card ─────────────────────────────────── */
.cert-progress-ring {
  position: absolute;
  top: 20px; right: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ring-svg { transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 3; }
.ring-fill  { fill: none; stroke: var(--or-accent-mid); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.ring-label {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: rgba(248,246,241,.5);
  margin-top: 4px;
  text-align: center;
}

/* ── COPY BUTTON for inline code snippets ────────────────────────── */
.inline-code {
  font-family: var(--ff-mono);
  font-size: 11.5px;
  background: var(--s2);
  border: 1px solid var(--line-mid);
  padding: 1px 6px;
  border-radius: var(--r-xs);
  color: var(--ink-mid);
}

/* ── SIDEBAR SEARCH TRIGGER ─────────────────────────────────────── */
.sidebar-search-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 12px 4px;
  padding: 7px 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background .14s, border-color .14s;
  flex-shrink: 0;
}

.sidebar-search-trigger:hover {
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.16);
}

.search-icon {
  font-size: 15px;
  color: rgba(248,246,241,.40);
  flex-shrink: 0;
  line-height: 1;
}

.search-placeholder {
  flex: 1;
  font-size: 12px;
  color: rgba(248,246,241,.30);
}

.search-kbd {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: rgba(248,246,241,.22);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
}

/* ── SEARCH OVERLAY ─────────────────────────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15,15,14,.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.search-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.search-modal {
  width: 560px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  overflow: hidden;
  border: 1px solid var(--line-mid);
  transform: translateY(-8px);
  transition: transform .18s ease;
}

.search-overlay.open .search-modal {
  transform: translateY(0);
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.search-modal-icon {
  font-size: 18px;
  color: var(--ink-ghost);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--ff-body);
  font-size: 15px;
  color: var(--ink);
  background: transparent;
}

.search-input::placeholder { color: var(--ink-ghost); }

.search-close {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--ink-ghost);
  background: var(--s1);
  border: 1px solid var(--line-mid);
  border-radius: var(--r-xs);
  padding: 2px 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.search-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 6px 0;
}

.search-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  padding: 8px 16px 4px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background .10s;
}

.search-result:hover,
.search-result.focused { background: var(--s0); }

.sr-num {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--ink-ghost);
  width: 30px;
  flex-shrink: 0;
}

.sr-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sr-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-title mark {
  background: var(--or-accent-light);
  color: var(--or-accent);
  border-radius: 2px;
  padding: 0 1px;
}

.sr-sub {
  font-size: 11.5px;
  color: var(--ink-ghost);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-sub mark {
  background: var(--or-accent-light);
  color: var(--or-accent);
  border-radius: 2px;
  padding: 0 1px;
}

.sr-type {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}

.chapter-type { background: var(--or-accent-light); color: var(--or-accent); }
.subch-type   { background: var(--s2); color: var(--ink-muted); }

.search-empty {
  padding: 24px 16px;
  font-size: 13.5px;
  color: var(--ink-muted);
  text-align: center;
}

.search-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  background: var(--s0);
}

.search-hint {
  font-size: 11px;
  color: var(--ink-ghost);
  display: flex;
  align-items: center;
  gap: 4px;
}

.search-hint kbd {
  font-family: var(--ff-mono);
  font-size: 10px;
  background: #fff;
  border: 1px solid var(--line-mid);
  border-radius: 3px;
  padding: 1px 4px;
  color: var(--ink-muted);
}

/* ── TOPBAR ICON BUTTON ─────────────────────────────────────────── */
.topbar-icon-btn {
  position: relative;
  padding: 6px 9px;
  font-size: 15px;
}

.notif-dot {
  display: none;
  position: absolute;
  top: 4px; right: 4px;
  width: 7px; height: 7px;
  background: var(--or-accent);
  border-radius: 50%;
  border: 1.5px solid var(--s0);
}

/* ── NOTIFICATION PANEL ─────────────────────────────────────────── */
.notif-panel {
  position: fixed;
  top: calc(var(--topbar-h) + 6px);
  right: 12px;
  width: 320px;
  background: #fff;
  border: 1px solid var(--line-mid);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  z-index: 500;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(.97);
  transform-origin: top right;
  transition: opacity .16s ease, transform .16s ease;
}

.notif-panel.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px 10px;
  border-bottom: 1px solid var(--line);
}

.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.notif-mark-all {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--or-accent);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--ff-body);
  padding: 0;
}

.notif-mark-all:hover { text-decoration: underline; }

.notif-list { max-height: 320px; overflow-y: auto; }

.notif-empty {
  padding: 26px 24px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  background: linear-gradient(180deg, #fff 0%, var(--s0) 100%);
}

.notif-empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--or-accent-light);
  color: var(--or-accent);
  font-size: 17px;
  box-shadow: inset 0 0 0 1px rgba(196,86,26,.10);
}

.notif-empty-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.notif-empty-text {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 230px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background .12s;
  position: relative;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--s0); }
.notif-item.read { opacity: .6; }

.notif-item-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.notif-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.notif-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.notif-item-text {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.4;
}

.notif-item-time {
  font-size: 10.5px;
  color: var(--ink-ghost);
  margin-top: 2px;
}

.notif-unread-dot {
  width: 7px; height: 7px;
  background: var(--or-accent);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

/* ── FULL-WIDTH TOPIC PAGE ───────────────────────────────────────── */
.topic-page {
  animation: fadeUp .25s ease both;
}

.topic-page-inner {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 32px;
  align-items: start;
  max-width: 85%;
}

.topic-page-content {
  min-width: 0;
}

.topic-page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 28px;
}

.topic-page-sep {
  color: var(--ink-ghost);
  font-size: 14px;
}

.topic-page-loc {
  font-size: 12px;
  color: var(--ink-ghost);
  font-family: var(--ff-mono);
}

.topic-page-body {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 36px 40px;
  box-shadow: var(--sh-sm);
  margin-bottom: 20px;
}

.tp-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.tp-read-time {
  font-size: 11.5px;
  font-family: var(--ff-mono);
  color: var(--ink-ghost);
  background: var(--s1);
  padding: 2px 9px;
  border-radius: 20px;
  border: 1px solid var(--line);
}

.tp-chapter-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--or-accent);
  background: var(--or-accent-xlt);
  padding: 2px 9px;
  border-radius: 20px;
}

.tp-title {
  font-family: var(--ff-display);
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: -.015em;
  color: var(--ink);
  margin-bottom: 28px;
}

.tp-section {
  margin-bottom: 24px;
}

.tp-section-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.tp-section-body p {
  font-size: 14px;
  color: var(--ink-mid);
  line-height: 1.75;
  margin-bottom: 10px;
}

.tp-section-body p:last-child { margin-bottom: 0; }
.tp-section-body strong { color: var(--ink); font-weight: 600; }

.tp-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.60;
  margin: 24px 0;
}

.tp-callout-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.tp-callout-info { background: var(--c-blue-l);  color: var(--c-blue);  border: 1px solid rgba(26,69,112,.12); }
.tp-callout-warn { background: var(--c-amber-l); color: var(--c-amber); border: 1px solid rgba(122,82,9,.12); }

.tp-keypoints { margin-top: 24px; }

.tp-keypoints-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  margin-bottom: 10px;
}

.tp-keypoint {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  color: var(--ink-mid);
  margin-bottom: 7px;
  line-height: 1.5;
}

.tp-keypoint-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--or-accent);
  flex-shrink: 0;
  margin-top: 5px;
}

/* ── tp-prose: styles the renderMarkdown output inside topic-page-body ── */
.tp-prose h2, .tp-prose h3, .tp-prose h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  margin-top: 28px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-family: var(--ff-body);
}

.tp-prose p {
  font-size: 14px;
  color: var(--ink-mid);
  line-height: 1.75;
  margin-bottom: 10px;
}

.tp-prose p:last-child { margin-bottom: 0; }
.tp-prose strong { color: var(--ink); font-weight: 600; }
.tp-prose code { font-family: var(--ff-mono); font-size: 12.5px; background: var(--s1); padding: 1px 5px; border-radius: 3px; }

.tp-prose ul, .tp-prose ol {
  margin: 4px 0 12px 22px;
  color: var(--ink-mid);
  font-size: 14px;
  line-height: 1.75;
}

.tp-prose li { margin-bottom: 4px; }
.tp-prose li::marker { color: var(--or-accent); }

.tp-placeholder-block {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px;
  background: var(--s1);
  border: 1.5px dashed var(--line-mid);
  border-radius: var(--r-lg);
  margin-top: 20px;
}

.tp-placeholder-icon { font-size: 24px; flex-shrink: 0; }

.tp-placeholder-text {
  font-size: 13.5px;
  color: var(--ink-muted);
  line-height: 1.65;
}

.topic-page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}

.topic-page-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tp-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--s3);
  cursor: pointer;
  transition: background .12s, transform .12s;
  flex-shrink: 0;
}

.tp-dot:hover  { background: var(--ink-ghost); transform: scale(1.2); }
.tp-dot.active { background: var(--or-accent); transform: scale(1.3); }

.btn:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }

.topic-page-outline {
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-xs);
  max-height: calc(100vh - var(--topbar-h) - 40px);
  overflow-y: auto;
}

.topic-page-outline::-webkit-scrollbar { width: 3px; }
.topic-page-outline::-webkit-scrollbar-thumb { background: var(--line-mid); border-radius: 2px; }

.tp-outline-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--s0);
}

.tp-subch-list { padding: 4px 0; }

.tp-subch-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background .10s;
  border-left: 2px solid transparent;
}

.tp-subch-item:hover { background: var(--s0); }

.tp-subch-item.active {
  background: var(--or-accent-xlt);
  border-left-color: var(--or-accent);
}

.tp-subch-num {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  color: var(--ink-ghost);
  width: 16px;
  flex-shrink: 0;
  padding-top: 1px;
}

.tp-subch-item.active .tp-subch-num { color: var(--or-accent); }

.tp-subch-name {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.4;
}

.tp-subch-item.active .tp-subch-name {
  color: var(--or-accent);
  font-weight: 500;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .layout { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .topbar { padding: 0 16px; }
  .content-wrap { padding: 20px 16px 48px; }
  .cert-domains { grid-template-columns: 1fr; }
  .chapter-hero-title { font-size: 24px; }
  .video-grid { grid-template-columns: 1fr; }
  .hero-top-row { flex-direction: column; gap: 12px; }
  .hero-right { align-self: flex-start; }
  .topic-page-inner { grid-template-columns: 1fr; }
  .topic-page-outline { position: static; max-height: none; }
  .topic-page-body { padding: 24px 20px; }
  .tp-title { font-size: 26px; }
}

@media (max-width: 560px) {
  .meta-strip { gap: 6px; }
  .cert-req-row { flex-direction: column; }
  .cert-domains { grid-template-columns: 1fr; }
  .topbar-breadcrumb span:not(.current):not(.sep) { display: none; }
}
