#ai-chatbot-wp-root {
  --ai-chatbot-primary: #46e5c4;
  --ai-chatbot-primary-dim: rgba(70, 229, 196, 0.16);
  --ai-chatbot-primary-mid: rgba(70, 229, 196, 0.42);
  --ai-chatbot-violet: #8b7cff;
  --ai-chatbot-blue: #4c8dff;
  --ai-chatbot-gradient: linear-gradient(110deg, var(--ai-chatbot-primary), var(--ai-chatbot-blue) 52%, var(--ai-chatbot-violet));
  --ai-chatbot-navy: #0a0e1a;
  --ai-chatbot-navy-light: #111634;
  --ai-chatbot-steel: #1a2044;
  --ai-chatbot-steel-dark: rgba(255, 255, 255, 0.14);
  --ai-chatbot-text: #f7f8ff;
  --ai-chatbot-muted: #a5acc8;
  --ai-chatbot-white: #ffffff;
  --ai-chatbot-radius: 14px;
  --ai-chatbot-radius-sm: 8px;
  --ai-chatbot-width: 370px;
  --ai-chatbot-bottom: 108px;
  --ai-chatbot-side: 22px;
  --ai-chatbot-shadow: 0 22px 60px rgba(3, 6, 18, 0.48), 0 4px 14px rgba(3, 6, 18, 0.34);
  --ai-chatbot-font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --ai-chatbot-mono: 'SF Mono', 'Fira Code', monospace;
}

#ai-chatbot-wp-root *,
#ai-chatbot-wp-root *::before,
#ai-chatbot-wp-root *::after {
  box-sizing: border-box;
}

#ai-chatbot-wp-root button,
#ai-chatbot-wp-root input,
#ai-chatbot-wp-root textarea {
  box-sizing: border-box !important;
  font-family: var(--ai-chatbot-font) !important;
  letter-spacing: normal;
  text-transform: none;
}

#ai-chatbot-wp-root button {
  min-width: 0 !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

#ai-chatbot-bubble {
  position: fixed !important;
  bottom: 104px !important;
  right: 27px;
  left: auto !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% 50% 50% 50% !important;
  background: var(--ai-chatbot-gradient) !important;
  box-shadow: 0 7px 24px rgba(76, 141, 255, 0.34), 0 2px 8px rgba(0,0,0,0.24);
  cursor: pointer;
  z-index: 2147483646 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border: 0 !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  outline: none;
  padding: 0 !important;
  line-height: 1 !important;
}

#ai-chatbot-wp-root[data-position="left"] #ai-chatbot-bubble {
  right: auto !important;
  left: var(--ai-chatbot-side) !important;
  border-radius: 50% 50% 50% 5px !important;
}

#ai-chatbot-bubble:hover {
  transform: scale(1.07);
  box-shadow: 0 10px 32px rgba(139, 124, 255, 0.4), 0 3px 10px rgba(0,0,0,0.26);
}

#ai-chatbot-bubble:active {
  transform: scale(0.96);
}

#ai-chatbot-bubble:focus-visible,
#ai-chatbot-close:focus-visible,
#ai-chatbot-send:focus-visible,
.ai-chatbot-lead-submit:focus-visible {
  outline: 3px solid var(--ai-chatbot-primary-mid);
  outline-offset: 3px;
}

#ai-chatbot-bubble svg {
  width: 30px !important;
  height: 30px !important;
  fill: #fff !important;
  pointer-events: none !important;
}

#ai-chatbot-bubble img {
  width: 35px !important;
  height: auto !important;
  max-width: 35px !important;
  max-height: 35px !important;
  margin-left: 2px;
  object-fit: contain;
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
}

#ai-chatbot-window {
  z-index: 2147483647 !important;
  position: fixed !important;
  bottom: calc(var(--ai-chatbot-bottom) + 144px) !important;
  right: var(--ai-chatbot-side) !important;
  left: auto !important;
  width: min(var(--ai-chatbot-width), calc(100vw - (2 * var(--ai-chatbot-side)))) !important;
  max-width: calc(100vw - (2 * var(--ai-chatbot-side))) !important;
  height: min(540px, calc(100dvh - var(--ai-chatbot-bottom) - 100px)) !important;
  max-height: calc(100dvh - var(--ai-chatbot-bottom) - 100px) !important;
  background:
    radial-gradient(circle at 80% 0, rgba(76, 141, 255, 0.08), transparent 42%),
    var(--ai-chatbot-navy);
  border-radius: var(--ai-chatbot-radius);
  box-shadow: var(--ai-chatbot-shadow);
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--ai-chatbot-font);
  transform-origin: bottom right;
  transition: opacity 0.22s ease, transform 0.22s ease;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: normal;
}

#ai-chatbot-wp-root[data-position="left"] #ai-chatbot-window {
  right: auto !important;
  left: var(--ai-chatbot-side) !important;
  transform-origin: bottom left;
}

#ai-chatbot-window.ai-chatbot-hidden {
  opacity: 0;
  transform: scale(0.9) translateY(12px);
  pointer-events: none;
}

#ai-chatbot-header {
  background: var(--ai-chatbot-navy-light);
  background-image:
    radial-gradient(circle at 15% 0, rgba(70, 229, 196, 0.08), transparent 45%),
    linear-gradient(180deg, var(--ai-chatbot-navy-light) 0%, var(--ai-chatbot-navy) 100%);
  padding: 0;
  display: block !important;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(70, 229, 196, 0.16);
}

#ai-chatbot-header-main {
  min-height: 54px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#ai-chatbot-header-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--ai-chatbot-white);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

#ai-chatbot-header-title .ai-chatbot-header-bullet {
  display: block;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  overflow: visible;
  fill: none;
  stroke: url(#ai-chatbot-header-bullet-gradient);
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(70, 229, 196, 0.24));
}

#ai-chatbot-close {
  background: none !important;
  border: 0 !important;
  cursor: pointer;
  width: 26px !important;
  height: 26px !important;
  padding: 4px !important;
  border-radius: 6px !important;
  color: rgba(255,255,255,0.64);
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

#ai-chatbot-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

#ai-chatbot-close svg {
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor !important;
  fill: none !important;
}

#ai-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  position: relative;
  min-height: 0;
  scrollbar-color: var(--ai-chatbot-steel-dark) transparent;
  scrollbar-width: thin;
  background: transparent;
}

#ai-chatbot-messages::-webkit-scrollbar {
  width: 3px;
}

#ai-chatbot-messages::-webkit-scrollbar-button,
#ai-chatbot-input::-webkit-scrollbar-button,
.ai-chatbot-lead-form textarea::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

#ai-chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

#ai-chatbot-messages::-webkit-scrollbar-thumb {
  background: var(--ai-chatbot-steel-dark);
  border-radius: 999px;
}

#ai-chatbot-messages::-webkit-scrollbar-thumb:hover,
#ai-chatbot-input::-webkit-scrollbar-thumb:hover,
.ai-chatbot-lead-form textarea::-webkit-scrollbar-thumb:hover { background: var(--ai-chatbot-muted); }

#ai-chatbot-watermark {
  position: sticky;
  top: 50%;
  transform: translateY(-50%);
  align-self: center;
  width: 100%;
  height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ai-chatbot-steel-dark);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

#ai-chatbot-watermark img {
  width: 72px;
  height: 72px;
  opacity: 0.12;
  object-fit: contain;
}

#ai-chatbot-watermark p {
  font-size: 12px;
  opacity: 0.55;
  text-align: center;
  line-height: 1.5;
}

.ai-chatbot-message {
  position: relative;
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
  z-index: 2;
}

.ai-chatbot-user {
  background: var(--ai-chatbot-gradient);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--ai-chatbot-navy);
  margin-left: auto;
  border-bottom-right-radius: 4px;
  box-shadow: 0 7px 18px rgba(76, 141, 255, 0.16);
}

.ai-chatbot-bot {
  background: rgba(26, 32, 68, 0.88);
  border: 1px solid var(--ai-chatbot-steel-dark);
  backdrop-filter: blur(8px);
  color: var(--ai-chatbot-text);
  border-bottom-left-radius: 4px;
}

.ai-chatbot-message p {
  margin: 0 0 6px;
}

.ai-chatbot-message p:last-child {
  margin-bottom: 0;
}

.ai-chatbot-message ul,
.ai-chatbot-message ol {
  padding-left: 18px;
  margin: 6px 0;
}

.ai-chatbot-message li {
  margin: 3px 0;
}

.ai-chatbot-message strong {
  font-weight: 650;
}

.ai-chatbot-message code {
  background: rgba(255,255,255,0.09);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--ai-chatbot-mono);
  font-size: 12px;
}

.ai-chatbot-message pre code {
  background: none;
  padding: 0;
}

.ai-chatbot-message pre {
  background: rgba(3,6,18,0.38);
  padding: 10px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 8px 0;
}

.ai-chatbot-message h1,
.ai-chatbot-message h2,
.ai-chatbot-message h3 {
  margin: 10px 0 4px;
  font-size: 14px;
}

.ai-chatbot-message a {
  color: var(--ai-chatbot-primary);
  text-underline-offset: 2px;
}

.ai-chatbot-user a {
  color: var(--ai-chatbot-navy);
}

.ai-chatbot-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  min-height: 22px;
}

.ai-chatbot-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ai-chatbot-primary);
  animation: ai-chatbot-bounce 1.3s infinite ease-in-out;
}

.ai-chatbot-typing span:nth-child(2) {
  animation-delay: 0.18s;
}

.ai-chatbot-typing span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes ai-chatbot-bounce {
  0%, 80%, 100% { transform: translateY(0) scale(0.75); opacity: 0.5; }
  40% { transform: translateY(-5px) scale(1); opacity: 1; }
}

#ai-chatbot-input-row {
  display: flex !important;
  align-items: flex-end;
  gap: 0;
  border-top: 1px solid var(--ai-chatbot-steel-dark);
  background: var(--ai-chatbot-navy-light);
  padding: 10px 12px;
  width: 100%;
  flex-shrink: 0;
}

#ai-chatbot-input {
  display: block !important;
  flex: 1 1 auto !important;
  width: auto !important;
  border: 1px solid var(--ai-chatbot-steel-dark) !important;
  border-radius: var(--ai-chatbot-radius-sm) !important;
  padding: 9px 12px !important;
  margin: 0 !important;
  font-size: 13.5px !important;
  outline: none;
  resize: none !important;
  max-height: 100px !important;
  min-height: 38px !important;
  height: 38px !important;
  line-height: 1.45 !important;
  color: var(--ai-chatbot-text);
  transition: border-color 0.15s;
  background: rgba(3, 6, 18, 0.46) !important;
  box-shadow: none !important;
  overflow-y: auto;
  scrollbar-color: var(--ai-chatbot-steel-dark) transparent;
  scrollbar-width: thin;
  appearance: none;
  -webkit-appearance: none;
  cursor: text !important;
}

#ai-chatbot-input::-webkit-scrollbar,
.ai-chatbot-lead-form textarea::-webkit-scrollbar {
  width: 3px;
}

#ai-chatbot-input::-webkit-scrollbar-track,
.ai-chatbot-lead-form textarea::-webkit-scrollbar-track {
  background: transparent;
}

#ai-chatbot-input::-webkit-scrollbar-thumb,
.ai-chatbot-lead-form textarea::-webkit-scrollbar-thumb {
  background: var(--ai-chatbot-steel-dark);
  border-radius: 999px;
}

.ai-chatbot-lead-form textarea { cursor: text !important; }

#ai-chatbot-input:focus {
  border-color: var(--ai-chatbot-primary);
}

#ai-chatbot-input:focus-visible,
.ai-chatbot-lead-form input:focus-visible,
.ai-chatbot-lead-form textarea:focus-visible {
  outline: 3px solid var(--ai-chatbot-primary-mid);
  outline-offset: 2px;
}

#ai-chatbot-input::placeholder {
  color: var(--ai-chatbot-muted);
}

#ai-chatbot-send {
  margin: 2px 0 2px 6px !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: var(--ai-chatbot-radius-sm) !important;
  background: var(--ai-chatbot-gradient) !important;
  border: 0 !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
  outline: none;
  padding: 0 !important;
  line-height: 1 !important;
}

#ai-chatbot-send:hover {
  filter: brightness(0.92);
}

#ai-chatbot-send:active {
  transform: scale(0.93);
}

#ai-chatbot-send:disabled {
  background: var(--ai-chatbot-steel) !important;
  cursor: not-allowed;
  transform: none;
}

#ai-chatbot-send:disabled svg {
  stroke: var(--ai-chatbot-muted) !important;
}

#ai-chatbot-send svg {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  fill: none !important;
  stroke: var(--ai-chatbot-navy) !important;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#ai-chatbot-footer {
  text-align: center;
  font-size: 10.5px;
  color: var(--ai-chatbot-muted);
  padding: 5px 12px 9px;
  border-top: 1px solid var(--ai-chatbot-steel-dark);
  background: var(--ai-chatbot-navy-light);
  letter-spacing: 0.02em;
}

.ai-chatbot-lead-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

.ai-chatbot-lead-form-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ai-chatbot-text);
  margin-bottom: 2px;
}

.ai-chatbot-lead-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ai-chatbot-muted);
  text-transform: uppercase;
  letter-spacing: 0.055em;
  margin-bottom: -3px;
}

.ai-chatbot-lead-label-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ai-chatbot-muted);
  font-size: 10px;
}

.ai-chatbot-lead-required::after {
  content: ' *';
  color: var(--ai-chatbot-primary);
}

.ai-chatbot-lead-form input,
.ai-chatbot-lead-form textarea {
  display: block !important;
  width: 100% !important;
  padding: 7px 10px !important;
  margin: 0 !important;
  border: 1px solid var(--ai-chatbot-steel-dark) !important;
  border-radius: var(--ai-chatbot-radius-sm) !important;
  font-size: 12.5px !important;
  background: rgba(3, 6, 18, 0.46) !important;
  color: var(--ai-chatbot-text);
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.4;
  box-shadow: none !important;
}

.ai-chatbot-lead-form input:focus,
.ai-chatbot-lead-form textarea:focus {
  border-color: var(--ai-chatbot-primary);
}

.ai-chatbot-lead-form textarea {
  resize: none;
  scrollbar-color: var(--ai-chatbot-steel-dark) transparent;
  scrollbar-width: thin;
}

.ai-chatbot-lead-submit {
  background: var(--ai-chatbot-gradient) !important;
  color: var(--ai-chatbot-navy) !important;
  border: 0 !important;
  padding: 9px 14px !important;
  border-radius: var(--ai-chatbot-radius-sm) !important;
  font-size: 13px !important;
  font-weight: 700;
  cursor: pointer;
  width: 100% !important;
  height: auto !important;
  margin: 3px 0 0 !important;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}

.ai-chatbot-lead-submit:hover {
  opacity: 0.88;
}

.ai-chatbot-lead-submit:active {
  transform: scale(0.97);
}

.ai-chatbot-lead-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ai-chatbot-lead-error {
  font-size: 11.5px;
  color: #c62828;
  display: none;
  padding: 4px 0 0;
}

.ai-chatbot-lead-error.ai-chatbot-visible {
  display: block;
}

.ai-chatbot-contact-bubble,
.ai-chatbot-escalation-bubble {
  max-width: 94% !important;
  width: min(100%, 310px);
}

.ai-chatbot-contact-prompt,
.ai-chatbot-escalation-bubble > p {
  margin: 0 0 10px;
}

.ai-chatbot-contact-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-chatbot-contact-success,
.ai-chatbot-escalation-status {
  outline: none;
}

.ai-chatbot-escalation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ai-chatbot-escalation-confirm,
.ai-chatbot-escalation-decline {
  flex: 1 1 125px;
  min-height: 38px;
  padding: 8px 10px !important;
  border-radius: var(--ai-chatbot-radius-sm) !important;
  font-size: 12px !important;
  font-weight: 700;
  cursor: pointer;
}

.ai-chatbot-escalation-confirm {
  border: 0 !important;
  background: var(--ai-chatbot-gradient) !important;
  color: var(--ai-chatbot-navy) !important;
}

.ai-chatbot-escalation-decline {
  border: 1px solid var(--ai-chatbot-steel-dark) !important;
  background: transparent !important;
  color: var(--ai-chatbot-text) !important;
}

.ai-chatbot-escalation-confirm:disabled,
.ai-chatbot-escalation-decline:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ai-chatbot-escalation-confirm:focus-visible,
.ai-chatbot-escalation-decline:focus-visible {
  outline: 2px solid var(--ai-chatbot-primary);
  outline-offset: 2px;
}

.ai-chatbot-escalation-status:not(:empty) {
  margin-top: 9px;
  font-size: 11.5px;
}

@media (max-width: 600px) {
  #ai-chatbot-bubble {
    right: max(18px, env(safe-area-inset-right)) !important;
    bottom: max(88px, env(safe-area-inset-bottom)) !important;
    left: auto !important;
    width: 48px !important;
    height: 48px !important;
  }

  #ai-chatbot-wp-root[data-position="left"] #ai-chatbot-bubble {
    right: auto !important;
    left: max(16px, env(safe-area-inset-left)) !important;
  }

  #ai-chatbot-wp-root #ai-chatbot-window,
  #ai-chatbot-wp-root[data-position="left"] #ai-chatbot-window {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: auto !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    transform-origin: center !important;
  }

  #ai-chatbot-header-main {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-left: max(16px, env(safe-area-inset-left));
  }

  #ai-chatbot-input-row {
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  #ai-chatbot-footer {
    padding-bottom: max(9px, env(safe-area-inset-bottom));
  }

  .ai-chatbot-contact-bubble,
  .ai-chatbot-escalation-bubble {
    width: 100%;
  }

  .ai-chatbot-escalation-actions {
    flex-direction: column;
  }

  .ai-chatbot-escalation-confirm,
  .ai-chatbot-escalation-decline {
    flex-basis: auto;
    width: 100% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-chatbot-typing span {
    animation: none;
  }

  #ai-chatbot-window {
    transition: none;
  }

}

/* Draggable edge-docked bubble mode. */
#ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble,
#ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble {
  position: fixed !important;
  width: 48px !important;
  height: 48px !important;
  min-width: 64px !important;
  min-height: 64px !important;
  max-width: 64px !important;
  max-height: 64px !important;
  border-radius: 999px !important;
  border: 3px solid rgba(255, 255, 255, 0.96) !important;
  background: var(--ai-chatbot-gradient) !important;
  box-shadow: 0 8px 28px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.18) !important;
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-touch-callout: none !important;
  cursor: grab !important;
  pointer-events: none !important;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden !important;
  will-change: left, top, transform;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: none !important;
}

/* Keep the bubble hidden until its stored edge/height has been restored after page load. */
#ai-chatbot-wp-root.ai-chatbot-bubble-ready[data-bubble-support="1"] #ai-chatbot-bubble:not(.ai-chatbot-bubble-open),
#ai-chatbot-wp-root.ai-chatbot-bubble-ready.ai-chatbot-bubble-mode #ai-chatbot-bubble:not(.ai-chatbot-bubble-open) {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.12s ease !important;
}

#ai-chatbot-wp-root.ai-chatbot-bubble-ready[data-bubble-support="1"] #ai-chatbot-bubble:not(.ai-chatbot-bubble-open):hover,
#ai-chatbot-wp-root.ai-chatbot-bubble-ready.ai-chatbot-bubble-mode #ai-chatbot-bubble:not(.ai-chatbot-bubble-open):hover {
  transform: scale(1.06);
  box-shadow: 0 10px 32px rgba(0,0,0,0.32), 0 3px 10px rgba(0,0,0,0.2) !important;
}

#ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble.ai-chatbot-drag-ready,
#ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble.ai-chatbot-drag-ready {
  cursor: grabbing !important;
}

#ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble.ai-chatbot-dragging,
#ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble.ai-chatbot-dragging {
  cursor: grabbing !important;
  transition: box-shadow 0.08s ease !important;
  transform: scale(1.08) !important;
  box-shadow: 0 12px 34px rgba(0,0,0,0.36), 0 4px 12px rgba(0,0,0,0.22) !important;
}

/* While held, the bubble follows the pointer freely and the icon is centered in the full circle. */
#ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble.ai-chatbot-dragging img,
#ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble.ai-chatbot-dragging svg,
#ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble.ai-chatbot-dragging img,
#ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble.ai-chatbot-dragging svg {
  transform: translateX(0) !important;
}

/* On release, animate the launcher to the nearest docked edge. */
#ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble.ai-chatbot-snapping,
#ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble.ai-chatbot-snapping {
  transition: left 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.12s ease, transform 0.14s ease, box-shadow 0.14s ease !important;
}

#ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble img,
#ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble img {
  width: 36px !important;
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  margin: 0 !important;
  border-radius: 50% !important;
  object-fit: contain !important;
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
  transition: transform 0.12s ease !important;
}

#ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble svg,
#ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble svg {
  width: 29px !important;
  height: 29px !important;
  pointer-events: none !important;
  transition: transform 0.12s ease !important;
}

/* Keep roughly three quarters of the circle visible and bias the icon into that visible area. */
#ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble[data-side="left"] img,
#ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble[data-side="left"] svg,
#ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble[data-side="left"] img,
#ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble[data-side="left"] svg {
  transform: translateX(8px);
}

#ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble[data-side="right"] img,
#ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble[data-side="right"] svg,
#ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble[data-side="right"] img,
#ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble[data-side="right"] svg {
  transform: translateX(-8px);
}

/* While chat is open, Bubble Support uses the same fully visible launcher
 * position/shape as normal mode. Clicking it closes the chat. */
#ai-chatbot-wp-root.ai-chatbot-bubble-ready[data-bubble-support="1"] #ai-chatbot-bubble.ai-chatbot-bubble-open,
#ai-chatbot-wp-root.ai-chatbot-bubble-ready.ai-chatbot-bubble-mode #ai-chatbot-bubble.ai-chatbot-bubble-open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  width: 64px !important;
  height: 64px !important;
  min-width: 64px !important;
  min-height: 64px !important;
  max-width: 64px !important;
  max-height: 64px !important;
  top: auto !important;
  bottom: max(var(--ai-chatbot-bottom), env(safe-area-inset-bottom)) !important;
  left: auto !important;
  right: var(--ai-chatbot-side) !important;
  border: 0 !important;
  border-radius: 50% 50% 5px 50% !important;
  cursor: pointer !important;
  overflow: hidden !important;
  transform: none !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.12s ease !important;
}

#ai-chatbot-wp-root.ai-chatbot-bubble-ready[data-position="left"][data-bubble-support="1"] #ai-chatbot-bubble.ai-chatbot-bubble-open,
#ai-chatbot-wp-root.ai-chatbot-bubble-ready.ai-chatbot-bubble-mode[data-position="left"] #ai-chatbot-bubble.ai-chatbot-bubble-open {
  right: auto !important;
  left: var(--ai-chatbot-side) !important;
  border-radius: 50% 50% 50% 5px !important;
}

#ai-chatbot-wp-root.ai-chatbot-bubble-ready[data-bubble-support="1"] #ai-chatbot-bubble.ai-chatbot-bubble-open:hover,
#ai-chatbot-wp-root.ai-chatbot-bubble-ready.ai-chatbot-bubble-mode #ai-chatbot-bubble.ai-chatbot-bubble-open:hover {
  transform: scale(1.07) !important;
  box-shadow: 0 6px 24px color-mix(in srgb, var(--ai-chatbot-primary) 55%, transparent), 0 2px 6px rgba(0,0,0,0.2) !important;
}

#ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble.ai-chatbot-bubble-open img,
#ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble.ai-chatbot-bubble-open img {
  width: 35px !important;
  height: auto !important;
  max-width: 35px !important;
  max-height: 35px !important;
  margin-left: 2px !important;
  transform: translateX(0) !important;
}

#ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble.ai-chatbot-bubble-open svg,
#ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble.ai-chatbot-bubble-open svg {
  width: 30px !important;
  height: 30px !important;
  transform: translateX(0) !important;
}

/* Bubble mode changes only the launcher. The chat window keeps the configured default side/bottom position. */
@media (max-width: 600px) {
  #ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble,
  #ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
    border-radius: 999px !important;
  }

  #ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble img,
  #ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble img {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
  }

  #ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble[data-side="left"] img,
  #ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble[data-side="left"] svg,
  #ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble[data-side="left"] img,
  #ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble[data-side="left"] svg {
    transform: translateX(7px);
  }

  #ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble[data-side="right"] img,
  #ai-chatbot-wp-root[data-bubble-support="1"] #ai-chatbot-bubble[data-side="right"] svg,
  #ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble[data-side="right"] img,
  #ai-chatbot-wp-root.ai-chatbot-bubble-mode #ai-chatbot-bubble[data-side="right"] svg {
    transform: translateX(-7px);
  }

  /* Match the regular non-bubble launcher exactly while the mobile chat is open. */
  #ai-chatbot-wp-root.ai-chatbot-bubble-ready[data-bubble-support="1"] #ai-chatbot-bubble.ai-chatbot-bubble-open,
  #ai-chatbot-wp-root.ai-chatbot-bubble-ready.ai-chatbot-bubble-mode #ai-chatbot-bubble.ai-chatbot-bubble-open {
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
    min-height: 58px !important;
    max-width: 58px !important;
    max-height: 58px !important;
    right: max(16px, env(safe-area-inset-right)) !important;
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
    left: auto !important;
  }

  #ai-chatbot-wp-root.ai-chatbot-bubble-ready[data-position="left"][data-bubble-support="1"] #ai-chatbot-bubble.ai-chatbot-bubble-open,
  #ai-chatbot-wp-root.ai-chatbot-bubble-ready.ai-chatbot-bubble-mode[data-position="left"] #ai-chatbot-bubble.ai-chatbot-bubble-open {
    right: auto !important;
    left: max(16px, env(safe-area-inset-left)) !important;
  }
}
