/* Results “phone” layout – try to stick closely to Whimsical wireframe */

.results-shell {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Inter", sans-serif;
  font-size: 13px;
  color: #0f172a;
  /* slate-900 */
}

/* Top A/B header row */

.results-header {
  padding: 12px 20px 12px 20px;
  width: 100%;
  box-sizing: border-box;
  /* Include padding in width calculation */
  background-color: #f8fafc;
  /* slate-50 */
  border-bottom: 1px solid #e2e8f0;
  /* slate-200 */
}

.results-header-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.results-endpoint {
  flex: 1 1 0;
}

.results-endpoint-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #0f172a;
  margin-bottom: 2px;
  font-weight: 500;
  /* slightly bolder */
}

.results-pill-a,
.results-pill-b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.results-pill-a {
  background-color: #ef4444;
  /* orange-500-ish */
}

.results-pill-b {
  background-color: #ef4444;
  /* red-500-ish */
}

.results-endpoint-title {
  font-size: 15px;
  font-weight: 700;
}

.results-endpoint-subtitle {
  font-size: 11px;
  color: #4b5563;
  /* slate-600 */
}

/* Distance tracker */

.results-distance-wrap {
  margin-top: 14px;
  /* +4px */
}

.results-distance-track {
  position: relative;
  height: 12px;
  background: transparent;
  border-radius: 9999px;
  overflow: visible;
  /* let markers float above */
}

.results-distance-bar-full {
  position: absolute;
  inset: 0;
  background: #a7f3d0;
  /* darker mint green */
  border-radius: 9999px;
  /* <<< FIX */
}

.results-distance-bar-fail {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #f87171;
  /* richer red */
  border-radius: 9999px;
  right: 0;
}

.results-distance-bar-reachable {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  background-color: #c7f9e9;
}

.results-distance-bar-full,
.results-distance-bar-reachable {
  transform: scaleX(0);
  transform-origin: left center;
  animation: resultsDistanceBarSlide 700ms cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.results-distance-bar-fail {
  transform: scaleX(0);
  transform-origin: left center;
  /* Start after the green finishes, same easing but slightly slower */
  animation: resultsDistanceBarSlide 950ms cubic-bezier(0.25, 1, 0.5, 1) forwards;
  animation-delay: 720ms;
}

.results-distance-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.3);
  opacity: 0;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background-color: #60a5fa;
  /* lighter map charger blue */
  color: #fff;
  font-size: 12px;
  border: 1.5px solid #1d4ed8;
  /* slimmer outline */
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.18);
  animation: resultsChargerPop 360ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--pop-delay, 200ms);
}

.results-distance-marker-charger {
  background-color: #60a5fa;
  /* lighter map charger blue */
}

.results-distance-marker-limit {
  background-color: #fb923c;
  /* orange-400 */
  color: #fff;
}

/* Distance summary lines under tracker */

.results-distance-summary {
  margin-top: 12px;
  /* +4px */
  font-size: 13px;
  color: #0f172a;
  text-align: center;
}

.results-distance-summary span:first-child {
  font-weight: 600;
}

.results-meta-row {
  margin-top: 4px;
  font-size: 12px;
  color: #4b5563;
  text-align: center;
}

/* Timeline */

.results-body {
  padding: 16px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  column-gap: 12px;
}

.timeline-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background-color: #e0f2fe;
  /* sky-100 */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #0f172a;
}

.timeline-icon-charger {
  background-color: #60a5fa;
  /* lighter map charger blue */
  color: #fff;
  border: 1.5px solid #1d4ed8;
  font-size: 13px;
}

.timeline-line {
  width: 2px;
  background: #86efac;
  /* mint-green */
  border-radius: 2px;
  flex-grow: 1;
  /* <-- makes spacing AUTOMATIC */
}

.timeline-line-danger {
  background: #ef4444;
  /* red-500 */
}

.timeline-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-main {
  padding-top: 3px;
  padding-bottom: 16px;
}

.timeline-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.timeline-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.timeline-trip {
  font-size: 13px;
  color: #111827;
}

.timeline-note-warning {
  font-size: 13px;
  color: #dc2626;
}

.timeline-station-card {
  margin-top: 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  padding: 8px 10px;
  background-color: #ffffff;
  font-size: 12px;
}

.timeline-station-name {
  font-weight: 700;
  margin-bottom: 2px;
}

.timeline-station-meta {
  color: #4b5563;
}

/* SoC badges */

.timeline-soc {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 4px;
}

.soc-badge {
  background: transparent;
  color: #0f172a;
  /* slate-900 or keep as current */
  padding: 0;
  border-radius: 0;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}


.soc-badge span:first-child {
  font-size: 13px;
}

.soc-badge span:last-child {
  font-weight: 500;
  /* Medium */
}

/* Bottom metrics */

.results-metrics {
  border-top: 1px solid #cbd5e1;
  padding: 14px 16px 16px 16px;
  font-size: 13px;
}

.results-metrics-row {
  margin-bottom: 2px;
}

.results-metrics-label {
  font-weight: 700;
}

.results-distance-summary .results-not-reaching-label {
  color: #dc2626 !important;
  /* red-600 */
  font-weight: 600;
}

@keyframes resultsDistanceBarSlide {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes resultsChargerPop {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }

  68% {
    transform: translate(-50%, -50%) scale(1.08);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}