:root {
  --apihub-action-blue: #579fe2;
  --apihub-action-purple: #8b5cf6;
  --apihub-action-ink: #111827;
  --apihub-action-muted: #667085;
  --apihub-action-surface: rgba(255, 255, 255, 0.98);
  --apihub-action-border: rgba(148, 163, 184, 0.28);
  --apihub-action-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
}

.apihub-purchase-cta {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid rgba(99, 102, 241, 0.24);
  border-radius: 10px;
  background: linear-gradient(135deg, var(--apihub-action-blue), var(--apihub-action-purple));
  color: #fff;
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.2);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: box-shadow 200ms ease, filter 200ms ease;
}

.apihub-purchase-cta:hover {
  color: #fff;
  filter: brightness(1.04);
  box-shadow: 0 14px 30px rgba(99, 102, 241, 0.28);
}

.apihub-purchase-cta:active {
  filter: brightness(0.96);
}

.apihub-purchase-cta:focus-visible,
.apihub-support-trigger:focus-visible,
.apihub-support-close:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.46);
  outline-offset: 3px;
}

.apihub-purchase-icon,
.apihub-purchase-arrow {
  width: 17px;
  height: 17px;
  display: inline-flex;
  flex: 0 0 auto;
}

.apihub-purchase-arrow {
  width: 15px;
  height: 15px;
  opacity: 0.86;
}

.apihub-purchase-icon svg,
.apihub-purchase-arrow svg,
.apihub-support-trigger svg,
.apihub-support-close svg,
.apihub-support-eyebrow svg,
.apihub-support-services svg,
.apihub-support-hint svg {
  width: 100%;
  height: 100%;
}

.apihub-support-root {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
}

.apihub-support-label {
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--apihub-action-border);
  border-radius: 14px;
  background: var(--apihub-action-surface);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  color: var(--apihub-action-ink);
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

.apihub-support-label strong {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
}

.apihub-support-root:hover .apihub-support-label,
.apihub-support-root:focus-within .apihub-support-label {
  opacity: 1;
  transform: translateX(0);
}

.apihub-support-trigger {
  position: relative;
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 19px;
  background: linear-gradient(145deg, var(--apihub-action-blue), var(--apihub-action-purple));
  box-shadow: 0 16px 34px rgba(79, 70, 229, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  color: #fff;
  cursor: pointer;
  animation: apihub-support-float 3.2s ease-in-out infinite;
  transition: box-shadow 200ms ease, filter 200ms ease;
}

.apihub-support-trigger:hover {
  filter: brightness(1.05);
  box-shadow: 0 20px 40px rgba(79, 70, 229, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.apihub-support-trigger:active {
  filter: brightness(0.96);
}

.apihub-support-trigger-icon {
  width: 27px;
  height: 27px;
  display: inline-flex;
}

.apihub-support-online {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 13px;
  height: 13px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #22c55e;
}

@keyframes apihub-support-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.apihub-support-dialog {
  position: fixed;
  inset: 0;
  width: min(420px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: var(--apihub-action-ink);
  overflow: visible;
}

.apihub-support-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(5px);
}

.apihub-support-dialog[open] {
  animation: apihub-dialog-enter 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes apihub-dialog-enter {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.apihub-support-dialog-fallback {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 50;
  transform: translate(-50%, -50%);
}

.apihub-support-card {
  position: relative;
  max-height: calc(100dvh - 32px);
  padding: 26px;
  border: 1px solid var(--apihub-action-border);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 0%, rgba(96, 165, 250, 0.12), transparent 34%),
    radial-gradient(circle at 100% 8%, rgba(139, 92, 246, 0.1), transparent 32%),
    var(--apihub-action-surface);
  box-shadow: var(--apihub-action-shadow);
  overflow: auto;
  overscroll-behavior: contain;
}

.apihub-support-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: rgba(148, 163, 184, 0.1);
  color: #475569;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.apihub-support-close:hover {
  background: rgba(148, 163, 184, 0.18);
  color: #0f172a;
}

.apihub-support-close svg {
  width: 20px;
  height: 20px;
}

.apihub-support-header {
  padding-right: 48px;
}

.apihub-support-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.apihub-support-eyebrow svg {
  width: 16px;
  height: 16px;
}

.apihub-support-header h2 {
  margin: 9px 0 0;
  color: #0f172a;
  font-size: 25px;
  font-weight: 720;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.apihub-support-header p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.apihub-support-qr-frame {
  width: min(100%, 302px);
  margin: 20px auto 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.apihub-support-qr-frame img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.apihub-support-services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.apihub-support-services li {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 8px;
  border: 1px solid rgba(99, 102, 241, 0.14);
  border-radius: 11px;
  background: rgba(99, 102, 241, 0.06);
  color: #334155;
  font-size: 12px;
  font-weight: 560;
  white-space: nowrap;
}

.apihub-support-services svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: #6366f1;
}

.apihub-support-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 14px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.apihub-support-hint svg {
  width: 16px;
  height: 16px;
}

.dark .apihub-support-label,
.dark .apihub-support-card {
  --apihub-action-surface: rgba(15, 23, 42, 0.98);
  --apihub-action-border: rgba(148, 163, 184, 0.22);
  --apihub-action-ink: #f8fafc;
  --apihub-action-muted: #aab5c5;
  color: #f8fafc;
}

.dark .apihub-support-card {
  background:
    radial-gradient(circle at 12% 0%, rgba(96, 165, 250, 0.17), transparent 34%),
    radial-gradient(circle at 100% 8%, rgba(139, 92, 246, 0.16), transparent 32%),
    rgba(15, 23, 42, 0.98);
}

.dark .apihub-support-header h2,
.dark .apihub-support-close {
  color: #f8fafc;
}

.dark .apihub-support-header p,
.dark .apihub-support-hint {
  color: #b6c0cf;
}

.dark .apihub-support-close {
  background: rgba(148, 163, 184, 0.13);
}

.dark .apihub-support-close:hover {
  background: rgba(148, 163, 184, 0.22);
}

.dark .apihub-support-eyebrow {
  color: #a5b4fc;
}

.dark .apihub-support-services li {
  border-color: rgba(129, 140, 248, 0.22);
  background: rgba(99, 102, 241, 0.12);
  color: #e2e8f0;
}

.dark .apihub-support-services svg {
  color: #a5b4fc;
}

@media (max-width: 640px) {
  .apihub-purchase-cta {
    padding-inline: 15px;
  }

  .apihub-support-root {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .apihub-support-label {
    display: none;
  }

  .apihub-support-trigger {
    width: 54px;
    height: 54px;
    border-radius: 18px;
  }

  .apihub-support-card {
    padding: 22px 18px 20px;
    border-radius: 21px;
  }

  .apihub-support-header {
    padding-right: 44px;
  }

  .apihub-support-header h2 {
    font-size: 22px;
  }

  .apihub-support-qr-frame {
    width: min(100%, 274px);
    margin-top: 16px;
    padding: 10px;
  }

  .apihub-support-services {
    gap: 6px;
    margin-top: 14px;
  }

  .apihub-support-services li {
    padding-inline: 5px;
    font-size: 11px;
  }
}

@media (max-width: 390px) {
  .apihub-purchase-cta {
    flex: 1 1 100%;
    width: 100%;
  }

  .apihub-support-dialog {
    width: calc(100vw - 20px);
  }

  .apihub-support-card {
    max-height: calc(100dvh - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .apihub-purchase-cta,
  .apihub-support-label,
  .apihub-support-trigger,
  .apihub-support-dialog[open] {
    animation: none !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
