@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,500;0,600;0,700;0,800;0,900;1,600;1,700&family=Inter:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

:root {
  --bg: #07090f;
  --bg-2: #0c1018;
  --bg-card: #101520;
  --bg-card-hover: #141c2a;
  --sidebar-width: 300px;
  --topbar-height: 60px;
  --border: rgba(255, 255, 255, 0.06);
  --border-gold: rgba(200, 146, 62, 0.3);
  --gold: #c8923e;
  --gold-light: #e8b06a;
  --gold-dim: rgba(200, 146, 62, 0.1);
  --text: #ddd4c0;
  --text-2: #8a9ab8;
  --text-3: #4a5870;
  --radius: 10px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: 'Archivo', sans-serif;
  line-height: 1.2;
}

a { color: inherit; text-decoration: none; }

/* ─── TOP BAR ─── */
.topbar {
  height: var(--topbar-height);
  background: rgba(7, 9, 15, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-logo {
  font-family: 'Archivo', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text);
  white-space: nowrap;
}
.topbar-logo span { color: var(--gold); }

.topbar-sep { width: 1px; height: 24px; background: var(--border); }

.topbar-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  max-width: 240px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-label {
  font-size: 0.78rem;
  color: var(--text-3);
  white-space: nowrap;
}

.progress-chip {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding: 3px 9px;
  border-radius: 100px;
  flex-shrink: 0;
}
.progress-chip-extra {
  background: rgba(147, 112, 219, 0.16);
  border: 1px solid rgba(147, 112, 219, 0.35);
  color: #c3aef0;
}
.progress-chip-bonus {
  background: rgba(64, 176, 166, 0.16);
  border: 1px solid rgba(64, 176, 166, 0.35);
  color: #7fd9ce;
}

.topbar-home {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-2);
  transition: var(--transition);
  margin-left: auto;
}
.topbar-home:hover { color: var(--gold); }

.topbar-logout {
  margin-left: 18px;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.topbar-logout:hover { color: var(--gold); }

.sidebar-toggle-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  padding: 4px;
  flex-direction: column;
  gap: 4px;
}
.sidebar-toggle-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: var(--transition);
}

/* ─── MAIN LAYOUT ─── */
.course-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

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

.sidebar-module-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.sidebar-module-header:hover { background: var(--bg-card); }
.sidebar-module-header.active { background: var(--gold-dim); }

.sidebar-module.accent-cool {
  background: linear-gradient(180deg, rgba(147, 112, 219, 0.14), rgba(147, 112, 219, 0.04));
}
.sidebar-module.accent-cool .sidebar-module-header:hover { background: rgba(147, 112, 219, 0.14); }
.sidebar-module.accent-cool .sidebar-module-header.active { background: rgba(147, 112, 219, 0.2); }
.sidebar-module.accent-cool .sidebar-mod-num { color: #b39ddb; }

.sidebar-module.accent-teal {
  background: linear-gradient(180deg, rgba(64, 176, 166, 0.14), rgba(64, 176, 166, 0.04));
}
.sidebar-module.accent-teal .sidebar-module-header:hover { background: rgba(64, 176, 166, 0.14); }
.sidebar-module.accent-teal .sidebar-module-header.active { background: rgba(64, 176, 166, 0.2); }
.sidebar-module.accent-teal .sidebar-mod-num { color: #7fd9ce; }

.sidebar-mod-num {
  font-family: 'Archivo', sans-serif;
  font-size: 0.65rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  width: 24px;
  flex-shrink: 0;
}

.sidebar-mod-tag {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 100px;
  flex-shrink: 0;
}

.sidebar-mod-tag.tag-extra {
  background: rgba(147, 112, 219, 0.18);
  border: 1px solid rgba(147, 112, 219, 0.4);
  color: #c3aef0;
}

.sidebar-mod-tag.tag-bonus {
  background: rgba(64, 176, 166, 0.18);
  border: 1px solid rgba(64, 176, 166, 0.4);
  color: #7fd9ce;
}

.sidebar-mod-title {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.3;
  flex: 1;
}

.sidebar-mod-arrow {
  color: var(--text-3);
  font-style: normal;
  font-size: 0.7rem;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.sidebar-module.open .sidebar-mod-arrow { transform: rotate(180deg); }

.sidebar-lessons {
  display: none;
  padding: 0 0 8px;
}
.sidebar-module.open .sidebar-lessons { display: block; }

.sidebar-lesson {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px 8px 52px;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--text-2);
  transition: var(--transition);
  border-left: 3px solid transparent;
  line-height: 1.4;
}
.sidebar-lesson:hover { background: var(--bg-card); color: var(--text); }
.sidebar-lesson.active {
  color: var(--gold-light);
  background: var(--gold-dim);
  border-left-color: var(--gold);
}
.sidebar-lesson.completed { color: var(--text-3); }
.sidebar-lesson.completed .lesson-check { opacity: 1; color: var(--gold); }

.lesson-check {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  flex-shrink: 0;
  opacity: 0.5;
  transition: var(--transition);
  cursor: pointer;
  /* Larger invisible hit area, since the visible dot alone is a bit small to click reliably */
  position: relative;
}
.lesson-check::after {
  content: '';
  position: absolute;
  inset: -8px;
}
.lesson-check:hover {
  opacity: 1;
  border-color: var(--gold-light);
  transform: scale(1.15);
}
.sidebar-lesson.active .lesson-check {
  border-color: var(--gold);
  opacity: 1;
  background: var(--gold-dim);
}

/* Topics covered inside a lesson's video, shown as a timeline flowing down from
   its "Watch the Video" row, since they're chapters of that one video, not
   separate lessons — each still jumps to its section in the transcript below. */
.sidebar-topics {
  position: relative;
  margin: -9px 0 10px 59px;
  padding: 15px 0 0 16px;
  border-left: 2px solid var(--border-gold);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-topic {
  position: relative;
  font-size: 0.76rem;
  font-style: italic;
  color: var(--text-3);
  line-height: 1.4;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-topic:hover {
  color: var(--gold-light);
}

.sidebar-topic::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 0.5em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1.5px solid var(--text-3);
  transform: translate(-50%, -50%);
  transition: var(--transition);
}

.sidebar-topic:hover::before {
  background: var(--gold-light);
  border-color: var(--gold-light);
}

/* ─── CONTENT ─── */
.content-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.content-area::-webkit-scrollbar { width: 6px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.lesson-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 40px 80px;
  width: 100%;
}

/* ─── SITE-WIDE MEDICAL DISCLAIMER (bottom of every lesson) ─── */
.course-disclaimer {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 40px 48px;
  width: 100%;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.course-disclaimer p {
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--text-3);
  margin: 0;
}

@media (max-width: 640px) {
  .course-disclaimer { padding: 20px 22px 40px; }
}

.lesson-module-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.lesson-module-title-extra { color: #b39ddb; }
.lesson-module-title-bonus { color: #7fd9ce; }

.lesson-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 32px;
  line-height: 1.2;
}

.video-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.video-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(200, 146, 62, 0.05) 0%, transparent 60%);
}

.video-play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(200, 146, 62, 0.15);
  border: 2px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--gold);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  z-index: 1;
}
.video-play-btn:hover {
  background: rgba(200, 146, 62, 0.25);
  transform: scale(1.05);
}

.video-placeholder p {
  font-size: 0.8rem;
  color: var(--text-3);
  position: relative;
  z-index: 1;
}

/* Click-to-play YouTube embed: thumbnail + play button until clicked, then a real player */
.lesson-body-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  margin: 20px 0 28px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.lesson-body-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-embed {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

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

.video-embed::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 9, 15, 0.15) 0%, rgba(7, 9, 15, 0.55) 100%);
  transition: var(--transition);
}

.video-embed:hover::before {
  background: linear-gradient(180deg, rgba(7, 9, 15, 0.05) 0%, rgba(7, 9, 15, 0.4) 100%);
}

.video-embed-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(200, 146, 62, 0.2);
  border: 2px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--gold-light);
  cursor: pointer;
  transition: var(--transition);
  z-index: 1;
  backdrop-filter: blur(2px);
}

.video-embed:hover .video-embed-play {
  background: var(--gold);
  color: var(--bg);
  transform: translate(-50%, -50%) scale(1.08);
}

.video-embed.playing {
  cursor: default;
}

.video-embed.playing::before {
  display: none;
}

/* Thumbnail preview for a lesson whose video isn't filmed/uploaded yet — same frame as
   .video-embed but not clickable, with a badge instead of a play button. */
.video-embed-preview {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.video-embed-preview .video-embed-thumb {
  filter: saturate(0.7) brightness(0.55);
}

.video-embed-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 9, 15, 0.2) 0%, rgba(7, 9, 15, 0.6) 100%);
}

.video-embed-preview-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(7, 9, 15, 0.55);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  z-index: 1;
  backdrop-filter: blur(3px);
  white-space: nowrap;
}

.video-embed iframe,
.yt-player-mount,
.native-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  object-fit: cover;
}

/* Invisible layer that intercepts the mouse before it ever reaches the YouTube iframe —
   otherwise YouTube shows its own title/branding chrome on hover no matter what playerVars say */
.yt-click-catcher {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 42px;
  z-index: 1;
  cursor: pointer;
}

/* Custom control bar (replaces each platform's native chrome, which lingers/fades unpredictably).
   Fades out after a few idle seconds while playing; .controls-idle is toggled by JS. */
.video-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: linear-gradient(0deg, rgba(7, 9, 15, 0.88) 0%, rgba(7, 9, 15, 0.6) 75%, transparent 100%);
  opacity: 1;
  transition: opacity 0.4s ease;
}

.video-embed.controls-idle:not(.speed-open) .video-controls {
  opacity: 0;
  pointer-events: none;
}

.vc-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  flex-shrink: 0;
  transition: var(--transition);
}

.vc-btn:hover { color: var(--gold-light); }

.vc-playpause {
  font-size: 0.7rem;
  letter-spacing: -2px;
  width: 20px;
}

/* Circular-arrow button with the skip amount set inside the arc */
.vc-rewind {
  position: relative;
  width: 28px;
  height: 28px;
  padding: 0;
}

.vc-skip-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
  font-size: 0.47rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.vc-rewind:active { transform: scale(0.9); }

.vc-time {
  font-size: 0.72rem;
  color: var(--text-2);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.vc-progress {
  flex: 1;
  cursor: pointer;
  padding: 10px 0;
}

/* ─── Playback speed ─── */
.vc-speed-wrap {
  position: relative;
  flex-shrink: 0;
}

.vc-speed {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  padding: 4px 6px;
  border-radius: 5px;
}
.vc-speed.active { color: var(--gold-light); }
.vc-speed:hover { background: rgba(255, 255, 255, 0.08); }

.vc-speed-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  min-width: 96px;
  padding: 5px;
  border-radius: 10px;
  background: rgba(7, 9, 15, 0.97);
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
  display: none;
  flex-direction: column;
  gap: 1px;
  z-index: 5;
}
.vc-speed-menu.open { display: flex; }

.vc-speed-menu-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 4px 10px 6px;
}

.vc-speed-option {
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  text-align: left;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.vc-speed-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold-light);
}
.vc-speed-option.selected {
  color: var(--gold);
  font-weight: 600;
}

.vc-progress-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.vc-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--gold);
  border-radius: 2px;
}

/* Roomier touch targets on phones, where scrubbing the bar is hardest */
@media (max-width: 640px) {
  .video-controls { gap: 9px; height: 48px; padding: 0 10px; }
  .vc-rewind { width: 34px; height: 34px; }
  .vc-skip-num { font-size: 0.52rem; }
  .vc-time { font-size: 0.68rem; }
}

/* "Beyond the video" — sets the written breakdown apart as optional supplementary reading */
.lesson-extra {
  margin-top: 8px;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.lesson-extra-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--border-gold);
}

.lesson-extra-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.complete-btn-wrap-top {
  margin-top: 20px;
  margin-bottom: 4px;
}

.lesson-body {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.85;
}

/* <picture> wrapper: the tall portrait floats beside the text on desktop, and a wide
   crop (via the <source> media query) spans the full column on mobile, where a narrow
   floated portrait left the text cramped. overflow clips the img to the rounded corners. */
.lesson-body-portrait {
  display: block;
  float: right;
  width: 200px;
  margin: 4px 0 16px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border-gold);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.lesson-body-portrait img {
  display: block;
  width: 100%;
  height: auto;
}

.clear-float { clear: both; }

@media (max-width: 640px) {
  .lesson-body-portrait {
    float: none;
    display: block;
    width: 100%;
    margin: 0 0 20px;
  }
}

.lesson-body a {
  color: var(--gold-light);
  text-decoration: underline;
  text-decoration-color: rgba(232, 176, 106, 0.4);
  text-underline-offset: 3px;
  transition: var(--transition);
}
.lesson-body a:hover {
  color: var(--gold);
  text-decoration-color: var(--gold);
}

.lesson-body a.lesson-highlight {
  font-weight: 700;
  text-decoration-color: var(--gold);
}

/* Inline emphasis for a phrase worth catching the eye, on dark backgrounds */
.lesson-body mark {
  background: rgba(200, 146, 62, 0.18);
  color: var(--text);
  font-weight: 600;
  padding: 0.1em 0.32em;
  border-radius: 4px;
}

.lesson-disclaimer {
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 8px 0 28px;
}

.lesson-disclaimer-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 12px;
}

.lesson-disclaimer p {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 12px;
}

.lesson-disclaimer p:last-child { margin-bottom: 0; }

.lesson-body h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  margin: 48px 0 16px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.lesson-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.lesson-figure {
  margin: 0 0 32px;
}

.lesson-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.lesson-figure:first-child + h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.lesson-figure-flush img {
  border: none;
  border-radius: 0;
}

.lesson-body h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  margin: 32px 0 12px;
}

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

.lesson-body ul {
  padding-left: 20px;
  margin-bottom: 20px;
}

.lesson-body li { margin-bottom: 8px; }

.lesson-body strong { color: var(--text); font-weight: 600; }

.key-takeaways {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 36px 0;
}

/* ─── STORY CHOOSER (Personal Views landing) ─── */
.story-chooser { margin: 28px 0 8px; }

.story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.story-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  font: inherit;
  text-align: left;
  color: var(--text-2);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.story-card:hover {
  color: var(--text);
  background: var(--bg-card-hover);
  border-color: rgba(64, 176, 166, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.story-card-thumb-wrap {
  position: relative;
  display: block;
  line-height: 0;
}

.story-card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.story-card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  background: rgba(7, 9, 15, 0.35);
  opacity: 0.75;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.story-card:hover .story-card-play {
  opacity: 1;
  background: rgba(7, 9, 15, 0.2);
}

.story-card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px 16px;
}

.story-card-name {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #7fd9ce;
}

.story-card-sub {
  font-size: 0.8rem;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .story-grid { grid-template-columns: 1fr; }
}

/* ─── VIDEO INDEX (welcome lesson) ─── */
.video-index { margin: 18px 0 36px; }

.vidx-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.vidx-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 8px;
  font: inherit;
  text-align: left;
  color: var(--text-2);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.vidx-item:hover {
  color: var(--text);
  background: var(--bg-card-hover);
  border-color: var(--border-gold);
  transform: translateY(-1px);
}

.vidx-thumb-wrap {
  position: relative;
  display: block;
  flex-shrink: 0;
  line-height: 0;
}

.vidx-thumb {
  display: block;
  width: 92px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
}

.vidx-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #fff;
  background: rgba(7, 9, 15, 0.4);
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.vidx-item:hover .vidx-play { opacity: 1; }

.vidx-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.vidx-num {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.vidx-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
}

@media (max-width: 700px) {
  .vidx-grid { grid-template-columns: 1fr; }
}

/* ─── VIDEO TRANSCRIPT ─── */
.transcript {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 36px 0;
  overflow: hidden;
}

.transcript > summary {
  padding: 18px 24px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold-light);
  transition: var(--transition);
}
.transcript > summary::-webkit-details-marker { display: none; }
.transcript > summary:hover { background: var(--bg-card-hover); }

.transcript > summary::before {
  content: '▸';
  display: inline-block;
  font-size: 0.9rem;
  transition: transform 0.25s ease;
}
.transcript[open] > summary::before { transform: rotate(90deg); }

.transcript-meta {
  margin-left: auto;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-3);
}

.transcript-body {
  padding: 4px 24px 24px;
  border-top: 1px solid var(--border);
  max-height: 620px;
  overflow-y: auto;
}

.transcript-note {
  font-size: 0.82rem;
  color: var(--text-3);
  margin: 16px 0 20px !important;
  font-style: italic;
}

.transcript-line {
  display: flex;
  gap: 14px;
  margin-bottom: 14px !important;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-2);
}

.transcript-ts {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  color: var(--text-3);
  padding-top: 2px;
  min-width: 44px;
}

@media (max-width: 640px) {
  .transcript > summary { padding: 16px 18px; }
  .transcript-body { padding: 4px 18px 20px; }
  .transcript-line { gap: 10px; font-size: 0.86rem; }
}

/* ─── PROVIDERS MAP ─── */
.providers-map {
  height: 600px;
  border-radius: var(--radius);
  border: 1px solid var(--border-gold);
  overflow: hidden;
  margin: 8px 0 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.providers-map-note {
  font-size: 0.85rem !important;
  color: var(--text-3) !important;
  font-style: italic;
}

.provider-marker {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid rgba(7, 9, 15, 0.85);
  box-shadow: 0 0 10px rgba(200, 146, 62, 0.7), 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.2s ease;
}
.provider-marker:hover { transform: scale(1.35); }

.provider-marker-featured {
  background: radial-gradient(circle, #7fd9ce 0%, rgba(64, 176, 166, 1) 70%);
  box-shadow: 0 0 0 6px rgba(64, 176, 166, 0.18), 0 0 24px rgba(64, 176, 166, 0.85);
  animation: providerPulse 2.4s ease-in-out infinite;
}

@keyframes providerPulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(64, 176, 166, 0.18), 0 0 24px rgba(64, 176, 166, 0.85); }
  50% { box-shadow: 0 0 0 12px rgba(64, 176, 166, 0.08), 0 0 34px rgba(64, 176, 166, 1); }
}

/* Leaflet chrome, restyled to match the course's dark theme */
.leaflet-container {
  background: var(--bg) !important;
  font-family: 'Inter', sans-serif;
}
.leaflet-tooltip.provider-tooltip {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
.leaflet-tooltip.provider-tooltip::before { border-top-color: var(--border-gold); }
.leaflet-tooltip.provider-tooltip-featured { color: #7fd9ce; border-color: rgba(64, 176, 166, 1); font-size: 0.85rem; }
.leaflet-control-zoom a {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
.leaflet-control-zoom a:hover { background: var(--bg-card-hover) !important; }
.leaflet-control-attribution {
  background: rgba(7, 9, 15, 0.7) !important;
  color: var(--text-3) !important;
}
.leaflet-control-attribution a { color: var(--text-2) !important; }

.key-takeaways h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.key-takeaways ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.key-takeaways li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-2);
}

.key-takeaways li::before {
  content: '→';
  color: var(--gold);
  flex-shrink: 0;
}

/* Source/further-reading line beneath a takeaways list */
.key-takeaways .kt-note {
  margin: 16px 0 0 !important;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-3);
}

/* ─── VETTING CHECKLIST (Lesson 5 companion) ─── */
.vet-checklist {
  list-style: none;
  padding: 0;
  margin: 16px 0 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vet-checklist li {
  position: relative;
  padding-left: 30px;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.65;
}

.vet-checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--gold);
  border-radius: 3px;
}

.download-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, rgba(200, 146, 62, 0.14) 0%, rgba(200, 146, 62, 0.04) 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin: 28px 0 36px;
  flex-wrap: wrap;
}

.download-card-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}
.download-card-icon svg { width: 22px; height: 22px; stroke: var(--gold-light); }

.download-card-text { flex: 1; min-width: 200px; }
.download-card-text h4 { font-size: 1.05rem; color: var(--text); margin-bottom: 4px; }
.download-card-text p { color: var(--text-3); font-size: 0.85rem; margin: 0 !important; }

.flags-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0 32px;
}

.flags-box {
  border-radius: var(--radius);
  padding: 20px 22px;
}

.flags-box.red { background: rgba(196, 90, 70, 0.08); border: 1px solid rgba(196, 90, 70, 0.3); }
.flags-box.green { background: rgba(64, 176, 106, 0.08); border: 1px solid rgba(64, 176, 106, 0.3); }

.flags-box h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.flags-box.red h4 { color: #d97a5f; }
.flags-box.green h4 { color: #5fc98a; }

.flags-box ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.flags-box li { font-size: 0.85rem; color: var(--text-2); line-height: 1.5; padding-left: 16px; position: relative; }
.flags-box.red li::before { content: '✕'; position: absolute; left: 0; color: #d97a5f; font-size: 0.75rem; }
.flags-box.green li::before { content: '✓'; position: absolute; left: 0; color: #5fc98a; font-size: 0.75rem; }

@media (max-width: 640px) {
  .flags-grid { grid-template-columns: 1fr; }
}

.expert-note {
  background: var(--bg-card);
  border: 1px solid rgba(64, 176, 166, 0.3);
  border-left: 3px solid #40b0a6;
  border-radius: var(--radius);
  padding: 22px 28px;
  margin: 36px 0;
}

.expert-note h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7fd9ce;
  margin-bottom: 10px;
}

.expert-note p {
  font-size: 0.92rem;
  color: var(--text-2);
  margin-bottom: 0 !important;
}

/* ─── SURVEY FORM ─── */
/* ─── LESSON NAVIGATION ─── */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.lesson-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
  color: var(--text-2);
  font-family: 'Inter', sans-serif;
}
.lesson-nav-btn:hover {
  border-color: var(--border-gold);
  color: var(--text);
}
.lesson-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.lesson-nav-btn.next {
  background: linear-gradient(135deg, var(--gold), #a87030);
  border-color: transparent;
  color: #fff;
}
.lesson-nav-btn.next:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(200, 146, 62, 0.3);
}

.complete-btn-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.lesson-nav-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin: 0 0 32px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
}
.lesson-nav-top .lesson-nav-btn.prev { justify-self: start; }
.lesson-nav-top .lesson-nav-btn.next { justify-self: end; }
.lesson-nav-top .complete-btn-wrap-top { justify-self: center; margin: 0; }

/* Keep the three controls on one row on mobile rather than stacking them, so the whole
   nav stays inside a thumb's reach under the video. The buttons shrink and their label
   wraps under the arrow when space runs out, instead of the row breaking apart. */
@media (max-width: 700px) {
  .lesson-nav-top {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
    padding: 10px 8px;
  }
  .lesson-nav-top .lesson-nav-btn {
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 5px;
    padding: 9px 10px;
    font-size: 0.75rem;
    line-height: 1.3;
    text-align: center;
  }
  .lesson-nav-top .mark-complete-btn {
    padding: 8px 9px;
    font-size: 0.68rem;
    line-height: 1.3;
    text-align: center;
  }
}

.mark-complete-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-3);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}
.mark-complete-btn:hover { border-color: var(--gold); color: var(--gold); }
.mark-complete-btn.done {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
}

/* ─── WELCOME SCREEN ─── */
.welcome-screen {
  max-width: 700px;
  margin: 0 auto;
  padding: 60px 40px;
  text-align: center;
}

.welcome-icon {
  font-size: 3rem;
  margin-bottom: 24px;
}

.welcome-screen h2 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.welcome-screen p {
  color: var(--text-2);
  font-size: 1.05rem;
  margin-bottom: 36px;
}

.welcome-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--gold), #a87030);
  color: #fff;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  box-shadow: 0 4px 24px rgba(200, 146, 62, 0.3);
}
.welcome-start-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(200, 146, 62, 0.4);
}

/* ─── LOGIN GATE ─── */
body.gate-locked .sidebar,
body.gate-locked .topbar-progress { display: none; }

.login-gate { padding-top: 12vh; }

.login-gate-form {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.login-gate-input {
  width: min(340px, 100%);
  padding: 14px 18px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  outline: none;
  transition: var(--transition);
}
.login-gate-input:focus { border-color: var(--gold); }

.login-gate-btn:disabled { opacity: 0.6; cursor: wait; }

.login-gate-error {
  max-width: 420px;
  margin: 0 auto 20px !important;
  font-size: 0.88rem !important;
  color: #e08a8a !important;
}

.login-gate-alt { font-size: 0.9rem !important; }
.login-gate-alt a { color: var(--gold-light); }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  :root { --sidebar-width: 260px; }
}

@media (max-width: 700px) {
  .sidebar-toggle-btn { display: flex; }

  .sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 40px rgba(0,0,0,0.6); }

  .lesson-container { padding: 32px 20px 60px; }

  .topbar-progress { display: none; }
  .topbar-sep { display: none; }
}

/* ─── REVIEW QUIZ ─────────────────────────────────────────────────────────
   Self-contained quiz component. Semantic colours are declared here rather
   than in :root because correct/incorrect are the only place the course
   needs green and red. */
.quiz {
  --quiz-ok: #5ec2a8;
  --quiz-ok-dim: rgba(94, 194, 168, 0.12);
  --quiz-no: #d9776b;
  --quiz-no-dim: rgba(217, 119, 107, 0.12);
  margin: 32px 0;
}

.quiz-loading {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-3);
  font-size: 0.9rem;
  text-align: center;
}
.quiz-loading-error { color: var(--text-2); }

.quiz-card {
  background: linear-gradient(165deg, rgba(200, 146, 62, 0.06) 0%, var(--bg-card) 60%);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  padding: 30px;
  animation: quizIn 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.quiz-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 10px;
}

.quiz-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.quiz-desc {
  color: var(--text-2);
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.quiz-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 0;
  margin: 0 0 22px;
}
.quiz-meta li {
  position: relative;
  font-size: 0.78rem;
  color: var(--text-3);
  margin: 0;
  padding-left: 15px;
}
.quiz-meta li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.65;
}

.quiz-prev {
  padding: 12px 16px;
  margin-bottom: 20px;
  background: var(--gold-dim);
  border: 1px dashed var(--border-gold);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-2);
}
.quiz-prev strong { color: var(--gold-light); font-weight: 700; }

/* Buttons */
.quiz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.quiz-btn-primary {
  background: linear-gradient(135deg, var(--gold), #a87030);
  color: #fff;
}
.quiz-btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(200, 146, 62, 0.3);
}
.quiz-btn-ghost {
  background: none;
  border-color: var(--border-gold);
  color: var(--gold-light);
}
.quiz-btn-ghost:hover { background: var(--gold-dim); color: var(--gold); }

/* Progress rail */
.quiz-rail {
  display: flex;
  gap: 5px;
  margin-bottom: 18px;
}
.quiz-rail-seg {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.35s ease;
}
.quiz-rail-seg.is-current { background: var(--gold); }
.quiz-rail-seg.is-correct { background: var(--quiz-ok); }
.quiz-rail-seg.is-wrong   { background: var(--quiz-no); }

.quiz-counter {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}

.quiz-prompt {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 20px;
}

/* Options */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  line-height: 1.55;
  cursor: pointer;
  transition: var(--transition);
}
.quiz-option:not(.is-locked):hover {
  border-color: var(--border-gold);
  background: var(--bg-card-hover);
  color: var(--text);
}
.quiz-option:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.quiz-key {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 700;
  transition: var(--transition);
}
.quiz-option:not(.is-locked):hover .quiz-key { background: var(--gold-dim); color: var(--gold-light); }

.quiz-opt-text { flex: 1; min-width: 0; }

.quiz-mark {
  flex-shrink: 0;
  width: 18px;
  font-weight: 700;
  text-align: right;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.quiz-option.is-locked { cursor: default; }
/* Dim the also-rans so the two that matter carry the eye. */
.quiz-option.is-locked:not(.is-correct):not(.is-wrong) { opacity: 0.45; }

.quiz-option.is-correct {
  border-color: var(--quiz-ok);
  background: var(--quiz-ok-dim);
  color: var(--text);
}
.quiz-option.is-correct .quiz-key { background: var(--quiz-ok); color: #07120f; }
.quiz-option.is-correct .quiz-mark { opacity: 1; color: var(--quiz-ok); }
.quiz-option.is-correct .quiz-mark::after { content: '✓'; }

.quiz-option.is-wrong {
  border-color: var(--quiz-no);
  background: var(--quiz-no-dim);
  color: var(--text);
}
.quiz-option.is-wrong .quiz-key { background: var(--quiz-no); color: #1a0d0b; }
.quiz-option.is-wrong .quiz-mark { opacity: 1; color: var(--quiz-no); }
.quiz-option.is-wrong .quiz-mark::after { content: '✕'; }

/* Hint */
.quiz-hint-toggle {
  margin-top: 14px;
  padding: 0;
  background: none;
  border: none;
  border-bottom: 1px dashed var(--border-gold);
  color: var(--text-3);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}
.quiz-hint-toggle:hover { color: var(--gold-light); }

.quiz-hint {
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--gold-dim);
  border-left: 2px solid var(--border-gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-2);
  animation: quizIn 0.28s ease;
}

/* Verdict + explanation */
.quiz-reveal {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  animation: quizIn 0.3s ease;
}

.quiz-verdict {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.quiz-reveal.is-correct .quiz-verdict { color: var(--quiz-ok); }
.quiz-reveal.is-wrong .quiz-verdict { color: var(--quiz-no); }

.quiz-explain {
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.75;
  margin-bottom: 18px;
}

/* Results */
.quiz-results { text-align: center; }

.quiz-score {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
}
.quiz-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.quiz-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 8;
}
.quiz-ring-fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}
.quiz-score-num {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
.quiz-score-num strong {
  font-family: 'Archivo', sans-serif;
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--gold-light);
}
.quiz-score-num span { font-size: 0.72rem; color: var(--text-3); }

.quiz-result-msg {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 46ch;
  margin: 0 auto 24px;
}

.quiz-recap {
  list-style: none;
  text-align: left;
  padding: 0;
  margin: 0 0 24px;
  border-top: 1px solid var(--border);
}
.quiz-recap-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 2px;
  margin: 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-2);
}
.quiz-recap-mark {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.62rem;
  font-weight: 700;
  margin-top: 2px;
}
.quiz-recap-item.is-correct .quiz-recap-mark { background: var(--quiz-ok-dim); color: var(--quiz-ok); }
.quiz-recap-item.is-wrong .quiz-recap-mark { background: var(--quiz-no-dim); color: var(--quiz-no); }
.quiz-recap-n { color: var(--text-3); font-weight: 700; margin-right: 4px; }

@media (max-width: 640px) {
  .quiz-card { padding: 22px 18px; }
  .quiz-prompt { font-size: 1rem; }
  .quiz-option { padding: 12px 13px; gap: 11px; font-size: 0.87rem; }
  .quiz-btn { width: 100%; }
  .quiz-meta { gap: 6px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-card, .quiz-hint, .quiz-reveal { animation: none; }
  .quiz-ring-fill { transition: none; }
}

/* ─── PRE-COURSE SURVEY ───────────────────────────────────────────────────
   Reuses the quiz card shell (.quiz-card, .quiz-rail, .quiz-option, .quiz-btn)
   so both read as one system. Only the survey-specific pieces live here:
   selection state, multi-select boxes, the scale, free text, and the summary. */
.survey { margin: 32px 0; }

/* Answered-but-not-current segments: muted gold, so progress reads at a glance */
.quiz-rail-seg.is-done { background: rgba(200, 146, 62, 0.45); }

.sv-help {
  margin: -12px 0 18px;
  font-size: 0.85rem;
  color: var(--text-3);
  line-height: 1.6;
}

/* Chosen answer — gold, since nothing here is right or wrong */
.quiz-option.is-selected {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--text);
}
.quiz-option.is-selected .quiz-key {
  background: var(--gold);
  color: #1a1408;
}

/* Multi-select gets a checkbox rather than a letter */
.sv-key-box { border-radius: 5px; position: relative; }
.quiz-option.is-selected .sv-key-box::after {
  content: '✓';
  font-size: 0.7rem;
  line-height: 1;
}

.sv-option { align-items: center; }

/* Scale */
.sv-scale { margin-top: 4px; }
.sv-scale-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
}
.sv-scale-btn {
  padding: 14px 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.sv-scale-btn:hover {
  border-color: var(--border-gold);
  background: var(--bg-card-hover);
  color: var(--text);
}
.sv-scale-btn.is-selected {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold-light);
}
.sv-scale-ends {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--text-3);
}
.sv-scale-ends span:last-child { text-align: right; }

/* Free text + the optional "tell us more" field */
.sv-textarea,
.sv-other {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  line-height: 1.7;
  resize: vertical;
  transition: var(--transition);
}
.sv-other { margin-top: 12px; }
.sv-textarea::placeholder,
.sv-other::placeholder { color: var(--text-3); }
.sv-textarea:focus,
.sv-other:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--bg-card-hover);
}

/* The warm line that answers back after a choice */
.sv-reflection {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--gold-dim);
  border-left: 2px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.87rem;
  line-height: 1.65;
  color: var(--text-2);
  animation: quizIn 0.28s ease;
}

/* Actions */
.sv-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}
.sv-actions .sv-back { margin-right: auto; }
.sv-actions .quiz-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: none;
  transform: none;
  box-shadow: none;
}
.sv-actions-end { justify-content: flex-end; flex-wrap: wrap; }

/* Summary */
.sv-focus {
  margin: 22px 0;
  padding: 18px 20px;
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
}
.sv-focus-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 8px;
}
.sv-focus-note {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 12px;
}
.sv-focus-list { list-style: none; padding: 0; margin: 0; }
.sv-focus-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 7px;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}
.sv-focus-list li:last-child { margin-bottom: 0; }
.sv-focus-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--gold);
}

.sv-sum-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
}
.sv-sum-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 2px;
  margin: 0;
  border-bottom: 1px solid var(--border);
}
.sv-sum-q { font-size: 0.78rem; color: var(--text-3); line-height: 1.45; }
.sv-sum-a { font-size: 0.9rem; color: var(--text); line-height: 1.55; }

/* Sent */
.sv-done { text-align: center; }
.sv-done-mark {
  width: 46px;
  height: 46px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  font-size: 1.1rem;
  font-weight: 700;
}
.sv-done .sv-focus { text-align: left; }

@media (max-width: 640px) {
  .sv-scale-row { grid-auto-flow: row; grid-auto-columns: auto; }
  .sv-scale-ends { display: none; }
  .sv-actions { flex-wrap: wrap; }
  .sv-actions .quiz-btn { width: auto; flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .sv-reflection { animation: none; }
}
