:root { --accent: #2f5bea; --accent-2: #f59e0b; --bg: #f7f7f8; --surface: #fff; --text: #16181d; --muted: #6b7280; --line: #e5e7eb; --radius: 16px;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; color: var(--text); background: var(--bg); }
:root[data-mode=dark] { --bg: #0f1115; --surface: #181b21; --text: #eceef2; --muted: #9aa1ad; --line: #2a2f38; }
:root[data-font=rounded] { font-family: ui-rounded, "SF Pro Rounded", "Nunito", -apple-system, sans-serif; }
:root[data-font=serif] { font-family: Georgia, "Times New Roman", serif; }
:root[style*="--brand-font"] { font-family: var(--brand-font), -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
:root[data-font=serif][style*="--brand-font"] { font-family: var(--brand-font), Georgia, serif; }
:root[data-radius=square] { --radius: 6px; } :root[data-radius=round] { --radius: 22px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
.wrap { max-width: 760px; margin: 0 auto; height: 100%; display: flex; flex-direction: column; }
header { display: flex; gap: 12px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.logo { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
h1 { font-size: 16px; margin: 0; }
header p { margin: 0; color: var(--muted); font-size: 13px; }
main { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: var(--radius); white-space: pre-wrap; word-wrap: break-word; animation: in .15s ease-out; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.human { align-self: flex-start; background: var(--surface); border: 1px solid var(--accent-2); }
.msg.note { align-self: center; color: var(--muted); font-size: 13px; background: none; }
.msg b, .msg strong { font-weight: 650; }
.typing { display: inline-flex; gap: 4px; } .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; } .typing i:nth-child(2) { animation-delay: .15s } .typing i:nth-child(3) { animation-delay: .3s }
@keyframes blink { 50% { opacity: .25 } } @keyframes in { from { opacity: 0; transform: translateY(4px) } }
.chips { display: flex; gap: 8px; padding: 0 18px 10px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 6px 12px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 13px; }
.chips button:hover { border-color: var(--accent); color: var(--accent); }
form { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface); }
textarea { flex: 1; resize: none; font: inherit; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg); color: var(--text); max-height: 140px; }
textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); border-color: var(--accent); }
#send { border: 0; background: var(--accent); color: #fff; width: 44px; border-radius: 12px; cursor: pointer; font-size: 16px; }
#send:disabled { opacity: .5; }
footer { text-align: center; font-size: 11px; color: var(--muted); padding: 0 0 10px; background: var(--surface); }
.who { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 4px 0 -4px 2px; align-self: flex-start; }
.who .av { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: color-mix(in srgb, var(--agent, var(--accent)) 16%, var(--surface)); color: var(--agent, var(--accent)); font-weight: 700; overflow: hidden; }
.who .av img { width: 100%; height: 100%; object-fit: cover; }
.msg.bot.tinted { border-color: color-mix(in srgb, var(--agent) 35%, var(--line)); }
