:root {
  --void: #f6f7f9;
  --deep: #ffffff;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --ink: #111827;
  --ink-soft: #374151;
  --muted: #6b7280;
  --line: rgba(17, 24, 39, 0.1);
  --amber: #2451b3;
  --amber-deep: #1b3f8f;
  --sage: #15803d;
  --sage-deep: #166534;
  --leaf: #4d7c0f;
  --coral: #c2410c;
  --violet: #6d28d9;
  --sky: #0369a1;
  --aqua: #0f766e;
  --aqua-deep: #115e59;
  --gold: #2451b3;
  --ember: #c2410c;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 6px 20px rgba(17, 24, 39, 0.05);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html {
  /* clip (unlike hidden) kills sideways scroll without creating a scroll
     container, so position: sticky keeps working; hidden is the fallback. */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: var(--void);
  overflow-x: hidden;
  overflow-x: clip;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.starfield {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 18px;
}

.topbar {
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(260px, 420px) minmax(420px, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid rgba(17, 24, 39, 0.16);
  border-top-color: rgba(17, 24, 39, 0.24);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  flex-shrink: 0;
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 10px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: "Fraunces", serif;
  font-size: 1.28rem;
  letter-spacing: -0.01em;
}

.brand small {
  margin-top: 2px;
  color: rgba(17, 24, 39, 0.52);
  font-size: 0.75rem;
}

.search-box {
  height: 48px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 9px;
  background: rgba(17, 24, 39, 0.03);
  border: 1px solid rgba(17, 24, 39, 0.13);
}

.search-box span {
  color: rgba(17, 24, 39, 0.44);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-box input::placeholder {
  color: rgba(17, 24, 39, 0.3);
}

.top-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.top-links a,
.mode-tab,
.filter-chip,
.detail-links a {
  text-decoration: none;
  border-radius: 7px;
  font-weight: 700;
}

.top-links a {
  padding: 9px 12px;
  color: var(--ink-soft);
  background: rgba(17, 24, 39, 0.03);
  border: 1px solid rgba(17, 24, 39, 0.12);
  font-size: 0.82rem;
  transition: all 0.18s ease;
}

.top-links a:hover,
.filter-chip:hover,
.repo-card:hover,
.detail-links a:hover {
  border-color: rgba(36, 81, 179, 0.5);
  color: var(--ink);
}

.atlas {
  --rail-width: 292px;
  --detail-width: 364px;
  display: grid;
  grid-template-columns: var(--rail-width) minmax(430px, 1fr) var(--detail-width);
  gap: 16px;
  margin-top: 16px;
  min-height: calc(100vh - 128px);
  align-items: start;
}

.atlas.is-rail-collapsed {
  --rail-width: 0px;
}

.atlas.is-detail-closed {
  --detail-width: 0px;
}

.source-rail,
.graph-stage,
.inspector {
  border: 1px solid rgba(17, 24, 39, 0.11);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition:
    opacity 0.24s ease,
    transform 0.24s ease,
    visibility 0.24s ease;
}

.source-rail,
.inspector {
  border-radius: 12px;
  padding: 16px;
  overflow: auto;
  max-height: calc(100vh - 128px);
  min-width: 0;
}

.atlas.is-rail-collapsed .source-rail {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-20px);
  visibility: hidden;
}

.atlas.is-detail-closed .inspector {
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
  visibility: hidden;
}

.graph-stage {
  position: relative;
  min-width: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.graph-stage::after {
  content: none;
}

.graph-stage > * {
  position: relative;
  z-index: 1;
}

.rail-heading {
  display: grid;
  gap: 3px;
}

.rail-heading p,
.kicker,
.inspector-topline,
.repo-card small {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--amber);
}

.rail-heading strong {
  font-family: "Fraunces", serif;
  font-size: 3.6rem;
  line-height: 0.9;
  color: var(--amber);
}

.rail-heading span,
.rail-stats span {
  color: var(--muted);
  font-size: 0.84rem;
}

.rail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}

.rail-stats div {
  padding: 12px;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.03);
  border: 1px solid rgba(17, 24, 39, 0.11);
}

.rail-stats strong,
.rail-stats span {
  display: block;
}

.rail-stats strong {
  font-size: 1.05rem;
  color: var(--ink);
}

.rail-manifesto {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 2px solid rgba(36, 81, 179, 0.68);
  color: var(--ink-soft);
  background: rgba(36, 81, 179, 0.055);
  font-size: 0.84rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.62;
}

.rail-section-title {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(17, 24, 39, 0.1);
  color: var(--amber);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scholar-card,
.reading-card,
.paper-card {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(36, 81, 179, 0.22);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  background:
    linear-gradient(135deg, rgba(36, 81, 179, 0.09), transparent 52%), rgba(17, 24, 39, 0.03);
  transition: all 0.2s ease;
}

.scholar-card:hover,
.reading-card:hover,
.paper-card:hover,
.fork-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(17, 24, 39, 0.07);
}

.scholar-card span,
.scholar-card em,
.paper-card span,
.paper-card em {
  color: var(--muted);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 700;
}

.scholar-card strong,
.paper-card strong {
  font-family: "Fraunces", serif;
  color: var(--amber);
  font-size: 2.25rem;
  line-height: 0.95;
}

.scholar-card small,
.paper-card small {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.reading-card {
  border-color: rgba(194, 65, 12, 0.26);
  background:
    linear-gradient(135deg, rgba(194, 65, 12, 0.1), transparent 52%), rgba(17, 24, 39, 0.03);
}

.reading-card span,
.reading-card em {
  color: var(--muted);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 700;
}

.reading-card strong {
  font-family: "Fraunces", serif;
  color: var(--coral);
  font-size: 2.25rem;
  line-height: 0.95;
}

.reading-card small {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.paper-card {
  border-color: rgba(3, 105, 161, 0.26);
  background:
    linear-gradient(135deg, rgba(3, 105, 161, 0.09), transparent 52%), rgba(17, 24, 39, 0.03);
}

.paper-card strong {
  color: var(--sky);
}

.fork-card {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(21, 128, 61, 0.22);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  background:
    linear-gradient(135deg, rgba(21, 128, 61, 0.09), transparent 52%), rgba(17, 24, 39, 0.03);
  transition: all 0.2s ease;
}

.fork-card span,
.fork-card em {
  color: var(--muted);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 700;
}

.fork-card strong {
  line-height: 1.2;
}

.rail-more {
  margin-top: 10px;
  border: 1px solid rgba(17, 24, 39, 0.11);
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.03);
}

.rail-more summary {
  cursor: pointer;
  padding: 11px 13px;
  color: var(--ink-soft);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.16s ease;
}

.rail-more summary:hover {
  color: var(--ink);
}

.rail-more[open] summary {
  border-bottom: 1px solid rgba(17, 24, 39, 0.11);
}

.rail-more .scholar-card,
.rail-more .reading-card,
.rail-more .paper-card,
.rail-more .fork-card {
  margin: 10px;
}

.library-links {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.library-link {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(17, 24, 39, 0.11);
  border-radius: 9px;
  color: var(--ink);
  text-decoration: none;
  background: rgba(17, 24, 39, 0.03);
  transition: all 0.18s ease;
}

.library-link strong,
.library-link span {
  display: block;
}

.library-link strong {
  font-size: 0.88rem;
}

.library-link span {
  color: var(--muted);
  font-size: 0.75rem;
}

.library-link-input {
  border-color: rgba(194, 65, 12, 0.22);
}

.library-link-output {
  border-color: rgba(3, 105, 161, 0.24);
}

.library-link-advisor {
  border-color: rgba(36, 81, 179, 0.26);
}

.library-link:hover {
  border-color: rgba(36, 81, 179, 0.5);
  transform: translateY(-1px);
}

.filter-bar,
.layer-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.layer-filter-bar {
  padding-top: 0;
}

.compact-filter-bar {
  margin: 0;
  padding: 10px;
}

.filter-chip {
  appearance: none;
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 7px;
  background: rgba(17, 24, 39, 0.03);
  color: var(--ink-soft);
  padding: 7px 10px;
  font-size: 0.77rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.filter-chip.active {
  background: rgba(36, 81, 179, 0.15);
  border-color: rgba(36, 81, 179, 0.68);
  color: var(--ink);
}

.trail-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.trail-card {
  appearance: none;
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(17, 24, 39, 0.11);
  border-radius: 9px;
  color: var(--ink);
  background: rgba(17, 24, 39, 0.03);
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}

.trail-card strong {
  font-size: 0.84rem;
  line-height: 1.28;
}

.trail-card span {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.trail-card.active {
  border-color: rgba(36, 81, 179, 0.65);
  background:
    linear-gradient(135deg, rgba(36, 81, 179, 0.11), transparent 56%), rgba(17, 24, 39, 0.03);
}

.repo-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.repo-card {
  display: grid;
  gap: 5px;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(17, 24, 39, 0.11);
  border-radius: 9px;
  padding: 11px 12px;
  background: rgba(17, 24, 39, 0.03);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.18s ease;
}

.repo-card.active {
  outline: 1px solid var(--sage);
  background: rgba(21, 128, 61, 0.08);
}

.repo-card.is-curated-output {
  border-color: rgba(36, 81, 179, 0.22);
}

.repo-card.is-scholar-output {
  border-style: dashed;
  background: rgba(3, 105, 161, 0.04);
}

.repo-card strong {
  color: var(--ink);
  line-height: 1.25;
  font-size: 0.87rem;
}

.repo-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

.repo-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed rgba(17, 24, 39, 0.16);
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.stage-toolbar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: flex-start;
  padding: 22px 22px 0;
}

.stage-toolbar h1 {
  max-width: 780px;
  margin: 4px 0 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 3.3vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.stage-onboarding {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.72;
  font-size: 0.94rem;
}

.layer-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.layer-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(17, 24, 39, 0.03);
  font-size: 0.76rem;
  font-weight: 700;
}

.layer-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.layer-legend i[data-layer="input"] {
  color: var(--coral);
  background: var(--coral);
}

.layer-legend i[data-layer="question"] {
  color: var(--violet);
  background: var(--violet);
}

.layer-legend i[data-layer="output"] {
  color: var(--sky);
  background: var(--sky);
}

.mode-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.03);
  width: min(100%, 300px);
  margin-top: 2px;
}

.mode-tab {
  appearance: none;
  border: 0;
  padding: 9px 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.18s ease;
}

.mode-tab.active {
  background: rgba(36, 81, 179, 0.14);
  color: var(--ink);
}

.graph-wrap {
  position: relative;
  min-height: 650px;
}

.graph-wrap::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(17, 24, 39, 0.07);
  background-image:
    linear-gradient(rgba(17, 24, 39, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.06) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at center, black, transparent 70%);
  pointer-events: none;
}

#graph-svg {
  position: relative;
  display: block;
  width: 100%;
  height: 650px;
}

.graph-link {
  fill: none;
  stroke: rgba(17, 24, 39, 0.28);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 2 10;
  animation: route-drift 9s linear infinite;
}

.graph-link.hot {
  stroke: var(--amber);
  stroke-width: 2.5;
  stroke-dasharray: 10 12;
  animation-duration: 2.8s;
}

.graph-link.muted,
.graph-node.is-muted {
  opacity: 0.3;
}

.node-halo {
  fill: transparent;
  stroke: rgba(36, 81, 179, 0.28);
  stroke-width: 14;
  animation: halo-breathe 3s ease-in-out infinite;
}

.orbit-ring {
  fill: none;
  stroke: rgba(36, 81, 179, 0.28);
  stroke-width: 1.5;
  stroke-dasharray: 4 10;
  transform-origin: center;
  animation: orbit-spin 11s linear infinite;
}

.orbit-two {
  stroke: rgba(21, 128, 61, 0.24);
  stroke-dasharray: 2 12;
  animation-duration: 16s;
  animation-direction: reverse;
}

.graph-node {
  cursor: pointer;
}

.node-hit {
  fill: rgba(17, 24, 39, 0.03);
  stroke: transparent;
}

.node-visual {
  pointer-events: none;
}

.graph-node circle.core {
  stroke: rgba(17, 24, 39, 0.55);
  stroke-width: 2;
  transition: stroke-width 0.2s ease;
}

.graph-node.is-selected circle.core {
  stroke: #111827;
  stroke-width: 3;
}

.graph-node.node-source-scholar circle.core {
  opacity: 0.85;
  stroke-width: 1.4;
}

.graph-node.node-source-curated circle.core {
  stroke-width: 2.6;
}

.node-kind-input circle.core {
  stroke-dasharray: 3 6;
}

.node-kind-question circle.core {
  stroke-dasharray: 8 5;
}

.node-aura {
  opacity: 0.08;
}

.node-spark {
  fill: rgba(255, 255, 255, 0.75);
  pointer-events: none;
}

.energy-particle {
  fill: rgba(17, 24, 39, 0.72);
  pointer-events: none;
}

.energy-particle.hot {
  fill: #2451b3;
}

.spark-burst {
  pointer-events: none;
  animation: burst-fade 0.82s ease-out forwards;
}

.burst-ring {
  fill: none;
  stroke-width: 2;
  animation: burst-ring 0.82s ease-out forwards;
}

.burst-ray {
  stroke-width: 2;
  stroke-linecap: round;
  animation: burst-ray 0.82s ease-out forwards;
}

.graph-node text {
  pointer-events: none;
  fill: #111827;
  font-weight: 700;
  font-size: 13px;
}

.graph-node .node-meta {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

@keyframes route-drift {
  to {
    stroke-dashoffset: -120;
  }
}

@keyframes halo-breathe {
  0%,
  100% {
    opacity: 0.44;
    stroke-width: 10;
  }
  50% {
    opacity: 0.86;
    stroke-width: 18;
  }
}

@keyframes orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes burst-fade {
  0% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
  }
}

@keyframes burst-ring {
  0% {
    transform: scale(0.7);
    stroke-width: 5;
  }
  100% {
    transform: scale(1.65);
    stroke-width: 0;
  }
}

@keyframes burst-ray {
  0% {
    opacity: 0.9;
    stroke-width: 3;
  }
  100% {
    opacity: 0;
    stroke-width: 0;
  }
}

.inspector-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.inspector h2 {
  margin: 12px 0 8px;
  font-family: "Fraunces", serif;
  font-size: 1.65rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.detail-meta,
.detail-section p,
.connection-list {
  color: var(--muted);
  line-height: 1.7;
}

.repo-preview {
  margin: 16px 0;
}

.repo-art,
.node-art {
  display: grid;
  gap: 8px;
  min-height: 178px;
  align-content: end;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.18);
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(36, 81, 179, 0.08), rgba(21, 128, 61, 0.05));
  overflow: hidden;
}

.node-art-input {
  background: linear-gradient(135deg, rgba(194, 65, 12, 0.12), rgba(36, 81, 179, 0.04));
}

.node-art-question {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.12), rgba(3, 105, 161, 0.05));
}

.node-art-output {
  background: linear-gradient(135deg, rgba(3, 105, 161, 0.12), rgba(21, 128, 61, 0.05));
}

.repo-art span,
.node-art span {
  width: max-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(17, 24, 39, 0.06);
  color: var(--ink-soft);
  font-size: 0.73rem;
  font-weight: 700;
}

.repo-art strong,
.node-art strong {
  font-family: "Fraunces", serif;
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: -0.01em;
}

.repo-art em,
.node-art em {
  color: rgba(17, 24, 39, 0.68);
  font-style: normal;
  font-weight: 700;
}

.repo-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.repo-metrics div {
  border-radius: 8px;
  padding: 9px;
  background: rgba(17, 24, 39, 0.03);
  border: 1px solid rgba(17, 24, 39, 0.11);
}

.repo-metrics strong,
.repo-metrics span {
  display: block;
}

.repo-metrics span {
  color: var(--muted);
  font-size: 0.74rem;
}

.detail-section {
  border-top: 1px solid rgba(17, 24, 39, 0.1);
  padding-top: 14px;
  margin-top: 14px;
}

.detail-section h3 {
  margin: 0 0 8px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 700;
}

.token-group,
.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.token,
.detail-links a {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 0.77rem;
  font-weight: 700;
  background: rgba(17, 24, 39, 0.03);
}

.detail-links a {
  color: var(--ink);
  transition: all 0.16s ease;
}

.connection-list {
  margin: 0;
  padding-left: 18px;
}

.next-node-actions {
  display: grid;
  gap: 7px;
}

.next-node-action {
  appearance: none;
  width: 100%;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 9px;
  padding: 9px 11px;
  color: var(--ink);
  background: rgba(17, 24, 39, 0.03);
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}

.next-node-action strong,
.next-node-action span {
  display: block;
}

.next-node-action strong {
  font-size: 0.84rem;
  line-height: 1.25;
}

.next-node-action span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.38;
}

.next-node-action:hover {
  border-color: rgba(36, 81, 179, 0.48);
}

.next-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.guide-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.guide-shell .topbar {
  grid-template-columns: minmax(260px, 1fr) auto;
}

.guide-links {
  justify-content: end;
}

.guide-page {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

/* Grid items default to min-width:auto and refuse to shrink below the widest
   unbreakable content (e.g. the git-clone line in fork.html's <pre>), which
   blows the page out on narrow screens. Let panels shrink; the pre scrolls. */
.guide-page > * {
  min-width: 0;
}

.guide-hero,
.guide-panel,
.guide-command {
  border: 1px solid rgba(17, 24, 39, 0.11);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.guide-hero {
  padding: 30px;
}

.guide-hero h1 {
  max-width: 860px;
  margin: 4px 0 16px;
  font-family: "Fraunces", serif;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
}

.guide-hero p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.78;
  font-size: 0.95rem;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.guide-panel {
  padding: 18px 20px;
}

/* Number badge: only direct-child spans of a guide panel (e.g. <span>1</span>).
   Keep this scoped with ">" so card labels nested deeper (.room-card span,
   .advisor-desk-card span, .next-stop-card span) never inherit the circle. */
.guide-panel > span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--amber);
  font-weight: 700;
  font-size: 0.88rem;
}

/* Eyebrow labels inside cards: small uppercase kicker, not a badge. */
.room-card > span,
.advisor-desk-card > span,
.next-stop-card > span {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--amber);
  line-height: 1.4;
}

.guide-panel h2 {
  margin: 14px 0 8px;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.guide-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.9rem;
}

.guide-command {
  padding: 22px;
}

.guide-command h2 {
  margin: 0 0 12px;
}

.guide-command pre {
  margin: 0;
  overflow: auto;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  color: var(--ink);
  background: #f6f7f9;
  font-size: 0.84rem;
  line-height: 1.62;
}

.reading-hero {
  display: grid;
  gap: 14px;
}

.reading-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.reading-metrics div {
  padding: 13px;
  border: 1px solid rgba(17, 24, 39, 0.11);
  border-radius: 9px;
  background: rgba(17, 24, 39, 0.03);
}

.reading-metrics strong,
.reading-metrics span {
  display: block;
}

.reading-metrics strong {
  color: var(--amber);
  font-family: "Fraunces", serif;
  font-size: 1.7rem;
  line-height: 1;
}

.reading-metrics span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.metric-footnote {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.reading-list-panel {
  display: grid;
  gap: 14px;
}

.reading-list-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
}

.reading-list-heading h2 {
  margin: 3px 0 0;
}

.reading-list-heading a {
  flex: 0 0 auto;
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(17, 24, 39, 0.03);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.16s ease;
}

.reading-list {
  display: grid;
  gap: 8px;
}

.reading-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(17, 24, 39, 0.11);
  border-radius: 9px;
  background: rgba(17, 24, 39, 0.03);
}

.reading-rank {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--amber);
  font-weight: 700;
}

.reading-row h3,
.reading-row p {
  margin: 0;
}

.reading-row h3 {
  font-size: 0.96rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

.reading-row p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

.reading-row > strong {
  color: var(--ink-soft);
  font-size: 0.84rem;
  white-space: nowrap;
}

.papers-hero p {
  max-width: 820px;
}

.paper-control-panel {
  padding: 14px;
}

.paper-control-grid {
  display: grid;
  grid-template-columns: minmax(240px, 380px) 1fr;
  gap: 12px;
  align-items: start;
}

.paper-search {
  width: 100%;
}

.paper-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.paper-heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.paper-list-panel {
  display: grid;
  gap: 14px;
}

.paper-list {
  display: grid;
  gap: 10px;
}

.paper-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) minmax(150px, 210px);
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(17, 24, 39, 0.11);
  border-radius: 11px;
  background:
    linear-gradient(135deg, rgba(3, 105, 161, 0.07), transparent 48%), rgba(17, 24, 39, 0.03);
}

.paper-year {
  display: grid;
  place-items: center;
  height: 54px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--sky);
  font-weight: 700;
}

.paper-body {
  min-width: 0;
}

.paper-eyebrow,
.paper-meta,
.paper-summary {
  margin: 0;
}

.paper-eyebrow {
  color: var(--sage);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.paper-row h3 {
  margin: 6px 0;
  font-family: "Fraunces", serif;
  font-size: clamp(1.1rem, 2.2vw, 1.7rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.paper-meta,
.paper-summary {
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.58;
}

.paper-summary {
  margin-top: 8px;
  color: var(--ink-soft);
}

.paper-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.paper-tags span {
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 6px;
  padding: 5px 8px;
  color: var(--muted);
  background: rgba(17, 24, 39, 0.03);
  font-size: 0.7rem;
  font-weight: 700;
}

.paper-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: stretch;
}

.paper-actions strong {
  padding: 10px;
  border: 1px solid rgba(36, 81, 179, 0.2);
  border-radius: 8px;
  color: var(--amber);
  background: rgba(36, 81, 179, 0.07);
  text-align: center;
  font-size: 0.84rem;
}

.paper-actions a {
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  background: rgba(17, 24, 39, 0.03);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: all 0.16s ease;
}

.paper-actions a:hover {
  border-color: rgba(36, 81, 179, 0.48);
}

.advisor-hero p {
  max-width: 860px;
}

.advisor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.advisor-panel {
  min-width: 0;
}

.compact-heading {
  align-items: start;
}

.advisor-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.advisor-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(17, 24, 39, 0.11);
  border-radius: 9px;
  background: rgba(17, 24, 39, 0.03);
}

.advisor-row h3,
.advisor-row p {
  margin: 0;
}

.advisor-row h3 {
  font-size: 0.88rem;
  line-height: 1.28;
}

.advisor-row p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.73rem;
}

.advisor-row a {
  border: 1px solid rgba(36, 81, 179, 0.2);
  border-radius: 7px;
  padding: 7px 9px;
  color: var(--amber);
  background: rgba(36, 81, 179, 0.07);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.advisor-bridge-panel {
  display: grid;
  gap: 14px;
}

.theme-bridge-grid,
.advisor-moves {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.theme-bridge-card,
.advisor-move {
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 10px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(36, 81, 179, 0.06), transparent 52%), rgba(17, 24, 39, 0.03);
}

.theme-bridge-card h3,
.advisor-move h3 {
  margin: 5px 0 8px;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.theme-bridge-card p,
.advisor-move p {
  color: var(--muted);
  line-height: 1.58;
}

.theme-bridge-card a {
  display: inline-flex;
  margin-top: 12px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--ink);
  background: rgba(17, 24, 39, 0.03);
  font-size: 0.77rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.16s ease;
}

.workflow-chip {
  display: inline-flex;
  width: auto;
  height: auto;
  border-radius: 7px;
  padding: 5px 9px;
  color: #ffffff;
  background: var(--sage);
  font-size: 0.7rem;
  line-height: 1;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
}

@media (max-width: 1180px) {
  .atlas {
    grid-template-columns: 280px minmax(420px, 1fr);
  }

  .inspector {
    grid-column: 1 / -1;
    max-height: none;
  }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 10px;
  }

  .topbar,
  .atlas,
  .stage-toolbar {
    grid-template-columns: 1fr;
  }

  .guide-shell .topbar {
    grid-template-columns: 1fr;
  }

  .source-rail,
  .inspector {
    max-height: none;
  }

  .graph-wrap,
  #graph-svg {
    min-height: 560px;
    height: 560px;
  }

  /* Mobile nav: one horizontally swipeable row instead of three wrapped rows,
     so the first screen shows content instead of chrome. */
  .top-links {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    mask-image: linear-gradient(90deg, black 88%, transparent);
  }

  .top-links::-webkit-scrollbar {
    display: none;
  }

  .top-links a {
    flex: 0 0 auto;
    white-space: nowrap;
    text-align: center;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }

  .reading-metrics,
  .reading-row,
  .advisor-grid,
  .advisor-row,
  .theme-bridge-grid,
  .advisor-moves,
  .paper-control-grid,
  .paper-row {
    grid-template-columns: 1fr;
  }

  .reading-list-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .reading-list-heading a,
  .paper-heading-actions {
    text-align: center;
  }
}

.panel-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-topline-detail {
  margin-bottom: 10px;
}

.panel-toggle {
  appearance: none;
  border: 1px solid rgba(17, 24, 39, 0.16);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--ink-soft);
  background: rgba(17, 24, 39, 0.03);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.18s ease;
}

.panel-toggle:hover {
  border-color: rgba(36, 81, 179, 0.5);
  color: var(--ink);
}

.stage-toggle {
  white-space: nowrap;
}

.stage-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.stage-copy {
  max-width: 760px;
}

.stage-side {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.stage-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: flex-start;
  padding: 20px 22px 0;
}

.stage-toolbar h1 {
  max-width: 780px;
  margin: 4px 0 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2.2rem, 3.4vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.stage-onboarding {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.72;
  font-size: 0.94rem;
}

.stage-manifesto {
  max-width: 720px;
  margin: 12px 0 0;
  padding-left: 16px;
  border-left: 2px solid rgba(36, 81, 179, 0.72);
  color: var(--ink-soft);
  line-height: 1.66;
  font-weight: 500;
  font-style: italic;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.hero-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(36, 81, 179, 0.3);
  background: linear-gradient(135deg, rgba(36, 81, 179, 0.14), rgba(21, 128, 61, 0.07));
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.hero-action-muted {
  border-color: rgba(17, 24, 39, 0.16);
  background: rgba(17, 24, 39, 0.03);
}

.story-strip {
  padding: 0 22px 18px;
}

.story-strip-heading h2 {
  margin: 4px 0 0;
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.story-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.story-card {
  appearance: none;
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(36, 81, 179, 0.09), transparent 44%),
    linear-gradient(215deg, rgba(3, 105, 161, 0.07), transparent 48%), rgba(17, 24, 39, 0.03);
  text-align: left;
  cursor: pointer;
}

.story-card strong {
  font-size: 1rem;
  line-height: 1.28;
}

.story-card p,
.story-card span {
  margin: 0;
  color: var(--muted);
  font-size: 0.81rem;
  line-height: 1.58;
}

.story-card.active {
  border-color: rgba(36, 81, 179, 0.68);
}

.story-card:hover {
  border-color: rgba(36, 81, 179, 0.42);
}

.story-card-route {
  color: var(--amber);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.story-card-foot {
  color: var(--ink-soft);
  font-weight: 700;
}

.story-card-foot b {
  color: var(--amber);
}

.layer-legend {
  margin-top: 16px;
}

.mode-tabs {
  border-radius: 12px;
}

.atlas.is-rail-collapsed.is-detail-closed .graph-wrap,
.atlas.is-rail-collapsed.is-detail-closed #graph-svg {
  min-height: 720px;
  height: 720px;
}

@media (max-width: 1180px) {
  .atlas,
  .atlas.is-rail-collapsed,
  .atlas.is-detail-closed,
  .atlas.is-rail-collapsed.is-detail-closed {
    --rail-width: 280px;
    --detail-width: 0px;
    grid-template-columns: var(--rail-width) minmax(420px, 1fr);
  }

  .atlas.is-detail-closed .inspector,
  .atlas .inspector {
    grid-column: 1 / -1;
    max-height: none;
  }

  .stage-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .stage-side {
    width: 100%;
    justify-items: flex-start;
  }

  .stage-panel-actions {
    justify-content: flex-start;
  }

  .story-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .atlas,
  .atlas.is-rail-collapsed,
  .atlas.is-detail-closed,
  .atlas.is-rail-collapsed.is-detail-closed {
    --rail-width: 1fr;
    --detail-width: 1fr;
    grid-template-columns: 1fr;
  }

  .atlas.is-rail-collapsed .source-rail,
  .atlas.is-detail-closed .inspector {
    opacity: 1;
    pointer-events: auto;
    transform: none;
    visibility: visible;
  }

  .hero-actions,
  .stage-panel-actions {
    width: 100%;
  }

  .hero-action,
  .stage-toggle,
  .panel-toggle {
    width: 100%;
  }
}

.reading-spotlight-grid,
.advisor-desk-grid,
.paper-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.reading-spotlight-card,
.advisor-desk-card,
.paper-feature-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.11);
  background:
    linear-gradient(145deg, rgba(36, 81, 179, 0.07), transparent 44%), rgba(17, 24, 39, 0.03);
}

.reading-spotlight-card {
  background:
    linear-gradient(145deg, rgba(194, 65, 12, 0.09), transparent 42%), rgba(17, 24, 39, 0.03);
}

.advisor-desk-card {
  background:
    linear-gradient(145deg, rgba(36, 81, 179, 0.1), transparent 42%), rgba(17, 24, 39, 0.03);
}

.paper-feature-card {
  background:
    linear-gradient(145deg, rgba(3, 105, 161, 0.09), transparent 42%), rgba(17, 24, 39, 0.03);
}

.reading-spotlight-card h3,
.advisor-desk-card h3,
.paper-feature-card h3 {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.32;
  letter-spacing: -0.01em;
}

.reading-spotlight-card p,
.advisor-desk-card p,
.paper-feature-card p,
.reading-spotlight-card em,
.advisor-desk-card span,
.paper-feature-card span {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.reading-spotlight-card strong,
.paper-feature-card strong {
  color: var(--amber);
}

.reading-spotlight-rank {
  color: var(--coral);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.paper-feature-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: rgba(17, 24, 39, 0.03);
  font-size: 0.77rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.18s ease;
}

@media (max-width: 860px) {
  .reading-spotlight-grid,
  .advisor-desk-grid,
  .paper-feature-grid {
    grid-template-columns: 1fr;
  }
}

.knowledge-rooms {
  padding: 8px 22px 26px;
}

.knowledge-room-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.knowledge-room-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background:
    linear-gradient(145deg, rgba(21, 128, 61, 0.08), transparent 40%),
    linear-gradient(215deg, rgba(36, 81, 179, 0.06), transparent 44%), rgba(17, 24, 39, 0.03);
  transition: all 0.2s ease;
}

.knowledge-room-card h3,
.knowledge-room-card p {
  margin: 0;
}

.knowledge-room-card h3 {
  font-size: 1.06rem;
  line-height: 1.32;
  letter-spacing: -0.01em;
}

.knowledge-room-card p {
  color: var(--muted);
  line-height: 1.62;
  font-size: 0.9rem;
}

.knowledge-room-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 4px;
}

.knowledge-room-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: rgba(17, 24, 39, 0.03);
  color: var(--ink);
  font-size: 0.77rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.18s ease;
}

@media (max-width: 860px) {
  .knowledge-room-grid {
    grid-template-columns: 1fr;
  }
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.rooms-grid-single {
  grid-template-columns: 1fr;
}

.room-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background:
    linear-gradient(145deg, rgba(21, 128, 61, 0.08), transparent 40%),
    linear-gradient(215deg, rgba(36, 81, 179, 0.06), transparent 44%), rgba(17, 24, 39, 0.03);
  transition: all 0.2s ease;
}

.room-card-wide {
  max-width: none;
}

.room-card h3,
.room-card p {
  margin: 0;
}

.room-card h3 {
  font-size: 1.06rem;
  line-height: 1.32;
  letter-spacing: -0.01em;
}

.room-card p,
.room-card span {
  color: var(--muted);
  line-height: 1.62;
  font-size: 0.9rem;
}

.room-card a {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: rgba(17, 24, 39, 0.03);
  color: var(--ink);
  font-size: 0.77rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.18s ease;
}

.room-inline-links,
.rooms-panel .reading-list-heading + .rooms-grid,
.rooms-panel .reading-list-heading + .rooms-grid-single {
  margin-top: 14px;
}

.room-inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

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

.next-stop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.next-stop-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background:
    linear-gradient(145deg, rgba(36, 81, 179, 0.09), transparent 42%),
    linear-gradient(215deg, rgba(21, 128, 61, 0.06), transparent 46%), rgba(17, 24, 39, 0.03);
  color: var(--ink);
  text-decoration: none;
}

.next-stop-card span,
.next-stop-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.next-stop-card strong {
  line-height: 1.35;
}

.next-stop-card:hover {
  border-color: rgba(36, 81, 179, 0.46);
  transform: translateY(-1px);
}

@media (max-width: 860px) {
  .next-stop-grid {
    grid-template-columns: 1fr;
  }
}

.guide-shell .topbar,
.guide-hero,
.guide-panel,
.story-card,
.knowledge-room-card,
.room-card,
.next-stop-card,
.reading-spotlight-card,
.advisor-desk-card,
.paper-feature-card {
  border-radius: 16px;
}

.guide-page {
  display: grid;
  gap: 16px;
}

.guide-hero,
.guide-panel {
  border: 1px solid rgba(17, 24, 39, 0.11);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.guide-hero {
  padding: 28px 30px;
}

.guide-hero h1 {
  max-width: 820px;
  margin: 6px 0 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2.25rem, 3.6vw, 3.8rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.guide-hero > p {
  max-width: 860px;
}

.guide-hero-note {
  margin: 14px 0 0;
  max-width: 760px;
  padding-left: 14px;
  border-left: 2px solid rgba(36, 81, 179, 0.72);
  color: var(--ink-soft);
  line-height: 1.68;
  font-weight: 500;
  font-style: italic;
}

.guide-panel {
  padding: 20px 22px;
}

.top-links a,
.hero-action,
.paper-feature-link,
.knowledge-room-links a,
.room-card a,
.next-stop-card,
.library-link,
.panel-toggle,
.trail-card,
.story-card {
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    background 0.2s ease;
}

.hero-action:hover,
.paper-feature-link:hover,
.knowledge-room-links a:hover,
.room-card a:hover,
.next-stop-card:hover,
.library-link:hover,
.trail-card:hover,
.story-card:hover {
  transform: translateY(-2px);
}

.reading-list-heading,
.compact-heading {
  gap: 12px;
}

@media (max-width: 860px) {
  .guide-hero,
  .guide-panel {
    padding: 18px 20px;
  }
}

.stage-side-note {
  max-width: 300px;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.58;
  text-align: right;
}

.rail-browse-more {
  margin-top: 18px;
}

.rail-section-title-inner {
  margin-top: 0;
  padding-top: 10px;
  border-top: 0;
}

.rail-compact-list {
  margin-top: 12px;
}

@media (max-width: 1180px) {
  .stage-side-note {
    max-width: none;
    text-align: left;
  }
}

.knowledge-room-grid-teaser {
  grid-template-columns: 1fr;
}

.knowledge-room-card-teaser {
  max-width: 860px;
}

.detail-empty-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.62;
}

.atlas.is-detail-closed .detail-empty-note {
  display: none;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
}

.top-links a[aria-current="page"] {
  border-color: rgba(36, 81, 179, 0.5);
  background: linear-gradient(135deg, rgba(36, 81, 179, 0.14), rgba(21, 128, 61, 0.07));
  color: var(--ink);
}

.guide-links a[aria-current="page"] {
  border-color: rgba(36, 81, 179, 0.5);
}

/* ── Entry animations ───────────────────────────────── */

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

@keyframes topbarDrop {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .topbar {
    animation: topbarDrop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .stage-copy .kicker {
    animation: fadeUp 0.5s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .stage-toolbar h1 {
    animation: fadeUp 0.6s 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .stage-onboarding {
    animation: fadeUp 0.55s 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .stage-manifesto {
    animation: fadeUp 0.55s 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .hero-actions {
    animation: fadeUp 0.55s 0.44s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .layer-legend {
    animation: fadeUp 0.55s 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .story-strip {
    animation: fadeUp 0.6s 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

/* ── Search box focus glow ──────────────────────────── */

.search-box:focus-within {
  border-color: rgba(36, 81, 179, 0.45);
  box-shadow:
    0 0 0 3px rgba(36, 81, 179, 0.1),
    0 0 18px rgba(36, 81, 179, 0.07);
  background: rgba(17, 24, 39, 0.05);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}
