:root{--ink:#111;--line:#e2ddd8;--muted:#6f6a66;--me:#1b1b1b;--bot:#fff}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{background:#2a2a2a;font:15px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:var(--ink)}
.app{display:flex;flex-direction:column;height:100dvh;max-width:560px;margin:0 auto;background:var(--bg);box-shadow:0 0 60px rgba(0,0,0,.35)}
.top{display:flex;align-items:center;gap:12px;padding:12px 14px;padding-top:max(12px,env(safe-area-inset-top));background:var(--head);color:#fff;border-bottom:4px solid var(--p)}
.avatar{flex:none;width:42px;height:42px;border-radius:50%;background:var(--p);display:grid;place-items:center;font:900 22px/1 "Arial Black",Arial,sans-serif}
.who{flex:1;min-width:0}
.brand{font:900 19px/1 "Arial Black",Arial,sans-serif;letter-spacing:.02em}
.brand span{color:var(--p);filter:brightness(1.25)}
.status{margin-top:5px;font-size:12px;color:#bdb8b3}
.status i{display:inline-block;width:8px;height:8px;margin-right:6px;border-radius:50%;background:#25d366;vertical-align:1px}
.demo{flex:none;padding:5px 9px;border:1.5px solid var(--p);border-radius:6px;color:#fff;background:rgba(255,255,255,.12);font:800 11px/1 ui-monospace,Menlo,monospace;letter-spacing:.12em}
.notice{padding:8px 14px;background:#fff4d6;border-bottom:1px solid #f0dfa8;font-size:12px;color:#6b5512;text-align:center}
.log{flex:1;overflow-y:auto;padding:16px 12px 8px;display:flex;flex-direction:column;gap:8px;scroll-behavior:smooth}
.msg{max-width:86%;padding:9px 12px 10px;border-radius:14px;white-space:normal;word-wrap:break-word;box-shadow:0 1px 1px rgba(0,0,0,.06);animation:in .18s ease-out}
.msg p{margin:0 0 6px}.msg p:last-child{margin:0}.msg ul{margin:4px 0 6px;padding-left:18px}.msg li{margin:2px 0}
.bot{align-self:flex-start;background:var(--bot);border-top-left-radius:4px}
.me{align-self:flex-end;background:var(--me);color:#fff;border-top-right-radius:4px}
.err{align-self:center;background:#fde8e8;color:var(--pd);font-size:13px;border-radius:10px}
.typing{display:inline-flex;gap:4px;padding:12px 14px}
.typing span{width:7px;height:7px;border-radius:50%;background:#b9b3ad;animation:blink 1.2s infinite}
.typing span:nth-child(2){animation-delay:.2s}.typing span:nth-child(3){animation-delay:.4s}
.chips{display:flex;gap:8px;overflow-x:auto;padding:6px 12px 8px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chips button{flex:none;border:1.5px solid var(--p);background:#fff;color:var(--pd);border-radius:999px;padding:8px 12px;font-family:inherit;font-weight:600;font-size:13px;line-height:1;cursor:pointer}
.chips button:active{background:var(--p);color:#fff}
.chips.hide{display:none}
.composer{display:flex;align-items:flex-end;gap:8px;padding:8px 10px;padding-bottom:max(8px,env(safe-area-inset-bottom));background:#fff;border-top:1px solid var(--line)}
.composer textarea{flex:1;resize:none;max-height:120px;border:1px solid var(--line);border-radius:20px;padding:10px 14px;font-family:inherit;font-size:16px;line-height:1.35;background:var(--bg);outline:none}
.composer textarea:focus{border-color:var(--p)}
.composer button{flex:none;width:44px;height:44px;border:0;border-radius:50%;background:var(--p);color:#fff;display:grid;place-items:center;cursor:pointer}
.composer button:disabled{opacity:.45}
.foot{padding:6px 12px 8px;background:#fff;font-size:11px;color:var(--muted);text-align:center}
@keyframes blink{0%,80%,100%{opacity:.3}40%{opacity:1}}
@keyframes in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@media(min-width:720px){body{padding:24px 0}.app{height:calc(100dvh - 48px);border-radius:18px;overflow:hidden}}
.embed .foot,.embed .notice{display:none}
.embed body,body.embed{background:var(--bg);padding:0}
body.embed .app{max-width:none;height:100dvh;border-radius:0;box-shadow:none}
