:root {
  --rgt-ink: #f8fbff;
  --rgt-panel: rgba(15, 18, 45, 0.94);
  --rgt-panel-2: rgba(42, 32, 91, 0.96);
  --rgt-cyan: #5ee7ff;
  --rgt-violet: #8b5cf6;
  --rgt-yellow: #ffd45c;
}

.rgt-tutorial-host {
  position: relative;
}

.rgt-chat-tutorial[hidden] {
  display: none !important;
}

.rgt-chat-tutorial {
  position: absolute;
  z-index: 88;
  top: clamp(88px, 14%, 142px);
  left: 50%;
  width: min(420px, calc(100% - 30px));
  min-height: 104px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 14px 42px 13px 14px;
  color: var(--rgt-ink);
  border: 1px solid rgba(94, 231, 255, 0.62);
  border-radius: 20px;
  background:
    radial-gradient(circle at 15% 0%, rgba(94, 231, 255, 0.2), transparent 42%),
    linear-gradient(145deg, var(--rgt-panel-2), var(--rgt-panel));
  box-shadow: 0 18px 40px rgba(3, 5, 25, 0.38), 0 0 28px rgba(94, 231, 255, 0.16);
  opacity: 0;
  pointer-events: auto;
  transform: translate(-50%, -8px) scale(0.97);
  transform-origin: 50% 100%;
  transition: opacity 160ms ease, transform 220ms cubic-bezier(0.2, 0.9, 0.25, 1.12);
}

.rgt-chat-tutorial::after {
  content: "";
  position: absolute;
  left: var(--rgt-pointer-x, 50%);
  bottom: -12px;
  width: 22px;
  height: 22px;
  border-right: 1px solid rgba(94, 231, 255, 0.62);
  border-bottom: 1px solid rgba(94, 231, 255, 0.62);
  background: var(--rgt-panel);
  transform: translateX(-50%) rotate(45deg);
}

.rgt-chat-tutorial.is-open {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.rgt-chat-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  color: #10142f;
  font: 1000 22px/1 system-ui, sans-serif;
  background: linear-gradient(145deg, #fff8a8, var(--rgt-yellow));
  box-shadow: 0 7px 18px rgba(255, 212, 92, 0.26);
}

.rgt-chat-content {
  min-width: 0;
}

.rgt-chat-meta {
  display: block;
  margin-bottom: 3px;
  color: var(--rgt-cyan);
  font: 900 9px/1.2 system-ui, sans-serif;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.rgt-chat-title {
  display: block;
  font: 1000 clamp(16px, 2.6vw, 21px)/1.05 system-ui, sans-serif;
  letter-spacing: -0.025em;
}

.rgt-chat-description,
.rgt-chat-tip {
  margin: 5px 0 0;
  font: 750 11px/1.35 system-ui, sans-serif;
}

.rgt-chat-description {
  color: rgba(248, 251, 255, 0.84);
}

.rgt-chat-tip {
  color: #fff0a7;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.rgt-chat-actions {
  align-self: end;
  display: flex;
  gap: 6px;
  padding-top: 18px;
}

.rgt-chat-button,
.rgt-chat-close,
.rgt-help-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: system-ui, sans-serif;
}

.rgt-chat-button {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  color: #fff;
  font-size: 9px;
  font-weight: 1000;
  letter-spacing: 0.07em;
  background: rgba(255, 255, 255, 0.1);
}

.rgt-chat-ok {
  color: #10142f;
  background: linear-gradient(135deg, var(--rgt-yellow), #ff9f43);
}

.rgt-chat-close {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  color: rgba(255,255,255,.78);
  background: rgba(255, 255, 255, 0.09);
  font-size: 18px;
  line-height: 1;
}

.rgt-help-button {
  position: absolute;
  z-index: 82;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 12px 5px 6px;
  border: 1px solid rgba(94, 231, 255, 0.48);
  border-radius: 999px;
  color: #fff;
  background: rgba(11, 17, 40, 0.83);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.rgt-help-icon {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  color: #0e1730;
  background: linear-gradient(145deg, #d8ff9d, var(--rgt-cyan));
  font-size: 13px;
  font-weight: 1000;
}

.rgt-help-copy {
  font-size: 9px;
  font-weight: 1000;
  letter-spacing: 0.08em;
}

.rgt-blocked-toast {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: 28px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 18, 45, 0.94);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
  font: 850 11px/1.25 system-ui, sans-serif;
}

.rgt-blocked-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 640px) {
  .rgt-chat-tutorial {
    top: 82px;
    grid-template-columns: 36px minmax(0, 1fr);
    min-height: 96px;
    padding: 12px 38px 12px 12px;
  }

  .rgt-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 13px;
    font-size: 18px;
  }

  .rgt-chat-actions {
    grid-column: 2;
    justify-self: end;
    padding-top: 6px;
  }

  .rgt-chat-description {
    font-size: 10px;
  }

  .rgt-help-button {
    top: 10px;
    left: 10px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .rgt-chat-tutorial {
    top: 56px;
    width: min(500px, calc(100% - 110px));
    min-height: 78px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    padding-block: 9px;
  }

  .rgt-chat-avatar {
    width: 34px;
    height: 34px;
  }

  .rgt-chat-description {
    margin-top: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rgt-chat-tutorial,
  .rgt-blocked-toast {
    transition-duration: 1ms !important;
  }
}
