:root {
  --enjin-primary: #0B4EA2;
  --enjin-primary-hover: #093d80;
  --enjin-secondary: #40a040;
  --enjin-bg: #f2f4f8;
  --enjin-dark: #101330;
  --enjin-white: #ffffff;
  --enjin-radius: 1rem;
}

#enjin-chatbot-root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  z-index: 99999;
}

#enjin-chatbot-root[data-mode="floating"] {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
}

#enjin-chatbot-root[data-mode="floating"].enjin-left {
  right: auto;
  left: 1rem;
}

.enjin-toggle {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.enjin-toggle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.enjin-toggle:hover {
  transform: scale(1.04);
}

.enjin-window {
  width: min(400px, calc(100vw - 2rem));
  height: min(600px, calc(100vh - 6rem));
  background: var(--enjin-bg);
  border-radius: var(--enjin-radius);
  border: 1px solid #e6e9f1;
  display: none;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 0.75rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

#enjin-chatbot-root.enjin-open .enjin-window {
  display: flex;
}

#enjin-chatbot-root[data-mode="inline"] .enjin-window {
  display: flex;
  width: 100%;
  max-width: 480px;
  height: 560px;
  margin: 0 auto;
}

#enjin-chatbot-root[data-mode="inline"] .enjin-toggle {
  display: none;
}

.enjin-header {
  background: var(--enjin-primary);
  color: var(--enjin-white);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.enjin-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #fff;
}

.enjin-header-text {
  min-width: 0;
}

.enjin-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.enjin-header p {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  opacity: 0.85;
}

.enjin-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.enjin-msg {
  max-width: 85%;
  padding: 0.8rem 1rem;
  border-radius: var(--enjin-radius);
  line-height: 1.5;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.enjin-msg.bot {
  align-self: flex-start;
  background: var(--enjin-white);
  color: var(--enjin-dark);
}

.enjin-msg.user {
  align-self: flex-end;
  background: var(--enjin-secondary);
  color: var(--enjin-white);
}

.enjin-msg.typing {
  opacity: 0.7;
  font-style: italic;
}

.enjin-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--enjin-white);
  border-top: 1px solid #e6e9f1;
}

.enjin-input-row textarea {
  flex: 1;
  border: 0;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  font: inherit;
  padding: 0.6rem;
  outline: none;
}

.enjin-input-row button {
  border: 0;
  border-radius: 0.75rem;
  background: var(--enjin-primary);
  color: var(--enjin-white);
  padding: 0 1rem;
  cursor: pointer;
}

.enjin-input-row button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
