.wp-ai-chatbot {
  --wp-ai-chatbot-accent: #111111;
  --wp-ai-chatbot-accent-soft: rgba(17, 17, 17, 0.08);
  --wp-ai-chatbot-bg: #ffffff;
  --wp-ai-chatbot-border: rgba(17, 17, 17, 0.08);
  --wp-ai-chatbot-muted: #666666;
  --wp-ai-chatbot-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
  --wp-ai-chatbot-panel-shadow: 0 26px 80px rgba(0, 0, 0, 0.22);
  --wp-ai-chatbot-radius: 22px;
  --wp-ai-chatbot-input-radius: 18px;
  --wp-ai-chatbot-pad: 18px;
  font-family: "Avenir", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wp-ai-chatbot * { box-sizing: border-box; }

.wp-ai-chatbot button,
.wp-ai-chatbot input,
.wp-ai-chatbot textarea,
.wp-ai-chatbot button {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
}
.wp-ai-chatbot--floating {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99999;
  width: 62px;
  height: 62px;
  pointer-events: auto;
}
.wp-ai-chatbot--embedded { max-width: 420px; width: 100%; }
.wp-ai-chatbot__toggle,
.wp-ai-chatbot__panel,
.wp-ai-chatbot__send,
.wp-ai-chatbot__close,
.wp-ai-chatbot__lead-submit,
.wp-ai-chatbot__lead-toggle {
  pointer-events: auto;
}

.wp-ai-chatbot__toggle,
.wp-ai-chatbot__send,
.wp-ai-chatbot__close,
.wp-ai-chatbot__lead-submit {
  color: #111;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0 !important;
  padding: 0 !important;
  width: 100%;
  min-height: 0 !important;
  justify-self: stretch;
  margin-left: auto;
  cursor: pointer;
  display: block !important;
  vertical-align: middle;
  text-align: end!important;
  text-decoration: underline!important;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  border-bottom: 0 !important;
}

.wp-ai-chatbot__toggle {
  width: 62px;
  height: 62px;
  padding: 20px !important;
  font-size: 0 !important;
  line-height: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 999px !important;
  color: #111;
  background: #fff !important;
  cursor: pointer;
  box-shadow: var(--wp-ai-chatbot-shadow) !important;
  transform: translateY(0) scale(1);
  transition: transform .4s ease, box-shadow .4s ease;
  overflow: hidden;
  flex: 0 0 auto;
}

.wp-ai-chatbot__toggle:hover,
.wp-ai-chatbot__toggle:focus,
.wp-ai-chatbot__toggle:active {
  background: #fff !important;
  color: #111 !important;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 28px 76px rgba(0, 0, 0, 0.24) !important;
}
.wp-ai-chatbot__toggle:active { transform: scale(0.96); }
.wp-ai-chatbot__toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0 !important;
}
.wp-ai-chatbot__toggle-icon--open { display: none; width: 24px; height: 24px; position: relative; font-size: 0 !important; line-height: 0 !important; }
.wp-ai-chatbot.is-open .wp-ai-chatbot__toggle-icon--closed { display: none; }
.wp-ai-chatbot.is-open .wp-ai-chatbot__toggle-icon--open { display: inline-flex; }
.wp-ai-chatbot__toggle-message-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #111;
  position: relative;
  display: inline-block;
}
.wp-ai-chatbot__toggle-message-icon::before {
  content: '';
  position: absolute;
  left: 8px;
  bottom: -4px;
  width: 9px;
  height: 9px;
  background: #111;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.wp-ai-chatbot__toggle-message-icon::after {
  content: '';
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  height: 9px;
  border-bottom: 3px solid #fff;
  border-radius: 0 0 12px 12px;
}
.wp-ai-chatbot__panel {
  width: min(420px, calc(100vw - 32px));
  height: min(600px, calc(100vh - 144px));
  max-height: calc(100vh - 144px);
  background: var(--wp-ai-chatbot-bg);
  border: 1px solid var(--wp-ai-chatbot-border);
  border-radius: var(--wp-ai-chatbot-radius);
  box-shadow: var(--wp-ai-chatbot-panel-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.wp-ai-chatbot--floating .wp-ai-chatbot__panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(0.92);
  transform-origin: bottom right;
  transition: opacity .4s ease, transform .4s ease, visibility .4s ease;
}
.wp-ai-chatbot--floating.is-open .wp-ai-chatbot__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.wp-ai-chatbot--embedded .wp-ai-chatbot__panel { width: 100%; height: 680px; max-height: none; }
.wp-ai-chatbot__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: var(--wp-ai-chatbot-pad);
  border-bottom: 1px solid var(--wp-ai-chatbot-border);
  background: #fff;
}
.wp-ai-chatbot__title { font-size: 16px; line-height: 1.2; font-weight: 700; color: #111; }
.wp-ai-chatbot__subtitle { font-size: 12px; color: var(--wp-ai-chatbot-muted); margin-top: 4px; }
.wp-ai-chatbot__close {
  color: #111;
  font-size: 24px !important;
  line-height: 1 !important;
  cursor: pointer;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  flex: 0 0 auto;
  border-radius: 0 !important;
  align-self: center;
}
.wp-ai-chatbot__close:hover,
.wp-ai-chatbot__close:focus,
.wp-ai-chatbot__close:active,
.wp-ai-chatbot__send:hover,
.wp-ai-chatbot__send:focus,
.wp-ai-chatbot__send:active,
.wp-ai-chatbot__lead-submit:hover,
.wp-ai-chatbot__lead-submit:focus,
.wp-ai-chatbot__lead-submit:active {
  opacity: 1;
  color: #111 !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}
.wp-ai-chatbot__messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--wp-ai-chatbot-pad);
  background: #fafafa;
}
.wp-ai-chatbot__message { display: flex; margin-bottom: 12px; }
.wp-ai-chatbot__message--user { justify-content: flex-end; }
.wp-ai-chatbot__bubble {
  max-width: 85%;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.wp-ai-chatbot__bubble a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.wp-ai-chatbot__message--assistant .wp-ai-chatbot__bubble { background: #f1f1f1; color: #111; border-bottom-left-radius: 8px; }
.wp-ai-chatbot__message--user .wp-ai-chatbot__bubble { background: var(--wp-ai-chatbot-accent); color: #fff; border-bottom-right-radius: 8px; }
.wp-ai-chatbot__typing-dots { display: inline-flex; align-items: center; gap: 4px; }
.wp-ai-chatbot__typing-dots span {
  width: 6px; height: 6px; border-radius: 999px; background: #999; display: inline-block;
  animation: wpAiChatbotTyping 1.2s infinite ease-in-out;
}
.wp-ai-chatbot__typing-dots span:nth-child(2) { animation-delay: .15s; }
.wp-ai-chatbot__typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes wpAiChatbotTyping { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-3px); opacity: 1; } }
.wp-ai-chatbot__lead {
  border-top: 1px solid var(--wp-ai-chatbot-border);
  padding: 0 var(--wp-ai-chatbot-pad);
}
.wp-ai-chatbot__lead-toggle {
  width: 100% !important;
  display: flex !important;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  cursor: pointer;
  color: #111;
  background: transparent !important;
  padding: 14px 0 !important;
  text-align: left;
  min-height: 32px;
  line-height: 1.2;
}
.wp-ai-chatbot__lead-toggle > * {
  display: inline-flex;
  align-items: center;
}

.wp-ai-chatbot__lead-toggle:hover,
.wp-ai-chatbot__lead-toggle:focus,
.wp-ai-chatbot__lead-toggle:active {
  background: transparent !important;
  color: #111 !important;
  box-shadow: none !important;
}
.wp-ai-chatbot__lead-toggle-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}
.wp-ai-chatbot__lead-chevron {
  width: 12px;
  height: 15.6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 0 0 auto;
}
.wp-ai-chatbot__lead-chevron::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid currentColor;
  transition: transform .4s ease;
  transform-origin: 35% 50%;
  transform: translateY(-50%);
}
.wp-ai-chatbot__lead.is-open .wp-ai-chatbot__lead-chevron::before {
  transform: translateY(-50%) rotate(90deg);
}
.wp-ai-chatbot__lead-inner {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease, opacity .4s ease, padding-bottom .4s ease;
  opacity: 0;
  padding-bottom: 0;
}
.wp-ai-chatbot__lead.is-open .wp-ai-chatbot__lead-inner {
  opacity: 1;
  padding-bottom: var(--wp-ai-chatbot-pad);
}
.wp-ai-chatbot__lead-inner-content {
  overflow: hidden;
  padding-top: 2px;
}
.wp-ai-chatbot__lead p {
  font-size: 12px;
  color: var(--wp-ai-chatbot-muted);
  margin: 0 0 12px;
}
.wp-ai-chatbot__lead-form { display: grid; gap: 10px; }
.wp-ai-chatbot__lead-form input,
.wp-ai-chatbot__lead-form textarea {
  width: 100%;
  border: 1px solid var(--wp-ai-chatbot-border)!important;
  border-radius: 10px !important;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.4;
  background: #fff;
  outline: none;
}
.wp-ai-chatbot__input { min-height: 48px; max-height: 140px; resize: none; outline: none; margin-top: 0; width: 100%!important; display: inline-block!important; border-radius: 0 !important;}
.wp-ai-chatbot__lead-submit {
  color: #111;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0 !important;
  padding: 0 !important;
  width: auto;
  min-height: 0 !important;
  justify-self: stretch;
  margin-left: auto;
  cursor: pointer;
  display: inline-block !important;
  vertical-align: middle;
  text-align: end!important;
  text-decoration: underline!important;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  border-bottom: 0 !important;
}
.wp-ai-chatbot__lead-feedback { font-size: 12px; color: var(--wp-ai-chatbot-muted); position: absolute;   bottom: 20px;}
.wp-ai-chatbot__form {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: var(--wp-ai-chatbot-pad);
  border-top: 1px solid var(--wp-ai-chatbot-border);
  background: #fff;
}

.wp-ai-chatbot__send {
  color: #111;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px;
  display: flex !important;
  align-items: center!important;
  justify-content: end!important;
  align-self: center;
  cursor: pointer;
  transition: transform 160ms ease;
  padding: 0 !important;
  margin: 0 !important;
  position: relative;
  flex: 0 0 auto;
}

.wp-ai-chatbot__send:hover { transform: translateY(-1px); }
.wp-ai-chatbot__send:disabled { opacity: .45; cursor: not-allowed; }
.wp-ai-chatbot__send-icon {
  display: block;
  width: 18px;
  height: 18px;
  background: url('up-arrow.svg') center center / 18px 18px no-repeat;
  font-size: 0 !important;
  line-height: 0 !important;
}


.wp-ai-chatbot__toggle-icon--open::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 38%;
  width: 12px;
  height: 12px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}
.wp-ai-chatbot__close span { display: inline-block; transform: translateY(0); font-size: 24px !important; line-height: 1 !important; }
.wp-ai-chatbot__lead-submit::after { content: none !important; }
.wp-ai-chatbot__form.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  height: 0;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-width: 0;
  overflow: hidden;
}
.wp-ai-chatbot__input-wrap {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

@media (max-width: 640px) {
  .wp-ai-chatbot--floating { right: 12px; bottom: 12px; }
  .wp-ai-chatbot--floating .wp-ai-chatbot__panel {
    width: min(100vw - 24px, 420px);
    height: min(72vh, calc(100vh - 112px));
    max-height: calc(100vh - 112px);
  }
}
