.neighbors-page {
  margin: 0;
  min-width: 0;
  background: var(--demo-bg);
}

.neighbors-workspace {
  max-width: 1056px;
  margin: 0 auto;
  padding: calc(var(--demo-header-height) + 20px) clamp(16px, 4vw, 36px) 40px;
}

.neighbors-intro { margin-bottom: 24px; }
.neighbors-intro h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4.8vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.neighbors-intro p { max-width: 57ch; margin: 10px 0 0; line-height: 1.5; }
.neighbors-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(12px, 2.5vw, 26px);
  align-items: start;
}
.neighbors-map { min-width: 0; margin: 0; }
.neighbors-map svg {
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-height: 70vh;
  border: 1px solid var(--demo-line);
  border-radius: var(--demo-panel-radius);
  background: var(--demo-panel);
}
.neighbors-map figcaption, .neighbors-credit {
  color: var(--demo-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}
.neighbors-map figcaption { margin-top: 8px; }
.neighbors-credit { margin: 22px 0 0; }
.neighbors-credit a { color: var(--demo-accent); text-underline-offset: 3px; }
#ingredient-dots { stroke: var(--demo-muted); stroke-width: 2.4; stroke-linecap: round; opacity: .38; }
.map-link { stroke: var(--demo-accent); stroke-width: 1.7; opacity: .85; }
.map-current-ring { fill: var(--demo-bg); stroke: var(--demo-accent); stroke-width: 2.5; }
.map-current, .map-result-dot, .map-badge { fill: var(--demo-accent); }
.map-leader { stroke: var(--demo-accent); stroke-width: 1; opacity: .6; }
.map-result text { fill: var(--demo-bg); font-size: 13px; font-weight: 700; pointer-events: none; }
.map-hop { cursor: pointer; touch-action: manipulation; }
.map-hop:hover .map-badge { fill: var(--demo-text); }
.neighbors-controls .segmented > button { flex: 1 1 10rem; }
.neighbors-controls select { height: 44px; }
.neighbors-trail { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; }
.neighbors-trail p { margin: 0; flex: 1 1 12ch; overflow-wrap: anywhere; }
.neighbors-results { margin-top: 18px; }
.neighbors-results h2 { font-size: 1.35rem; line-height: 1.2; margin: 0; }
.neighbors-results p { margin: 5px 0 10px; }
.neighbors-results ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.neighbors-controls .neighbors-row {
  display: grid;
  width: 100%;
  box-sizing: border-box;
  grid-template-columns: 1.35rem minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  text-align: left;
}
span.neighbors-row { padding: 8px 12px; min-height: 40px; }
.neighbors-rank { font-weight: 700; color: var(--demo-accent); }
.neighbors-score { font-variant-numeric: tabular-nums; }
.neighbors-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 680px) {
  .neighbors-layout { grid-template-columns: minmax(0, 1fr); }
  .neighbors-map svg { max-height: min(37vh, 360px); }
}
