/* urbanXplorer multimodal route planner */
.route-mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 3px;
}

.route-mode-eta {
  min-height: 15px;
  color: #64748B;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
}

.route-mode.active .route-mode-eta {
  color: #0F766E;
}

/* When a route is being planned, the legacy compact destination card becomes
   the route-planner surface. Manual compact mode remains unchanged because the
   additional route-planner-active state is owned only by RoutePlannerUI. */
.destination-sheet.route-compact.route-planner-active {
  max-height: min(72dvh, 620px);
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}

.destination-sheet.route-compact.route-planner-active .destination-actions {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  max-height: min(56dvh, 510px);
  margin: 0;
  padding: 4px 4px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.destination-sheet.route-compact.route-planner-active
.destination-actions > .destination-action-secondary {
  display: none !important;
}

.destination-sheet.route-compact.route-planner-active .route-origin {
  display: block;
}

.destination-sheet.route-compact.route-planner-active .route-actions {
  display: grid;
}

.destination-sheet.route-compact.route-planner-active .route-planner-panel {
  display: flex;
}

.route-planner-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(51, 65, 85, 0.10);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.92);
}

.route-planner-panel[hidden] {
  display: none !important;
}

.destination-sheet.origin-map-selecting .route-planner-panel {
  display: none !important;
}

.route-planner-status {
  color: #64748B;
  font-size: 14px;
  line-height: 1.35;
}

.route-planner-alternatives {
  display: grid;
  gap: 8px;
}

.route-planner-alternative {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(51, 65, 85, 0.10);
  border-radius: 12px;
  background: #FFFFFF;
  color: #334155;
  text-align: left;
  cursor: pointer;
}

.route-planner-alternative.selected {
  border-color: rgba(13, 148, 136, 0.45);
  background: rgba(13, 148, 136, 0.07);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.10);
}

.route-planner-alternative-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(51, 65, 85, 0.07);
  color: #475569;
  font-size: 14px;
  font-weight: 800;
}

.route-planner-alternative.selected .route-planner-alternative-index {
  background: #0D9488;
  color: #FFFFFF;
}

.route-planner-alternative-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.route-planner-alternative-title {
  overflow: visible;
  color: #0F172A;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.route-planner-alternative-detail {
  overflow: visible;
  color: #64748B;
  font-size: 14px;
  line-height: 1.35;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.route-planner-alternative-duration {
  color: #0F766E;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.route-planner-transit-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.route-planner-transit-controls[hidden] {
  display: none;
}

.route-planner-transit-controls select,
.route-planner-transit-controls input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 9px;
  border: 1px solid rgba(51, 65, 85, 0.12);
  border-radius: 10px;
  background: #FFFFFF;
  color: #334155;
  font: 600 16px/1.2 var(--font-family);
}

.route-planner-transit-time-wrap {
  grid-column: 1 / -1;
}

.route-planner-transit-time-wrap[hidden] {
  display: none;
}

.ux-route-duration-chip {
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid rgba(71, 85, 105, 0.16);
  background: rgba(255, 255, 255, 0.94);
  color: #475569;
  font: 800 14px/1 var(--font-family);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.14);
  white-space: nowrap;
}

.ux-route-duration-chip.selected {
  border-color: #0D9488;
  background: #0D9488;
  color: #FFFFFF;
}

@media (max-width: 600px) {
  .destination-sheet.route-compact.route-planner-active {
    max-height: 68dvh;
  }

  .destination-sheet.route-compact.route-planner-active .destination-actions {
    max-height: 52dvh;
  }

  .route-planner-transit-controls {
    grid-template-columns: 1fr;
  }

  .route-planner-transit-controls > :first-child,
  .route-planner-transit-time-wrap {
    grid-column: 1;
  }
}
