/* base card */
.hnaa-card {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  max-width: 720px;
  margin: 8px auto;
  display: flex;
  flex-direction: column;
  height: 520px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  background: #fff;
}
.hnaa-header {
  padding: 12px 16px;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hnaa-title {
  font-weight: 600;
}
.hnaa-close {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.hnaa-body {
  flex: 1;
  overflow: auto;
  background: #fafafa;
}
.hnaa-msgs {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hnaa-row {
  display: flex;
}
.hnaa-row.is-user {
  justify-content: flex-end;
}
.hnaa-bubble {
  max-width: 80%;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.hnaa-row.is-user .hnaa-bubble {
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.hnaa-row.is-bot .hnaa-bubble {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}
.hnaa-form {
  display: flex;
  gap: 8px;
  border-top: 1px solid #e5e7eb;
  padding: 10px;
  background: #fff;
}
.hnaa-input {
  flex: 1;
  resize: vertical;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font: inherit;
}
.hnaa-send {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #1f2937;
  cursor: pointer;
  background: #111827;
  color: #fff;
}
.hnaa-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.hnaa-chatbot-error {
  color: #b91c1c;
  font-weight: 600;
}

/* themes */
.hnaa-theme-dark .hnaa-card {
  border-color: #374151;
  box-shadow: none;
  background: #0f172a;
  color: #e5e7eb;
}
.hnaa-theme-dark .hnaa-header {
  border-color: #374151;
  background: #111827;
  color: #e5e7eb;
}
.hnaa-theme-dark .hnaa-body {
  background: #0b1220;
}
.hnaa-theme-dark .hnaa-row.is-bot .hnaa-bubble {
  background: #0f172a;
  border-color: #1f2937;
  color: #e5e7eb;
}
.hnaa-theme-dark .hnaa-form {
  background: #111827;
  border-color: #374151;
}
.hnaa-theme-dark .hnaa-input {
  background: #0f172a;
  border-color: #374151;
  color: #e5e7eb;
}
.hnaa-theme-dark .hnaa-send {
  background: #2563eb;
  border-color: #2563eb;
}

/* launcher button */
.hnaa-launcher {
  position: fixed;
  z-index: 9998;
  border-radius: 9999px;
  padding: 12px 16px;
  border: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  background: #111827;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.hnaa-launcher.pos-bottom-right {
  right: 20px;
  bottom: 120px;
}
.hnaa-launcher.pos-bottom-left {
  left: 20px;
  bottom: 120px;
}
.hnaa-launcher.pos-top-right {
  right: 20px;
  top: 20px;
}
.hnaa-launcher.pos-top-left {
  left: 20px;
  top: 20px;
}

/* modal */
.hnaa-modal-open {
  overflow: hidden;
}
.hnaa-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 9998;
}
.hnaa-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.hnaa-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 9999;
}
.hnaa-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.hnaa-modal-box {
  width: min(90vw, 820px);
  height: min(80vh, 680px);
  border-radius: 16px;
  overflow: hidden;
}
.hnaa-modal-chat {
  height: 100%;
}
.hnaa-theme-dark .hnaa-launcher {
  background: #2563eb;
}
