.route-cover {
  position: relative;
  isolation: isolate;
}

.route-cover::before,
.route-cover > .cover-grid,
.route-cover > .cover-route {
  z-index: 0;
}

.route-raster-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity .28s ease, transform .45s ease;
  pointer-events: none;
}

.route-preview-loaded .route-raster-preview,
.route-preview-fallback .route-raster-preview,
.route-preview-failed .route-raster-preview[src] {
  opacity: 1;
  transform: scale(1);
}

.route-preview-loaded .route-cover > .cover-grid,
.route-preview-loaded .route-cover > .cover-route,
.route-preview-fallback .route-cover > .cover-grid,
.route-preview-fallback .route-cover > .cover-route {
  opacity: 0;
  transition: opacity .2s ease;
}

.route-cover > .cover-top {
  position: absolute !important;
  z-index: 6 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none;
}

.route-cover > .cover-top .pill {
  position: relative;
  z-index: 1;
  opacity: 1;
  visibility: visible;
  color: #f4f8fb;
  background: rgba(7, 16, 28, .80);
  border-color: rgba(255, 255, 255, .22);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .34);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
}

.route-cover > .cover-top .pill-blue {
  color: #d5f9ff;
  background: rgba(8, 49, 65, .84);
  border-color: rgba(53, 215, 255, .38);
}

.route-cover > .cover-top .pill-accent {
  color: #e3ffdd;
  background: rgba(31, 72, 43, .86);
  border-color: rgba(140, 255, 122, .38);
}

.route-preview-attribution,
.route-preview-status {
  position: absolute;
  z-index: 5;
  bottom: 7px;
  padding: 3px 6px;
  border-radius: 7px;
  background: rgba(7, 16, 28, .76);
  color: rgba(255, 255, 255, .86);
  font-size: 9px;
  line-height: 1;
  letter-spacing: .01em;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  pointer-events: none;
}

.route-preview-attribution {
  left: 8px;
}

.route-preview-attribution-yandex {
  display: block;
  width: 96px;
  height: 30px;
  padding: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: url('https://yastatic.net/q/logoaas/v2/%D0%AF%D0%BD%D0%B4%D0%B5%D0%BA%D1%81%20%D0%9A%D0%B0%D1%80%D1%82%D1%8B.svg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  color: transparent;
  text-decoration: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: auto;
}

.route-preview-attribution-yandex:hover,
.route-preview-attribution-yandex:focus-visible {
  background-color: transparent;
  outline: 2px solid rgba(255, 255, 255, .85);
  outline-offset: 1px;
}

.route-preview-attribution-yandex > * {
  display: none;
}

.route-preview-yandex-mark {
  display: none;
}

.route-preview-status {
  right: 8px;
}

.route-preview-fallback .route-preview-status {
  color: #d8ffd1;
  border: 1px solid rgba(140, 255, 122, .22);
}

.route-preview-loading .route-cover::after {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.08) 46%, transparent 62%);
  transform: translateX(-100%);
  animation: route-preview-shimmer 1.7s ease-in-out infinite;
}

@keyframes route-preview-shimmer {
  0%, 20% { transform: translateX(-100%); }
  70%, 100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .route-raster-preview { transition: none; }
  .route-preview-loading .route-cover::after { animation: none; }
}
