.branch-rail {
  position: relative;
  inset: auto;
  display: flex;
  gap: 10px;
  width: min(820px, 100%);
  max-height: none;
  margin: 20px auto 0;
  padding: 4px 4px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 16px;
}

.branch-pill {
  flex: 0 0 184px;
  width: 184px;
  min-height: 86px;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  scroll-snap-align: center;
}

.branch-pill small {
  display: block;
  font-size: .85rem;
  font-weight: 750;
  line-height: 1.3;
  white-space: normal;
  overflow: visible;
}

.branch-pill b { grid-row: 1; font-size: .76rem; color: var(--teal); }
.branch-pill.selected b { color: var(--ink); }
.branch-pill.selected { box-shadow: 0 3px 0 #ae7d27, 0 0 24px #ffd16625; }

.branch-progress {
  display: block;
  grid-column: 1 / -1;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(4, 14, 33, .65);
  border: 1px solid rgba(255, 255, 255, .14);
}

.branch-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.topic-nodes.vertical {
  display: grid;
  gap: 24px;
  position: relative;
}

.topic-nodes.vertical .topic-node:nth-child(n) {
  width: min(calc(100% - 56px), 430px);
  margin-inline: auto;
  min-height: 86px;
  padding: 12px;
  border-radius: 24px;
  transform: translateX(-16px);
}

.topic-nodes.vertical .topic-node:nth-child(even) { transform: translateX(16px); }
.topic-nodes.vertical .topic-node:active { scale: .98; }
.topic-nodes.vertical .node-copy strong {
  font-size: .96rem;
  line-height: 1.35;
}

.topic-nodes.vertical .node-copy small {
  font-size: .78rem;
}

.map-heading { margin-block: 22px 0; }
.map-heading h1 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
.map-heading > p { font-size: .68rem; letter-spacing: .07em; }
.map-heading .level-progress { max-width: 200px; height: 5px; margin-block: 10px 0; }
.map-progress-link { border: 0; background: none; color: var(--muted); font: inherit; font-size: .75rem; min-height: 44px; cursor: pointer; }
.mission-heading { text-align: center; margin: 0 0 22px; text-shadow: 0 2px 12px var(--ink); }
.mission-heading p { margin: 0; color: var(--teal); text-transform: uppercase; font-size: .66rem; font-weight: 800; letter-spacing: .12em; }
.mission-heading small { color: var(--muted); font-size: .75rem; }
.learning-path { margin-top: 18px; padding-bottom: 30px; }
.learning-path .path-line { top: 100px; bottom: 50px; left: 50%; width: 3px; opacity: .7; }
.topic-node .node-orb { width: 50px; height: 50px; flex-basis: 50px; font-size: 1.1rem; }
.topic-node.pending:not(.current) .node-orb { border-style: dashed; color: var(--muted); }
.topic-node.started .node-orb { border-color: var(--teal); background: conic-gradient(from -90deg, #2a727a var(--node-progress), #112c51 0); }
.topic-node.secure .node-orb { border-color: var(--gold); background: #3a3f39; color: var(--gold); }
.node-open { margin-left: auto; font-size: 1.6rem; color: var(--muted); }
.node-next { font-style: normal; font-size: .64rem; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: .04em; }
.node-review { color: var(--gold); font-size: .75rem; }
.node-review b { display: inline-block; font-size: .9rem; }
.topic-node.needs-review { border-style: dashed; }
.topic-node.current { border-color: var(--gold); }
:is(.branch-pill, .topic-node, .map-progress-link):focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

.topic-preview-examples {
  display: grid;
  gap: 2px;
  margin-top: 3px;
}

.item-sheet-list .topic-preview-examples small {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.25;
}

@media (max-width: 760px) {
  .branch-rail {
    width: 100%;
  }

  .branch-pill {
    flex-basis: 168px;
    width: 168px;
  }
  .map-shell { padding-bottom: calc(var(--nav-h) + 32px); }
  .map-heading { margin-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .branch-rail { scroll-behavior: auto; }
  .topic-node { transition: none; }
}
