.route-map[hidden],
.route-map [hidden] {
  display: none !important;
}
.route-map {
  margin: 2rem 0;
  padding: 1.25rem;
  border: 1px solid #cad5c9;
  border-radius: 24px;
  background: #fffdf9;
}
.route-map h2 {
  margin-top: 0;
}
.route-map p {
  margin: 0.65rem 0;
}
.route-map-stats,
.route-map-tools,
.route-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.route-map-stats {
  font-size: 0.9rem;
  font-weight: 800;
}
.route-map button {
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 1px solid #173521;
  border-radius: 999px;
  background: #fffaf4;
  color: #173521;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.route-map .route-map-open {
  margin: 0.5rem 0;
  background: #173521;
  color: white;
}
.route-map-layers {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: #e2f0dd;
}
.route-map-layers button {
  border-color: transparent;
  background: transparent;
  padding: 0.5rem 1.1rem;
}
.route-map-layers [aria-pressed="true"] {
  background: #173521;
  color: white;
}
.route-map button:disabled {
  cursor: progress;
  opacity: 0.7;
}
.route-map :focus-visible {
  outline: 3px solid #aa4738;
  outline-offset: 3px;
}
.route-map-frame {
  position: relative;
  margin: 1rem 0 0.5rem;
}
.route-map-canvas {
  height: clamp(280px, 46vw, 390px);
  width: 100%;
  border-radius: 14px;
  isolation: isolate;
  background: #e2f0dd;
}
.route-map .route-map-fit {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fffdf9;
  border-color: #cad5c9;
  border-radius: 10px;
  font-size: 0.8rem;
  box-shadow: 0 1px 5px #10221926;
}
.route-map-touch-prompt {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.route-map-touch-prompt button {
  pointer-events: auto;
  background: #173521;
  color: white;
  box-shadow: 0 2px 12px #10221933;
}
.route-map-canvas.leaflet-container {
  font-family: "Nunito", sans-serif;
}
/* Leaflet normally captures every touch. Keep page scrolling until explicitly enabled. */
.route-map-canvas.leaflet-container:not(.route-map-can-drag) {
  touch-action: pan-y;
}
.route-map-canvas.leaflet-container.route-map-can-drag {
  touch-action: none;
}
.route-map-canvas .leaflet-control-attribution {
  background: #fffdf9;
  color: #102219;
  font-size: 11px;
}
.route-map-canvas .leaflet-control-zoom a {
  width: 44px;
  height: 44px;
  line-height: 44px;
  color: #173521;
}
.route-map-tools {
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  font-size: 0.85rem;
}
.route-map-tools p {
  flex: 1;
  font-size: 0.8rem;
  color: #465b49;
}
.route-map-pin {
  background: #173521;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #173521;
}
.route-map-pin-end {
  background: #aa4738;
  border-radius: 3px;
}
.route-map-legend {
  color: #173521;
  font-size: 0.8rem;
}
.route-map-legend span + span {
  color: #aa4738;
}
.route-map-profile {
  margin-top: 1rem;
  border-top: 1px solid #cad5c9;
}
.route-map-profile h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.route-map-profile svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  touch-action: pan-y;
}
.route-map-profile svg text {
  fill: #173521;
  font-family: "Nunito", sans-serif;
  font-size: 14px;
}
.profile-grid {
  stroke: #dce4d8;
}
.profile-area {
  fill: #e2f0dd;
}
.profile-line {
  fill: none;
  stroke: #173521;
  stroke-width: 2;
}
.profile-cursor {
  fill: #e58367;
  stroke: #102219;
  stroke-width: 2;
}
.route-map-profile label {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
}
.route-map-profile input {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0;
  accent-color: #173521;
}
.route-map-profile output {
  display: block;
  min-height: 2.8em;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.route-map .route-map-note {
  font-size: 0.8rem;
  color: #465b49;
}
@media (max-width: 600px) {
  .route-map {
    padding: 1rem 0.75rem;
  }
  .route-map-profile svg text {
    font-size: 24px;
  }
}
