/* TeleRocket — интерактивный тур (demo) */
.gram-tour-root {
  position: fixed;
  inset: 0;
  z-index: 120000;
  pointer-events: none;
}

.gram-tour-root.is-active {
  pointer-events: auto;
}

.gram-tour-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  backdrop-filter: none;
  opacity: 1;
  pointer-events: auto;
}

.gram-tour-spot {
  position: fixed;
  z-index: 1;
  border-radius: 14px;
  box-shadow:
    0 0 0 9999px rgba(2, 6, 14, 0.68),
    0 0 0 2px rgba(56, 189, 248, 0.9),
    0 0 36px rgba(14, 165, 233, 0.5),
    0 0 72px rgba(99, 102, 241, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  transition:
    top 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    left 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease,
    box-shadow 0.35s ease;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
}

.gram-tour-spot.is-live {
  transform: scale(1);
}

.gram-tour-root.is-visible .gram-tour-spot.is-live {
  opacity: 1;
}

.gram-tour-spot.is-pulse {
  animation: gramTourSpotPulse 1.8s ease-in-out infinite;
}

@keyframes gramTourSpotPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 9999px rgba(2, 6, 14, 0.68),
      0 0 0 2px rgba(56, 189, 248, 0.9),
      0 0 30px rgba(14, 165, 233, 0.42),
      0 0 56px rgba(99, 102, 241, 0.18),
      inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  }
  50% {
    box-shadow:
      0 0 0 9999px rgba(2, 6, 14, 0.68),
      0 0 0 3px rgba(125, 211, 252, 1),
      0 0 48px rgba(14, 165, 233, 0.7),
      0 0 88px rgba(99, 102, 241, 0.32),
      inset 0 0 0 2px rgba(255, 255, 255, 0.18);
  }
}

.gram-tour-highlight {
  position: relative;
  z-index: 120001 !important;
  outline: 2px solid rgba(125, 211, 252, 0.9) !important;
  outline-offset: 3px;
  border-radius: 12px;
  box-shadow:
    0 0 0 6px rgba(14, 165, 233, 0.2),
    0 0 28px rgba(56, 189, 248, 0.45) !important;
  animation: gramTourHighlightGlow 1.6s ease-in-out infinite;
}

@keyframes gramTourHighlightGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 4px rgba(14, 165, 233, 0.18),
      0 0 22px rgba(56, 189, 248, 0.35);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(14, 165, 233, 0.28),
      0 0 36px rgba(56, 189, 248, 0.55);
  }
}

.gram-tour-arrow {
  display: none !important;
}

.gram-tour-card {
  position: fixed;
  z-index: 3;
  width: min(400px, calc(100vw - 32px));
  padding: 0;
  border-radius: 20px;
  border: 1px solid rgba(125, 211, 252, 0.32);
  background: linear-gradient(
    145deg,
    rgba(15, 23, 42, 0.72),
    rgba(30, 41, 59, 0.58)
  );
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 48px rgba(14, 165, 233, 0.12);
  color: #e2e8f0;
  opacity: 0;
  transform: translateY(18px) scale(0.94);
  transition:
    opacity 0.38s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    left 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
  overflow: visible;
}

.gram-tour-card[data-placement="sidebar"]::after,
.gram-tour-card[data-placement="right"]::after {
  content: "";
  position: absolute;
  left: -7px;
  top: var(--tour-arrow-y, 50%);
  width: 14px;
  height: 14px;
  transform: translateY(-50%) rotate(45deg);
  background: linear-gradient(145deg, rgba(18, 28, 46, 0.98), rgba(28, 40, 58, 0.92));
  border-left: 1px solid rgba(125, 211, 252, 0.35);
  border-bottom: 1px solid rgba(125, 211, 252, 0.35);
  box-shadow: -3px 3px 10px rgba(0, 0, 0, 0.25);
}

.gram-tour-card[data-placement="left"]::after {
  content: "";
  position: absolute;
  right: -7px;
  top: var(--tour-arrow-y, 50%);
  width: 14px;
  height: 14px;
  transform: translateY(-50%) rotate(45deg);
  background: linear-gradient(145deg, rgba(18, 28, 46, 0.98), rgba(28, 40, 58, 0.92));
  border-top: 1px solid rgba(125, 211, 252, 0.35);
  border-right: 1px solid rgba(125, 211, 252, 0.35);
  box-shadow: 3px -3px 10px rgba(0, 0, 0, 0.25);
}

.gram-tour-card[data-placement="top"]::after {
  content: "";
  position: absolute;
  left: var(--tour-arrow-x, 50%);
  bottom: -7px;
  width: 14px;
  height: 14px;
  transform: translateX(-50%) rotate(45deg);
  background: linear-gradient(145deg, rgba(18, 28, 46, 0.98), rgba(28, 40, 58, 0.92));
  border-right: 1px solid rgba(125, 211, 252, 0.35);
  border-bottom: 1px solid rgba(125, 211, 252, 0.35);
}

.gram-tour-card[data-placement="bottom"]::after {
  content: "";
  position: absolute;
  left: var(--tour-arrow-x, 50%);
  top: -7px;
  width: 14px;
  height: 14px;
  transform: translateX(-50%) rotate(45deg);
  background: linear-gradient(145deg, rgba(18, 28, 46, 0.98), rgba(28, 40, 58, 0.92));
  border-left: 1px solid rgba(125, 211, 252, 0.35);
  border-top: 1px solid rgba(125, 211, 252, 0.35);
}

.gram-tour-card-glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    125deg,
    rgba(14, 165, 233, 0.35),
    rgba(99, 102, 241, 0.2) 40%,
    transparent 70%
  );
  opacity: 0.65;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  padding: 1px;
}

.gram-tour-card.is-step-in {
  animation: gramTourCardIn 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes gramTourCardIn {
  from {
    opacity: 0.4;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gram-tour-root.is-visible .gram-tour-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.gram-tour-card.is-center {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) scale(0.97);
}

.gram-tour-root.is-visible .gram-tour-card.is-center {
  transform: translate(-50%, -50%) scale(1);
}

.gram-tour-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 10px;
  position: relative;
  z-index: 1;
}

.gram-tour-card-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(99, 102, 241, 0.35));
  color: #7dd3fc;
  font-size: 1.15rem;
  animation: gramTourIconFloat 3s ease-in-out infinite;
}

@keyframes gramTourIconFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.gram-tour-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: #f8fafc;
}

.gram-tour-card-body {
  margin: 0;
  padding: 0 18px 14px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #e2e8f0;
  position: relative;
  z-index: 1;
}

.gram-tour-progress {
  display: flex;
  gap: 6px;
  padding: 0 18px 12px;
}

.gram-tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  transition: width 0.25s ease, background 0.25s ease;
}

.gram-tour-dot.is-active {
  width: 18px;
  background: linear-gradient(90deg, #0ea5e9, #6366f1);
}

.gram-tour-dot.is-done {
  background: rgba(56, 189, 248, 0.55);
}

.gram-tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.gram-tour-skip {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 6px 8px;
}

.gram-tour-skip:hover {
  color: #e2e8f0;
}

.gram-tour-nav {
  display: flex;
  gap: 8px;
}

.gram-tour-btn {
  border: 0;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gram-tour-btn:active {
  transform: scale(0.97);
}

.gram-tour-btn-back {
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
}

.gram-tour-btn-next {
  background: linear-gradient(135deg, #0ea5e9, #6366f1, #8b5cf6);
  background-size: 200% 200%;
  animation: gramTourBtnShine 3s ease infinite;
  color: #fff;
  box-shadow: 0 10px 28px rgba(14, 165, 233, 0.4);
}

@keyframes gramTourBtnShine {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.gram-tour-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 120001;
}

.gram-tour-confetti i {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.9;
  animation: gramTourConfettiFall 1.8s ease-in forwards;
}

@keyframes gramTourConfettiFall {
  to {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gram-tour-spot,
  .gram-tour-card,
  .gram-tour-backdrop,
  .gram-tour-card-icon,
  .gram-tour-spot.is-pulse,
  .gram-tour-highlight,
  .gram-tour-arrow,
  .gram-tour-btn-next,
  .gram-tour-card.is-step-in {
    animation: none !important;
    transition: none !important;
  }
}

/* Обучалка: центр, стиль как buy-premium, акцент emerald */
.gram-tour-root:has(.gram-tour-card--onboard) .gram-tour-backdrop {
  background: rgba(2, 8, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.gram-tour-card--onboard {
  width: min(460px, calc(100vw - 32px));
  border-radius: 22px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  background: linear-gradient(
    160deg,
    rgba(12, 22, 34, 0.96),
    rgba(15, 28, 42, 0.92) 45%,
    rgba(10, 24, 32, 0.96)
  );
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 0 48px rgba(16, 185, 129, 0.12);
}

.gram-tour-card--onboard .gram-tour-card-glow {
  background: linear-gradient(
    125deg,
    rgba(16, 185, 129, 0.4),
    rgba(45, 212, 191, 0.22) 42%,
    transparent 72%
  );
  opacity: 0.75;
}

.gram-tour-card--onboard .gram-tour-card-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.15rem 0 0.25rem;
}

.gram-tour-card--onboard .gram-tour-card-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.gram-tour-card--onboard .gram-tour-card-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6ee7b7;
  opacity: 0.9;
}

.gram-tour-card--onboard .gram-tour-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.28), rgba(45, 212, 191, 0.12));
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.22);
}

.gram-tour-card--onboard .gram-tour-card-title {
  font-size: 1.12rem;
  line-height: 1.3;
  color: #f0fdf4;
}

.gram-tour-card--onboard .gram-tour-card-body {
  padding: 0 18px 4px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.gram-tour-card--onboard .gram-tour-card-body b {
  color: #ecfdf5;
  font-weight: 650;
}

.gram-tour-card--onboard .gram-tour-link {
  color: #5eead4;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.gram-tour-card--onboard .gram-tour-link:hover {
  color: #99f6e4;
}

.gram-tour-card--onboard .gram-tour-dot.is-active {
  width: 22px;
  background: linear-gradient(90deg, #10b981, #2dd4bf);
}

.gram-tour-card--onboard .gram-tour-dot.is-done {
  background: rgba(52, 211, 153, 0.55);
}

.gram-tour-card--onboard .gram-tour-btn-next {
  background: linear-gradient(135deg, #059669, #10b981, #14b8a6);
  background-size: 200% 200%;
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.38);
}

.gram-tour-card--onboard .gram-tour-actions {
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 6px;
}

html:not(.theme-dark) .gram-tour-card--onboard {
  border-color: rgba(16, 185, 129, 0.28);
  background: linear-gradient(160deg, #ffffff, #f0fdf4 55%, #ecfdf5);
  color: #0f172a;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(16, 185, 129, 0.08);
}

html:not(.theme-dark) .gram-tour-card--onboard .gram-tour-card-title {
  color: #064e3b;
}

html:not(.theme-dark) .gram-tour-card--onboard .gram-tour-card-body {
  color: #334155;
}

html:not(.theme-dark) .gram-tour-card--onboard .gram-tour-card-body b {
  color: #065f46;
}

html:not(.theme-dark) .gram-tour-card--onboard .gram-tour-card-kicker {
  color: #059669;
}

html:not(.theme-dark) .gram-tour-card--onboard .gram-tour-link {
  color: #0d9488;
}

html:not(.theme-dark) .gram-tour-root:has(.gram-tour-card--onboard) .gram-tour-backdrop {
  background: rgba(15, 23, 42, 0.45);
}
