.tls-stations {
  --tls-surface: #18293e;
  --tls-line-color: #dce5ef;
  --tls-icon-color: #fff;
  --tls-label-color: #fff;
  --tls-primary-size-v3: 82px;
  --tls-secondary-size-v3: 82px;
  --tls-icon-size-v3: 46px;
  --tls-title-size-v4: 13px;
  position: relative;
  width: 100%;
  min-height: 260px;
  overflow: hidden;
  background-color: transparent;
}

.tls-stations__list,
.tls-stations__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tls-stations__origin {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 30%;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 999px;
  background: #fff;
  transform: translate(-1px, -50%);
  box-shadow: 0 0 9px #fff, 0 0 20px color-mix(in srgb, var(--tls-line-color), transparent 22%);
  transition: opacity .2s ease, visibility .2s ease;
}

.tls-stations.has-departed .tls-stations__origin {
  opacity: 0;
  visibility: hidden;
}

.tls-stations__lines {
  z-index: 1;
  overflow: visible;
  pointer-events: none;
}

.tls-stations__lines path {
  fill: none;
  stroke: var(--tls-line-color);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 4 10;
  opacity: .2;
  vector-effect: non-scaling-stroke;
  transition: opacity .3s ease;
  animation: tls-line-flow 12s linear infinite;
}

.tls-stations__lines path.is-complete {
  opacity: .46;
}

.tls-stations__lines path.is-travelling {
  opacity: .72;
  animation-duration: 9s;
}

.tls-stations__spark {
  fill: #fff;
  stroke: rgba(255, 255, 255, .7);
  stroke-width: 2;
  filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 12px var(--tls-line-color));
}

@keyframes tls-line-flow {
  to { stroke-dashoffset: -28; }
}

.tls-station {
  --tls-node-size-v3: var(--tls-primary-size-v3);
  position: absolute;
  z-index: 2;
  left: var(--tls-x);
  top: var(--tls-y);
  width: var(--tls-node-size-v3);
  color: var(--tls-icon-color);
  text-align: center;
  text-decoration: none;
  transform: translate(-50%, -50%);
}

.tls-station--secondary {
  --tls-node-size-v3: var(--tls-secondary-size-v3);
}

.tls-station::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: calc(var(--tls-node-size-v3) / 2);
  left: 50%;
  width: calc(var(--tls-node-size-v3) * 1.45);
  height: calc(var(--tls-node-size-v3) * 1.45);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 68%);
  filter: blur(16px);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.72);
  transition: opacity .28s ease, transform .5s ease;
  pointer-events: none;
}

.tls-station__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tls-node-size-v3);
  height: var(--tls-node-size-v3);
  min-width: var(--tls-node-size-v3);
  min-height: var(--tls-node-size-v3);
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  margin-inline: auto;
  padding: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background:
    radial-gradient(
      circle at 30% 30%,
      color-mix(in srgb, var(--tls-surface) 72%, transparent),
      color-mix(in srgb, var(--tls-surface) 34%, transparent) 68%,
      rgba(8, 14, 22, .08) 100%
    );
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 14px 24px rgba(0, 0, 0, .18) !important;
  opacity: .6;
  transition: transform .32s ease, border-color .32s ease, background .32s ease, box-shadow .32s ease, opacity .32s ease;
}

.tls-station:hover .tls-station__button,
.tls-station:focus-visible .tls-station__button {
  border-color: rgba(255, 255, 255, .24);
  opacity: .9;
  transform: translateY(-2px) scale(1.02);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 18px 30px rgba(0, 0, 0, .2), 0 0 24px rgba(255, 255, 255, .08) !important;
}

.tls-station.is-visited::before,
.tls-station.is-arriving::before {
  opacity: .72;
  transform: translate(-50%, -50%) scale(1);
}

.tls-station.is-visited .tls-station__button,
.tls-station.is-arriving .tls-station__button {
  border-color: rgba(255, 255, 255, .34);
  background:
    radial-gradient(
      circle at 30% 30%,
      color-mix(in srgb, var(--tls-surface) 80%, white 20%),
      color-mix(in srgb, var(--tls-surface) 82%, transparent) 72%,
      rgba(12, 19, 30, .38) 100%
    );
  opacity: 1;
  transform: translateY(-4px) scale(1.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 18px 34px rgba(0, 0, 0, .2), 0 0 0 9px rgba(255, 255, 255, .035), 0 0 40px rgba(255, 255, 255, .11) !important;
}

.tls-station.is-arriving .tls-station__button {
  animation: tls-station-arrival 1.05s cubic-bezier(.22, .84, .24, 1) both;
}

@keyframes tls-station-arrival {
  0% { transform: translateY(0) scale(1); }
  38% { transform: translateY(-7px) scale(1.13); }
  68% { transform: translateY(-4px) scale(1.08); }
  100% { transform: translateY(-4px) scale(1.08); }
}

.tls-station:focus-visible {
  outline: none;
}

.tls-station:focus-visible .tls-station__button {
  outline: 3px solid rgba(255, 255, 255, .34);
  outline-offset: 4px;
}

.tls-station__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--tls-icon-color);
  font-size: var(--tls-icon-size-v3) !important;
  line-height: 1;
  opacity: .7;
  filter: drop-shadow(0 4px 12px rgba(255, 255, 255, .14));
  transition: transform .32s ease, opacity .32s ease, filter .32s ease;
}

.tls-station:hover .tls-station__icon,
.tls-station:focus-visible .tls-station__icon {
  opacity: 1;
  transform: scale(1.06);
}

.tls-station.is-visited .tls-station__icon,
.tls-station.is-arriving .tls-station__icon {
  opacity: 1;
  transform: scale(1.14);
  filter: drop-shadow(0 8px 20px rgba(255, 255, 255, .22));
}

.tls-station__icon svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

.tls-station__label {
  position: absolute;
  left: 50%;
  top: calc(100% + 15px);
  display: block;
  min-width: max-content;
  max-width: 210px;
  padding: 0;
  color: var(--tls-label-color) !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity .34s ease, transform .42s cubic-bezier(.22, .84, .24, 1), visibility .34s ease;
  pointer-events: none;
}

.tls-station.is-visited .tls-station__label,
.tls-station.is-arriving .tls-station__label,
.tls-station:focus-visible .tls-station__label {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.tls-station__title {
  display: block;
  font-size: var(--tls-title-size-v4) !important;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 0 18px rgba(255, 255, 255, .12);
}

.tls-station__description {
  display: block;
  margin-top: 5px;
  font-size: max(9px, calc(var(--tls-title-size-v4) - 2px));
  line-height: 1.25;
  letter-spacing: .04em;
  opacity: .72;
}

.tls-stations[data-rotate="0"] .tls-station__label {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

@media (max-width: 767px) {
  .tls-stations {
    height: auto !important;
    min-height: 0;
    overflow: visible;
  }

  .tls-stations__list {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 18px;
    padding: 20px;
  }

  .tls-stations__lines,
  .tls-stations__origin {
    display: none;
  }

  .tls-station {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    transform: none;
  }

  .tls-station__button {
    margin: 0 auto;
  }

  .tls-station__label {
    position: relative;
    left: auto;
    top: auto;
    min-width: 0;
    max-width: none;
    margin: 12px auto 0;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .tls-station.is-arriving .tls-station__label,
  .tls-station.is-visited .tls-station__label,
  .tls-station:focus-visible .tls-station__label {
    transform: translateY(-2px);
  }

  .tls-stations[data-rotate="0"] .tls-station__label {
    transform: none;
  }
}

@media (max-width: 479px) {
  .tls-stations__list {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tls-station__button,
  .tls-station__icon,
  .tls-station__label,
  .tls-stations__lines path {
    transition: none;
    animation: none !important;
  }

  .tls-station__label {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }
}
