.enneabot-widget {
  --ennea-ink: #1C3B2C;
  --ennea-ink-soft: #4E6C5A;
  --ennea-bg: #F3F7EE;
  --ennea-border: #D7E4C9;
  --ennea-bot-bubble: #FFFFFF;
  --ennea-user-bubble: #1C3B2C;
  --ennea-user-text: #F6F8F1;

  max-width: 720px;
  margin: 2rem auto;
  border: 1px solid var(--ennea-border);
  border-radius: 20px;
  background: var(--ennea-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
}

.enneabot-messages {
  padding: 1.25rem;
  height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.enneabot-msg {
  max-width: 82%;
  padding: 0.7rem 1rem;
  border-radius: 16px;
  line-height: 1.6;
  font-size: 1.08rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.enneabot-msg.bot {
  align-self: flex-start;
  background: var(--ennea-bot-bubble);
  border: 1px solid var(--ennea-border);
  color: var(--ennea-ink);
  border-bottom-left-radius: 4px;
}

.enneabot-msg.user {
  align-self: flex-end;
  background: var(--ennea-user-bubble);
  color: var(--ennea-user-text);
  border-bottom-right-radius: 4px;
}

.enneabot-pdf-link {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0 0.4rem;
  margin-top: -0.45rem;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--ennea-ink-soft);
  text-decoration: underline;
  cursor: pointer;
}

.enneabot-pdf-link:hover { color: var(--ennea-ink); }
.enneabot-pdf-link:disabled { opacity: 0.6; cursor: default; text-decoration: none; }

.enneabot-continue-btn {
  align-self: flex-start;
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  background: var(--ennea-ink);
  color: var(--ennea-user-text);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.enneabot-continue-btn:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.enneabot-msg.error {
  align-self: center;
  background: #fbeaea;
  color: #7a2b2b;
  border: 1px solid #e6c3c3;
  font-size: 0.9rem;
}

.enneabot-typing {
  display: flex;
  gap: 4px;
  padding: 0 1.25rem 0.75rem;
}

.enneabot-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ennea-ink-soft);
  opacity: 0.5;
  animation: enneabot-bounce 1.2s infinite ease-in-out;
}

.enneabot-typing span:nth-child(2) { animation-delay: 0.15s; }
.enneabot-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes enneabot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .enneabot-typing span { animation: none; opacity: 0.6; }
}

.enneabot-form {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--ennea-border);
  background: #FFFFFF;
}

.enneabot-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--ennea-border);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  font-family: inherit;
  font-size: 1.08rem;
  color: var(--ennea-ink);
  max-height: 140px;
  line-height: 1.4;
}

.enneabot-input:focus {
  outline: none;
  border-color: var(--ennea-ink);
}

.enneabot-send,
.enneabot-mic {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--ennea-ink);
  color: var(--ennea-user-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.enneabot-mic {
  background: #FFFFFF;
  color: var(--ennea-ink);
  border: 1px solid var(--ennea-border);
}

.enneabot-mic.is-listening {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}

.enneabot-mic[hidden] { display: none; }

.enneabot-send:hover,
.enneabot-mic:hover { transform: translateY(-1px); }
.enneabot-send:disabled { opacity: 0.5; cursor: default; transform: none; }

.enneabot-send:focus-visible,
.enneabot-mic:focus-visible,
.enneabot-input:focus-visible {
  outline: 2px solid var(--ennea-ink);
  outline-offset: 2px;
}
