/* OttBot Chat Widget */
#ottbot-chat-wrapper {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: inline-block;
  transition: opacity .2s var(--ease, ease), transform .2s var(--ease, ease);
}

body.ottbot-open #ottbot-chat-wrapper {
  opacity: 0;
  transform: translateY(8px) scale(.96);
  pointer-events: none;
}

#ottbot-chat-button {
  background: var(--grad-brand, #7C1AED);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: .85em 1.6em;
  font-family: var(--font-head, system-ui, sans-serif);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow, 0 16px 44px rgba(16,32,72,.18));
  transition: transform .2s var(--ease, ease), box-shadow .2s var(--ease, ease);
}

#ottbot-chat-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg, 0 30px 80px rgba(16,32,72,.24));
}

.ottbot-quick-replies-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
  align-self: flex-start;
}

.ottbot-quick {
  background: var(--pale-blue, #F0F5FF);
  color: var(--ink, #0E1B33);
  border: 1px solid var(--line, #e3e8f3);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: var(--font-head, system-ui, sans-serif);
  font-size: .82rem;
  font-weight: 600;
  transition: all .2s var(--ease, ease);
  white-space: nowrap;
}

.ottbot-quick:hover {
  background: var(--purple, #7C1AED);
  color: #fff;
  border-color: var(--purple, #7C1AED);
  transform: translateY(-1px);
}

#ottbot-chat-window {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 360px;
  height: 520px;
  background: var(--bg, #fff);
  border: 1px solid var(--line, #e3e8f3);
  border-radius: var(--radius-lg, 28px);
  display: none;
  flex-direction: column;
  box-shadow: var(--shadow-lg, 0 30px 80px rgba(16,32,72,.24));
  font-family: var(--font-body, ui-monospace, monospace);
  overflow: hidden;
  z-index: 10000;
}

#ottbot-chat-window.show {
  display: flex !important;
}

#ottbot-header {
  position: relative;
  background: var(--grad-cool, linear-gradient(120deg, #7C1AED 0%, #0FF0FC 100%));
  color: #fff;
  padding: 18px 44px 18px 20px;
  text-align: left;
  font-family: var(--font-head, system-ui, sans-serif);
  font-weight: 800;
  font-size: 1.05rem;
}

#ottbot-close-button {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: rgba(255,255,255,.16);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 15px;
  color: #fff;
  cursor: pointer;
  transition: background .2s var(--ease, ease);
}

#ottbot-close-button:hover {
  background: rgba(255,255,255,.3);
}

#ottbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--soft-white, #F9FAFB);
  font-family: var(--font-body, ui-monospace, monospace);
}

.ottbot-bubble {
  max-width: 80%;
  padding: 12px 18px;
  border-radius: var(--radius, 18px);
  line-height: 1.5;
  font-size: .92rem;
  word-wrap: break-word;
}

.ottbot-message-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ottbot-message-content p {
  margin: 0;
}

.ottbot-message-content ul,
.ottbot-message-content ol {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ottbot-message-content li {
  margin: 0;
  padding-left: 2px;
}

.ottbot-bot {
  background: #fff;
  color: var(--ink, #0E1B33);
  border: 1px solid var(--line, #e3e8f3);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}

.ottbot-user {
  background: var(--grad-cool, linear-gradient(135deg, #7C1AED, #0FF0FC));
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
}

.ottbot-typing {
  font-style: italic;
  color: var(--slate, #64748B);
  align-self: flex-start;
  font-family: var(--font-body, ui-monospace, monospace);
  font-size: .92rem;
}

#ottbot-input-container {
  display: flex;
  border-top: 1px solid var(--line, #e3e8f3);
  padding: 10px;
  background: #fff;
}

#ottbot-input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid var(--line, #e3e8f3);
  border-radius: 999px;
  outline: none;
  font-family: var(--font-body, ui-monospace, monospace);
  font-size: .88rem;
  color: var(--ink, #0E1B33);
  margin-right: 10px;
  transition: border-color .2s var(--ease, ease);
}

#ottbot-input:focus {
  border-color: var(--purple, #7C1AED);
}

#ottbot-send {
  flex: 0 0 auto;
  background: var(--grad-brand, #7C1AED);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  font-size: 16px;
  transition: transform .2s var(--ease, ease), opacity .2s var(--ease, ease);
}

#ottbot-send:hover {
  transform: scale(1.05);
}

#ottbot-send:disabled {
  background: var(--line, #ccc);
  cursor: not-allowed;
  transform: none;
}

#ottbot-sparkles {
  display: none !important;
  animation: none !important;
  -webkit-animation: none !important;
}

@media (max-width: 640px) {
  #ottbot-chat-wrapper {
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  #ottbot-chat-window {
    right: 12px;
    left: 12px;
    bottom: max(78px, calc(env(safe-area-inset-bottom) + 78px));
    width: auto;
    height: min(520px, 100dvh - 110px);
  }
}
