/* ===== Tokens ===== */
:root {
  --primary: #1ca0f1;
  --primary-600: #0f8ad7;
  --primary-700: #0773b6;
  --primary-bg: #e4f5fe;
  --primary-bg-soft: #f3faff;

  --ink: #424b55;
  --ink-strong: #14202b;
  --ink-soft: #5b6470;
  --muted: #8a93a0;
  --muted-soft: #b3b9c2;

  --line: #ECEEF1;
  --line-soft: #F4F5F7;
  --bg: #ffffff;
  --bg-sidebar: #fbfbfa;
  --bg-card: #ffffff;
  --hover-bg: rgba(120, 130, 140, 0.07);
  --hover-bg-strong: rgba(28, 160, 241, 0.08);

  --yellow-bg: #fde8a8;
  --yellow-bg-soft: #fdf3d3;
  --yellow-text: #6b5318;
  --green: #22a97a;
  --green-strong: #1f8a5c;
  --green-soft: #6ed4ab;
  --green-bg: #e1f5ee;
  --pink-bg: #fbeaf0;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --content-width: 960px;
  --sidebar-width: 280px;
  --rail-width: 76px;

  --shadow-card: 0 1px 2px rgba(20, 32, 43, 0.04), 0 0 0 1px rgba(20, 32, 43, 0.04);
  --shadow-video: 0 24px 60px -20px rgba(28, 160, 241, 0.25), 0 4px 16px rgba(20, 32, 43, 0.06);
  --shadow-lift: 0 8px 24px -8px rgba(20, 32, 43, 0.12);

  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background:
    radial-gradient(1100px 600px at 100% -10%, rgba(28, 160, 241, 0.045), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; }
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection { background: var(--primary-bg); color: var(--ink-strong); }

/* ===== Layout ===== */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* ===== Top navbar (course pages) ===== */
.topnav {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  min-height: 56px;
}
.topnav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-strong);
  text-decoration: none;
  background: var(--line-soft);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.topnav-back:hover {
  background: var(--hover-bg-strong);
  color: var(--primary-700);
  text-decoration: none;
  transform: translateX(-1px);
}
.topnav-back svg { flex-shrink: 0; }
.topnav-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-strong);
  letter-spacing: -0.01em;
  padding-left: 16px;
  margin-left: 4px;
  border-left: 1px solid var(--line);
}
.topnav-emoji {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1;
  background: linear-gradient(135deg, var(--course-color, var(--primary)) 0%, var(--primary-600) 100%);
  box-shadow: 0 4px 10px -4px var(--course-color, var(--primary));
  color: #fff;
}
.topnav-name { color: var(--ink-strong); }

.topnav-progress {
  margin-left: auto;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  min-width: 168px;
  max-width: 240px;
}
.topnav-progress-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-align: right;
  line-height: 1;
}
.topnav-progress-count {
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
}
.topnav-progress-bar {
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 12%, var(--line));
  overflow: hidden;
}
.topnav-progress-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--green-soft));
  border-radius: inherit;
  transition: width 0.32s ease;
}
.topnav-progress.is-done .topnav-progress-label {
  color: var(--green-strong);
}

body.has-topnav .sidebar { top: 56px; height: calc(100vh - 56px); }

/* ===== Home page ===== */
body.home {
  background:
    radial-gradient(900px 500px at 100% -10%, rgba(28, 160, 241, 0.08), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(155, 58, 166, 0.05), transparent 60%),
    var(--bg);
}
.home-main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 56px 40px 88px;
  animation: fade-up 0.4s ease-out both;
}
.home-header { margin-bottom: 28px; }
.home-back {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  margin-bottom: 18px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.home-back:hover { color: var(--ink-strong); border-color: rgba(0,0,0,0.18); }
.home-back svg { flex-shrink: 0; }
.home-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  padding: 4px 10px;
  background: var(--primary-bg);
  border-radius: 999px;
  margin: 0 0 14px;
}
.home-title {
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--ink-strong);
  margin: 0 0 12px;
}
.home-lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
  max-width: 640px;
}
/* Two symmetrical "how your training works" cues under the hub heading:
   a bright Required card and a muted Optional card, so tutors can scan the
   one thing they must do versus what's open whenever they like. */
.home-cues {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}
.home-cue {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--bg-card, #fff);
  box-shadow: var(--shadow-card);
}
.home-cue.is-required {
  background:
    linear-gradient(180deg, var(--primary-bg) 0%, var(--primary-bg-soft) 100%);
  box-shadow: 0 0 0 1px rgba(28, 160, 241, 0.18);
}
.home-cue-flag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 11px;
  border-radius: 999px;
}
/* Match the course cards' status labels (dark "Required" flag, muted
   "Optional" tag) so the cues read as labels, not clickable buttons. */
.home-cue.is-required .home-cue-flag { color: #fff; background: var(--ink-strong); }
.home-cue.is-optional .home-cue-flag {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 14%, var(--line));
}
.home-cue-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink-strong);
}
.home-cue-icon { font-size: 22px; line-height: 1; }
.home-cue-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}
@media (max-width: 640px) {
  .home-cues { grid-template-columns: 1fr; gap: 12px; }
}
.training-quiz-root {
  margin: 0 0 22px;
}
.training-quiz-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-card);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}
.training-quiz-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.training-quiz-eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
.training-quiz-title {
  margin: 0;
  color: var(--ink-strong);
  font-size: 19px;
  line-height: 1.25;
}
.training-quiz-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.training-quiz-status.is-passed {
  background: var(--green-bg);
  color: var(--green-strong);
}
.training-quiz-status.is-pending {
  background: var(--yellow-bg-soft);
  color: var(--yellow-text);
}
.training-quiz-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.training-quiz-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line-soft);
  padding: 8px 10px;
  color: var(--ink-soft);
  font-size: 14px;
}
.training-quiz-stats strong {
  color: var(--ink-strong);
}
.training-quiz-note {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}
.training-quiz-panel.is-error {
  border-color: rgba(220, 38, 38, 0.25);
  background: #fffafa;
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 8px;
}
.course-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid #D6DAE0;
  border-radius: var(--radius);
  background: var(--bg-card);
  text-decoration: none;
  color: var(--ink-strong);
  box-shadow: var(--shadow-card);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
/* Soft color wash that grows on hover */
.course-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(140% 80% at 0% 0%,
      color-mix(in srgb, var(--course-color, var(--primary)) 14%, transparent) 0%,
      transparent 55%);
  opacity: 0.6;
  transition: opacity 0.22s ease;
  pointer-events: none;
}
.course-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--course-color, var(--primary)) 50%, var(--line));
  box-shadow:
    0 14px 30px -14px color-mix(in srgb, var(--course-color, var(--primary)) 45%, transparent),
    var(--shadow-lift);
  text-decoration: none;
}
.course-card:hover::before { opacity: 1; }

/* Hero band — full colored rectangle */
.course-card-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg,
    var(--course-color, var(--primary)) 0%,
    color-mix(in srgb, var(--course-color, var(--primary)) 55%, #000) 100%);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}
.course-card-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255, 255, 255, 0.18) 0%, transparent 55%),
    radial-gradient(90% 70% at 0% 100%, rgba(0, 0, 0, 0.18) 0%, transparent 60%);
  pointer-events: none;
}
.course-card-tile {
  display: inline-grid;
  place-items: center;
  position: relative;
  transition: transform 0.22s ease;
}
.course-card:hover .course-card-tile { transform: scale(1.06) rotate(-2deg); }
.course-card-emoji {
  font-size: 75px;
  line-height: 1;
  filter: saturate(1.1) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.25));
}

/* Title block */
.course-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 24px 20px;
  text-align: center;
  flex: 1;
}
.course-card-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--course-color, var(--primary));
  opacity: 0.85;
}
.course-card-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-strong);
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.course-card-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-top: 2px;
}
.course-card-country {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: center;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--course-color) 12%, transparent);
  color: var(--course-color);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
/* Encouraged / recommended course (e.g. Special Needs) */
.course-card.is-recommended {
  border-color: color-mix(in srgb, var(--course-color) 55%, var(--line));
  box-shadow: var(--shadow-card), 0 0 0 2px color-mix(in srgb, var(--course-color) 22%, transparent);
}
/* Card flag — "Required" (onboarding) or "Most popular" (recommended) */
.course-card-flag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.course-card-flag.is-popular {
  background: var(--course-color);
  color: #fff;
}
.course-card-flag.is-required {
  background: var(--ink-strong);
  color: #fff;
}
.course-card.is-locked .course-card-flag { opacity: 0.92; }
/* "Optional" status tag in the card body (non-onboarding courses) */
.course-card-status {
  align-self: center;
  margin-top: 2px;
  padding: 2px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 14%, var(--line));
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.course-card-note {
  align-self: center;
  margin-top: 6px;
  max-width: 92%;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: color-mix(in srgb, var(--course-color) 80%, var(--ink-strong));
}
.course-card-description {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 6px;
}
.course-card-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-soft);
}

/* Progress bar on course cards */
.course-card-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  align-items: stretch;
}
.course-card-progress-bar {
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 12%, var(--line));
  overflow: hidden;
}
.course-card-progress-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--green-soft));
  border-radius: inherit;
  transition: width 0.32s ease;
}
.course-card-progress-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-align: center;
}
.course-card.is-done .course-card-progress-label {
  color: var(--green-strong);
}

/* Completed state — celebratory filled pill replaces the progress bar */
.course-card-complete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 14px;
  padding: 8px 16px;
  align-self: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--green), var(--green-strong));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--green) 70%, transparent);
  position: relative;
  overflow: hidden;
}
/* Shine sweep across the pill — a little celebration on every visit */
.course-card-complete::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: complete-shine 3s ease-in-out infinite;
}
@keyframes complete-shine {
  0% { left: -60%; }
  55%, 100% { left: 130%; }
}
.course-card-complete .row-check {
  width: 14px;
  height: 14px;
  color: #fff;
  opacity: 1;
  transform: none;
}
/* Lessons done but onboarding quiz not yet passed — amber, not green. */
.course-card-complete.is-quiz-pending {
  background: var(--yellow-bg-soft);
  color: var(--yellow-text);
  box-shadow: none;
}
.course-card-complete.is-quiz-pending::after {
  display: none;
}
.course-card.needs-quiz .course-card-cta {
  color: var(--yellow-text);
  background: var(--yellow-bg-soft);
}
.course-card.needs-quiz:hover .course-card-cta {
  background: var(--yellow-bg);
}
.course-card.is-done {
  border-color: color-mix(in srgb, var(--green) 55%, var(--line));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--green) 30%, transparent),
    0 10px 24px -14px color-mix(in srgb, var(--green) 50%, transparent);
}
/* Soft green wash so a finished course glows a little */
.course-card.is-done::before {
  background:
    radial-gradient(140% 80% at 0% 0%,
      color-mix(in srgb, var(--green) 15%, transparent) 0%,
      transparent 60%);
  opacity: 1;
}
.course-card.is-done .course-card-cta {
  color: var(--green-strong);
  background: color-mix(in srgb, var(--green) 8%, transparent);
}
.course-card.is-done:hover .course-card-cta {
  background: color-mix(in srgb, var(--green) 16%, transparent);
}
/* Filled green completion badge so done reads at a glance — pops in like a
   little trophy moment */
.course-card.is-done .course-card-badge {
  width: 32px;
  height: 32px;
  background: var(--green);
  color: #fff;
  box-shadow: 0 6px 14px -4px color-mix(in srgb, var(--green) 60%, transparent);
  animation: badge-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.course-card.is-done .course-card-badge .row-check {
  width: 17px;
  height: 17px;
}
@keyframes badge-pop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

/* Per-card quiz attempts — reuses the sidebar .quiz-attempt row styling, kept
   compact and tucked under the card's progress. Empty slot collapses away. */
.course-card-attempts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}
.course-card-attempts:empty {
  display: none;
}
.course-card.is-done .course-card-badge .row-check {
  color: #fff;
}

/* Completion badge on course-card hero (top-right of tile area) */
.course-card-hero { position: relative; }
.course-card-badge {
  position: absolute;
  top: 14px;
  right: 18px;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: var(--course-color, var(--primary));
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, 0.3);
  z-index: 1;
}
.course-card-badge .row-check {
  opacity: 1;
  transform: none;
  color: var(--course-color, var(--primary));
  width: 14px;
  height: 14px;
}

/* CTA footer */
.course-card-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--course-color, var(--primary));
  background: color-mix(in srgb, var(--course-color, var(--primary)) 4%, transparent);
  transition: background 0.22s ease, padding 0.22s ease;
}
.course-card-arrow {
  flex-shrink: 0;
  transition: transform 0.22s ease;
}
.course-card:hover .course-card-cta {
  background: color-mix(in srgb, var(--course-color, var(--primary)) 12%, transparent);
}
.course-card:hover .course-card-arrow { transform: translateX(4px); }

@media (max-width: 1400px) {
  .home-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1180px) {
  .home-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .home-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .home-grid { gap: 14px; }
  .course-card-hero { padding: 40px 20px; }
  .course-card-emoji { font-size: 72px; }
  .course-card-body { padding: 16px 20px 18px; }
  .course-card-title { font-size: 17.5px; }
}
@media (max-width: 520px) {
  .home-grid { grid-template-columns: 1fr; }
}

/* Locked course card — visible but not clickable */
.course-card.is-locked {
  cursor: not-allowed;
  filter: grayscale(0.55);
  opacity: 0.78;
}
.course-card.is-locked:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: var(--shadow-card);
}
.course-card.is-locked::before { opacity: 0.35; }
.course-card.is-locked .course-card-hero {
  background: linear-gradient(135deg, #9aa3ad 0%, #6a727b 100%);
}
.course-card.is-locked .course-card-hero::after {
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255, 255, 255, 0.10) 0%, transparent 55%),
    radial-gradient(90% 70% at 0% 100%, rgba(0, 0, 0, 0.22) 0%, transparent 60%);
}
.course-card.is-locked:hover .course-card-tile { transform: none; }
.course-card.is-locked .course-card-emoji {
  filter: saturate(0.4) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.25));
}
.course-card-badge.course-card-badge-lock {
  background: rgba(255, 255, 255, 0.95);
  color: #4a525b;
}
.course-card-badge.course-card-badge-lock .course-card-lock-icon {
  color: #4a525b;
}
.course-card.is-locked .course-card-cta {
  color: #5a626b;
  background: color-mix(in srgb, #6a727b 5%, transparent);
  border-top: 1px dashed var(--line);
}
.course-card.is-locked .course-card-cta .course-card-lock-icon {
  flex-shrink: 0;
}

/* Lock tooltip — floats above locked cards on hover */
.lock-tooltip {
  position: fixed;
  z-index: 9999;
  transform: translateX(-50%);
  background: #1c2027;
  color: #fff;
  border-radius: 10px;
  padding: 11px 15px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  max-width: 210px;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.lock-tooltip.is-visible {
  opacity: 1;
}
.lock-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #1c2027;
}

/* ===== Overview card variant — used for non-training website portals =====
   Distinct from the training card: no big colored hero, no progress bar.
   Thin colored top stripe + circular emoji badge + description-led body. */
.course-card.is-overview {
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--course-color, var(--primary)) 5%, var(--bg-card)) 0%,
      var(--bg-card) 38%);
}
.course-card.is-overview::before {
  background:
    radial-gradient(120% 60% at 100% 100%,
      color-mix(in srgb, var(--course-color, var(--primary)) 12%, transparent) 0%,
      transparent 60%);
  opacity: 0.7;
}
.course-card-stripe {
  display: block;
  height: 6px;
  background: linear-gradient(90deg,
    var(--course-color, var(--primary)) 0%,
    color-mix(in srgb, var(--course-color, var(--primary)) 60%, #fff) 100%);
}
.course-card.is-overview .course-card-body {
  padding: 28px 26px 22px;
  align-items: flex-start;
  text-align: left;
  gap: 10px;
}
.course-card-badge-emoji {
  display: inline-grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--course-color, var(--primary)) 14%, #fff);
  border: 1px solid color-mix(in srgb, var(--course-color, var(--primary)) 22%, var(--line));
  box-shadow:
    0 6px 14px -8px color-mix(in srgb, var(--course-color, var(--primary)) 45%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
  transition: transform 0.22s ease;
}
.course-card.is-overview:hover .course-card-badge-emoji {
  transform: scale(1.05) rotate(-3deg);
}
.course-card-badge-emoji .course-card-emoji {
  font-size: 38px;
  filter: saturate(1.05) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}
.course-card.is-overview .course-card-title {
  font-size: 20px;
  line-height: 1.2;
}
.course-card.is-overview .course-card-description {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-top: 0;
}
.course-card-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.course-card-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--course-color, var(--primary)) 10%, transparent);
  color: color-mix(in srgb, var(--course-color, var(--primary)) 65%, var(--ink-strong));
  border: 1px solid color-mix(in srgb, var(--course-color, var(--primary)) 18%, transparent);
}
.course-card-cta.is-ghost {
  background: transparent;
  border-top: 1px dashed color-mix(in srgb, var(--course-color, var(--primary)) 25%, var(--line));
}
.course-card.is-overview:hover .course-card-cta.is-ghost {
  background: color-mix(in srgb, var(--course-color, var(--primary)) 8%, transparent);
}

@media (max-width: 720px) {
  .course-card.is-overview .course-card-body { padding: 22px 20px 18px; }
  .course-card-badge-emoji { width: 58px; height: 58px; }
  .course-card-badge-emoji .course-card-emoji { font-size: 32px; }
  .course-card.is-overview .course-card-title { font-size: 18px; }
  .sk-emoji { width: 58px; height: 58px; }
}

/* ===== Loading skeletons ===== */
/* Shown in the grid while courses.js/script.js download, then replaced the
   moment the real cards render. Matters most on slower mobile connections. */
.course-card.is-skeleton {
  pointer-events: none;
  cursor: default;
  background: var(--bg-card);
}
.course-card.is-skeleton .course-card-stripe { background: var(--line); }
/* One sheen, two consumers: the standalone `.sk` blocks, and `[data-tutor-state]`
   elements inside a container marked `aria-busy` — the in-app loading mask,
   which shimmers the real elements in place (see below). */
.sk,
[aria-busy="true"] [data-tutor-state] {
  background-image: linear-gradient(
    100deg,
    var(--line-soft) 30%,
    color-mix(in srgb, var(--line) 55%, #fff) 50%,
    var(--line-soft) 70%
  );
  background-size: 200% 100%;
  animation: sk-shimmer 1.3s ease-in-out infinite;
}
.sk { display: block; border-radius: 8px; }
.sk-emoji { width: 66px; height: 66px; border-radius: 18px; margin-bottom: 4px; }
.sk-title { width: 72%; height: 20px; }
.sk-line { width: 52%; height: 13px; }
.sk-tag { width: 42%; height: 22px; border-radius: 999px; margin-top: 6px; }
@keyframes sk-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sk,
  [aria-busy="true"] [data-tutor-state] { animation: none; }
  /* The spinner keeps turning, just slowly — it's the only cue that the card is
     still waiting on an answer. */
  .load-spinner,
  [aria-busy="true"] .course-card-badge::after { animation-duration: 2.4s; }
}

/* ===== In-app loading masks =====
   The real markup is painted — course names, emoji and lesson counts are static
   and correct either way — and only the elements marked `data-tutor-state` (the
   ones whose content comes from the tutor's account) shimmer in place. Because
   they are the real elements, the container keeps its true height and nothing
   shifts when the read lands. The sheen itself lives with `.sk` above. */
[aria-busy="true"] [data-tutor-state] {
  color: transparent !important;
  border-radius: 999px;
}
[aria-busy="true"] [data-tutor-state] * { visibility: hidden; }
/* The CTA's trailing icon (padlock or arrow) sits beside the masked label
   rather than inside it, but it's part of the same verdict — hide it too. */
[aria-busy="true"] .course-card-cta svg { visibility: hidden; }

/* Cards can't be opened until we know where they lead, and a card shouldn't
   assert "locked" while we're still asking. */
[aria-busy="true"] .course-card { pointer-events: none; cursor: default; }
[aria-busy="true"] .course-card.is-locked { filter: none; opacity: 1; }

/* The corner badge is a padlock or a tick — both are verdicts. While we're
   still asking, keep the disc and spin a loader in it instead. */
[aria-busy="true"] .course-card-badge {
  color: transparent;
  background: var(--bg-card);
}
[aria-busy="true"] .course-card-badge svg { visibility: hidden; }

/* Shared spinner: the badge disc and the resource-link padlock slot. */
.load-spinner,
[aria-busy="true"] .course-card-badge::after,
.resource-cue a.rc-link.is-checking .rc-go::after {
  content: "";
  display: inline-block;
  width: var(--spinner-size, 14px);
  height: var(--spinner-size, 14px);
  border: 2px solid var(--line);
  border-top-color: var(--muted);
  border-radius: 50%;
  animation: load-spin 0.8s linear infinite;
}
[aria-busy="true"] .course-card-badge::after {
  position: absolute;
  --spinner-size: 13px;
}
@keyframes load-spin { to { transform: rotate(360deg); } }

/* Quiz intro: the Start button is a verdict too (locked, or ready), so it
   shimmers as a whole rather than just losing its label. */
.quiz-content[aria-busy="true"] .quiz-actions .quiz-btn {
  border-color: transparent;
  box-shadow: none;
  pointer-events: none;
}

/* ===== Course rail (leftmost) ===== */
.rail {
  background: linear-gradient(180deg, #15202b 0%, #0e1721 100%);
  color: #cdd6df;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }

.rail-inner {
  padding: 14px 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.rail-courses {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rail-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px 7px;
  border-radius: 10px;
  text-decoration: none;
  color: #9ba6b3;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.rail-item:hover {
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
  color: #fff;
  transform: translateY(-1px);
}
.rail-item:hover .rail-tile { transform: scale(1.04); }

.rail-tile {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.rail-emoji { font-size: 22px; line-height: 1; filter: saturate(1.05); }

.rail-label {
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: inherit;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.rail-item.active { color: #fff; }
.rail-item.active .rail-tile {
  background: linear-gradient(135deg, var(--course-color, var(--primary)) 0%, var(--primary-600) 100%);
  box-shadow: 0 6px 16px -6px var(--course-color, var(--primary)), 0 0 0 1px rgba(255,255,255,0.08) inset;
}
.rail-item.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 28px;
  background: #fff;
  border-radius: 0 3px 3px 0;
}

/* ===== Sidebar ===== */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.12) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }

/* Drag handle on the right edge of the sidebar. */
.sidebar-resizer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: var(--sidebar-width);
  width: 8px;
  margin-left: -4px;
  cursor: col-resize;
  z-index: 30;
  background: transparent;
  transition: background 0.15s ease;
  touch-action: none;
}
.sidebar-resizer::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 36px;
  background: transparent;
  border-radius: 2px;
  transform: translate(-50%, -50%);
  transition: background 0.15s ease;
}
.sidebar-resizer:hover { background: color-mix(in srgb, var(--primary) 14%, transparent); }
.sidebar-resizer:hover::after { background: var(--primary); }
.sidebar-resizer.dragging { background: color-mix(in srgb, var(--primary) 22%, transparent); }
.sidebar-resizer.dragging::after { background: var(--primary); }
.sidebar-resizer:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}
body.has-topnav .sidebar-resizer { top: 56px; }
@media (max-width: 960px) {
  .sidebar-resizer { display: none; }
}

.sidebar-inner {
  padding: 22px 14px 22px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 16px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-strong);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-emoji { font-size: 18px; line-height: 1; }
.brand:hover { text-decoration: none; }

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 14px;
  color: var(--muted);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(28, 160, 241, 0.15);
}
.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}
.search input::placeholder { color: var(--muted); }

/* Search results panel */
.sidebar[data-mode="results"] .nav,
.sidebar[data-mode="results"] .sidebar-footer { display: none; }
.sidebar[data-mode="nav"] .search-results { display: none; }

.search-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 -4px 8px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding-right: 2px;
}
.search-result {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  transition: background 0.12s ease;
  border: 1px solid transparent;
}
.search-result:hover {
  background: var(--hover-bg);
  text-decoration: none;
}
.search-result.current { background: var(--hover-bg-strong); border-color: rgba(28,160,241,0.18); }

.search-result .sr-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-strong);
}
.search-result .sr-head .ico {
  width: 16px;
  display: inline-flex;
  justify-content: center;
  font-size: 13.5px;
  flex-shrink: 0;
}
.search-result .sr-title { flex: 1; min-width: 0; }
.search-result .sr-snippet {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result .sr-meta {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}
.search-result mark {
  background: rgba(28, 160, 241, 0.20);
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}

.search-empty {
  padding: 14px 12px;
  font-size: 13px;
  color: var(--muted);
}
.search-empty strong { color: var(--ink-strong); font-weight: 600; }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-group {
  border: 0;
  margin-bottom: 2px;
}
.nav-group > summary {
  list-style: none;
  cursor: pointer;
  padding: 7px 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-strong);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  letter-spacing: 0.01em;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover { background: var(--hover-bg); }

/* "From your search" — the sidebar becomes the carried-over result set:
   only these results, tagged with every filter/term that produced them. */
.nav-search-head {
  padding: 2px 4px 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.nav-search-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 3px 0;
  margin-bottom: 8px;
}
.nav-search-back:hover { color: var(--course-color, var(--primary)); }
.nav-search-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.nav-search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.nav-search-chip {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--course-color, var(--primary));
  background: color-mix(in srgb, var(--course-color, var(--primary)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--course-color, var(--primary)) 30%, transparent);
}
.nav-search-count {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.nav-search-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.caret {
  width: 12px;
  height: 12px;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
  color: var(--muted);
}
.caret::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0; height: 0;
  border-left: 4px solid currentColor;
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  transform: translate(-50%, -50%);
  transition: transform 0.18s ease;
}
.nav-group[open] > summary .caret::before { transform: translate(-50%, -50%) rotate(90deg); }

.nav-group ul {
  list-style: none;
  margin: 2px 0 6px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-group li a,
.nav-search-list li a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 22px;
  font-size: 13px;
  color: var(--ink);
  border-radius: var(--radius-sm);
  text-decoration: none;
  position: relative;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-group li a:hover,
.nav-search-list li a:hover {
  background: var(--hover-bg);
  text-decoration: none;
  color: var(--ink-strong);
}
.nav-group li.active a,
.nav-search-list li.active a {
  background: var(--hover-bg-strong);
  color: var(--primary-700);
  font-weight: 500;
}
.nav-group li.active a::before,
.nav-search-list li.active a::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
}
.nav-group .ico,
.nav-search-list .ico {
  display: inline-flex;
  width: 16px;
  justify-content: center;
  font-size: 13.5px;
  line-height: 1;
}
.nav-group .row-title,
.nav-search-list .row-title { flex: 1; min-width: 0; }
.nav-group .row-ext,
.nav-flat .row-ext {
  color: var(--muted);
  opacity: 0.7;
  flex-shrink: 0;
}
.nav-group li a:hover .row-ext,
.nav-flat:hover .row-ext { opacity: 1; color: var(--primary); }

/* ===== Completion check on sidebar rows ===== */
.nav-group li .row-check,
.nav-flat .row-check {
  flex-shrink: 0;
  color: #16a34a;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.nav-group li.completed .row-check,
.nav-flat.completed .row-check {
  opacity: 1;
  transform: scale(1);
}
.nav-flat .row-title { flex: 1; min-width: 0; }

/* ===== Section-complete tick on group headers ===== */
.nav-group > summary .group-check {
  flex-shrink: 0;
  margin-left: auto;
  color: #16a34a;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav-group.section-complete > summary .group-check {
  opacity: 1;
  transform: scale(1);
}
.nav-group.section-complete > summary .group-title { color: #15803d; }

/* ===== Lesson cards (Teaching Tips landing page) ===== */
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 8px 0 32px;
}
.lesson-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  text-decoration: none !important;
  border-bottom: 1px solid var(--line) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: var(--shadow-card);
  color: var(--ink-strong);
  position: relative;
  overflow: hidden;
}
.lesson-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(28,160,241,0.04));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.lesson-card:hover {
  transform: translateY(-2px);
  border-color: rgba(28, 160, 241, 0.35) !important;
  box-shadow: var(--shadow-lift);
}
.lesson-card:hover::before { opacity: 1; }
.lesson-card .lesson-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-600) 100%);
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.lesson-card .lesson-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}
.lesson-card .lesson-meta {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}
.lesson-card .lesson-ext { color: var(--primary); }

.section-group {
  margin-top: 8px;
  margin-bottom: 28px;
}
.section-group-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

.nav-flat {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-strong);
  border-radius: var(--radius-sm);
  margin-top: 6px;
  text-decoration: none;
  transition: background 0.12s ease;
}
.nav-flat:hover { background: var(--hover-bg); text-decoration: none; }
.nav-flat.active {
  background: var(--hover-bg-strong);
  color: var(--primary-700);
}
.nav-flat .ico { font-size: 13.5px; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.quiz-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-600) 100%);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  box-shadow: 0 4px 12px -4px rgba(28, 160, 241, 0.45);
}
.quiz-link:hover {
  filter: brightness(1.05);
  text-decoration: none;
  transform: translateY(-1px);
}
.quiz-link .ext { margin-left: auto; opacity: 0.85; }

/* Completed quiz attempts, listed above the Start Quiz button. Green = pass,
   red = fail. */
.quiz-attempts {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quiz-attempt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 11px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.quiz-attempt-label { color: var(--text-soft, #64748b); font-weight: 600; }
.quiz-attempt-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.quiz-attempt.is-pass {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.22);
}
.quiz-attempt.is-pass .quiz-attempt-score { color: #15803d; }
.quiz-attempt.is-fail {
  background: rgba(220, 38, 38, 0.07);
  border-color: rgba(220, 38, 38, 0.2);
}
.quiz-attempt.is-fail .quiz-attempt-score { color: #dc2626; }

/* Topnav quiz ring (sits in the top-right area) */
.topnav-quiz {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 14px;
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
  background: var(--primary-bg-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
  text-decoration: none;
  color: var(--primary-700);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.topnav-quiz:hover {
  background: var(--primary-bg);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
  text-decoration: none;
  transform: translateY(-1px);
}
.topnav-quiz-icon { font-size: 14px; line-height: 1; }
.topnav-quiz-label { line-height: 1.1; }

/* ===== Main ===== */
.main {
  padding: 44px 40px 72px;
  display: flex;
  justify-content: center;
}
.content {
  width: 100%;
  max-width: var(--content-width);
  animation: fade-up 0.4s ease-out both;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Reference sections: Parent Education (help centre) + Teacher Education (docs) =====
   These are resource libraries, not courses — no progress, completion or linear flow. */
/* Help centre: drop the nav rail so articles read as standalone, centred docs. */
body.ref-helpcenter .layout { grid-template-columns: 1fr; }
body.ref-helpcenter .sidebar,
body.ref-helpcenter .sidebar-toggle,
body.ref-helpcenter .sidebar-resizer { display: none; }

/* Related topics — non-linear footer that replaces the "Up next" course card. */
.related-topics { margin: 56px 0 0; }
.related-heading { font-size: 1rem; font-weight: 600; color: #5a5a5a; margin: 0 0 14px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.related-card {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid #e2e2dd; border-radius: 12px;
  padding: 14px 16px; text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.related-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.06); border-color: var(--course-color, #cccac4); }
.related-emoji {
  font-size: 20px; flex-shrink: 0; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: #f4f3f0; border-radius: 10px;
}
.related-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.related-title { font-size: 14.5px; font-weight: 600; color: #1a1a1a; line-height: 1.3; }
.related-group { font-size: 12px; color: #999; }
.related-arrow { color: #c4c2bc; flex-shrink: 0; transition: transform .15s ease, color .15s ease; }
.related-card:hover .related-arrow { color: var(--course-color, #888); transform: translateX(3px); }

/* Eyebrow / breadcrumb label, injected by script.js */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  padding: 4px 10px;
  background: var(--primary-bg);
  border-radius: 999px;
  margin: 0 0 14px;
}

h1 {
  font-size: 46px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--ink-strong);
  margin: 0 0 10px;
}
.title-emoji {
  margin-right: 6px;
  display: inline-block;
}
/* Training pages keep decorative emoji only in the sidebar — drop them from the
   page title and the Previous/Up Next nav cards, where they read as clutter. */
body.has-topnav .content h1 .title-emoji { display: none; }
body.has-topnav .next-card .ico,
body.has-topnav .prev-card .ico { display: none; }

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0 28px;
  opacity: 0.7;
}

.lead {
  font-size: 17.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 28px;
}

.section-heading {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-strong);
  margin: 36px 0 14px;
  letter-spacing: -0.012em;
  /* Roomier leading so a highlight that wraps to two lines doesn't overlap the
     line below it and clip descenders (the "g" in "tutoring"). */
  line-height: 1.5;
}
.divider + .section-heading { margin-top: 8px; }
.section-heading .hl,
.section-heading .hl-blue {
  padding: 3px 9px;
  border-radius: 6px;
  /* Give every wrapped line its own padded, rounded box instead of one box
     split across the break. */
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.section-heading .hl {
  background: var(--yellow-bg-soft);
}
.section-heading .hl-blue {
  background: var(--primary-bg);
  color: var(--primary-700);
}
/* The highlight's side padding otherwise indents the subheading text ~9px past
   the body copy beneath it. Pull the whole heading left by that padding so the
   text lines up (the padded box then sits just into the gutter). */
.section-heading:has(.hl),
.section-heading:has(.hl-blue) {
  margin-left: -9px;
}

/* Body rhythm */
.content p { margin: 0 0 16px; }
.content ul,
.content ol { margin: 0 0 20px; padding-left: 22px; }
.content li { margin-bottom: 6px; padding-left: 4px; }
.content li::marker { color: var(--muted); }
.content li > ul,
.content li > ol { margin: 8px 0 8px; }

.content h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-strong);
  margin: 28px 0 10px;
  letter-spacing: -0.005em;
}

.content strong { color: var(--ink-strong); font-weight: 600; }

/* Inline code */
.content code {
  background: var(--primary-bg);
  color: var(--primary-700);
  padding: 1.5px 7px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: var(--font-mono);
}

/* Figure / images */
.content figure { margin: 18px 0 26px; }
.content figure img,
.content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
  box-shadow: var(--shadow-card);
}
.content figcaption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
}

/* Tables */
.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 28px;
  font-size: 14.5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}
.content thead th {
  text-align: left;
  font-weight: 600;
  color: var(--ink-strong);
  background: var(--line-soft);
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.content tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.content tbody tr:last-child td { border-bottom: 0; }
.content tbody tr:hover td { background: var(--hover-bg); }

/* Columns */
.content .cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin: 10px 0 28px;
}
.content .cols .col { min-width: 0; }

/* Toggle */
.content .toggle {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 16px;
  margin: 0 0 10px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease;
}
.content .toggle[open] {
  border-color: rgba(28, 160, 241, 0.30);
}
.content .toggle > summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--ink-strong);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}
.content .toggle > summary::-webkit-details-marker { display: none; }
.content .toggle > summary::before {
  content: "";
  width: 0; height: 0;
  border-left: 5px solid var(--muted);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.content .toggle[open] > summary::before {
  transform: rotate(90deg);
  border-left-color: var(--primary);
}
.content .toggle > *:not(summary) { margin-top: 12px; }

/* Blockquote */
.content blockquote {
  border-left: 3px solid var(--primary);
  background: var(--primary-bg-soft);
  padding: 12px 18px;
  color: var(--ink);
  margin: 16px 0 22px;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.content blockquote p:last-child { margin-bottom: 0; }

/* Inline links inside content */
.content a {
  color: var(--primary-700);
  border-bottom: 1px solid rgba(28, 160, 241, 0.30);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.content a:hover {
  border-bottom-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}
/* Exceptions */
.content .next-card,
.content .next-card:hover,
.content .prev-card,
.content .prev-card:hover,
.content .callout a { border-bottom: 0; }
/* Quiz buttons rendered as links must keep button styling, not link styling */
.content a.quiz-btn,
.content a.quiz-btn:hover { border-bottom: 0; }
.content a.quiz-btn-primary,
.content a.quiz-btn-primary:hover { color: #fff; }
.content a.quiz-btn-ghost { color: var(--ink-soft); }

/* External activity / resource links */
.content .resource-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  margin: 0 8px 10px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  color: var(--primary-700);
  font-weight: 500;
  font-size: 15px;
}
.content .resource-link:hover {
  border-color: rgba(28, 160, 241, 0.30);
  color: var(--primary);
}
.content .resource-link::after { content: "↗"; font-size: 13px; opacity: 0.75; }

/* Resource cue — ties a training page to ready-to-use resources in the hub */
.content .resource-cue {
  margin: 14px 0 32px;
  padding: 16px 18px 15px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--course-color, var(--primary)) 6%, var(--bg-card));
  border: 1px solid color-mix(in srgb, var(--course-color, var(--primary)) 22%, var(--line));
  box-shadow: var(--shadow-card);
}
.resource-cue .rc-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--course-color, var(--primary));
  margin: 0 0 8px;
}
.resource-cue .rc-lead { margin: 0 0 13px; font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.resource-cue .rc-links { display: flex; flex-direction: column; gap: 8px; }
.resource-cue a.rc-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 13px;
  background: var(--bg-card);
  border: 1px solid color-mix(in srgb, var(--course-color, var(--primary)) 18%, var(--line));
  border-radius: 10px;
  text-decoration: none; border-bottom: 0;
  transition: border-color .15s ease, transform .15s ease;
}
.resource-cue a.rc-link:hover {
  border-color: var(--course-color, var(--primary));
  transform: translateX(2px);
}
.resource-cue .rc-emoji {
  flex: none; width: 36px; height: 36px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 19px;
  background: color-mix(in srgb, var(--course-color, var(--primary)) 13%, #fff);
}
.resource-cue .rc-body { display: flex; flex-direction: column; line-height: 1.35; }
.resource-cue .rc-body strong { font-size: 15px; color: var(--ink-strong); font-weight: 600; }
.resource-cue .rc-meta { font-size: 12.5px; color: var(--ink-soft); }
.resource-cue .rc-go { margin-left: auto; color: var(--course-color, var(--primary)); font-size: 17px; flex: none; }

/* Locked resource link — outbound library links stay sealed during onboarding. */
.resource-cue a.rc-link.is-locked {
  cursor: not-allowed;
  filter: grayscale(0.55);
  opacity: 0.72;
  border-style: dashed;
  border-color: var(--line);
}
.resource-cue a.rc-link.is-locked:hover {
  transform: none;
  border-color: var(--line);
}
.resource-cue a.rc-link.is-locked .rc-emoji { background: color-mix(in srgb, #6a727b 12%, #fff); }
.resource-cue a.rc-link.is-locked .rc-go { color: #6a727b; display: inline-flex; align-items: center; }
.resource-cue a.rc-link.is-locked .rc-go .course-card-lock-icon { width: 16px; height: 16px; }

/* In-app, the unlock answer comes from the tutor's account: hold the link sealed
   but spin the padlock slot until the backend replies, so a tutor who has
   already passed isn't shown a lock that flips a second later. The spinner
   itself is declared with the card-badge one, above. */
.resource-cue a.rc-link.is-checking { border-style: solid; }
.resource-cue a.rc-link.is-checking .rc-go svg { display: none; }

/* Locked library tile on the root home gallery. */
.course-card.is-overview.is-locked .course-card-badge-emoji { filter: saturate(0.4); }
.course-card-tag .course-card-lock-icon { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; }

/* ===== Video ===== */
.video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin: 12px 0 32px;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-video);
}
.video-wrap iframe,
.video-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Loom click-to-play facade.
   .is-facade  → player not loaded yet; the poster and play button are all
                 there is, and the (src-less) iframe is out of the way.
   .is-loading → play was pressed and the player is still coming down. */
.video-wrap.has-poster {
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.video-wrap.is-facade iframe { display: none; }
.loom-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0;
  background: rgba(0, 0, 0, 0.14);
  border: 0;
  cursor: pointer;
  transition: background 0.18s ease;
}
.loom-play:hover { background: rgba(0, 0, 0, 0.26); }
.loom-play:focus-visible {
  outline: 3px solid var(--brand, #1ca0f1);
  outline-offset: -3px;
}
.loom-play-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--brand, #1ca0f1);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.34);
  transition: transform 0.18s ease;
}
.loom-play-icon svg { width: 28px; height: 28px; margin-left: 3px; }
.loom-play:hover .loom-play-icon { transform: scale(1.08); }
.loom-play:active .loom-play-icon { transform: scale(0.97); }

/* Spinner between the click and the player painting, so the still frame is
   never mistaken for a dead screenshot again. */
.video-wrap.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: loom-spin 0.8s linear infinite;
}
@keyframes loom-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .loom-play-icon,
  .loom-play { transition: none; }
  .loom-play:hover .loom-play-icon,
  .loom-play:active .loom-play-icon { transform: none; }
  .video-wrap.is-loading::after { animation-duration: 2.4s; }
}

/* ===== Video placeholder =====
   Stands in for a Loom that hasn't been filmed yet. The ID (e.g. AU-05)
   matches the video brief, so whoever films it knows where it goes. */
.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  min-height: 150px;
  width: 100%;
  margin: 12px 0 32px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1.5px dashed color-mix(in srgb, var(--course-color, var(--primary)) 35%, var(--line));
  background: linear-gradient(180deg, var(--primary-bg-soft) 0%, #fff 100%);
  box-sizing: border-box;
}
.video-placeholder .vp-icon { font-size: 30px; line-height: 1; }
.video-placeholder .vp-title { font-weight: 600; color: var(--ink-strong); font-size: 16px; }
.video-placeholder .vp-note { font-size: 13.5px; color: var(--muted); }
.video-placeholder .vp-id {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted-soft);
  font-variant-numeric: tabular-nums;
}

/* ===== Callout ===== */
.callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background:
    linear-gradient(180deg, var(--primary-bg) 0%, var(--primary-bg-soft) 100%);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 10px 0 32px;
  color: var(--ink);
  position: relative;
  box-shadow: 0 0 0 1px rgba(28, 160, 241, 0.12);
}
.callout::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  background: var(--primary);
  border-radius: 2px;
}
.callout-icon {
  font-size: 20px;
  line-height: 1.4;
  flex-shrink: 0;
}
.callout-body {
  font-size: 15px;
  line-height: 1.6;
}
.callout-body strong { color: var(--ink-strong); }
.callout-body p:last-child { margin-bottom: 0; }
/* Same shape, warmer accent — for a "nothing's broken, but read this" notice. */
.callout.is-warn {
  background: linear-gradient(180deg, var(--yellow-bg-soft) 0%, #fffdf5 100%);
  box-shadow: 0 0 0 1px rgba(107, 83, 24, 0.14);
}
.callout.is-warn::before { background: #d9a02c; }

/* =====================================================================
   Interactive learning components (course pages)
   - .checkpoint  → active-recall "pause & think", click to reveal
   - .scenario    → pick-an-option decision practice with feedback
   - .say         → ready-to-use script line with a copy button
   These are progressively enhanced by script.js; they degrade to
   readable static content if JS is off.
===================================================================== */

/* Shared eyebrow label used inside interactive blocks */
.ix-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

/* ----- Checkpoint (active recall) ----- */
.content .checkpoint {
  --ix: var(--course-color, var(--primary));
  border: 1px solid color-mix(in srgb, var(--ix) 24%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--ix) 7%, #fff) 0%,
      color-mix(in srgb, var(--ix) 3%, #fff) 100%);
  padding: 18px 20px;
  margin: 10px 0 28px;
  box-shadow: var(--shadow-card);
}
.content .checkpoint .ix-eyebrow { color: var(--ix); }
.content .checkpoint .cp-q {
  font-weight: 600;
  color: var(--ink-strong);
  margin: 0;
  font-size: 16px;
}
.content .checkpoint .cp-reveal {
  appearance: none;
  -webkit-appearance: none;
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ix);
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--ix) 34%, var(--line));
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.content .checkpoint .cp-reveal:hover {
  background: color-mix(in srgb, var(--ix) 9%, #fff);
  border-color: var(--ix);
}
.content .checkpoint .cp-reveal:active { transform: translateY(1px); }
.content .checkpoint .cp-a {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed color-mix(in srgb, var(--ix) 30%, var(--line));
  color: var(--ink);
  animation: ixFade 0.25s ease;
}
.content .checkpoint .cp-a[hidden] { display: none; }
.content .checkpoint .cp-a > :first-child { margin-top: 0; }
.content .checkpoint .cp-a > :last-child { margin-bottom: 0; }

@keyframes ixFade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* ----- Scenario (decision practice) ----- */
.content .scenario {
  --ix: var(--course-color, var(--primary));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 18px 20px;
  margin: 10px 0 28px;
  box-shadow: var(--shadow-card);
}
.content .scenario .ix-eyebrow { color: var(--ix); }
.content .scenario .sc-q {
  font-weight: 600;
  color: var(--ink-strong);
  margin: 0 0 14px;
  font-size: 16px;
}
.content .scenario .sc-opt {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 15px;
  color: var(--ink-strong);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 15px 12px 44px;
  margin: 0 0 10px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.content .scenario .sc-opt::before {
  content: "";
  position: absolute;
  left: 15px; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--ix) 35%, var(--line));
  transition: border-color 0.15s ease, background 0.15s ease;
}
.content .scenario .sc-opt:hover:not([disabled]) {
  border-color: color-mix(in srgb, var(--ix) 45%, var(--line));
  background: color-mix(in srgb, var(--ix) 5%, #fff);
}
.content .scenario .sc-opt[disabled] { cursor: default; }
.content .scenario .sc-opt.is-chosen { border-width: 1px; }
.content .scenario .sc-opt.is-correct {
  border-color: var(--green);
  background: var(--green-bg);
}
.content .scenario .sc-opt.is-correct::before {
  border-color: var(--green-strong);
  background: var(--green-strong);
}
.content .scenario .sc-opt.is-wrong {
  border-color: #e8a3a3;
  background: #fdeeee;
}
.content .scenario .sc-opt.is-wrong::before {
  border-color: #d05b5b;
  background: #d05b5b;
}
.content .scenario .sc-feedback {
  margin: 4px 0 0;
  padding: 12px 15px;
  border-radius: 10px;
  font-size: 14.5px;
  color: var(--ink);
  background: color-mix(in srgb, var(--ix) 7%, #fff);
  border: 1px solid color-mix(in srgb, var(--ix) 18%, var(--line));
  animation: ixFade 0.25s ease;
}
.content .scenario .sc-feedback[hidden] { display: none; }
.content .scenario .sc-feedback.is-good {
  background: var(--green-bg);
  border-color: color-mix(in srgb, var(--green) 35%, var(--line));
}
.content .scenario .sc-feedback strong { color: var(--ink-strong); }

/* ----- Pay example (what the take rate comes to in dollars) ----- */
.content .pay-example {
  --ix: var(--course-color, var(--primary));
  border: 1px solid color-mix(in srgb, var(--green) 38%, var(--line));
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--green-bg) 0%, #fff 65%);
  padding: 20px 22px;
  margin: 10px 0 28px;
  box-shadow: var(--shadow-card);
}
.content .pay-example .pe-head {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-strong);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.content .pay-example .pe-lead {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--ink);
}
.content .pay-example .pe-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.content .pay-example .pe-row {
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line));
  border-radius: 10px;
  padding: 13px 16px;
}
.content .pay-example .pe-label {
  display: block;
  font-size: 12.8px;
  color: var(--ink-soft);
  margin-bottom: 2px;
}
.content .pay-example .pe-val {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink-strong);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.content .pay-example .pe-unit {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0;
}
.content .pay-example .pe-note {
  margin: 16px 0 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.content .pay-example .pe-note strong { color: var(--ink); }

/* ----- Earnings growth chart (illustrative monthly earnings) ----- */
.content .earn-chart {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  padding: 22px 22px 16px;
  margin: 14px 0 24px;
}
.content .earn-chart .ec-bars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: end;
}
.content .earn-chart .ec-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.content .earn-chart .ec-val {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-strong);
  letter-spacing: -0.01em;
}
.content .earn-chart .ec-track {
  width: 100%;
  max-width: 110px;
  height: 190px;
  display: flex;
  align-items: flex-end;
  border-radius: 10px;
  background: var(--line-soft);
  overflow: hidden;
}
.content .earn-chart .ec-fill {
  width: 100%;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--green) 85%, #fff) 0%,
    var(--green-strong) 100%);
}
.content .earn-chart .ec-x {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-strong);
}
.content .earn-chart .ec-sub {
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: center;
  margin-top: -4px;
}
.content .earn-chart .ec-caption {
  margin: 16px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
@media (max-width: 560px) {
  .content .earn-chart .ec-track { height: 140px; }
  .content .earn-chart .ec-val { font-size: 16px; }
}

/* ----- Pay acknowledgement (confirm the starting take rate) ----- */
.content .payack {
  --ix: var(--course-color, var(--primary));
  border: 2px solid color-mix(in srgb, var(--ix) 42%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--ix) 9%, #fff) 0%,
      color-mix(in srgb, var(--ix) 3%, #fff) 100%);
  padding: 22px 24px;
  margin: 16px 0 30px;
  box-shadow: var(--shadow-card);
  scroll-margin-top: 90px;
}
.content .payack .ix-eyebrow { color: var(--ix); }
.content .payack .pa-q {
  font-weight: 600;
  color: var(--ink-strong);
  font-size: 17px;
  margin: 0 0 6px;
}
.content .payack .pa-sub {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--ink);
}
.content .payack .pa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.content .payack .pa-btn {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.content .payack .pa-btn:active { transform: translateY(1px); }
.content .payack .pa-yes {
  color: #fff;
  background: var(--green-strong);
  border: 1px solid var(--green-strong);
}
.content .payack .pa-yes:hover { background: var(--green); border-color: var(--green); }
.content .payack .pa-no {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}
.content .payack .pa-no:hover { border-color: var(--muted-soft); background: var(--hover-bg); }

.content .payack .pa-confirmed {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  color: var(--ink);
}
.content .payack .pa-confirmed[hidden],
.content .payack .pa-ask[hidden],
.content .payack .pa-unsure[hidden] { display: none; }
.content .payack .pa-tick {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green-strong);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}
.content .payack .pa-confirmed p { margin: 0; }
.content .payack .pa-change {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink-soft);
  background: none;
  border: none;
  padding: 0;
  margin-top: 6px;
  text-decoration: underline;
  cursor: pointer;
}
.content .payack .pa-change:hover { color: var(--ink-strong); }
.content .payack.is-confirmed {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
  background: linear-gradient(180deg, var(--green-bg) 0%, #fff 100%);
}
.content .payack.is-confirmed .ix-eyebrow { color: var(--green-strong); }

/* Sent here by the quiz's lock modal — draw the eye once, then settle. */
.content .payack.is-flagged {
  animation: payackFlag 1.1s ease-out 2;
}
@keyframes payackFlag {
  0%, 100% { box-shadow: var(--shadow-card); }
  35% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--ix) 22%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .content .payack.is-flagged { animation: none; }
}

.content .payack .pa-unsure {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 10px;
  background: var(--yellow-bg-soft);
  border: 1px solid color-mix(in srgb, var(--yellow-bg) 70%, var(--line));
  color: var(--yellow-text);
  font-size: 14.5px;
  animation: ixFade 0.25s ease;
}
.content .payack .pa-unsure > :first-child { margin-top: 0; }
.content .payack .pa-unsure > :last-child { margin-bottom: 0; }
.content .payack .pa-unsure strong { color: var(--yellow-text); }

/* ----- Say-this (copyable script line) ----- */
.content .say {
  --ix: var(--course-color, var(--primary));
  position: relative;
  border-left: 3px solid var(--ix);
  background: color-mix(in srgb, var(--ix) 6%, #fff);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 90px 14px 18px;
  margin: 10px 0 22px;
  color: var(--ink-strong);
  font-style: italic;
}
.content .say::before {
  content: "Say this";
  position: absolute;
  top: -9px; left: 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ix);
  background: #fff;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ix) 22%, var(--line));
  font-style: normal;
}
.content .say .say-copy {
  position: absolute;
  top: 50%; right: 12px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  color: var(--ix);
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--ix) 28%, var(--line));
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.content .say .say-copy:hover {
  background: color-mix(in srgb, var(--ix) 9%, #fff);
  border-color: var(--ix);
}
.content .say .say-copy.is-copied { color: var(--green-strong); border-color: var(--green); }
.content .say.prompt::before { content: "Prompt"; }

@media (max-width: 600px) {
  .content .say { padding: 14px 16px 44px; }
  .content .say .say-copy { top: auto; bottom: 10px; right: 14px; transform: none; }
}

/* =====================================================================
   Course archetype components
   A small kit applied selectively per page type — not all on every page.
     .lesson-meta → course-arc orientation strip under the H1
     .figure      → inline SVG diagram + caption
     .steps       → numbered method (ordered)
     .example     → worked "in the lesson" mini-transcript
     .compare     → instead-of / try-this two-column
     .takeaway    → single "try this next lesson" line
     .this-week   → closing commitment card
===================================================================== */

/* ----- Lesson orientation strip ----- */
.content .lesson-meta {
  --ix: var(--course-color, var(--primary));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: -4px 0 26px;
  font-size: 13px;
  color: var(--ink-soft);
}
.content .lesson-meta .lm-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.content .lesson-meta .lm-item svg { color: var(--ix); flex-shrink: 0; }
.content .lesson-meta .lm-dot { color: var(--muted-soft); }

/* ----- Figure / diagram ----- */
.content .figure {
  margin: 14px 0 30px;
  text-align: center;
}
.content .figure svg { max-width: 100%; height: auto; }
.content .figure-cap {
  margin: 12px auto 0;
  max-width: 540px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* ----- Numbered method steps ----- */
.content .steps {
  --ix: var(--course-color, var(--primary));
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 6px 0 28px;
}
.content .steps > li {
  counter-increment: step;
  position: relative;
  padding: 4px 0 18px 56px;
  margin: 0;
}
.content .steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px; top: 38px; bottom: 4px;
  width: 2px;
  background: color-mix(in srgb, var(--ix) 28%, var(--line));
}
.content .steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ix) 12%, #fff);
  border: 1.5px solid color-mix(in srgb, var(--ix) 40%, var(--line));
  color: var(--ix);
  font-weight: 700;
  font-size: 15px;
}
.content .steps > li > .step-title {
  display: block;
  font-weight: 600;
  color: var(--ink-strong);
  font-size: 16px;
  margin: 5px 0 4px;
}
.content .steps > li > :last-child { margin-bottom: 0; }

/* ----- Worked example ("in the lesson") ----- */
.content .example {
  --ix: var(--course-color, var(--primary));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-sidebar, #fbfbfa);
  padding: 16px 18px 6px;
  margin: 10px 0 28px;
}
.content .example > .ix-eyebrow { color: var(--ix); }
.content .example .turn {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  margin-bottom: 12px;
  align-items: start;
}
.content .example .turn .who {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ix);
  text-align: right;
  padding-top: 2px;
  line-height: 1.5;
}
.content .example .turn.you .who { color: var(--ink-strong); }
.content .example .turn p { margin: 0; line-height: 1.55; }
@media (max-width: 560px) {
  .content .example .turn { grid-template-columns: 1fr; gap: 2px; }
  .content .example .turn .who { text-align: left; }
}

/* ----- Compare: instead of / try ----- */
.content .compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 10px 0 28px;
}
.content .compare .col {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--bg-card);
}
.content .compare .col h4 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 7px;
}
.content .compare .col ul { margin: 0; padding-left: 18px; }
.content .compare .col li { margin-bottom: 7px; }
.content .compare .col li:last-child { margin-bottom: 0; }
.content .compare .col.dont { background: #fdf6f6; border-color: #f0d9d9; }
.content .compare .col.dont h4 { color: #c0524f; }
.content .compare .col.do { background: var(--green-bg); border-color: color-mix(in srgb, var(--green) 30%, var(--line)); }
.content .compare .col.do h4 { color: var(--green-strong); }
@media (max-width: 560px) {
  .content .compare { grid-template-columns: 1fr; }
}

/* ----- Single takeaway line ----- */
.content .takeaway {
  --ix: var(--course-color, var(--primary));
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-left: 3px solid var(--ix);
  background: color-mix(in srgb, var(--ix) 6%, #fff);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 13px 18px;
  margin: 10px 0 28px;
  color: var(--ink-strong);
}
.content .takeaway::before { content: "🎯"; font-size: 17px; line-height: 1.5; }
.content .takeaway p { margin: 0; }

/* ----- Closing "this week" commitment card ----- */
.content .this-week {
  --ix: var(--course-color, var(--primary));
  border: 1.5px solid color-mix(in srgb, var(--ix) 35%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ix) 8%, #fff) 0%, #fff 70%);
  padding: 20px 22px;
  margin: 32px 0 8px;
}
.content .this-week .tw-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: var(--ink-strong);
  font-size: 17px;
  margin: 0 0 12px;
}
.content .this-week .tw-head .tw-badge {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--ix);
  color: #fff;
}
.content .this-week ul { margin: 0; padding-left: 4px; list-style: none; }
.content .this-week li {
  position: relative;
  padding: 0 0 10px 30px;
  margin: 0;
}
.content .this-week li:last-child { padding-bottom: 0; }
.content .this-week li::before {
  content: "";
  position: absolute;
  left: 2px; top: 6px;
  width: 15px; height: 15px;
  border-radius: 5px;
  border: 2px solid color-mix(in srgb, var(--ix) 45%, var(--line));
}

/* ===== Page nav (prev + next) ===== */
.page-nav {
  display: flex;
  gap: 14px;
  margin: 48px 0 0;
}
.page-nav .prev-card,
.page-nav .next-card { flex: 1 1 0; margin: 0; }

.next-card,
.prev-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  box-shadow: var(--shadow-card);
}
.next-card { margin: 48px 0 0; justify-content: space-between; }
.prev-card { justify-content: flex-start; }

.next-card:hover,
.prev-card:hover {
  transform: translateY(-2px);
  border-color: rgba(28, 160, 241, 0.40);
  box-shadow: var(--shadow-lift);
  text-decoration: none;
  background: linear-gradient(135deg, #fff 0%, var(--primary-bg-soft) 100%);
}

.next-card .next-label,
.prev-card .prev-label {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.next-card .next-target,
.prev-card .prev-target {
  color: var(--ink-strong);
  font-size: 17px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.next-card .next-arrow,
.prev-card .prev-arrow {
  flex-shrink: 0;
  color: var(--primary);
  transition: transform 0.18s ease;
}
.next-card:hover .next-arrow { transform: translateX(4px); }
.prev-card:hover .prev-arrow { transform: translateX(-4px); }

.next-card .next-body,
.prev-card .prev-body { display: flex; flex-direction: column; }
.prev-card .prev-body { align-items: flex-start; }

/* ===== End-of-course quiz CTA card ===== */
.quiz-cta-card {
  border-color: rgba(28, 160, 241, 0.45);
  background: linear-gradient(135deg, #fff 0%, var(--primary-bg-soft) 100%);
}
.quiz-cta-card .next-label { color: var(--primary); }
.quiz-cta-card:hover { border-color: var(--primary); }

/* ===== Mobile toggle ===== */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 30;
  width: 36px; height: 36px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-strong);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .main { padding: 40px 32px 64px; }
}

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .main { padding: 28px 18px 60px; }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    max-width: 86vw;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.10);
  }
  body.has-topnav .sidebar { top: 0; height: 100vh; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle {
    display: inline-flex;
    top: 10px;
    right: 12px;
    left: auto;
  }
  /* Course pages only: the menu (opens the lesson sidebar) moves to the LEFT —
     it's the primary in-course navigation. Back, which exits all the way to the
     course list, is the secondary action and sits just to its right. CLR and
     reference pages keep their own top bars untouched. */
  body.has-topnav .sidebar-toggle { left: 12px; right: auto; }
  body.has-topnav .topnav { padding: 8px 14px 8px 56px; }
  /* CLR resource pages: same idea — menu on the LEFT, and pad the top bar so its
     Back link clears the button. (Otherwise the right-hand menu covered the
     favourite button.) */
  body.has-clr-topbar .sidebar-toggle { left: 12px; right: auto; }
  body.has-clr-topbar .clr-topbar { padding-left: 56px; }
  .topnav { padding: 8px 56px 8px 14px; gap: 8px; min-height: 52px; }
  .topnav-title {
    font-size: 14px;
    padding-left: 12px;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }
  .topnav-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topnav-emoji { width: 24px; height: 24px; font-size: 14px; flex-shrink: 0; }
  .topnav-back { padding: 6px 10px; font-size: 13px; flex-shrink: 0; }
  .topnav-progress { min-width: 84px; max-width: 120px; gap: 4px; flex-shrink: 0; }
  /* On mobile the course name only truncates to "Tutor Onb…" and crowds the
     row. Drop it — Back + progress + the sidebar button are enough. */
  .topnav-title { display: none; }
  /* The quiz is still reachable from the sidebar footer — drop the topnav chip
     on mobile so the row (back + progress) fits without overflow. */
  .topnav-quiz { display: none; }
  .topnav-progress-label { font-size: 10.5px; }
  body.has-topnav .sidebar-toggle { top: 8px; }
  h1 { font-size: 34px; }
  .lead { font-size: 16px; }
  .next-card,
  .prev-card { padding: 16px 18px; }
  .next-card .next-target,
  .prev-card .prev-target { font-size: 15px; }
  .page-nav { flex-direction: column; gap: 10px; }
  .home-main { padding: 32px 18px 64px; }
  .home-title { font-size: 34px; }
  .home-lead { font-size: 16px; }
}

/* ===== Quiz page ===== */
.quiz-topnav {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  min-height: 56px;
}
.quiz-main { padding: 60px 48px 72px; }
.quiz-main .quiz-content { max-width: 900px; }
@media (max-width: 1100px) {
  .quiz-main { padding: 48px 36px 60px; }
}
@media (max-width: 960px) {
  .quiz-main { padding: 24px 16px 54px; }
}
.quiz-content { padding-bottom: 60px; }

.quiz-rules { margin: 0; padding-left: 22px; }
.quiz-rules li { margin-bottom: 8px; }
.quiz-rules li:last-child { margin-bottom: 0; }

.quiz-good-luck {
  margin-top: 8px;
  font-size: 17px;
  color: var(--ink-strong);
}

.quiz-attempt-note {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.quiz-progress {
  margin: 8px 0 28px;
}
.quiz-progress-bar {
  height: 6px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.quiz-progress-label {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.quiz-q-text {
  font-size: 24px;
  line-height: 1.4;
  color: var(--ink-strong);
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.quiz-q-num {
  color: var(--primary);
  font-weight: 700;
  margin-right: 6px;
}

.quiz-helper {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 24px 0 32px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink-strong);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.quiz-option:hover {
  border-color: rgba(28, 160, 241, 0.45);
  background: var(--primary-bg-soft);
}
.quiz-option:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(28, 160, 241, 0.18);
}
.quiz-option:active { transform: translateY(1px); }

.quiz-option-letter {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--line-soft);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.quiz-option-text { flex: 1; line-height: 1.5; }
.quiz-option-check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.quiz-option.is-selected {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.quiz-option.is-selected .quiz-option-letter {
  background: var(--primary);
  color: #fff;
}
.quiz-option.is-selected .quiz-option-check {
  opacity: 1;
  transform: scale(1);
}

.quiz-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 12px;
  flex-wrap: wrap;
}

.quiz-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}
.quiz-btn:active { transform: translateY(1px); }
.quiz-btn:disabled,
.quiz-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.quiz-btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.quiz-btn-primary:hover:not(:disabled) {
  background: var(--primary-600);
  border-color: var(--primary-600);
  box-shadow: 0 4px 14px -4px rgba(28, 160, 241, 0.45);
}
.quiz-btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}
.quiz-btn-ghost:hover:not(:disabled) {
  background: var(--hover-bg);
  color: var(--ink-strong);
  border-color: var(--muted-soft);
}
.quiz-btn-locked {
  background: var(--line-soft);
  color: var(--ink-soft);
  border-color: var(--line);
}
.quiz-btn-locked:hover:not(:disabled) {
  background: var(--hover-bg);
  color: var(--ink-strong);
  border-color: var(--muted-soft);
}
.quiz-btn-block {
  width: 100%;
  justify-content: center;
}
.quiz-actions-stack {
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
}

.quiz-lock-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 32, 43, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: quizLockFade 0.15s ease-out;
}
@keyframes quizLockFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.quiz-lock-modal-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 60px -15px rgba(20, 32, 43, 0.4);
}
.quiz-lock-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.quiz-lock-modal-icon-warn {
  background: var(--yellow-bg-soft);
  color: var(--yellow-text);
}
.quiz-lock-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-strong);
  margin: 0 0 8px;
}
.quiz-lock-modal-body {
  color: var(--ink-soft);
  margin: 0 0 20px;
  line-height: 1.55;
  font-size: 14.5px;
}
.quiz-lock-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-score {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 28px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: var(--bg-card);
  margin: 8px 0 24px;
  box-shadow: var(--shadow-card);
}
.quiz-score.is-pass {
  border-color: rgba(34, 169, 122, 0.35);
  background: linear-gradient(135deg, var(--green-bg), #fff 70%);
}
.quiz-score.is-fail {
  border-color: rgba(28, 160, 241, 0.25);
  background: linear-gradient(135deg, var(--primary-bg-soft), #fff 70%);
}
.quiz-score-pct {
  font-size: 56px;
  font-weight: 700;
  color: var(--ink-strong);
  letter-spacing: -0.03em;
  line-height: 1;
}
.quiz-score.is-pass .quiz-score-pct { color: #1f8a5c; }
.quiz-score-meta {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-strong);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quiz-score-sub {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
}

/* Shown only when the result didn't reach the tutor's record. A save that worked
   says nothing at all — the mark itself is the confirmation. */
.quiz-save-status:empty { display: none; }

/* The wait between the last answer and the mark, while the score is written. */
.quiz-calculating {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: var(--bg-card);
  margin: 8px 0 24px;
  box-shadow: var(--shadow-card);
  font-size: 15px;
  color: var(--ink-soft);
}
.quiz-calculating p { margin: 0; }
.quiz-calculating-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--primary-bg);
  border-top-color: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
  animation: load-spin 0.8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .quiz-calculating-spinner { animation: none; }
}

.quiz-review {
  list-style: none;
  padding: 0;
  margin: 16px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.quiz-review-item {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}
.quiz-review-item.is-correct { border-left-color: #2eaf7d; background: linear-gradient(90deg, var(--green-bg), #fff 30%); }
.quiz-review-item.is-wrong { border-left-color: #d96a8a; background: linear-gradient(90deg, var(--pink-bg), #fff 30%); }

.quiz-review-q {
  font-size: 15px;
  color: var(--ink-strong);
  margin-bottom: 6px;
}
.quiz-review-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  margin-right: 8px;
  vertical-align: -3px;
}
.quiz-review-item.is-correct .quiz-review-mark { background: #2eaf7d; color: #fff; }
.quiz-review-item.is-wrong .quiz-review-mark { background: #d96a8a; color: #fff; }

.quiz-review-a {
  font-size: 14px;
  color: var(--ink-soft);
  margin-left: 28px;
  line-height: 1.5;
}
.quiz-review-label {
  font-weight: 600;
  color: var(--muted);
  margin-right: 4px;
}
.quiz-review-correct { color: #1f8a5c; }
.quiz-review-correct .quiz-review-label { color: #1f8a5c; }

@media (max-width: 600px) {
  .quiz-q-text { font-size: 20px; }
  .quiz-option { padding: 12px 14px; font-size: 14.5px; }
  .quiz-score { flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px; }
  .quiz-score-pct { font-size: 44px; }
  .quiz-actions { flex-direction: column; align-items: stretch; }
  .quiz-btn { width: 100%; justify-content: center; }
}

/* ===== Read time pill ===== */
.read-time {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin: -16px 0 22px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.read-time::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

/* ===== Key Learnings checklist ===== */
.key-learnings {
  background: var(--primary-bg-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 36px 0 0;
}
.key-learnings-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.key-learnings-icon { font-size: 16px; line-height: 1; }
.key-learnings-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-700);
}
.key-learnings-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kl-item label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.55;
  transition: color 0.15s ease;
}
.kl-item input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--primary);
  cursor: pointer;
  border-radius: 3px;
}
.kl-item.is-checked label {
  color: var(--muted);
}
.kl-item.is-checked label span {
  text-decoration: line-through;
  text-decoration-color: var(--muted-soft);
}
.kl-progress {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--primary) 12%, var(--line));
  display: flex;
  align-items: center;
  gap: 10px;
}
.kl-progress-bar-wrap {
  flex: 1;
  height: 4px;
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  border-radius: 99px;
  overflow: hidden;
}
.kl-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.3s ease;
}
.kl-progress-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* ===== Copy-to-clipboard button on template toggles ===== */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  flex-shrink: 0;
  padding: 3px 9px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--font);
  letter-spacing: 0.01em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  line-height: 1;
}
.copy-btn:hover {
  background: var(--hover-bg-strong);
  color: var(--primary-700);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
}
.copy-btn.is-copied {
  background: var(--green-bg);
  color: var(--green-strong);
  border-color: var(--green-soft);
}

/* Print: hide chrome, light layout */
@media print {
  .sidebar, .sidebar-toggle, .topnav, .next-card, .prev-card, .page-nav, .video-wrap { display: none; }
  .main { padding: 0; }
  body { background: white; }
}

/* ── Team Grid ─────────────────────────────────────────────────────── */
.team-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-secondary, #6b7280);
  margin: 20px 0 8px;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 0;
}
.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px 12px;
  border-radius: 12px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s;
  text-align: center;
}
.team-card:not(.team-card--no-link):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.1);
}
.team-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--av-bg, #94a3b8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.team-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: absolute;
  inset: 0;
}
.team-avatar span {
  position: relative;
  z-index: 1;
}
.team-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary, #111827);
}
.team-role {
  font-size: 11px;
  color: var(--text-secondary, #6b7280);
  line-height: 1.3;
}
.team-dept {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  margin-top: 2px;
}
.team-dept--am       { background: #fef3c7; color: #92400e; }
.team-dept--tech     { background: #ede9fe; color: #5b21b6; }
.team-dept--product  { background: #dbeafe; color: #1e40af; }
.team-dept--cs       { background: #d1fae5; color: #065f46; }
.team-dept--content  { background: #f3e8ff; color: #6b21a8; }
.team-dept--marketing{ background: #fce7f3; color: #9d174d; }
.team-dept--qa       { background: #fee2e2; color: #991b1b; }
.team-dept--ops      { background: #f1f5f9; color: #334155; }

/* =====================================================================
   Current Learning Resources — resource library (NOT a course).
   Landing year grid, year-index topic cards, lesson-plan topbar.
===================================================================== */

/* Landing: year-level cards */
.clr-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 8px;
}
.clr-year-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  color: var(--ink-strong);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.clr-year-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--course-color, var(--primary)) 50%, var(--line));
  box-shadow: 0 14px 30px -16px color-mix(in srgb, var(--course-color, var(--primary)) 45%, transparent), var(--shadow-card);
  text-decoration: none;
}
.clr-year-emoji {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 14px;
  font-size: 26px;
  line-height: 1;
  background: linear-gradient(135deg, var(--course-color, var(--primary)) 0%, color-mix(in srgb, var(--course-color, var(--primary)) 60%, #000) 100%);
}
.clr-year-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.clr-year-name { font-size: 18px; font-weight: 700; color: var(--ink-strong); }
.clr-year-blurb { font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.clr-year-meta {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-top: 4px;
}
.clr-year-card .course-card-arrow {
  margin-left: auto;
  color: var(--course-color, var(--primary));
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.clr-year-card:hover .course-card-arrow { transform: translateX(3px); }

/* Centralised browser: search + filter toolbar */
.clr-browse { margin-top: 8px; }
.clr-toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}
.clr-search {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}
.clr-search svg {
  position: absolute;
  left: 16px;
  color: var(--muted);
  pointer-events: none;
}
.clr-search input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  font: inherit;
  font-size: 15px;
  color: var(--ink-strong);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.clr-search input::-webkit-search-cancel-button { cursor: pointer; }
.clr-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.clr-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.clr-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 180px;
  min-width: 150px;
}
.clr-field > span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-left: 2px;
}
.clr-field select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-strong);
  background-color: var(--bg-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding: 12px 36px 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.clr-field select:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.clr-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.clr-clear {
  flex: 0 0 auto;
  align-self: flex-end;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.clr-clear:hover { background: var(--hover-bg-strong); color: var(--primary-700); }

@media (max-width: 560px) {
  .clr-filters { flex-direction: column; align-items: stretch; }
  .clr-field { flex-basis: auto; min-width: 0; }
  .clr-clear { align-self: stretch; text-align: center; }
}

.clr-result-meta {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  margin: 0 0 14px;
}
.clr-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.clr-result-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  color: var(--ink-strong);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.clr-result-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--course-color, var(--primary)) 45%, var(--line));
  box-shadow: 0 12px 24px -16px color-mix(in srgb, var(--course-color, var(--primary)) 40%, transparent), var(--shadow-card);
  text-decoration: none;
}
.clr-result-emoji {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 11px;
  font-size: 20px;
  line-height: 1;
  background: color-mix(in srgb, var(--course-color, var(--primary)) 12%, var(--line-soft));
}
.clr-result-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.clr-result-title { font-size: 14.5px; font-weight: 600; min-width: 0; }
.clr-result-title mark { background: color-mix(in srgb, var(--primary) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.clr-result-snippet {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.clr-result-snippet mark { background: color-mix(in srgb, var(--primary) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.clr-result-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.clr-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--line-soft);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
/* Colour-coded badges: each year level / topic group carries --tag-color */
.clr-tag--year,
.clr-tag--group {
  color: color-mix(in srgb, var(--tag-color, var(--ink-soft)) 72%, #0b1220);
  background: color-mix(in srgb, var(--tag-color, var(--ink-soft)) 14%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tag-color, var(--ink-soft)) 22%, transparent);
}

/* Hover rundown: a quick "what it covers + who it's good for" card */
.clr-result-tip {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(100% + 9px);
  z-index: 30;
  padding: 11px 13px;
  border-radius: 11px;
  background: var(--ink-strong, #14202b);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 500;
  box-shadow: 0 16px 32px -14px rgba(8, 16, 28, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
  pointer-events: none;
}
.clr-result-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 26px;
  border: 6px solid transparent;
  border-top-color: var(--ink-strong, #14202b);
}
.clr-result-card:hover .clr-result-tip,
.clr-result-card:focus-visible .clr-result-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
@media (hover: none) {
  .clr-result-tip { display: none; }
}
.clr-result-card .course-card-arrow {
  margin-left: auto;
  color: var(--course-color, var(--primary));
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  flex-shrink: 0;
}
.clr-result-card:hover .course-card-arrow { opacity: 1; transform: translateX(2px); }
.clr-empty {
  grid-column: 1 / -1;
  padding: 40px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  background: var(--line-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* =====================================================================
   Favourites — a tutor's personal saved-resource set
   ===================================================================== */
/* Toolbar toggle: filter the grid down to saved resources. Hidden until
   the tutor has saved at least one. Amber = the favourite accent throughout. */
.clr-fav-toggle {
  flex: 0 0 auto;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.clr-fav-toggle[hidden] { display: none; }
.clr-fav-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; flex-shrink: 0; }
.clr-fav-toggle:hover { border-color: color-mix(in srgb, #f59e0b 50%, var(--line)); color: #b45309; }
.clr-fav-toggle.is-active {
  color: #b45309;
  border-color: color-mix(in srgb, #f59e0b 55%, var(--line));
  background: color-mix(in srgb, #f59e0b 13%, var(--bg-card));
}
.clr-fav-toggle.is-active svg { fill: #f59e0b; stroke: #f59e0b; }
.clr-fav-toggle-count {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--ink-soft) 14%, transparent);
  border-radius: 999px;
  padding: 3px 7px;
  min-width: 10px;
  text-align: center;
}
.clr-fav-toggle.is-active .clr-fav-toggle-count {
  color: #b45309;
  background: color-mix(in srgb, #f59e0b 24%, #fff);
}

/* The whole card is a stretched link so the star can be a real sibling button
   (no interactive control nested inside an anchor). */
.clr-result-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
/* Reserve the top-right corner so long titles never slide under the star. */
.clr-result-body { padding-right: 26px; }
.clr-result-card:focus-within .clr-result-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

/* Per-card star: tucked in the corner, revealed on hover; once saved it stays
   lit so favourites read at a glance. Sits above the stretched link. */
.clr-fav-star {
  position: absolute;
  top: 8px;
  right: 9px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  /* Always visible (just understated) so tutors discover they can save. */
  color: color-mix(in srgb, var(--muted) 80%, transparent);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.clr-fav-star svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.clr-result-card:hover .clr-fav-star { color: var(--muted); }
.clr-fav-star:hover {
  background: color-mix(in srgb, #f59e0b 16%, transparent);
  color: #d97706;
  transform: scale(1.08);
}
.clr-fav-star:focus-visible { outline: 2px solid color-mix(in srgb, #f59e0b 70%, transparent); outline-offset: 1px; }
.clr-fav-star.is-fav { color: #f59e0b; }
.clr-fav-star.is-fav svg { fill: #f59e0b; stroke: #f59e0b; }

/* Resource-page topbar: favourite the lesson you're teaching from. */
.clr-fav-btn {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--line-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.clr-fav-btn-ico { display: inline-grid; place-items: center; }
.clr-fav-btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.clr-fav-btn:hover { background: color-mix(in srgb, #f59e0b 14%, var(--line-soft)); color: #b45309; }
.clr-fav-btn.is-fav {
  color: #b45309;
  background: color-mix(in srgb, #f59e0b 14%, #fff);
  border-color: color-mix(in srgb, #f59e0b 45%, transparent);
}
.clr-fav-btn.is-fav svg { fill: #f59e0b; stroke: #f59e0b; }
@media (max-width: 560px) {
  .clr-fav-btn-label { display: none; }
  .clr-fav-btn { padding: 7px 9px; }
  /* Match the stacked, full-width selects rather than floating right. */
  .clr-fav-toggle { align-self: stretch; justify-content: center; }
}

/* Year index: topics grouped by subject */
.clr-group { margin-top: 36px; }
.clr-group:first-child { margin-top: 8px; }
.clr-group-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.clr-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.clr-topic-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  color: var(--ink-strong);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.clr-topic-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--course-color, var(--primary)) 45%, var(--line));
  box-shadow: 0 12px 24px -16px color-mix(in srgb, var(--course-color, var(--primary)) 40%, transparent), var(--shadow-card);
  text-decoration: none;
}
.clr-topic-emoji {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  font-size: 19px;
  line-height: 1;
  background: color-mix(in srgb, var(--course-color, var(--primary)) 12%, var(--line-soft));
}
.clr-topic-title { font-size: 14.5px; min-width: 0; }
.clr-topic-card .course-card-arrow {
  margin-left: auto;
  color: var(--course-color, var(--primary));
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  flex-shrink: 0;
}
.clr-topic-card:hover .course-card-arrow { opacity: 1; transform: translateX(2px); }

/* Resource page: topbar (replaces the course progress topnav) */
.clr-topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 22px;
  min-height: 56px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.clr-topbar-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-strong);
  text-decoration: none;
  background: var(--line-soft);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.clr-topbar-back:hover {
  background: var(--hover-bg-strong);
  color: var(--primary-700);
  text-decoration: none;
  transform: translateX(-1px);
}
.clr-topbar-back svg { flex-shrink: 0; }
.clr-crumbs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  padding-left: 16px;
  border-left: 1px solid var(--line);
  min-width: 0;
}
.clr-crumbs a { color: var(--ink-soft); text-decoration: none; white-space: nowrap; }
.clr-crumbs a:hover { color: var(--primary-700); }
.clr-crumb-sep { color: var(--line); }
.clr-crumb-current { color: var(--ink); font-weight: 600; white-space: nowrap; }
.clr-crumb-years { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.clr-tag--subject {
  --tag-color: #7C3AED;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 10px;
}
/* "good for <need>" chip shown on cards while a Special need filter is active */
.clr-tag--need {
  --tag-color: #0F6E56;
  background: color-mix(in srgb, var(--tag-color) 13%, #fff);
  color: var(--tag-color);
  border: 1px solid color-mix(in srgb, var(--tag-color) 28%, transparent);
  font-weight: 600;
}

/* ── Special-needs resource detail pages ── */
.sn-audience {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600;
  padding: 6px 13px; border-radius: 100px;
  margin: 0 0 18px;
}
.sn-audience .sn-aud-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sn-audience--student { background: #e3f3ec; color: #0F6E56; }
.sn-audience--tutor   { background: #fbedd8; color: #b5681a; }
.content a.sn-download {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 6px 0 30px;
  padding: 12px 20px;
  background: var(--course-color, var(--primary));
  color: #fff; font-weight: 600; font-size: 15px;
  border-radius: 10px; text-decoration: none; border-bottom: 0;
  box-shadow: 0 6px 16px -8px var(--course-color, var(--primary));
  transition: transform .15s ease, box-shadow .15s ease;
}
.content a.sn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -8px var(--course-color, var(--primary));
  color: #fff;
}
.content p.sn-training-link {
  display: flex; align-items: center; gap: 9px;
  margin: 22px 0 18px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--course-color, var(--primary)) 6%, var(--bg-card));
  border: 1px solid color-mix(in srgb, var(--course-color, var(--primary)) 20%, var(--line));
  border-radius: 10px;
  font-size: 14.5px; color: var(--ink);
}
.sn-training-link .sn-tl-ico { font-size: 17px; }
.content p.sn-training-link a { font-weight: 600; }
.sn-needs { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; }
.sn-need-chip {
  font-size: 12.5px; font-weight: 600;
  padding: 4px 11px; border-radius: 100px;
  background: color-mix(in srgb, var(--course-color, var(--primary)) 10%, #fff);
  color: color-mix(in srgb, var(--course-color, var(--primary)) 72%, #000);
  border: 1px solid color-mix(in srgb, var(--course-color, var(--primary)) 25%, transparent);
}
.pdf-embed {
  width: 100%;
  height: 70vh;
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 12px 0;
  background: var(--surface, #fff);
}
.pdf-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 4px;
  font-weight: 600;
}
.clr-crumb-year {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--tag-color, var(--ink));
  background: color-mix(in srgb, var(--tag-color, #7C3AED) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tag-color, #7C3AED) 30%, transparent);
}
body.has-clr-topbar .sidebar { top: 56px; height: calc(100vh - 56px); }

/* Resource page: collapsible content sections (Introduction, Watch & learn,
   Practice questions, Activities, Applications). Each starts collapsed so the
   tutor can jump straight to the section they need during a live lesson. */
.content .section-toggle {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  margin: 0 0 14px;
}
.content .section-toggle > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-strong);
  border-radius: var(--radius);
  user-select: none;
}
.content .section-toggle > summary::-webkit-details-marker { display: none; }
.content .section-toggle > summary:hover { color: var(--primary-700); }
.content .section-toggle > summary .sec-emoji { font-size: 18px; line-height: 1; flex-shrink: 0; }
.content .section-toggle > summary .sec-caret {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--ink-soft);
  transition: transform 0.18s ease;
}
.content .section-toggle[open] > summary .sec-caret { transform: rotate(90deg); color: var(--primary); }
.content .section-toggle[open] > summary {
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}
.content .section-toggle > .section-body { padding: 6px 22px 22px; }
.content .section-toggle > .section-body > :first-child { margin-top: 8px; }
.content .section-toggle > .section-body > :last-child { margin-bottom: 0; }

/* Tutor-only guidance — discreet & collapsed by default, so it stays hidden
   when a tutor shares the resource on screen as the lesson itself. Framed as
   flexible "ways to use", never a rigid script, because resources are multi-use. */
.content .section-toggle.tutor-tips {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--course-color, var(--primary)) 38%, var(--line));
  background: color-mix(in srgb, var(--course-color, var(--primary)) 4%, #fff);
  box-shadow: none;
}
.content .section-toggle.tutor-tips > summary { font-size: 15.5px; color: var(--course-color, var(--primary)); }
.content .section-toggle.tutor-tips > summary .sec-caret { margin-left: 0; }
.content .section-toggle.tutor-tips[open] > summary { border-bottom-color: color-mix(in srgb, var(--course-color, var(--primary)) 22%, var(--line)); }
.content .section-toggle.tutor-tips .tt-pill {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--course-color, var(--primary));
  background: color-mix(in srgb, var(--course-color, var(--primary)) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--course-color, var(--primary)) 30%, var(--line));
  border-radius: 999px;
  padding: 2px 9px;
}

@media (max-width: 720px) {
  .clr-crumbs { display: none; }
}

/* =====================================================================
   Welcome / onboarding intro components.
   A warm gradient hero, benefit cards, and a course roadmap — used on
   the Tutor Onboarding introduction page to set first impressions.
===================================================================== */

/* Gradient welcome panel */
.welcome-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 32px 36px 34px;
  margin: 6px 0 34px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-700) 100%);
  color: #fff;
  box-shadow: var(--shadow-video);
}
.welcome-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, 0.20) 0%, transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(0, 0, 0, 0.16) 0%, transparent 60%);
  pointer-events: none;
}
.welcome-hero > * { position: relative; z-index: 1; }
.welcome-hero-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.welcome-hero-title {
  font-size: 27px;
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: #fff;
}
.welcome-hero-text {
  font-size: 16px;
  line-height: 1.62;
  color: rgba(255, 255, 255, 0.94);
  margin: 0;
  max-width: 56ch;
}
.welcome-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}
.welcome-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 7px 13px;
  border-radius: 999px;
}
.welcome-pill .welcome-pill-emoji { font-size: 14px; line-height: 1; }

/* Benefit cards (why this matters) */
.benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin: 12px 0 34px;
}
.benefit-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 20px 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.benefit-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
  box-shadow: var(--shadow-lift);
}
.benefit-card-emoji {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
  background: color-mix(in srgb, var(--primary) 12%, var(--line-soft));
  margin-bottom: 4px;
}
.benefit-card-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-strong);
  letter-spacing: -0.01em;
}
.benefit-card-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* Course roadmap (what you'll learn) */
.journey {
  margin: 12px 0 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.journey-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px;
  border-top: 1px solid var(--line-soft);
}
.journey-step:first-child { border-top: 0; }
.journey-num {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-600) 100%);
  box-shadow: 0 4px 10px -4px rgba(28, 160, 241, 0.5);
}
.journey-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.journey-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-strong);
  letter-spacing: -0.01em;
}
.journey-title .journey-emoji { margin-right: 7px; }
.journey-text { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }
.journey-body ul { margin: 6px 0 0; padding-left: 18px; }
.journey-body ul ul { margin: 3px 0 0; }
.journey-body li { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); margin: 3px 0; }
.journey-body li strong { color: var(--ink-strong); }

@media (max-width: 720px) {
  .welcome-hero { padding: 24px 22px 26px; }
  .welcome-hero-title { font-size: 22px; }
  .journey-step { padding: 16px 16px; gap: 13px; }
}

/* Do / Don't comparison */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 14px 0 32px;
}
.compare-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  padding: 18px 20px 20px;
  border-top: 3px solid var(--line);
}
.compare-card.do { border-top-color: #2eb872; }
.compare-card.dont { border-top-color: #e5645f; }
.compare-card.contact { border-top-color: var(--primary); }
.compare-sub {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  margin: -4px 0 10px;
}
.compare-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-strong);
  margin-bottom: 10px;
}
.compare-head .compare-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
.compare-card.do .compare-mark { background: color-mix(in srgb, #2eb872 16%, transparent); }
.compare-card.dont .compare-mark { background: color-mix(in srgb, #e5645f 16%, transparent); }
.compare-card ul { margin: 0; padding-left: 18px; }
.compare-card li { font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); margin: 4px 0; }

/* Tutor testimonial quote (subtle social proof) */
.tutor-quote {
  position: relative;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, #fff);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 17px 20px 15px;
  margin: 18px 0 26px;
}
.tutor-quote-text {
  font-size: 15px;
  line-height: 1.6;
  font-style: italic;
  color: var(--ink-strong);
  margin: 0 0 9px;
}
.tutor-quote-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 9px;
  font-size: 13px;
  color: var(--ink-soft);
}
.tutor-quote-name { font-weight: 600; color: var(--ink-strong); }
.tutor-quote-stars { color: #f5a623; letter-spacing: 1px; }

/* Social proof strip */
.proof-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 16px 0 30px;
}
.proof-stat {
  flex: 1 1 140px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  padding: 16px 14px;
}
.proof-num {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--primary);
  line-height: 1.1;
}
.proof-label {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-soft);
  margin-top: 3px;
}
