.reasoning-map {
  --rm-bg: #050914;
  --rm-panel: rgba(7, 13, 27, 0.66);
  --rm-panel-2: rgba(13, 26, 47, 0.82);
  --rm-border: rgba(148, 163, 184, 0.14);
  --rm-text: #e7eef8;
  --rm-muted: #9aa9bc;
  --rm-cyan: #7dd3fc;
  --rm-gold: #f7d36f;
  --rm-green: #9be3bd;
  --rm-amber: #e8c579;
  --rm-red: #e59aaa;
  color: var(--rm-text);
  padding: clamp(22px, 3vw, 42px);
  background:
    radial-gradient(circle at 76% 0%, rgba(247, 211, 111, 0.12), transparent 28%),
    radial-gradient(circle at 12% 12%, rgba(125, 211, 252, 0.13), transparent 34%),
    linear-gradient(180deg, #060b16 0%, #020611 100%);
  min-height: 100%;
}

#other-pane .reasoning-map {
  padding: clamp(18px, 2.6vw, 30px);
  background:
    radial-gradient(circle at 76% 0%, rgba(247, 211, 111, 0.09), transparent 28%),
    radial-gradient(circle at 12% 12%, rgba(125, 211, 252, 0.10), transparent 34%),
    transparent;
}

.rm-hero,
.rm-main-path,
.rm-legend,
.rm-branches,
.rm-alternatives,
.rm-footer-note,
.rm-principles {
  max-width: 1220px;
  margin: 0 auto 24px;
}

.rm-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid rgba(125, 211, 252, 0.20);
  border-radius: 26px;
  background:
    radial-gradient(circle at 90% 12%, rgba(247, 211, 111, 0.17), transparent 32%),
    radial-gradient(circle at 14% 6%, rgba(125, 211, 252, 0.15), transparent 34%),
    linear-gradient(130deg, rgba(13, 29, 52, 0.88), rgba(4, 9, 18, 0.78) 64%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.rm-hero h2 {
  max-width: 900px;
  margin: 6px 0 12px;
  color: #fff;
  font-size: clamp(2rem, 4.6vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.rm-hero p {
  max-width: 820px;
  margin: 0 0 12px;
  color: #c8d5e5;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.7;
}

.rm-hero .rm-caveat {
  color: #f2ddb0;
}

.rm-kicker {
  color: var(--rm-cyan);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rm-hero-map {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(247, 211, 111, 0.20);
  border-radius: 22px;
  background:
    radial-gradient(circle at 82% 16%, rgba(247, 211, 111, 0.12), transparent 24rem),
    rgba(2, 6, 23, 0.48);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.rm-hero-map-lead {
  max-width: 1320px;
  margin: 0 auto 24px;
}

.rm-hero-map img {
  display: block;
  width: 100%;
  height: auto;
  background: #06101d;
}

.rm-hero-map figcaption {
  margin: 0;
  padding: 13px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.66);
  color: #d7e1ee;
  font-size: 0.94rem;
  line-height: 1.55;
}

.rm-section-head {
  margin-bottom: 14px;
}

.rm-section-head h3 {
  margin: 4px 0 0;
  color: #f7fbff;
  font-size: clamp(1.25rem, 2vw, 2rem);
}

.rm-section-head p:not(.rm-kicker) {
  max-width: 820px;
  color: var(--rm-muted);
  line-height: 1.7;
}

.rm-path-line {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}

.rm-path-line::before {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  top: 34px;
  height: 2px;
  background: linear-gradient(90deg, rgba(125, 211, 252, 0.4), rgba(155, 227, 189, 0.52), rgba(247, 211, 111, 0.75));
  box-shadow: 0 0 22px rgba(125, 211, 252, 0.25);
}

.rm-path-node {
  position: relative;
  z-index: 1;
  min-height: 198px;
  padding: 18px 14px 16px;
  border: 1px solid var(--rm-border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 0%, rgba(125, 211, 252, 0.08), transparent 9rem),
    linear-gradient(180deg, rgba(13, 26, 47, 0.86), rgba(5, 10, 20, 0.82));
}

.rm-path-node.final {
  border-color: rgba(247, 211, 111, 0.42);
  background:
    radial-gradient(circle at 80% 0%, rgba(247, 211, 111, 0.18), transparent 40%),
    linear-gradient(180deg, rgba(28, 24, 12, 0.82), rgba(6, 10, 19, 0.88));
}

.rm-node-index {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  border-radius: 999px;
  color: #06111f;
  background: var(--rm-cyan);
  font-size: 0.74rem;
  font-weight: 900;
}

.rm-path-node.final .rm-node-index {
  background: var(--rm-gold);
}

.rm-path-node h3 {
  margin: 0 0 8px;
  color: #f5f9ff;
  font-size: 1rem;
  line-height: 1.25;
}

.rm-path-node p {
  margin: 0;
  color: #aebccd;
  font-size: 0.88rem;
  line-height: 1.55;
}

.rm-principles {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(247, 211, 111, 0.18);
  border-radius: 18px;
  background: rgba(48, 36, 12, 0.13);
}

.rm-principles p {
  margin: 0;
  color: #e9dcc0;
  line-height: 1.65;
}

.rm-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.rm-legend-grid article,
.rm-alt-card,
.rm-branch-card,
.rm-footer-note {
  border: 1px solid var(--rm-border);
  border-radius: 18px;
  background: var(--rm-panel);
}

.rm-legend-grid article {
  padding: 14px;
}

.rm-legend-grid p {
  margin: 8px 0 0;
  color: var(--rm-muted);
  line-height: 1.55;
}

.rm-branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

.rm-branch-card {
  padding: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(125, 211, 252, 0.07), transparent 10rem),
    linear-gradient(180deg, rgba(13, 22, 39, 0.84), rgba(5, 10, 20, 0.78)),
    var(--rm-panel);
}

.rm-branch-head,
.rm-alt-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.rm-branch-role {
  margin: 0 0 4px;
  color: var(--rm-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rm-branch-card h3 {
  margin: 0;
  color: #f8fbff;
  font-size: 1.25rem;
}

.rm-summary {
  color: #cbd7e5;
  line-height: 1.65;
}

.rm-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.rm-status,
.rm-pill,
.rm-code-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  color: #d8e4f2;
  background: rgba(2, 6, 23, 0.3);
  font-size: 0.70rem;
  font-weight: 750;
  text-transform: capitalize;
}

.rm-status.strong_path { color: #fff4c4; border-color: rgba(247, 211, 111, 0.34); background: rgba(247, 211, 111, 0.12); }
.rm-status.live_competitor { color: #dff4ff; border-color: rgba(125, 211, 252, 0.30); background: rgba(125, 211, 252, 0.10); }
.rm-status.partial_explanation { color: #e5e7ff; border-color: rgba(165, 180, 252, 0.26); background: rgba(99, 102, 241, 0.10); }
.rm-status.underdeveloped_branch,
.rm-status.needs_steelman,
.rm-status.needs_hypothesis_seat { color: #f9e6ba; border-color: rgba(232, 197, 121, 0.32); background: rgba(232, 197, 121, 0.12); }
.rm-status.breakpoint_identified { color: #ffd9df; border-color: rgba(229, 154, 170, 0.34); background: rgba(229, 154, 170, 0.12); }
.rm-status.contextual_only { color: #d6dce8; border-color: rgba(148, 163, 184, 0.20); background: rgba(148, 163, 184, 0.08); }

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

.rm-branch-columns section,
.rm-breakpoint,
.rm-fairness,
.rm-meta-grid > div,
.rm-collapse-risk,
.rm-audit-instruction,
.rm-burden-grid section {
  border: 1px solid rgba(148, 163, 184, 0.10);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.22);
  padding: 12px;
}

.rm-branch-columns h4 {
  margin: 0 0 8px;
  color: #f2f7ff;
}

.rm-branch-columns ul {
  margin: 0;
  padding-left: 18px;
  color: #b8c6d8;
  line-height: 1.55;
}

.rm-breakpoint {
  margin-top: 12px;
  border-color: rgba(229, 154, 170, 0.22);
  background: rgba(91, 33, 49, 0.14);
}

.rm-collapse-risk {
  margin-top: 12px;
  border-color: rgba(229, 154, 170, 0.28);
  background:
    radial-gradient(circle at 100% 0%, rgba(229, 154, 170, 0.10), transparent 8rem),
    rgba(58, 19, 31, 0.18);
}

.rm-audit-instruction {
  margin-top: 12px;
  border-color: rgba(247, 211, 111, 0.24);
  background:
    radial-gradient(circle at 100% 0%, rgba(247, 211, 111, 0.12), transparent 8rem),
    rgba(60, 45, 18, 0.16);
}

.rm-breakpoint span,
.rm-meta-grid span,
.rm-collapse-risk span,
.rm-audit-instruction span {
  display: block;
  margin-bottom: 6px;
  color: var(--rm-amber);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.rm-breakpoint p,
.rm-consequence,
.rm-fairness p,
.rm-collapse-risk p,
.rm-audit-instruction p {
  margin: 0;
  color: #d7e1ee;
  line-height: 1.65;
}

.rm-consequence {
  margin-top: 12px;
}

.rm-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.rm-burden-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.rm-burden-grid h4 {
  margin: 0 0 10px;
  color: #fff1ba;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rm-meta-grid div div,
.rm-alt-evidence,
.rm-burden-grid section div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rm-code-pill {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  text-transform: none;
  color: #bde8ff;
}

.rm-code-pill.evidence {
  color: #eee4c7;
}

.rm-code-pill.burden {
  color: #c8f0ff;
  border-color: rgba(125, 211, 252, 0.22);
  background: rgba(125, 211, 252, 0.08);
}

.rm-code-pill.disclose {
  color: #f7dfad;
  border-color: rgba(247, 211, 111, 0.24);
  background: rgba(247, 211, 111, 0.09);
}

.rm-fairness {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.rm-alt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.rm-alt-card {
  padding: 16px;
}

.rm-alt-card h4 {
  margin: 0;
  color: #f8fbff;
}

.rm-alt-card p {
  color: #bdcadb;
  line-height: 1.6;
}

.rm-alt-card small {
  display: block;
  margin-top: 10px;
  color: var(--rm-muted);
}

.rm-footer-note {
  padding: 18px;
}

.rm-footer-note h3 {
  margin: 0 0 8px;
}

.rm-footer-note p {
  margin: 0;
  color: #becadd;
  line-height: 1.65;
}

.rm-error {
  padding: 2rem;
  color: #ffd9df;
}

.results-reasoning-cta {
  max-width: 1220px;
  margin: 18px auto 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 1px solid rgba(247, 211, 111, 0.22);
  border-radius: 20px;
  background:
    radial-gradient(circle at 94% 12%, rgba(247, 211, 111, 0.15), transparent 30%),
    rgba(9, 16, 30, 0.78);
}

.results-reasoning-cta h3 {
  margin: 0 0 6px;
  color: #fff7d4;
}

.results-reasoning-cta p {
  margin: 0;
  color: #bdcadb;
  line-height: 1.6;
}

.reasoning-map-button {
  border: 1px solid rgba(247, 211, 111, 0.38);
  border-radius: 999px;
  padding: 0.72rem 1rem;
  color: #07111f;
  background: linear-gradient(135deg, #f7d36f, #fde9a7);
  font-weight: 850;
  cursor: pointer;
}

@media (max-width: 980px) {
  .rm-hero,
  .results-reasoning-cta {
    grid-template-columns: 1fr;
  }

  .rm-path-line {
    grid-template-columns: 1fr;
  }

  .rm-path-line::before {
    left: 30px;
    right: auto;
    top: 18px;
    bottom: 18px;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, rgba(125, 211, 252, 0.4), rgba(155, 227, 189, 0.52), rgba(247, 211, 111, 0.75));
  }

  .rm-path-node {
    min-height: 0;
    padding-left: 58px;
  }

  .rm-node-index {
    position: absolute;
    left: 14px;
    top: 16px;
  }

  .rm-branch-columns,
  .rm-meta-grid,
  .rm-burden-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .reasoning-map {
    padding: 16px;
  }

  .rm-branch-grid {
    grid-template-columns: 1fr;
  }

  .rm-branch-head,
  .rm-alt-head {
    flex-direction: column;
  }

  .rm-status-row {
    justify-content: flex-start;
  }
}
