.share-route-panel {
  min-height: clamp(430px, 68dvh, 720px);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.share-route-state {
  width: min(100%, 560px);
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .97), rgba(255, 248, 244, .96));
  box-shadow: 0 24px 60px rgba(95, 68, 80, .12);
  text-align: center;
}

.share-route-visual {
  position: relative;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
}

.share-route-visual img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.share-route-orbit {
  position: absolute;
  inset: 0;
  border: 4px solid rgba(185, 130, 158, .18);
  border-top-color: var(--pink-deep);
  border-radius: 50%;
  animation: share-route-spin .9s ease-in-out infinite;
}

.share-route-state[data-state="error"] .share-route-orbit {
  animation: none;
  border-color: rgba(190, 59, 75, .22);
  border-top-color: #be3b4b;
}

.share-route-state[data-state="error"] .share-route-visual::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: #be3b4b;
  transform: rotate(-45deg);
}

.share-route-eyebrow {
  margin: 2px 0 -6px;
  color: var(--pink-deep);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .12em;
}

.share-route-state h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.25;
  outline: none;
}

.share-route-message,
.share-route-slow {
  max-width: 38em;
  margin: 0;
  color: var(--muted-ink);
  font-size: 16px;
  line-height: 1.65;
}

.share-route-slow {
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(185, 130, 158, .1);
  color: var(--ink);
  font-size: 14px;
}

.share-route-progress {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0;
}

.share-route-progress span {
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted-ink);
  background: rgba(255, 255, 255, .72);
  font-size: 13px;
  font-weight: 650;
}

.share-route-progress span[aria-current="step"],
.share-route-progress span[data-complete="true"] {
  border-color: rgba(185, 130, 158, .45);
  background: var(--pink-soft);
  color: var(--ink);
}

.share-route-progress span[data-complete="true"]::before {
  content: "✓";
  margin-right: 4px;
}

.share-route-actions {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

#view-share .share-route-actions [hidden],
#view-share .share-route-slow[hidden] {
  display: none !important;
}

#view-share .share-route-actions .button {
  min-width: 132px;
  min-height: 48px !important;
  touch-action: manipulation;
}

@keyframes share-route-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .share-route-panel {
    min-height: max(430px, calc(100dvh - 210px));
    padding-inline: max(12px, env(safe-area-inset-left));
  }

  .share-route-state {
    min-height: 390px;
    padding: 28px 18px;
    border-radius: 24px;
  }

  .share-route-actions {
    flex-direction: column;
  }

  #view-share .share-route-actions .button {
    width: 100%;
  }
}

@media (orientation: landscape) and (max-height: 620px) {
  .share-route-panel {
    min-height: 420px;
    place-items: start center;
  }

  .share-route-state {
    min-height: 340px;
    padding-block: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .share-route-orbit {
    animation: none;
    border-top-color: var(--pink-deep);
  }
}
