.diagram-sheet { display: grid; gap: 14px; margin: 0; }
.diagram-header { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 4px 12px; }
.diagram-header :is(h2, h3) { font: 500 clamp(35px,5vw,60px)/1 var(--sans); letter-spacing: -.045em; }
.diagram-header p { font-size: 13px; color: #4d594d; }
.diagram-drawing svg { display: block; width: 100%; height: auto; }
.diagram-note { font-size: 15px; color: #425043; max-width: 70ch; }
.diagram-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font: 500 12px/1.4 "Instrument Sans",sans-serif; color: #425043; }
.diagram-legend span { display: inline-flex; align-items: center; gap: 7px; }
.diagram-legend i { flex: none; width: 17px; border-top: 2px dashed #608246; }
.diagram-legend .route-key { border-color: #a36c32; }

.map-stage { position: relative; display: grid; place-items: center; min-height: 88px; }
.plan-explorer[data-view="relief"] .map-stage {
  width: min(100%, 1050px); aspect-ratio: 1.65; margin-inline: auto;
}
.map-relief {
  position: absolute; inset: 0; width: 100%; height: 100%;
  touch-action: pan-y; cursor: grab; filter: drop-shadow(2px 12px 11px #26392535);
}
.map-relief:active { cursor: grabbing; }
.map-relief:focus-visible { outline: 2px solid #50664a; outline-offset: -5px; border-radius: 10px; }
.map-marker {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%,-50%);
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; background: transparent; cursor: pointer; color: #fff;
}
.plan-explorer:not([data-view="relief"]) .map-marker { display: none; }
.map-marker span {
  display: grid; place-items: center; width: 27px; height: 27px; box-sizing: border-box;
  border: 1px solid #d7e3c5; border-radius: 50%; background: #1a3229;
  box-shadow: 0 2px 7px #10241f88; font: 600 13px/1 "Instrument Sans",sans-serif;
  transition: background-color .18s ease, transform .18s ease;
}
.map-marker[data-active], .map-marker:focus-visible { z-index: 2; }
.map-marker[data-active] span, .map-marker[aria-pressed="true"] span {
  background: #d8e9ac; color: #24391e; border-color: #f2f9db; transform: scale(1.08);
}
.map-marker:focus-visible { outline: 2px solid #f5f7e8; outline-offset: -4px; border-radius: 50%; }

.map-tooltip {
  position: absolute; z-index: 3; transform: translateX(-50%);
  width: min(265px, calc(100% - 14px));
  padding: 12px 14px; border-radius: 12px;
  background: rgb(26 27 26 / 70%);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  color: #f6f8ed; box-shadow: 0 5px 18px #172c242d;
}
.map-tooltip .map-readout-title { margin: 0 0 4px; font-weight: 600; font-size: 16px; }
.map-tooltip .map-readout-note { margin: 0; font-size: 14px; line-height: 1.42; color: #f0f4e9; }
.map-hint { margin: 0; text-align: center; color: #4d594d; font-size: 13px; }
.map-unavailable { margin: 0; padding: 18px; color: #4d594d; }
.map-fallback details { padding: 8px 0; }
.map-fallback details p { margin: 7px 0 0; }
@media (max-width: 760px) {
  .plan-explorer[data-view="relief"] .map-stage { aspect-ratio: 1.25; }
  .map-marker span { width: 23px; height: 23px; font-size: 12px; }
  .map-tooltip { width: min(225px, calc(100% - 14px)); }
}
