.idp-ai-chatbot {
  --idp-ai-chatbot-bottom: 22px;
  --idp-ai-chatbot-left: 22px;
  --idp-ai-chatbot-right: 22px;
  bottom: var(--idp-ai-chatbot-bottom);
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  position: fixed;
  right: var(--idp-ai-chatbot-right);
  z-index: 99999;
}
.idp-ai-chatbot-bottom-left {
  left: var(--idp-ai-chatbot-left);
  right: auto;
}
.idp-ai-chatbot-bottom-right {
  left: auto;
  right: var(--idp-ai-chatbot-right);
}
.idp-ai-chatbot-toggle {
  background: #111827;
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  min-height: 46px;
  padding: 0 18px;
}
.idp-ai-chatbot.open .idp-ai-chatbot-toggle,
.idp-ai-chatbot.minimized .idp-ai-chatbot-toggle {
  display: none;
}
.idp-ai-chatbot-panel {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  bottom: 58px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .22);
  display: none;
  flex-direction: column;
  height: min(560px, calc(100vh - 120px));
  overflow: hidden;
  position: absolute;
  right: 0;
  width: min(380px, calc(100vw - 32px));
}
.idp-ai-chatbot-bottom-left .idp-ai-chatbot-panel {
  left: 0;
  right: auto;
}
.idp-ai-chatbot.open .idp-ai-chatbot-panel,
.idp-ai-chatbot.minimized .idp-ai-chatbot-panel,
.idp-ai-chatbot-preview .idp-ai-chatbot-panel,
.idp-ai-chatbot-panel[aria-hidden="false"] {
  display: flex;
}
.idp-ai-chatbot.minimized .idp-ai-chatbot-panel {
  height: auto;
  width: min(320px, calc(100vw - 32px));
}
.idp-ai-chatbot.minimized .idp-ai-chatbot-messages,
.idp-ai-chatbot.minimized .idp-ai-chatbot-panel form {
  display: none;
}
.idp-ai-chatbot-panel header {
  align-items: center;
  background: #111827;
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;
}
.idp-ai-chatbot-panel header strong {
  font-size: 16px;
  line-height: 1.25;
}
.idp-ai-chatbot-panel header button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  height: 32px;
  line-height: 1;
  min-width: 32px;
}
.idp-ai-chatbot-panel header button:hover,
.idp-ai-chatbot-panel header button:focus {
  background: rgba(255, 255, 255, .12);
}
.idp-ai-chatbot-messages {
  background: #f8fafc;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 14px;
}
.idp-ai-chatbot-message {
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
  max-width: 86%;
  padding: 9px 11px;
  white-space: pre-wrap;
  word-break: break-word;
}
.idp-ai-chatbot-message.user {
  align-self: flex-end;
  background: #1d4ed8;
  color: #fff;
}
.idp-ai-chatbot-message.assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #111827;
}
.idp-ai-chatbot-message a {
  color: #1d4ed8;
  text-decoration: underline;
}
.idp-ai-chatbot-message.loading {
  color: #6b7280;
}
.idp-ai-chatbot-panel form {
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  padding: 10px;
}
.idp-ai-chatbot-panel textarea {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  flex: 1;
  font: 14px/1.4 Arial, sans-serif;
  min-height: 44px;
  padding: 8px;
  resize: vertical;
}
.idp-ai-chatbot-panel form button {
  background: #111827;
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  padding: 0 14px;
}
@media (max-width: 520px) {
  .idp-ai-chatbot {
    bottom: min(var(--idp-ai-chatbot-bottom), 12px);
    left: 12px;
    right: 12px;
  }
  .idp-ai-chatbot-panel {
    bottom: 54px;
    left: 0;
    right: 0;
    width: calc(100vw - 24px);
  }
  .idp-ai-chatbot.minimized .idp-ai-chatbot-panel {
    width: calc(100vw - 24px);
  }
}
