/* ---------- Signature element: the ledger-tag breadcrumb trail ---------- */
.crumb-trail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: var(--sp-5);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 4px;
  background: none;
  border: none;
  color: var(--slate-500);
  border-radius: var(--radius-sm);
  position: relative;
  cursor: pointer;
  transition: color var(--dur-fast);
}
.crumb:hover { color: var(--brass); background: var(--brass-soft); }
.crumb::before {
  content: "";
  width: 0; height: 0;
  display: none;
}
.crumb:last-child {
  color: var(--parchment);
  font-weight: 600;
  background: none;
}
.crumb-thread {
  width: 14px;
  height: 8px;
  flex-shrink: 0;
  color: var(--slate-600);
  position: relative;
}
.crumb-thread::after {
  content: "›";
  position: absolute;
  left: 2px;
  top: -8px;
  color: var(--slate-600);
}

/* ---------- Node header ---------- */
.node-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-500);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--sp-2);
}
.node-eyebrow .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--teal-bright); }
.node-eyebrow.type-quiz .dot { background: var(--coral); }
.node-eyebrow.type-summary .dot { background: var(--green); }

.node-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
}

.node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  flex-shrink: 0;
  padding-top: 2px;
  justify-content: flex-end;
}
.icon-toggle {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  color: var(--slate-500);
  display: grid;
  place-items: center;
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}
.icon-toggle svg { width: 15px; height: 15px; }
.icon-toggle:hover { border-color: var(--brass-soft-strong); color: var(--parchment); }
.icon-toggle.is-on { color: var(--brass-bright); border-color: var(--brass-soft-strong); background: var(--brass-soft); }
.icon-toggle.is-flagged { color: var(--coral); border-color: var(--coral); background: var(--coral-soft); }
.icon-toggle[data-mark-done].is-on { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.icon-toggle[data-toggle-offline].is-on { color: var(--teal-bright); border-color: var(--teal); background: var(--teal-soft); }
.icon-toggle.is-loading { opacity: 0.7; cursor: default; }

/* ---------- Node eyebrow (updated: "Folder" type label uses branch icon color) ---------- */
.node-eyebrow.type-branch .dot { background: var(--slate-500); }

/* ---------- Node title ---------- */
.node-title {
  font-size: var(--fs-2xl);
  margin-bottom: var(--sp-5);
  line-height: 1.15;
}

.node-intro {
  font-size: var(--fs-md);
  color: var(--parchment-dim);
  margin-bottom: var(--sp-6);
  max-width: 62ch;
}

/* ---------- Key points ---------- */
.keypoints {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}
.keypoint {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-lg);
  border: none;
  border-left: 4px solid var(--brass);
  background: var(--brass-soft);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}
.keypoint__index {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--on-accent);
  background: var(--brass);
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  padding-top: 0;
  flex-shrink: 0;
}
.keypoint p { margin: 0; color: var(--parchment); font-size: var(--fs-base); line-height: 1.5; }
.keypoint:nth-child(4n+1) { border-left-color: var(--brass); background: var(--brass-soft); }
.keypoint:nth-child(4n+1) .keypoint__index { background: var(--brass); }
.keypoint:nth-child(4n+2) { border-left-color: var(--green); background: var(--green-soft); }
.keypoint:nth-child(4n+2) .keypoint__index { background: var(--green); }
.keypoint:nth-child(4n+3) { border-left-color: var(--teal); background: var(--teal-soft); }
.keypoint:nth-child(4n+3) .keypoint__index { background: var(--teal); }
.keypoint:nth-child(4n+4) { border-left-color: var(--coral); background: var(--coral-soft); }
.keypoint:nth-child(4n+4) .keypoint__index { background: var(--coral); }

/* ---------- Explore-further grid (children as cards) ---------- */
.section-label {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate-500);
  margin: var(--sp-6) 0 var(--sp-3);
}

.continue-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border-strong);
  background: linear-gradient(160deg, var(--brass-soft-strong), var(--glass-bg));
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  box-shadow: var(--glass-shadow);
  margin-bottom: var(--sp-2);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.continue-card:hover { transform: translateY(-3px); box-shadow: var(--glass-shadow-lg); }
.continue-card__label { font-size: 10px; color: var(--brass-bright); text-transform: uppercase; letter-spacing: 0.1em; }
.continue-card__title { font-size: var(--fs-md); font-weight: 600; color: var(--parchment); }
.continue-card__sub { font-size: var(--fs-xs); color: var(--slate-400); }

/* ---------- Offline course download card (course intro page) ---------- */
.offline-course-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}
.offline-course-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  color: var(--slate-400);
  font-size: var(--fs-xs);
  font-weight: 500;
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}
.offline-course-card__btn:hover { border-color: var(--brass-soft-strong); color: var(--parchment); }
.offline-course-card__btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.offline-course-card__btn.is-on { color: var(--teal-bright); border-color: var(--teal); background: var(--teal-soft); }
.offline-course-card__btn:disabled { opacity: 0.7; cursor: default; }
.offline-course-card__progress {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--slate-500);
}
.offline-course-card__track {
  width: 120px;
  height: 5px;
  border-radius: 3px;
  background: var(--ink-900);
  overflow: hidden;
}
.offline-course-card__fill {
  display: block;
  height: 100%;
  background: var(--teal-bright);
  border-radius: 3px;
  transition: width var(--dur-med, 220ms) var(--ease-out);
}
.offline-course-card__label { white-space: nowrap; }

.branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-3);
}

.branch-card {
  text-align: left;
  padding: var(--sp-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
}
.branch-card:hover {
  border-color: var(--brass-soft-strong);
  transform: translateY(-3px);
  background: var(--glass-bg-strong);
  box-shadow: var(--glass-shadow-lg);
}
.branch-card__icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--brass-soft);
  color: var(--brass-bright);
  display: grid;
  place-items: center;
}
.branch-card.type-lesson .branch-card__icon { background: var(--teal-soft); color: var(--teal-bright); }
.branch-card.type-quiz .branch-card__icon { background: var(--coral-soft); color: var(--coral); }
.branch-card.type-summary .branch-card__icon { background: var(--green-soft); color: var(--green); }
.branch-card__title { font-weight: 600; font-size: var(--fs-sm); }
.branch-card__meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Progress badge (branch/folder "x/y · NN%" done indicator) --- */
.progress-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  letter-spacing: normal;
  text-transform: none;
}
.progress-badge__track {
  width: 30px;
  height: 4px;
  border-radius: 2px;
  background: var(--ink-900);
  overflow: hidden;
  display: inline-block;
}
.progress-badge__fill {
  display: block;
  height: 100%;
  background: var(--brass-bright);
  border-radius: 2px;
  transition: width var(--dur-med, 220ms) var(--ease-out);
}
.progress-badge.is-complete .progress-badge__fill { background: var(--green); }
.progress-badge__pct { color: var(--slate-500); font-size: 10px; }
.progress-badge.is-complete .progress-badge__pct { color: var(--green); }
.progress-badge.is-complete { color: var(--green); }
.progress-badge svg { width: 13px; height: 13px; }

/* ---------- Examples ---------- */
.examples-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.example-item {
  padding: var(--sp-4);
  border-left: 2px solid var(--teal-bright);
  background: var(--ink-850);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--parchment-dim);
  position: relative;
}
.example-item::before {
  content: "“";
  font-family: var(--font-display);
  font-style: normal;
  color: var(--teal-bright);
  font-size: 1.4em;
  margin-right: 4px;
}

/* ---------- Summary ---------- */
.summary-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.summary-item {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-3) var(--sp-4);
  background: var(--green-soft);
  border-radius: var(--radius-md);
}
.summary-item svg { color: var(--green); flex-shrink: 0; margin-top: 3px; width: 15px; height: 15px; }
.summary-item p { margin: 0; color: var(--parchment); }

/* ---------- Quiz ---------- */
.quiz-card {
  padding: var(--sp-5);
  border: 1px solid var(--ink-700);
  border-radius: var(--radius-lg);
  background: var(--ink-850);
  margin-bottom: var(--sp-4);
}
.quiz-card__q {
  font-size: var(--fs-md);
  font-weight: 600;
  margin-bottom: var(--sp-4);
}
.quiz-options { display: flex; flex-direction: column; gap: var(--sp-2); }
.quiz-option {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--ink-700);
  border-radius: var(--radius-md);
  text-align: left;
  color: var(--parchment-dim);
  transition: border-color var(--dur-fast), background var(--dur-fast);
  width: 100%;
}
.quiz-option:hover:not(.is-locked) { border-color: var(--brass-soft-strong); background: var(--ink-800); }
.quiz-option__letter {
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 6px;
  background: var(--ink-750);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate-400);
}
.quiz-option.is-correct { border-color: var(--green); background: var(--green-soft); color: var(--parchment); }
.quiz-option.is-correct .quiz-option__letter { background: var(--green); color: var(--on-accent); }
.quiz-option.is-wrong { border-color: var(--coral); background: var(--coral-soft); color: var(--parchment); }
.quiz-option.is-wrong .quiz-option__letter { background: var(--coral); color: var(--on-accent); }

.quiz-explain {
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--radius-md);
  background: var(--ink-800);
  color: var(--slate-400);
  font-size: var(--fs-sm);
  display: none;
}
.quiz-explain.is-visible { display: block; }

.quiz-score {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--brass-bright);
  margin-bottom: var(--sp-4);
}

.quiz-results {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--ink-700);
  background: var(--ink-800);
}
.quiz-results[hidden] { display: none; }
.quiz-results__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.quiz-results__score {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--parchment);
}
.quiz-results__badge {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
}
.quiz-results.is-passed { border-color: var(--green); background: var(--green-soft); }
.quiz-results.is-passed .quiz-results__badge { background: var(--green); color: var(--on-accent); }
.quiz-results.is-notpassed { border-color: var(--coral); background: var(--coral-soft); }
.quiz-results.is-notpassed .quiz-results__badge { background: var(--coral); color: var(--on-accent); }
.quiz-results__hint {
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--slate-400);
}
.quiz-results .node-nav__btn {
  margin-top: var(--sp-3);
  width: auto;
  padding-inline: var(--sp-4);
}

.quiz-scenario {
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
  border-radius: var(--radius-md);
  background: var(--ink-800);
  color: var(--slate-400);
  font-size: var(--fs-sm);
  font-style: italic;
}

.quiz-match, .quiz-order { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.quiz-match__row, .quiz-order__row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--ink-700);
  border-radius: var(--radius-md);
}
.quiz-match__left { flex: 1; color: var(--parchment); }
.quiz-match__select, .quiz-order__select {
  background: var(--ink-850);
  border: 1px solid var(--ink-700);
  border-radius: var(--radius-sm);
  color: var(--parchment);
  padding: 6px 8px;
  font-family: inherit;
}
.quiz-match__select.is-correct, .quiz-order__select.is-correct { border-color: var(--green); background: var(--green-soft); }
.quiz-match__select.is-wrong, .quiz-order__select.is-wrong { border-color: var(--coral); background: var(--coral-soft); }

/* ---------- Reading progress bar ---------- */
.reading-progress {
  position: sticky;
  top: 0;
  height: 3px;
  background: var(--ink-800);
  z-index: 5;
}
.reading-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brass), var(--brass-bright));
  transition: width 120ms linear;
}

/* ---------- Lesson metadata bar ---------- */
.meta-bar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-2) 0 var(--sp-4);
  margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--ink-700);
}
.meta-chip {
  font-size: var(--fs-sm);
  font-family: var(--font-body);
  color: var(--parchment);
  font-weight: 600;
  background: none;
  border: none;
  border-radius: 0;
  padding: 5px 0;
  display: flex;
  gap: var(--sp-3);
  align-items: baseline;
}
.meta-chip__label {
  color: var(--slate-500);
  font-weight: 500;
  font-size: var(--fs-xs);
  min-width: 108px;
  flex-shrink: 0;
}
.meta-chip.status {
  align-self: flex-start;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--fs-2xs);
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--ink-800);
  border: 1px solid var(--ink-700);
  color: var(--slate-500);
  margin-bottom: var(--sp-3);
}
.meta-chip.status.is-completed { color: var(--green); border-color: transparent; background: var(--green-soft); }
.meta-chip.status.is-progress { color: var(--green); border-color: transparent; background: var(--green-soft); }
.meta-chip.status.is-notstarted { color: var(--slate-500); }
.meta-chip.status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
  display: inline-block;
}

/* ---------- SOP step cards ---------- */
.sop-progress { color: var(--slate-500); font-size: var(--fs-xs); margin-bottom: var(--sp-2); }
.sop-dots { display: flex; gap: 6px; margin-bottom: var(--sp-5); flex-wrap: wrap; }
.sop-dot {
  width: 20px; height: 6px;
  border-radius: 3px;
  background: var(--ink-700);
  transition: background var(--dur-fast);
}
.sop-dot.is-past { background: var(--teal-bright); }
.sop-dot.is-active { background: var(--brass-bright); width: 28px; }
.sop-card {
  padding: var(--sp-7) var(--sp-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.sop-card__number {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--on-accent);
  background: var(--brass);
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.sop-card__title { font-size: var(--fs-xl); font-family: var(--font-display); font-weight: 600; }
.sop-controls { display: flex; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.sop-controls .node-nav__btn { max-width: 48%; }

/* ---------- Checklist ---------- */
.checklist { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-6); }
.checklist-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  text-align: left;
  color: var(--parchment-dim);
}
.checklist-item__box {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1px solid var(--ink-600);
  display: grid;
  place-items: center;
  color: transparent;
  flex-shrink: 0;
}
.checklist-item__box svg { width: 12px; height: 12px; }
.checklist-item.is-checked { border-color: var(--green); }
.checklist-item.is-checked .checklist-item__box { background: var(--green); border-color: var(--green); color: var(--on-accent); }
.checklist-item.is-checked span:last-child { color: var(--parchment); text-decoration: line-through; text-decoration-color: var(--slate-600); }

/* ---------- Fill-in-the-blank ---------- */
.fillblank-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.fillblank-input {
  flex: 1;
  min-width: 160px;
  background: var(--glass-bg);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  color: var(--parchment);
  font-size: var(--fs-sm);
}
.fillblank-input:focus { border-color: var(--brass); outline: none; }
.fillblank-input.is-correct { border-color: var(--green); background: var(--green-soft); }
.fillblank-input.is-wrong { border-color: var(--coral); background: var(--coral-soft); }

/* ---------- Node footer nav ---------- */
.node-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--ink-700);
}
.node-nav__btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: var(--glass-shadow);
  color: var(--slate-400);
  font-size: var(--fs-sm);
  max-width: 48%;
  transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.node-nav__btn:hover { border-color: var(--brass-soft-strong); color: var(--parchment); transform: translateY(-2px); box-shadow: var(--glass-shadow-lg); }
.node-nav__btn.is-disabled { opacity: 0.3; pointer-events: none; }
.node-nav__label { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; display: block; }
.node-nav__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Welcome / home state ---------- */
.welcome {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: var(--sp-7);
}
.welcome h1 {
  font-size: var(--fs-2xl);
  max-width: 14ch;
  margin-bottom: var(--sp-4);
}
.welcome p { max-width: 52ch; font-size: var(--fs-md); margin-bottom: var(--sp-6); }

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-4);
  width: 100%;
}
.course-card {
  text-align: left;
  padding: var(--sp-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.course-card:hover { transform: translateY(-4px); border-color: var(--brass-soft-strong); box-shadow: var(--glass-shadow-lg); }
.course-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--card-color, var(--brass));
}
.course-card__title { font-weight: 600; font-size: var(--fs-md); margin-bottom: 6px; }
.course-card__desc { font-size: var(--fs-xs); color: var(--slate-500); margin-bottom: var(--sp-3); }
.course-card__cat {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-600);
}
.course-card.is-locked { opacity: 0.45; cursor: default; }
.course-card.is-locked:hover { transform: none; border-color: var(--glass-border); }
.course-card__badge {
  position: absolute;
  top: var(--sp-3); right: var(--sp-3);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--slate-600);
  border: 1px solid var(--ink-700);
  padding: 2px 6px;
  border-radius: 10px;
}

/* ---- Media & callout blocks (added for Admin-authored content) ---- */
.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin: 10px 0 20px;
}
.media-gallery__item {
  margin: 0; border-radius: 10px; overflow: hidden;
  background: var(--glass-bg); backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  cursor: zoom-in; transition: transform 0.15s ease, border-color 0.15s ease;
}
.media-gallery__item:hover, .media-gallery__item:focus-visible { transform: translateY(-2px); border-color: var(--brass-soft-strong); outline: none; }
.media-gallery__item img {
  width: 100%; height: 120px; object-fit: cover; display: block;
  -webkit-user-select: none; user-select: none;
  -webkit-user-drag: none; -webkit-touch-callout: none;
}
.media-gallery__item figcaption { padding: 6px 8px; font-size: var(--fs-xs); color: var(--parchment-dim); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---- Lightbox (click a gallery image to enlarge / switch between images) ---- */
body.lightbox-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(10, 10, 12, 0.92); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-4, 16px);
  animation: fadeIn 0.15s ease;
}
.lightbox__figure { margin: 0; max-width: min(92vw, 1100px); max-height: 88vh; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lightbox__figure img {
  max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 8px; display: block;
  -webkit-user-select: none; user-select: none;
  -webkit-user-drag: none; -webkit-touch-callout: none;
}
.lightbox__figure figcaption { color: var(--parchment-dim); font-size: var(--fs-sm); text-align: center; }
.lightbox__close {
  position: absolute; top: var(--sp-3, 12px); right: var(--sp-3, 12px);
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--glass-border);
  background: var(--glass-bg); color: var(--parchment); font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--glass-border);
  background: var(--glass-bg); color: var(--parchment); font-size: 24px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.lightbox__nav--prev { left: var(--sp-3, 12px); }
.lightbox__nav--next { right: var(--sp-3, 12px); }
.lightbox__counter {
  position: absolute; bottom: var(--sp-3, 12px); left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--parchment-dim);
  background: var(--glass-bg); border: 1px solid var(--glass-border); padding: 4px 10px; border-radius: 999px;
}
@media (max-width: 640px) {
  .lightbox__nav { width: 40px; height: 40px; font-size: 20px; }
}

.media-video { margin: 10px 0 0; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 16/9; }
.media-video iframe, .media-video video {
  width: 100%; height: 100%; border: 0; display: block;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.media-video__caption { margin: 6px 0 20px; font-size: var(--fs-sm); color: var(--parchment-dim); }

.pdf-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--brass-soft); color: var(--brass-bright);
  border: 1px solid var(--brass-soft-strong); text-decoration: none;
  font-size: var(--fs-sm); margin: 6px 0 20px;
}

.callout {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 6px 0 20px;
  border-left: 3px solid var(--teal-bright);
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: var(--glass-shadow);
}
.callout p { margin: 0; }
.callout p + p { margin-top: 6px; }
.callout--note { border-color: var(--teal-bright); }
.callout--tip { border-color: var(--green); background: var(--green-soft); }
.callout--warning { border-color: var(--coral); background: var(--coral-soft); }
.callout--mistake { border-color: var(--coral); }
.callout--case { border-color: var(--brass); background: var(--brass-soft); }

/* ---------- Mouse-tracked specular shine (liquid-glass hover highlight) ---------- */
.branch-card,
.course-card,
.continue-card,
.keypoint,
.node-nav__btn,
.sop-card,
.checklist-item,
.callout,
.icon-toggle,
.offline-course-card__btn {
  position: relative;
  overflow: hidden;
}
.branch-card::after,
.course-card::after,
.continue-card::after,
.keypoint::after,
.node-nav__btn::after,
.sop-card::after,
.checklist-item::after,
.callout::after,
.icon-toggle::after,
.offline-course-card__btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), var(--glass-shine), transparent 45%);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
  pointer-events: none;
  mix-blend-mode: soft-light;
}
.branch-card:hover::after,
.course-card:hover::after,
.continue-card:hover::after,
.keypoint:hover::after,
.node-nav__btn:hover::after,
.sop-card:hover::after,
.checklist-item:hover::after,
.callout:hover::after,
.icon-toggle:hover::after,
.offline-course-card__btn:hover::after {
  opacity: 1;
}

/* ---------- Press "squish" for cards that already have a hover lift ----
   (translateY on hover) — compose it with a scale-down on press instead of
   letting the global button:active rule get overridden by specificity. */
.branch-card:active,
.course-card:active,
.continue-card:active,
.node-nav__btn:active,
.sop-card:active {
  transform: translateY(-1px) scale(0.97);
}
@media (prefers-reduced-motion: reduce) {
  .branch-card:active,
  .course-card:active,
  .continue-card:active,
  .node-nav__btn:active,
  .sop-card:active {
    transform: none;
  }
}

/* ---------- Dark-mode content-card hover glow bleed ----------
   A soft colored glow (matched to each card/leaf-type's accent) that
   bleeds out from the card on hover, on top of the existing glass lift.
   Kept dark-mode-only since it reads as muddy on the light/paper theme. */
:root:not([data-theme="light"]) .branch-card:hover {
  box-shadow: var(--glass-shadow-lg), 0 0 34px -8px var(--brass-soft-strong);
}
:root:not([data-theme="light"]) .branch-card.type-lesson:hover,
:root:not([data-theme="light"]) .branch-card.type-sop:hover {
  box-shadow: var(--glass-shadow-lg), 0 0 34px -8px var(--teal-soft);
}
:root:not([data-theme="light"]) .branch-card.type-quiz:hover {
  box-shadow: var(--glass-shadow-lg), 0 0 34px -8px var(--coral-soft);
}
:root:not([data-theme="light"]) .branch-card.type-summary:hover {
  box-shadow: var(--glass-shadow-lg), 0 0 34px -8px var(--green-soft);
}
:root:not([data-theme="light"]) .continue-card:hover,
:root:not([data-theme="light"]) .sop-card:hover {
  box-shadow: var(--glass-shadow-lg), 0 0 34px -8px var(--brass-soft-strong);
}
:root:not([data-theme="light"]) .course-card:hover {
  box-shadow: var(--glass-shadow-lg),
    0 0 40px -6px color-mix(in srgb, var(--card-color, var(--brass)) 45%, transparent);
}
