/*
  Journey home + Modules listing + Glossary.
  Timeline uses SVG for the connecting spine so badge alignment is exact.
*/

/* ================================================================
   HOME — Journey
   ================================================================ */

.journey-band {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--divider-subtle);
}
.journey-band .eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.journey-band h1 {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  max-width: 720px;
  white-space: nowrap;
}
.journey-band h1 .h1-bold {
  font-weight: 300;
  opacity: 0.7;
}
.journey-band h1 .h1-light {
  font-weight: 300;
}
.journey-band .sub {
  color: var(--light);
  font-size: 16px;
  max-width: 620px;
  margin: 0 0 28px;
}

/* Welcome text + continue card side-by-side */
.jb-top {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  margin-bottom: 8px;
}
.jb-top .jb-intro { min-width: 0; }
.jb-top .jb-intro .sub { margin-bottom: 0; }
@media (max-width: 900px) {
  .jb-top { grid-template-columns: 1fr; gap: 24px; }
}

/* Continue hero — full-width, large cinematic card */
.continue-hero {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color 200ms, transform 200ms;
  margin-top: 28px;
}
.continue-hero:hover {
  border-color: var(--muted);
  transform: translateY(-2px);
  box-shadow: 0 18px 48px rgba(0,0,0,0.32);
}
.continue-hero .ch-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  overflow: hidden;
  min-height: 240px;
}
.continue-hero .ch-thumb .thumb-motif {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.continue-hero .ch-thumb .ch-thumb-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}
.continue-hero .ch-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 0%, rgba(10,10,10,0.25) 60%, rgba(10,10,10,0.55) 100%),
    linear-gradient(180deg, transparent 40%, rgba(10,10,10,0.6) 100%);
  z-index: 1;
  pointer-events: none;
}
[data-theme="light"] .continue-hero .ch-overlay {
  background:
    radial-gradient(ellipse at 50% 50%, transparent 0%, rgba(10,10,10,0.25) 60%, rgba(10,10,10,0.55) 100%),
    linear-gradient(180deg, transparent 40%, rgba(10,10,10,0.6) 100%);
}
.continue-hero .ch-play {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  z-index: 3;
  box-shadow: 0 12px 32px rgba(255,74,28,0.45), 0 0 0 6px rgba(255,74,28,0.12);
  transition: transform 200ms, background 200ms;
}
.continue-hero .ch-play svg { margin-left: 3px; }
.continue-hero:hover .ch-play {
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: 0 16px 44px rgba(255,74,28,0.55), 0 0 0 10px rgba(255,74,28,0.14);
}
.continue-hero .ch-time {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #F5F5F4;
  background: rgba(10,10,10,0.72);
  backdrop-filter: blur(6px);
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid rgba(245,245,244,0.08);
  white-space: nowrap;
}
.continue-hero .ch-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: var(--tint-strong);
  z-index: 3;
}
.continue-hero .ch-progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(255,74,28,0.6);
}
.continue-hero .ch-body {
  padding: 36px 40px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.continue-hero .ch-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  flex-wrap: wrap;
}
.continue-hero .ch-kicker-label,
.continue-hero .ch-kicker-mod {
  white-space: nowrap;
}
.continue-hero .ch-kicker-label {
  color: var(--accent);
}
.continue-hero .ch-kicker-sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.continue-hero .ch-kicker-mod {
  color: var(--muted);
}
.continue-hero .ch-title {
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: var(--white);
  text-wrap: balance;
}
.continue-hero .ch-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--light);
  margin: 0 0 28px;
  max-width: 56ch;
}
.continue-hero .ch-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.continue-hero .ch-resume {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.005em;
}
.continue-hero .ch-resume i[data-lucide] { width: 16px; height: 16px; }
.continue-hero .ch-arrow {
  transition: transform 200ms;
  display: inline-block;
}
.continue-hero:hover .ch-arrow { transform: translateX(4px); }
.continue-hero .ch-remaining {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
@media (max-width: 920px) {
  .continue-hero {
    grid-template-columns: 1fr;
  }
  .continue-hero .ch-thumb { min-height: 200px; }
  .continue-hero .ch-body { padding: 28px 24px; }
}

/* Legacy .continue-card removed — replaced by .continue-hero */

/* Journey stats row */
.journey-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 24px;
}
@media (max-width: 900px) { .journey-stats { grid-template-columns: repeat(2, 1fr); } }
.j-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.j-stat .big {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--white);
  line-height: 1;
  font-feature-settings: "tnum";
}
.j-stat .big .of {
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
}
.j-stat .big.accent { color: var(--accent); }
.j-stat .big.accent-2 { color: var(--accent-2); }
.j-stat .lbl {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  line-height: 1.3;
}

/* ============ Timeline ============ */
.timeline-section {
  padding: 56px 0;
}
.timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.timeline-head h2 {
  font-size: clamp(22px, 2.4vw, 26px);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
}
.timeline-head .legend {
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: var(--muted);
}
.timeline-head .legend .lg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.timeline-head .legend .lg::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
}
.timeline-head .legend .lg.earned::before { background: var(--accent); box-shadow: 0 0 0 2px rgba(255,74,28,0.2); }
.timeline-head .legend .lg.progress::before { background: transparent; border: 2px solid var(--accent); box-shadow: 0 0 0 2px rgba(255,74,28,0.12); }
.timeline-head .legend .lg.locked::before { background: var(--bg-card-alt); border: 1px solid var(--border); }
.timeline-head .legend .lg.cert::before { background: var(--white); box-shadow: 0 0 0 2px rgba(245,245,244,0.15); }

/* ============ Timeline (simplified) ============ */
.tl2 {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.tl2-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: start;
  padding: 22px 0;
  position: relative;
  border-bottom: 1px solid var(--divider-subtle);
}
.tl2-row:last-child { border-bottom: 0; }

/* Vertical rail runs through the dot column */
.tl2-rail {
  position: absolute;
  left: 21px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.tl2-row:first-child .tl2-rail { top: 22px; }
.tl2-row:last-child .tl2-rail { bottom: auto; top: 0; height: 22px; }

/* Numbered mark */
.tl2-mark {
  grid-column: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--muted);
  position: relative;
  z-index: 1;
  transition: border-color 200ms, color 200ms, background 200ms;
}
.tl2-row.progress .tl2-mark {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,74,28,0.08);
}
.tl2-row.earned .tl2-mark {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 0;
  position: relative;
  z-index: 1;
}
.tl2-row.earned .tl2-mark::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.tl2-row.locked .tl2-mark {
  color: var(--muted);
  background: var(--bg-card-alt);
}
.tl2-lock {
  width: 16px !important;
  height: 16px !important;
  color: var(--muted);
  opacity: 0.7;
}

/* Connecting rail — orange when the segment connects an earned node
   downward. The rail on an earned row continues down to the next row,
   so we color it orange. The rail on the row AFTER the last earned row
   should be orange on its top half only; we do that by coloring the
   progress row's rail with a gradient from orange (top) to border (bottom). */
.tl2-row.earned .tl2-rail {
  background: var(--accent);
}
.tl2-row.earned + .tl2-row.earned .tl2-rail {
  background: var(--accent);
}
/* The row immediately after an earned run: orange top, default rest */
.tl2-row.earned + .tl2-row:not(.earned) .tl2-rail {
  background: linear-gradient(to bottom, var(--accent) 0 50%, var(--border) 50% 100%);
}

/* Certification row */
.tl2-row.cert {
  padding-top: 28px;
  margin-top: 8px;
  border-top: 1px solid var(--divider);
  border-bottom: 0;
}
.tl2-mark-cert {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,74,28,0.08);
}
.tl2-row.cert.locked .tl2-mark-cert {
  border-color: var(--accent);
  color: var(--accent);
}

/* Body */
.tl2-body { min-width: 0; padding-top: 2px; }
.tl2-kicker {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.tl2-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
  margin: 0 0 6px;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.tl2-row.cert .tl2-title {
  font-size: 22px;
  font-weight: 600;
}
.tl2-row.locked .tl2-title { color: var(--light); }
.tl2-desc {
  font-size: 14px;
  color: var(--light);
  margin: 0;
  line-height: 1.55;
  max-width: 64ch;
}
.tl2-row.locked .tl2-desc { color: var(--muted); }
.tl2-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.04em;
  flex-wrap: wrap;
}
.tl2-meta > span { white-space: nowrap; }
.tl2-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tl2-tag.earned {
  background: color-mix(in srgb, var(--accent-2) 18%, transparent);
  color: var(--accent-2);
}
.tl2-tag.in-progress {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}
.tl2-tag.not-started {
  background: color-mix(in srgb, var(--muted) 18%, transparent);
  color: var(--muted);
}
.tl2-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tl2-chip-earned {
  background: rgba(255,74,28,0.14);
  color: var(--accent);
}
.tl2-chip-progress {
  background: rgba(255,74,28,0.12);
  color: var(--accent);
}

/* Action */
.tl2-action {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--light);
  text-decoration: none;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: color 150ms, border-color 150ms, background 150ms;
}
.tl2-action.primary {
  background: var(--accent);
  color: #0A0A0A;
  border-color: var(--accent);
}
.tl2-action.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.tl2-action.ghost {
  color: var(--muted);
}
.tl2-action.locked {
  color: var(--muted);
  cursor: not-allowed;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
  padding: 8px 12px;
  border: 1px dashed var(--divider);
  border-radius: 8px;
}
.tl2-action.locked::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A3A3A3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect width='18' height='11' x='3' y='11' rx='2' ry='2'/><path d='M7 11V7a5 5 0 0 1 10 0v4'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
}
.tl2-action:not(.primary):not(.ghost):not(.locked):hover {
  color: var(--accent);
}
.tl2-action .arrow { transition: transform 150ms; }
.tl2-action:hover .arrow { transform: translateX(3px); }

@media (max-width: 720px) {
  .tl2-row { grid-template-columns: 44px 1fr; gap: 16px; }
  .tl2-action { grid-column: 1 / -1; margin-left: 60px; justify-self: start; margin-top: 6px; }
}

/* ================================================================
   MODULES LISTING PAGE
   ================================================================ */

.modules-page {
  padding: 40px 0 80px;
}
.modules-page h1 {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
}
.modules-page .page-sub {
  color: var(--light);
  font-size: 16px;
  max-width: 620px;
  margin: 0 0 28px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0 20px;
  border-bottom: 1px solid var(--divider-subtle);
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.filter-bar .tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.filter-bar .tab {
  padding: 7px 12px;
  font-size: 13px;
  color: var(--muted);
  border-radius: 8px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
}
.filter-bar .tab.active {
  color: var(--white);
  background: var(--bg-card);
  border-color: var(--border);
}
.filter-bar .tab:hover { color: var(--white); }
.filter-bar .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.big-mod {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 42% 1fr;
  align-items: stretch;
  transition: border-color 150ms;
  margin-bottom: 16px;
}
.big-mod:hover { border-color: var(--muted); }
.big-mod.locked { opacity: 0.65; }
@media (max-width: 900px) {
  .big-mod { grid-template-columns: 1fr; }
}

.big-mod .bm-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 30% 35%, rgba(255,74,28,0.22), transparent 55%),
    linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.big-mod .bm-thumb .bm-thumb-img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}
@media (max-width: 900px) { .big-mod .bm-thumb { border-right: 0; border-bottom: 1px solid var(--border); aspect-ratio: 16/9; } }
.big-mod .bm-thumb .mock {
  position: absolute;
  inset: 52px 22px 22px 22px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  opacity: 0.78;
}
.big-mod .bm-thumb .mock > div {
  background: rgba(245, 245, 244, 0.06);
  border: 1px solid rgba(245, 245, 244, 0.08);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 10px;
  color: var(--light);
  line-height: 1.25;
  font-family: "JetBrains Mono", monospace;
}
.big-mod .bm-thumb .mock > div b {
  color: var(--white);
  font-size: 14px;
  display: block;
  margin-top: 2px;
  font-family: "Inter", sans-serif;
  font-weight: 700;
}
.big-mod .bm-thumb .play {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 54px; height: 54px;
  border-radius: 50%;
  background: rgba(10,10,10,0.85);
  border: 1px solid rgba(245,245,244,0.25);
  backdrop-filter: blur(10px);
  display: grid; place-items: center;
  color: #F5F5F4;
  transition: background 150ms;
}
.big-mod:hover .bm-thumb .play { background: var(--accent); border-color: var(--accent); color: #0A0A0A; }
.big-mod .bm-thumb .duration {
  position: absolute;
  bottom: 12px; right: 12px;
  background: rgba(10,10,10,0.85);
  border: 1px solid rgba(245,245,244,0.15);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: #F5F5F4;
  font-weight: 600;
}
.big-mod .bm-thumb .bm-state {
  position: absolute;
  bottom: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(10,10,10,0.85);
  border: 1px solid rgba(245,245,244,0.15);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  color: #B8B8B6;
  font-weight: 500;
}
.big-mod .bm-thumb .bm-state.done { color: var(--accent-2); border-color: rgba(245,192,75,0.3); }
.big-mod .bm-thumb .bm-state.done::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-2); }
.big-mod .bm-thumb .bm-state.in-progress { color: var(--accent); border-color: rgba(255,74,28,0.3); }
.big-mod .bm-thumb .bm-state.in-progress::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.big-mod .bm-thumb .bm-state.new { color: var(--accent-2); border-color: rgba(245,192,75,0.3); }

.big-mod .bm-body {
  padding: 24px 28px 24px;
  display: flex;
  flex-direction: column;
}
.big-mod .bm-kicker {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 8px;
}
.big-mod h3.bm-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  color: var(--white);
  line-height: 1.25;
}
.big-mod .bm-prop {
  font-size: 14px;
  color: var(--light);
  line-height: 1.55;
  margin: 0 0 16px;
}

.bm-steps {
  list-style: none;
  padding: 0;
  margin: 8px 0 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
}
@media (max-width: 1100px) { .bm-steps { grid-template-columns: 1fr; } }
.bm-steps li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 13px;
  color: var(--light);
  line-height: 1.45;
}
.bm-steps li .s-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  padding-top: 2px;
}
.bm-steps li b { color: var(--white); font-weight: 600; }

.bm-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--divider-subtle);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.bm-foot .bm-concepts {
  display: flex; gap: 6px; flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}
.bm-foot .bm-concepts .c {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  color: var(--light);
  white-space: nowrap;
}
.bm-foot .bm-cta {
  flex-shrink: 0;
}
.bm-foot .bm-cta .btn { padding: 10px 16px; font-size: 13px; }

/* Groups on modules page */
.mod-group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 40px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--divider-subtle);
}
.mod-group-head:first-of-type { margin-top: 16px; }
.mod-group-head .mg-marker {
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--tier, var(--accent));
}
.mod-group-head .mg-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
}
.mod-group-head .mg-sub {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}
.mod-group-head .mg-count {
  margin-left: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ================================================================
   GLOSSARY
   ================================================================ */

.glossary-page {
  padding: 40px 0 80px;
}
.glossary-page h1 {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
}
.glossary-page .page-sub {
  color: var(--light);
  font-size: 16px;
  max-width: 620px;
  margin: 0 0 28px;
}

.gloss-search-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0 20px;
  border-bottom: 1px solid var(--divider-subtle);
  margin-bottom: 24px;
}
.gloss-search-row .alpha-index {
  grid-column: 1 / -1;
}
@media (max-width: 700px) { .gloss-search-row { grid-template-columns: 1fr; } }
.gloss-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
}
.gloss-search:focus-within { border-color: var(--accent); }
.gloss-search input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--white);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  min-width: 0;
}
.gloss-search input::placeholder { color: var(--muted); }
.gloss-search [data-lucide] { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }

.alpha-index {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}
.alpha-index a {
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.alpha-index a.active { background: var(--bg-card); color: var(--white); border: 1px solid var(--border); }
.alpha-index a:hover { color: var(--white); }
.alpha-index a.disabled { color: var(--border); cursor: default; }

.gloss-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.gloss-cat-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--white);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.gloss-cat-select:focus { border-color: var(--accent); }
.gloss-cat-clear {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: background 0.15s;
}
.gloss-cat-clear:hover { background: var(--accent-hover); }

.gloss-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
}
@media (max-width: 900px) {
  .gloss-body { grid-template-columns: 1fr; gap: 24px; }
  .gloss-toc { position: static !important; }
}

.gloss-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 8px;
}
.gloss-toc h5 {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 12px;
}
.gloss-toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.gloss-toc a {
  display: block;
  font-size: 13px;
  color: var(--light);
  padding: 5px 8px;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: color 150ms, background 150ms, border-color 150ms;
}
.gloss-toc a:hover { color: var(--white); background: var(--bg-card); }
.gloss-toc a.active { color: var(--white); border-left-color: var(--accent); background: var(--bg-card); }

.gloss-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.gloss-list > div {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 12px;
}
.gloss-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 28px;
  scroll-margin-top: 96px;
  transition: border-color 0.2s;
}
.gloss-item:hover {
  border-color: rgba(255, 255, 255, 0.12);
}
.gloss-item .g-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.gloss-item .g-term {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--white);
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.gloss-item .g-pron {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}
.gloss-item .g-tags {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.gloss-item .g-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  color: var(--light);
}
.gloss-item .g-tag.sev-high { color: var(--severity-high); border-color: rgba(255,74,28,0.35); background: rgba(255,74,28,0.08); }
.gloss-item .g-tag.sev-medium { color: var(--severity-medium, #f59e0b); border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.08); }
.gloss-item .g-tag.sev-med { color: var(--severity-medium); border-color: rgba(245,165,36,0.35); background: rgba(245,165,36,0.08); }
.gloss-item .g-tag.sev-low { color: var(--severity-low); border-color: rgba(245,192,75,0.35); background: rgba(245,192,75,0.08); }
.gloss-item .g-tag.sev-info { color: var(--severity-info); border-color: rgba(122,167,255,0.35); background: rgba(122,167,255,0.08); }

.gloss-item p {
  font-size: 14px;
  color: var(--light);
  line-height: 1.6;
  margin: 0 0 10px;
}
.gloss-item p:last-child { margin-bottom: 0; }
.gloss-item .g-example {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg-card-alt);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: var(--white);
}
.gloss-item .g-example b { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; display: block; margin-bottom: 4px; }
.gloss-item .g-related {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.gloss-item .g-related .lbl {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.gloss-item .g-related a {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  color: var(--light);
  cursor: pointer;
  transition: color 150ms, border-color 150ms;
  white-space: nowrap;
}
.gloss-item .g-related a:hover { color: var(--white); border-color: var(--accent); }
.gloss-item .g-seen-in {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.gloss-item .g-seen-in a {
  color: var(--accent);
  font-weight: 500;
}
.gloss-item .g-seen-in a:hover { color: var(--accent-hover); }

.gloss-letter {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 24px 0 10px;
  margin-top: 8px;
  border-bottom: 1px solid var(--divider-subtle);
  margin-bottom: 16px;
}
.gloss-letter:first-of-type { margin-top: 0; padding-top: 0; }

.g-category-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 74, 28, 0.1);
  color: var(--accent);
  border: 1px solid rgba(255, 74, 28, 0.2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.g-category-badge:hover {
  background: rgba(255, 74, 28, 0.18);
  border-color: rgba(255, 74, 28, 0.35);
}

.g-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 0;
  margin-top: 4px;
  transition: color 0.15s;
}
.g-expand-btn:hover { color: var(--accent-hover); }

.g-details {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}
.g-detail-section {
  padding: 14px 18px;
  border-radius: 8px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
}
.g-detail-section h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 6px;
}
.g-detail-section p {
  margin: 0;
  white-space: pre-line;
  font-size: 14px;
  line-height: 1.6;
}

.gloss-view-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.gloss-view-btn {
  background: none;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.gloss-view-btn:hover { color: var(--white); }
.gloss-view-btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.gloss-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 12px;
  margin-top: 8px;
  border-bottom: 1px solid var(--divider-subtle);
  margin-bottom: 16px;
}
.gloss-module-header:first-of-type { margin-top: 0; padding-top: 0; }
.gloss-module-header-inner {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.gloss-module-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.gloss-module-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
}
a.gloss-module-title:hover { color: var(--accent); }
.gloss-module-count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.g-related-more {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  margin-left: 2px;
}
.g-related-more:hover {
  color: var(--white);
  border-color: var(--accent);
}

.gloss-toc-module > a {
  font-weight: 600;
  font-size: 12px;
  color: var(--white) !important;
}
.gloss-toc-module > a::before {
  content: "↳ ";
  color: var(--accent);
  font-weight: 700;
}
