.product-tour {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.product-tour[hidden],
.product-tour__panel[hidden] {
  display: none !important;
}

.product-tour__backdrop {
  position: fixed;
  inset: 0;
  background: hsl(24 18% 8% / .16);
  pointer-events: none;
}

.dark .product-tour__backdrop {
  background: hsl(24 18% 4% / .22);
}

.product-tour__panel {
  position: fixed;
  right: clamp(1rem, 3vw, 2.5rem);
  bottom: 1rem;
  width: min(33rem, calc(100vw - 2rem));
  max-height: calc(100vh - 6rem);
  max-height: calc(100dvh - 6rem);
  overflow-y: auto;
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  padding: 1.65rem;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: 0 24px 70px hsl(24 25% 8% / .28), 0 1px 0 hsl(var(--gold) / .18) inset;
  pointer-events: auto;
}

.product-tour__panel--targeted {
  box-shadow: 0 24px 70px hsl(24 25% 8% / .28), 0 0 0 1px hsl(var(--gold) / .18);
}

.product-tour__close {
  position: absolute;
  top: .85rem;
  right: .9rem;
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: hsl(var(--muted-foreground));
  font-size: 1.35rem;
  line-height: 1;
  transition: background-color 140ms ease, color 140ms ease;
}

.product-tour__close:hover,
.product-tour__close:focus-visible {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.product-tour__progress,
.product-tour__eyebrow {
  margin: 0;
  color: hsl(var(--gold));
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.product-tour__progress {
  padding-right: 2.75rem;
  color: hsl(var(--muted-foreground));
}

.product-tour__eyebrow {
  margin-top: .85rem;
}

.product-tour__content h2 {
  margin: .45rem 2rem .75rem 0;
  color: hsl(var(--foreground));
  font-family: var(--font-heading);
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.12;
  text-wrap: balance;
}

.product-tour__copy {
  display: grid;
  gap: .75rem;
  color: hsl(var(--muted-foreground));
  font-size: .96rem;
  line-height: 1.65;
}

.product-tour__copy p {
  margin: 0;
}

.product-tour__copy strong {
  color: hsl(var(--foreground));
  font-weight: 650;
}

.product-tour__copy kbd {
  display: inline-flex;
  min-width: 1.7rem;
  align-items: center;
  justify-content: center;
  border: 1px solid hsl(var(--border));
  border-bottom-width: 2px;
  border-radius: .35rem;
  padding: .05rem .35rem;
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  font: 600 .82rem/1.45 var(--font-body);
}

.product-tour__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .65rem;
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--border));
}

.product-tour__button {
  display: inline-flex;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: .55rem;
  padding: .65rem 1rem;
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  transition: transform 120ms ease, background-color 140ms ease, border-color 140ms ease;
}

.product-tour__button:hover {
  transform: translateY(-1px);
}

.product-tour__button:focus-visible,
.product-tour__close:focus-visible {
  outline: 2px solid hsl(var(--gold));
  outline-offset: 2px;
}

.product-tour__button--primary {
  border-color: hsl(var(--gold));
  background: hsl(var(--gold));
  color: hsl(var(--primary-foreground));
}

.product-tour__button--secondary {
  border-color: hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

.product-tour__button:disabled {
  cursor: wait;
  opacity: .7;
  transform: none;
}

.product-tour-target {
  border-radius: .6rem;
  outline: 3px solid hsl(var(--gold) / .9) !important;
  outline-offset: 5px;
  box-shadow: 0 0 0 9px hsl(var(--gold) / .12) !important;
  scroll-margin-top: 7rem;
}

.product-tour__sponsors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  margin-top: 1.25rem;
}

.product-tour__sponsor {
  display: flex;
  min-height: 3.35rem;
  align-items: center;
  justify-content: center;
  border: 1px solid hsl(var(--border));
  border-radius: .65rem;
  padding: .7rem .8rem;
  background: hsl(var(--background) / .72);
  color: hsl(var(--foreground));
  font-family: var(--font-heading);
  font-size: .9rem;
  font-weight: 600;
  text-align: center;
}

.product-tour__sponsor img {
  width: auto;
  max-width: 8rem;
  max-height: 1.65rem;
  object-fit: contain;
}

.product-tour__sponsor-thanks {
  margin-top: .2rem !important;
  border-left: 2px solid hsl(var(--gold));
  padding: .75rem 0 .75rem 1rem;
}

.product-tour__error {
  margin-top: .85rem !important;
  color: hsl(var(--destructive, 0 72% 46%));
  font-size: .86rem;
}

@media (max-width: 640px) {
  .product-tour__panel {
    right: .6rem;
    bottom: .6rem;
    left: .6rem;
    width: auto;
    max-height: 82vh;
    max-height: 82dvh;
    padding: 1.35rem;
  }

  .product-tour__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .product-tour__button {
    width: 100%;
  }

  .product-tour__sponsors {
    grid-template-columns: 1fr;
  }

  .product-tour-target {
    outline-offset: 3px;
    box-shadow: 0 0 0 6px hsl(var(--gold) / .12) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-tour__button,
  .product-tour__close {
    transition: none;
  }

  .product-tour__button:hover {
    transform: none;
  }
}
