/* ContentTraker SDK Q&A */
.empowered-sales-agent-window:has(.snapchingiq-qna) {
  right: 1rem;
  bottom: 1rem;
  width: min(22.5rem, calc(100vw - 2rem));
  min-width: 16rem;
  max-width: none;
  min-height: 0;
  max-height: none;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  z-index: 1100;
  height: auto;
}

.snapchingiq-qna {
  --phx-chat-accent: #6c2eb9;
  --phx-chat-accent-hover: #4b167e;
  --phx-chat-input-focus-ring: rgba(108, 46, 185, 0.2);
  --phx-chat-title-color: #35105a;
  --phx-chat-subtitle-color: #607080;
  --phx-chat-header-bg: #f8f5ff;
  --phx-chat-user-bubble-bg: #6c2eb9;
  --phx-chat-chip-hover-bg: #f2eaff;
  --phx-chat-chip-hover-border: #b88af0;
  --phx-chat-chip-hover-color: #4b167e;
}

.snapchingiq-qna-open {
  width: 100%;
  border: 0;
  padding: 0.95rem 1.1rem;
  background: #6c2eb9;
  color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(53, 16, 90, 0.18);
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  transition: background 0.15s ease, transform 0.15s ease;
}

.snapchingiq-qna-open:hover {
  background: #4b167e;
  transform: translateY(-1px);
}

.snapchingiq-qna-open:focus-visible {
  outline: 3px solid rgba(108, 46, 185, 0.32);
  outline-offset: 2px;
}

.phx-chat-popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.24);
  z-index: 1050;
}

.phx-chat-popup-dialog {
  --phx-chat-popup-width: 34rem;
  --phx-chat-popup-height: 42rem;
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: min(var(--phx-chat-popup-width), calc(100vw - 2rem));
  height: min(var(--phx-chat-popup-height), calc(100vh - 2rem));
  height: min(var(--phx-chat-popup-height), calc(100dvh - 2rem));
  border-radius: 1rem;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.phx-chat-popup-dialog .phx-chat {
  height: 100%;
  border-radius: inherit;
}

.phx-chat-popup-close {
  border: 1px solid #d1d5db;
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  background: #ffffff;
  color: #475569;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.phx-chat-popup-close:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.snapchingiq-qna-popup-dialog {
  display: flex;
  flex-direction: column;
  --phx-chat-popup-width: 42rem;
  --phx-chat-popup-height: 44rem;
}

.snapchingiq-qna-popup-dialog .phx-chat {
  flex: 1;
  min-height: 0;
  height: auto;
}

.book-chat-privacy {
  flex-shrink: 0;
  margin: 0;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: #475569;
}

.book-chat-purchase {
  margin: 0.75rem 0 0;
}

.snapchingiq-qna-chat {
  border-radius: 8px;
  overflow: hidden;
}

.snapchingiq-qna-chat-title {
  color: #35105a;
}

.snapchingiq-qna-chat-send-btn {
  background: #00747a;
}

.snapchingiq-qna-chat-send-btn:hover:not(:disabled) {
  background: #005d62;
}

@media (max-width: 768px) {
  .empowered-sales-agent-window:has(.snapchingiq-qna) {
    right: 0.75rem;
    bottom: 0.75rem;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    width: calc(100vw - 1.5rem);
    min-width: 0;
  }

  .snapchingiq-qna-popup-dialog {
    --phx-chat-popup-width: calc(100vw - 1rem);
    --phx-chat-popup-height: calc(100vh - 1rem);
    --phx-chat-popup-height: calc(100dvh - 1rem);
    right: 0.5rem;
    bottom: 0.5rem;
    width: calc(100vw - 1rem);
    height: calc(100vh - 1rem);
    height: calc(100dvh - 1rem);
  }
}
