.shp-indexed-popup {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  left: max(18px, env(safe-area-inset-left));
  z-index: 9999;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 36px;
  gap: 14px;
  align-items: center;
  width: min(780px, calc(100% - 36px));
  min-height: 82px;
  margin-inline: auto;
  padding: 15px 14px 15px 16px;
  color: #0f172a;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-top: 3px solid #1953d6;
  border-radius: 16px;
  box-shadow:
    0 22px 54px rgba(15, 23, 42, 0.17),
    0 8px 18px rgba(25, 83, 214, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(calc(100% + 32px));
  transition: transform 260ms ease-in-out, opacity 260ms ease-in-out;
}

.shp-indexed-popup::before {
  content: "";
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%231953d6' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='m7 15 4-4 3 3 5-7'/%3E%3Cpath d='M14 7h5v5'/%3E%3C/svg%3E")
      center / 22px 22px no-repeat,
    linear-gradient(135deg, rgba(239, 246, 255, 0.95) 0%, #ffffff 100%);
  border: 1px solid rgba(37, 99, 235, 0.14);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

.shp-indexed-popup.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.shp-indexed-popup__copy {
  min-width: 0;
}

.shp-indexed-popup__heading,
.shp-indexed-popup__subtext {
  margin: 0;
  letter-spacing: 0;
}

.shp-indexed-popup__heading {
  color: #0f172a;
  font-size: 1.1rem;
  font-weight: 850;
  line-height: 1.14;
}

.shp-indexed-popup__subtext {
  margin-top: 6px;
  color: #6b7890;
  font-size: 0.84rem;
  font-weight: 560;
  line-height: 1.36;
}

.shp-indexed-popup__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  color: #ffffff !important;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.12;
  text-align: center;
  text-decoration: none !important;
  white-space: nowrap;
  background: linear-gradient(135deg, #1953d6 0%, #2f76ff 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  box-shadow:
    0 14px 30px rgba(25, 83, 214, 0.32),
    0 0 0 0 rgba(47, 118, 255, 0.28);
  animation: shp-indexed-popup-cta-glow 2.8s ease-in-out infinite;
  transition:
    filter 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.shp-indexed-popup__cta:hover,
.shp-indexed-popup__cta:focus-visible {
  color: #ffffff !important;
  filter: saturate(1.08) brightness(1.02);
  box-shadow: 0 14px 28px rgba(25, 83, 214, 0.3);
  transform: translateY(-2px);
}

.shp-indexed-popup__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: #64748b;
  font: 400 22px/1 Inter, system-ui, sans-serif;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.shp-indexed-popup__close:hover,
.shp-indexed-popup__close:focus-visible {
  color: #0f172a;
  background: #f8fafc;
  border-color: #e2e8f0;
  transform: translateY(-1px);
}

.shp-indexed-popup__cta:focus-visible,
.shp-indexed-popup__close:focus-visible {
  outline: 3px solid rgba(15, 23, 42, 0.2);
  outline-offset: 3px;
}

@keyframes shp-indexed-popup-cta-glow {
  0%,
  100% {
    box-shadow:
      0 14px 30px rgba(25, 83, 214, 0.32),
      0 0 0 0 rgba(47, 118, 255, 0);
  }

  50% {
    box-shadow:
      0 16px 34px rgba(25, 83, 214, 0.36),
      0 0 0 7px rgba(47, 118, 255, 0.1);
  }
}

@media (max-width: 640px) {
  .shp-indexed-popup {
    right: env(safe-area-inset-right);
    bottom: env(safe-area-inset-bottom);
    left: env(safe-area-inset-left);
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-height: 0;
    padding: 18px 16px max(16px, env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 42px rgba(15, 23, 42, 0.14);
  }

  .shp-indexed-popup::before {
    display: none;
  }

  .shp-indexed-popup__copy {
    padding-right: 42px;
  }

  .shp-indexed-popup__heading {
    font-size: 1.05rem;
  }

  .shp-indexed-popup__subtext {
    font-size: 0.82rem;
  }

  .shp-indexed-popup__cta {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 46px;
  }

  .shp-indexed-popup__close {
    position: absolute;
    top: 12px;
    right: max(12px, env(safe-area-inset-right));
    width: 32px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shp-indexed-popup {
    transition: none;
  }

  .shp-indexed-popup__cta {
    animation: none;
  }
}
