.vehicle-sim-widget {
  position: fixed;
  left: 13px;
  right: auto;
  bottom: 317px;
  z-index: 9997;
  width: 258px;
  max-height: 166px;
  overflow: hidden;
  padding: 9px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.14);
  color: #0f172a;
  backdrop-filter: blur(8px);
}

.vehicle-sim-widget__eyebrow {
  margin: 0 0 2px;
  color: #64748b;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.vehicle-sim-widget__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.vehicle-sim-widget__header h3 {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.15;
}

.vehicle-sim-widget__count {
  color: #64748b;
  font-size: 0.64rem;
  font-weight: 800;
  white-space: nowrap;
}

.vehicle-sim-widget__controls {
  display: grid;
  grid-template-columns: 1fr 56px 46px;
  gap: 6px;
  margin-top: 7px;
}

.vehicle-sim-widget__time,
.vehicle-sim-widget__speed {
  height: 28px;
  border-radius: 9px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  color: #0f172a;
  padding: 0 8px;
  font-size: 0.72rem;
}

.vehicle-sim-widget__btn {
  height: 28px;
  border-radius: 9px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  color: #0f172a;
  padding: 0 8px;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 800;
}

.vehicle-sim-widget__btn--play {
  background: #0f172a;
  color: #fff;
}

.vehicle-sim-widget__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.vehicle-sim-widget__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.vehicle-sim-chip {
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
}

.vehicle-sim-chip.is-active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.vehicle-sim-widget.is-playing {
  box-shadow:
    0 16px 32px rgba(15, 23, 42, 0.16),
    0 0 0 2px rgba(15, 23, 42, 0.05);
}

/* ===== Markers ===== */

.vehicle-sim-marker-wrap {
  background: transparent;
  border: 0;
}

.vehicle-sim-marker-shell {
  width: 18px;
  height: 18px;
  position: relative;
  transform: rotate(var(--sim-bearing, 0deg));
  transform-origin: 50% 50%;
}

.vehicle-sim-direction {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 6px solid rgba(15, 23, 42, 0.9);
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.7));
}

.vehicle-sim-marker {
  position: absolute;
  left: 2px;
  top: 4px;
  width: 14px;
  height: 14px;
  background: var(--sim-color, #2563eb);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.28), 0 3px 8px rgba(15, 23, 42, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.vehicle-sim-marker__content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(calc(var(--sim-bearing, 0deg) * -1));
}

.vehicle-sim-marker__logo {
  width: 9px;
  height: 9px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.vehicle-sim-marker__emoji {
  font-size: 8px;
  line-height: 1;
}

.vehicle-sim-marker--evolity,
.vehicle-sim-marker--optymo {
  border-radius: 999px;
}

.vehicle-sim-marker--flixbus {
  border-radius: 2px;
}

.vehicle-sim-marker--mobigo {
  border-radius: 0;
  clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0 50%);
}

.vehicle-sim-marker--sncf {
  border-radius: 0;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0 50%);
}

.vehicle-sim-marker--mucar {
  border-radius: 4px;
  border: 2px solid #e11d48;
  box-shadow: 0 0 6px rgba(225, 29, 72, 0.5);
}

@media (max-width: 900px) {
  .vehicle-sim-widget {
    left: 12px;
    bottom: 232px;
    width: 236px;
    max-height: 160px;
  }
}

/* ── Arrêts du trajet covoiturage sélectionné (départ vert / arrivée rouge + personne) ── */
.cp-endpoint-wrap, .cp-stop-person-wrap { background: transparent !important; border: none !important; }
.cp-endpoint { position: relative; display: flex; flex-direction: column; align-items: center; }
.cp-endpoint__pin {
  width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--cp-bg); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.35); border: 2px solid #fff;
}
.cp-endpoint__pin > * { transform: rotate(45deg); }
.cp-endpoint__tag {
  margin-top: 2px; background: #fff; font-weight: 800; font-size: .68rem; line-height: 1;
  padding: 2px 6px; border-radius: 8px; border: 2px solid; box-shadow: 0 1px 4px rgba(0,0,0,.25);
  white-space: nowrap;
}
.cp-stop-person { position: relative; display: flex; flex-direction: column; align-items: center;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); animation: cpPersonBob 1.6s ease-in-out infinite; }
.cp-stop-person__badge {
  position: absolute; top: -4px; right: -6px; color: #fff; font-size: .6rem; font-weight: 800;
  min-width: 15px; height: 15px; line-height: 15px; text-align: center; border-radius: 50%;
  border: 2px solid #fff; padding: 0 1px;
}
@keyframes cpPersonBob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-3px) } }

/* ── Rendu identique MuCAR : arrêts (si), personne qui attend (pw), véhicule (cm) ── */
.leaflet-marker-icon.si, .leaflet-marker-icon.pw, .leaflet-marker-icon.cm {
  background: transparent !important; border: none !important;
}
@keyframes paxBounce { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-3px) } }
