:root {
  --bg:#120d19; --panel:#1c1428; --panel-2:#261b35; --text:#f8f5ff;
  --muted:#b9afc8; --line:rgba(255,255,255,.09); --accent:#b86cff;
  --accent-2:#ff68b7; --success:#62d8a7; --danger:#ff5d79;
}
* { box-sizing:border-box; }
html,body { margin:0; width:100%; height:100%; background:transparent; }
body { font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; color:var(--text); }
button,textarea { font:inherit; }
.widget-shell { width:100%; height:100dvh; min-height:520px; display:grid; grid-template-rows:auto 1fr auto auto auto; overflow:hidden; background:linear-gradient(180deg,rgba(31,23,44,.99),rgba(17,12,25,.99)); }
.widget-header { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:15px 16px; border-bottom:1px solid var(--line); background:rgba(255,255,255,.018); }
.agent-identity { display:flex; align-items:center; gap:11px; min-width:0; }
.avatar { width:44px; height:44px; flex:0 0 44px; overflow:hidden; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--accent-2)); box-shadow:0 0 0 3px rgba(184,108,255,.1); border:1px solid rgba(255,255,255,.14); }
.avatar img { width:100%; height:100%; display:block; object-fit:cover; object-position:50% 26%; }
.agent-name-row { display:flex; align-items:center; gap:7px; }
.agent-name-row h1 { margin:0; font:800 17px/1 Manrope,sans-serif; }
.agent-identity p { margin:4px 0 0; color:var(--muted); font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ai-badge { padding:3px 5px; border-radius:6px; font-size:8px; font-weight:800; letter-spacing:.08em; color:var(--success); background:rgba(98,216,167,.12); border:1px solid rgba(98,216,167,.18); }
.header-actions { display:flex; gap:6px; }
.icon-button,.send-button { border:0; color:var(--text); cursor:pointer; }
.icon-button { width:34px; height:34px; border-radius:10px; background:rgba(255,255,255,.055); font-size:18px; }
.icon-button:hover { background:rgba(255,255,255,.1); }
.messages { min-height:0; overflow-y:auto; padding:18px 14px 10px; scroll-behavior:smooth; }
.messages::-webkit-scrollbar { width:6px; }
.messages::-webkit-scrollbar-thumb { background:rgba(255,255,255,.09); border-radius:999px; }
.message { display:flex; align-items:flex-end; gap:7px; margin:0 0 12px; }
.message-user { justify-content:flex-end; }
.message-avatar { width:25px; height:25px; flex:0 0 25px; border-radius:50%; object-fit:cover; object-position:50% 26%; border:1px solid rgba(255,255,255,.12); }
.message-bubble { max-width:84%; padding:11px 13px; border-radius:16px; font-size:13px; line-height:1.5; }
.message-bubble p { margin:0; }
.message-bubble p + p { margin-top:7px; }
.message-assistant .message-bubble { border-top-left-radius:5px; background:rgba(255,255,255,.065); border:1px solid rgba(255,255,255,.06); }
.message-user .message-bubble { border-top-right-radius:5px; color:#fff; background:linear-gradient(135deg,#8f45e5,#a856d3); }
.status { min-height:22px; padding:0 14px 2px 47px; color:var(--muted); font-size:11px; }
.status.typing::after { content:""; display:inline-block; width:20px; height:6px; margin-left:5px; background:radial-gradient(circle,currentColor 2px,transparent 3px) 0 50%/7px 7px repeat-x; animation:pulse 1.1s infinite linear; }
@keyframes pulse { 50% { opacity:.35; } }
.composer { margin:0 10px 8px; padding:7px; display:grid; grid-template-columns:1fr auto; gap:6px; align-items:end; border:1px solid rgba(255,255,255,.09); border-radius:16px; background:rgba(255,255,255,.04); }
.composer:focus-within { border-color:rgba(184,108,255,.4); box-shadow:0 0 0 3px rgba(184,108,255,.06); }
.composer textarea { width:100%; max-height:105px; resize:none; overflow-y:auto; border:0; outline:0; padding:9px 7px; color:var(--text); background:transparent; line-height:1.4; }
.composer textarea::placeholder { color:#857b94; }
.send-button { width:39px; height:39px; border-radius:12px; display:grid; place-items:center; font-size:17px; background:linear-gradient(135deg,var(--accent),var(--accent-2)); }
.send-button:disabled { opacity:.45; cursor:progress; }
.privacy-note { margin:0 14px 10px; color:#81778e; font-size:9px; text-align:center; line-height:1.35; }
.error-bubble { background:rgba(255,94,122,.08)!important; border-color:rgba(255,94,122,.2)!important; color:#ffc4d0; }
@media (max-width:520px) {
  .widget-shell { min-height:100dvh; }
  .widget-header { padding-top:calc(13px + env(safe-area-inset-top)); }
  .privacy-note { padding-bottom:env(safe-area-inset-bottom); }
}