.fm {
  --fm-ink: #0b1f4b;
  --fm-ink-soft: #4c5b78;
  --fm-brand: #f05a00;
  --fm-brand-strong: #d94e00;
  --fm-cream: #fbf7f0;
  --fm-paper: #fffdfa;
  --fm-line: #e8ddcd;
  --fm-green: #1f8a5b;
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  color: var(--fm-ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.fm,
.fm *,
.fm *::before,
.fm *::after {
  box-sizing: border-box;
}

.fm__sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.fm__intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px 32px;
  margin: 0 0 22px;
}

.fm__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  color: #b34700;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.fm__live-dot {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--fm-green);
  box-shadow: 0 0 0 3px rgba(31, 138, 91, 0.14);
  animation: fm-live 2.2s ease-out infinite;
}

.fm__title {
  margin: 0;
  font-family: "Bricolage Grotesque", Georgia, serif;
  font-size: clamp(1.7rem, 3.2vw, 2.55rem);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.fm__lead {
  max-width: 48ch;
  margin: 0;
  color: var(--fm-ink-soft);
  font-size: 0.96rem;
  line-height: 1.6;
}

.fm__shell {
  overflow: hidden;
  border: 1px solid var(--fm-line);
  border-radius: 26px;
  background: var(--fm-paper);
  box-shadow: 0 30px 70px -42px rgba(7, 21, 51, 0.5);
}

.fm__map {
  position: relative;
  height: clamp(400px, 44vw, 560px);
  overflow: hidden;
  background: #f5efe3;
  isolation: isolate;
}

.fm__svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.fm--google .fm__svg {
  display: none;
}

.fm__google {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #f5efe3;
}

.fm__contours {
  fill: none;
  stroke: #e8decd;
  stroke-width: 1.2;
  opacity: 0.55;
}

.fm__parks {
  fill: #dfe8d2;
  opacity: 0.9;
}

.fm__river {
  fill: none;
  stroke: #c6d7e9;
  stroke-width: 5;
  stroke-linecap: round;
  opacity: 0.95;
}

.fm__ring {
  fill: none;
  stroke: #e7dcc9;
  stroke-width: 6;
  stroke-linecap: round;
}

.fm__road {
  fill: none;
  stroke: #eee4d3;
  stroke-width: 3.6;
  stroke-linecap: round;
}

.fm__street {
  fill: none;
  stroke: #f0e6d5;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.fm__highway {
  fill: none;
  stroke: #e2d4bd;
  stroke-width: 10;
  stroke-linecap: round;
}

.fm__highway-core {
  fill: none;
  stroke: #fffdfa;
  stroke-width: 7;
  stroke-linecap: round;
}

.fm__route-line {
  fill: none;
  stroke: var(--fm-brand);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-dasharray: 9 8;
  filter: drop-shadow(0 1px 1px rgba(240, 90, 0, 0.28));
  animation: fm-dash 1.7s linear infinite;
}

.fm__routes > .fm__route-line:nth-child(2) {
  animation-delay: -0.4s;
}

.fm__routes > .fm__route-line:nth-child(3) {
  animation-delay: -0.9s;
}

.fm__routes > .fm__route-line:nth-child(4) {
  animation-delay: -1.3s;
}

.fm__dest-ring {
  fill: none;
  stroke: var(--fm-brand);
  stroke-width: 2;
  opacity: 0.8;
  transform-box: fill-box;
  transform-origin: center;
  animation: fm-ring 2.6s ease-out infinite;
}

.fm__destinations > g:nth-child(2) .fm__dest-ring {
  animation-delay: 0.5s;
}

.fm__destinations > g:nth-child(3) .fm__dest-ring {
  animation-delay: 1.1s;
}

.fm__destinations > g:nth-child(4) .fm__dest-ring {
  animation-delay: 1.7s;
}

.fm__dest-dot {
  fill: var(--fm-brand);
  stroke: var(--fm-paper);
  stroke-width: 2;
}

.fm__origin-dot {
  fill: var(--fm-ink);
  stroke: var(--fm-paper);
  stroke-width: 2.5;
}

.fm__svg text {
  font-family: "Inter", system-ui, sans-serif;
}

.fm__city {
  font-size: 14.5px;
  font-weight: 600;
  fill: #33456f;
  paint-order: stroke;
  stroke: var(--fm-cream);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.fm__city--capital {
  font-size: 23px;
  font-weight: 700;
  fill: var(--fm-ink);
  stroke-width: 5px;
}

.fm__city--minor {
  font-size: 11px;
  font-weight: 500;
  fill: #5a6b8c;
  stroke-width: 3px;
}

.fm__hw-labels rect {
  fill: rgba(255, 253, 250, 0.94);
  stroke: #e3d5bf;
  stroke-width: 1;
}

.fm__hw-labels text {
  font-size: 10px;
  font-weight: 700;
  fill: #a56712;
  letter-spacing: 0.02em;
}

.fm__van {
  filter: drop-shadow(0 3px 3px rgba(7, 21, 51, 0.26));
  transition: opacity 0.35s ease;
  will-change: transform;
}

.fm__van.is-resetting,
.fm__van-marker.is-resetting {
  transition: none;
}

.fm__halo {
  fill: none;
  stroke: var(--fm-brand);
  stroke-width: 2.5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.fm__van.is-hot .fm__halo,
.fm__van-marker.is-hot .fm__halo {
  opacity: 1;
  animation: fm-halo 1s ease-out infinite;
}

.fm__pill {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 88px);
  padding: 10px 16px;
  border: 1px solid rgba(232, 221, 205, 0.9);
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: 0 14px 30px -20px rgba(7, 21, 51, 0.65);
  color: var(--fm-ink);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
  backdrop-filter: blur(8px);
}

.fm__pill strong {
  font-weight: 750;
}

.fm__pill-dot {
  position: relative;
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--fm-green);
  animation: fm-live 2.2s ease-out infinite;
}

.fm__pause {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(232, 221, 205, 0.9);
  border-radius: 50%;
  background: rgba(255, 253, 250, 0.94);
  color: var(--fm-ink);
  box-shadow: 0 14px 30px -20px rgba(7, 21, 51, 0.65);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.2s ease, transform 0.15s ease;
}

.fm__pause:hover {
  background: var(--fm-paper);
}

.fm__pause:active {
  transform: scale(0.94);
}

.fm__pause:focus-visible {
  outline: 3px solid var(--fm-brand);
  outline-offset: 2px;
}

.fm__pause svg {
  width: 18px;
  height: 18px;
}

.fm__icon-play {
  display: none;
}

.fm.is-paused .fm__icon-pause {
  display: none;
}

.fm.is-paused .fm__icon-play {
  display: block;
}

.fm.is-paused .fm__route-line,
.fm.is-paused .fm__dest-ring,
.fm.is-paused .fm__live-dot,
.fm.is-paused .fm__pill-dot {
  animation-play-state: paused;
}

.fm__note {
  margin: 0;
  padding: 10px 18px;
  border-top: 1px solid var(--fm-line);
  background: #f9f3e7;
  color: #5c6984;
  font-size: 0.7rem;
  letter-spacing: 0.01em;
}

.fm__noscript {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 3;
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--fm-paper);
  color: var(--fm-ink);
  font-size: 0.8rem;
}

.fm__routes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--fm-line);
  list-style: none;
  background: var(--fm-paper);
}

.fm__route-item {
  border-left: 1px solid var(--fm-line);
}

.fm__route-item:first-child {
  border-left: 0;
}

.fm__route {
  display: block;
  width: 100%;
  height: 100%;
  padding: 16px 18px 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.fm__route:hover {
  background: #fcf6ec;
}

.fm__route.is-hot {
  background: #fcf3e6;
  box-shadow: inset 0 0 0 2px rgba(240, 90, 0, 0.35);
}

.fm__route:focus-visible {
  outline: 3px solid var(--fm-brand);
  outline-offset: -3px;
}

.fm__route-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.fm__route-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(240, 90, 0, 0.1);
  color: var(--fm-brand-strong);
}

.fm__route-icon svg {
  width: 19px;
  height: 19px;
}

.fm__route-name {
  display: block;
  padding-top: 3px;
  color: var(--fm-ink);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.fm__route-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.fm__route-eta {
  color: #66738f;
  font-size: 0.71rem;
  line-height: 1.2;
  white-space: nowrap;
}

.fm__route-state {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8f4ec;
  color: #15734b;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.fm__route-state[data-state="llegando"] {
  background: #fff0d9;
  color: #a35b00;
}

.fm__route-state[data-state="destino"] {
  background: #eceff6;
  color: #33456f;
}

.fm__track {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #efe6d7;
}

.fm__bar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8a3d, var(--fm-brand));
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.fm__vans-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.fm__van-marker {
  position: absolute;
  top: 0;
  left: 0;
  width: 46px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 3px 4px rgba(7, 21, 51, 0.28));
  transition: opacity 0.35s ease;
  will-change: transform;
}

.fm__van-marker svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  transition: transform 0.2s ease;
}

.fm__van-marker:hover svg {
  transform: scale(1.1);
}

.fm__van-marker:focus-visible {
  outline: 3px solid var(--fm-brand);
  outline-offset: 3px;
  border-radius: 999px;
}

@keyframes fm-dash {
  to {
    stroke-dashoffset: -34;
  }
}

@keyframes fm-ring {
  0% {
    opacity: 0.75;
    transform: scale(0.65);
  }
  75%,
  100% {
    opacity: 0;
    transform: scale(2.2);
  }
}

@keyframes fm-live {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 138, 91, 0.4);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(31, 138, 91, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(31, 138, 91, 0);
  }
}

@keyframes fm-halo {
  0% {
    opacity: 0.9;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.55);
  }
}

@media (max-width: 900px) {
  .fm__routes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fm__route-item:nth-child(odd) {
    border-left: 0;
  }

  .fm__route-item:nth-child(n + 3) {
    border-top: 1px solid var(--fm-line);
  }

  .fm__city {
    font-size: 19px;
  }

  .fm__city--capital {
    font-size: 27px;
  }

  .fm__city--minor,
  .fm__hw-labels {
    display: none;
  }
}

@media (max-width: 640px) {
  .fm__intro {
    margin-bottom: 18px;
  }

  .fm__map {
    height: 420px;
  }

  .fm__city {
    font-size: 22px;
  }

  .fm__city--capital {
    font-size: 30px;
  }

  .fm__route-line {
    stroke-width: 4.4;
  }

  .fm__pill {
    top: 12px;
    left: 12px;
    gap: 8px;
    padding: 9px 13px;
    font-size: 0.76rem;
  }

  .fm__pause {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }

  .fm__routes {
    grid-template-columns: 1fr;
  }

  .fm__route-item {
    border-left: 0;
  }

  .fm__route-item:nth-child(n + 2) {
    border-top: 1px solid var(--fm-line);
  }

  .fm__route {
    padding: 14px 16px 16px;
  }

  .fm__note {
    padding: 9px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fm__live-dot,
  .fm__pill-dot,
  .fm__route-line,
  .fm__dest-ring,
  .fm__halo {
    animation: none !important;
  }
}
