/* Route Results & Metrics */
.route-summary-card {
  background: radial-gradient(circle at top right, rgba(6, 182, 212, 0.15) 0%, var(--bg-card) 80%);
  border-color: rgba(6, 182, 212, 0.18);
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.summary-actions {
  display: flex;
  gap: 8px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.metric-box {
  background: rgba(10, 15, 26, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
  min-width: 0;
}

.metric-box.metric-main {
  grid-column: span 3;
}

.metric-box:not(.metric-main) {
  grid-column: span 2;
}

.metric-box.metric-main .metric-value {
  font-size: 1.15rem;
  color: var(--primary);
}

.metric-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
}

.section-title {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

/* Timeline of Stops */
.stops-timeline {
  position: relative;
  padding-left: 20px;
}

.stops-timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 16px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-badge {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-sidebar);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
}

.timeline-badge.origin {
  background: var(--primary);
}

.timeline-badge.charger {
  background: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.timeline-badge.destination {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: var(--transition);
}

.timeline-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 4px;
  gap: 8px;
}

.timeline-meta .label-type {
  color: var(--success);
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.timeline-meta .dist-label {
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 600;
}

.timeline-sub-meta {
  font-size: 0.71rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.timeline-sub-meta i {
  color: var(--primary);
}

.timeline-card h4 {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 2px;
}

.timeline-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-detour {
  font-size: 0.75rem;
  color: var(--warning);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Battery Flow Widget: "Arrival -> Charge Target" visual stat chips */
.battery-flow {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.battery-flow-arrow {
  align-self: center;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.battery-stat {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  flex: 1 1 120px;
  min-width: 110px;
}

.battery-stat.warn {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
}

.battery-stat.target {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.battery-stat-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--primary);
}

.battery-stat.warn .battery-stat-icon {
  color: #ef4444;
}

.battery-stat.target .battery-stat-icon {
  color: #10b981;
}

.battery-stat-body {
  flex: 1;
  min-width: 0;
}

.battery-stat-top {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.battery-stat-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.1;
}

.battery-stat.warn .battery-stat-value {
  color: #ef4444;
}

.battery-stat.target .battery-stat-value {
  color: #10b981;
}

.battery-stat-label {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.battery-stat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.battery-stat-bar {
  margin-top: 5px;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.battery-stat-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--primary);
}

.battery-stat.warn .battery-stat-bar-fill {
  background: #ef4444;
}

.battery-stat-bar-fill.target {
  background: #10b981;
}

.battery-flow-note {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.battery-flow-note i {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.battery-flow-note.safe {
  color: #10b981;
}

.battery-flow-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  padding: 5px 8px;
  border-radius: 6px;
  margin-top: 6px;
}

.battery-flow-warning i {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.timeline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
}

.timeline-actions button {
  font-size: 0.72rem;
  padding: 4px 8px;
}
