.route-demo {
  --route-ink: #253b34;
  --route-mint: #64b89a;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  clear: both;
  margin: 3rem 0;
  padding: 1.5rem 0;
  border-block: 1px solid rgba(255, 255, 255, 0.2);
}

.route-demo__header {
  margin-bottom: 1.25rem;
}

.route-demo__header h2 {
  margin-bottom: 0.35rem;
}

.route-demo__header p:last-child {
  margin-bottom: 0;
}

.route-demo__eyebrow {
  margin-bottom: 0.25rem;
  color: #73d1b2;
  font-size: 0.78rem;
  font-weight: 700;
}

.route-demo__controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  min-width: 0;
}

.route-demo__locations {
  flex: 1 1 390px;
  min-width: 0;
  display: grid;
  gap: 0.45rem;
}

.route-demo__locations input[type="text"] {
  width: 100%;
  min-height: 42px;
  padding: 0.45rem 0.65rem;
}

.route-demo__locations input[type="range"] {
  width: 100%;
  accent-color: var(--route-mint);
}

.route-demo__locations output {
  color: #b4ead6;
  font-variant-numeric: tabular-nums;
}

.route-demo__hint {
  margin: 0.15rem 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
}

.route-demo__locations > label {
  margin: 0;
  font-weight: 600;
}

.route-demo__location-row {
  display: flex;
  min-width: 0;
  gap: 0.5rem;
}

.route-demo__location-row input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 42px;
  padding: 0.45rem 0.65rem;
}

.route-demo__pick,
.route-demo__clear {
  min-height: 42px;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: transparent;
  color: #fff;
}

.route-demo__pick.is-active {
  border-color: var(--route-mint);
  box-shadow: inset 0 -2px var(--route-mint);
  color: #b4ead6;
}

.route-demo__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.route-demo__actions .btn {
  min-height: 42px;
  padding: 0.55rem 0.85rem;
}

.route-demo__status {
  min-height: 1.5rem;
  margin: 0.9rem 0 0.65rem;
  color: #d4f2e7;
  font-weight: 600;
}

.route-demo__map {
  width: 100%;
  max-width: 100%;
  height: clamp(320px, 52vw, 520px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #e5e9e3;
  z-index: 0;
}

.route-demo__results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.route-demo__result {
  padding: 0.9rem 1rem;
  border-top: 3px solid var(--route-mint);
  background: rgba(255, 255, 255, 0.07);
}

.route-demo__result.is-shortest {
  border-color: #e78d61;
}

.route-demo__result h3 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.route-demo__result p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
}

.route-demo__download {
  display: inline-block;
  margin-top: 0.85rem;
  color: #b4ead6;
  text-decoration: underline;
}

.route-demo__download[hidden] {
  display: none;
}

.route-demo__attribution {
  margin: 0.75rem 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.75rem;
}

.route-demo__attribution a {
  color: #b4ead6;
  text-decoration: underline;
}

.route-demo .leaflet-control-attribution {
  font-size: 10px;
}

.route-demo .leaflet-container {
  font-family: inherit;
}

@media (max-width: 640px) {
  .route-demo {
    padding: 1.1rem 0;
  }

  .route-demo__controls,
  .route-demo__locations,
  .route-demo__actions {
    width: 100%;
  }

  .route-demo__actions > button {
    flex: 1 1 auto;
  }

  .route-demo__results {
    grid-template-columns: 1fr;
  }

  .route-demo__map {
    height: 360px;
  }
}
