/* Theme: change these variables to re-brand the whole widget */
:root {
  --bg: #e6ede7; --card: #f7faf6; --text: #18261f; --muted: #5d6f65; --border: #cbd8cd;
  --brand: #1f5c46; --accent: #f0a81c; --user: #1f5c46; --user-text: #fff; --bot: #e2eae3;
  --radius: 18px;
}
[data-theme="dark"] {
  --bg: #0b110e; --card: #131d18; --text: #e8f0ea; --muted: #93a79b; --border: #26372e;
  --brand: #16382b; --user: #2b7a5d; --bot: #1d2b24;
}
* { box-sizing: border-box; margin: 0; }
body {
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  height: 100vh; height: 100dvh; display: flex; justify-content: center; align-items: center;
}
.chat {
  width: 100%; max-width: 460px; height: 100%; max-height: 780px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden;
}
@media (max-width: 520px) { .chat { max-height: none; border: 0; border-radius: 0; } }
.chat-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--brand); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-size: 20px; }
h1 { font: 600 1.2rem/1.2 "Iowan Old Style", "Palatino Linotype", Georgia, serif; }
.brand small { opacity: .8; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.45); background: transparent; color: #fff; font-size: 18px; cursor: pointer; }
.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: var(--radius); overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--user); color: var(--user-text); border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--bot); border-bottom-left-radius: 4px; }
.msg p + p, .msg ul { margin-top: 6px; }
.msg ul { padding-left: 20px; }
.typing { display: flex; gap: 4px; padding: 14px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.quick { display: flex; gap: 8px; padding: 8px 16px; overflow-x: auto; }
.quick button { flex: none; font: inherit; font-size: .9rem; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--muted); background: transparent; color: var(--text); cursor: pointer; }
.composer { display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.composer input { flex: 1; min-width: 0; font: inherit; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text); }
.composer button { font: inherit; font-weight: 600; padding: 0 20px; border: 0; border-radius: 999px; background: var(--accent); color: #2b1d00; cursor: pointer; }
.composer button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; } }
