.buddy{--buddy-scale:1;--look-x:0;--look-y:0;width:calc(260px * var(--buddy-scale));height:calc(265px * var(--buddy-scale));flex-shrink:0;position:relative}.buddy-rig{width:260px;height:265px;transform:scale(var(--buddy-scale)) rotate(-7deg);transform-origin:0 0;position:absolute;inset:0 auto auto 0}.buddy-figure{rotate:calc(var(--look-x) * 4deg);transition:rotate .4s var(--ease-out);transform-origin:50% 85%;animation:3.6s ease-in-out infinite buddy-breathe;position:absolute;inset:0}.buddy-body{z-index:2;background:linear-gradient(145deg,#e7774d 0%,#ce4d29 50%,#b4361e 100%);border-radius:40px;width:210px;height:155px;position:absolute;top:45px;left:25px;box-shadow:inset 5px 5px 12px #ffb48299,inset -9px -9px 15px #902b2090,12px 16px 22px #8e41252b}.buddy-eyes{transform:translate(calc(var(--look-x) * 9px), calc(var(--look-y) * 6px));transition:transform .12s linear;position:absolute;inset:0}.buddy-eye{transform-origin:50%;background:#30241f;border-radius:50%;width:16px;height:22px;transition:height .2s,top .2s,border-radius .2s;animation:5.2s infinite buddy-blink;position:absolute;top:54px;box-shadow:inset 3px 2px 3px #705446}.buddy-eye:after{content:"";background:#fff9;border-radius:50%;width:4px;height:6px;position:absolute;top:4px;left:4px}.buddy-eye.left{left:65px}.buddy-eye.right{animation-delay:40ms;right:55px}.buddy-brow{opacity:0;width:22px;height:5px;transition:opacity .2s, transform .25s var(--ease-out);background:#6b2614;border-radius:4px;position:absolute;top:40px}.buddy-brow.left{left:62px}.buddy-brow.right{right:52px}.buddy-cheek{background:#f69b7490;border-radius:50%;width:20px;height:10px;transition:opacity .3s;position:absolute;top:85px}.buddy-cheek.left{left:40px}.buddy-cheek.right{right:30px}.buddy-mouth{width:24px;height:15px;transition:all .2s var(--ease-out);border:4px solid #532819;border-top:0;border-radius:0 0 20px 20px;position:absolute;top:86px;left:99px;transform:rotate(-5deg)}.buddy-sweat{opacity:0;background:#cfe6f2;border-radius:50%/60% 60% 40% 40%;width:10px;height:14px;position:absolute;top:28px;right:24px}.buddy-arm{z-index:1;transform-origin:50% 12%;width:32px;height:75px;transition:transform .35s var(--ease-spring);background:linear-gradient(90deg,#cc4726,#e56b43);border-radius:20px;position:absolute;top:110px}.buddy-arm.left{left:6px;transform:rotate(35deg)}.buddy-arm.right{top:65px;right:3px;transform:rotate(40deg)}.buddy-foot{z-index:1;background:linear-gradient(145deg,#df6a40,#b33a22);border-radius:14px;width:45px;height:36px;position:absolute;bottom:38px}.buddy-foot.left{left:52px;transform:rotate(8deg)}.buddy-foot.right{right:42px;transform:rotate(-5deg)}.buddy-shadow{filter:blur(9px);background:#7a523127;border-radius:50%;width:180px;height:22px;animation:3.6s ease-in-out infinite buddy-shadow;position:absolute;bottom:20px;left:45px}.buddy-thought,.buddy-alert{opacity:0;transition:opacity .25s, transform .3s var(--ease-spring);pointer-events:none;position:absolute;transform:scale(.6)}.buddy-thought{background:var(--color-surface,#fffefa);border:1px solid var(--color-line,#e7e4db);border-radius:20px;gap:7px;padding:10px 14px;display:flex;top:-8px;right:6px;box-shadow:0 8px 20px #3730241a}.buddy-thought i{background:#c8462a;border-radius:50%;width:10px;height:10px;animation:1s ease-in-out infinite buddy-dot}.buddy-thought i:nth-child(2){animation-delay:.15s}.buddy-thought i:nth-child(3){animation-delay:.3s}.buddy-alert{color:#fff;background:#80662e;border-radius:14px;place-items:center;width:44px;height:44px;font-size:28px;font-weight:900;display:grid;top:-4px;right:20px;rotate:12deg;box-shadow:0 6px #5f4b20}.buddy--listening .buddy-figure{rotate:calc(-5deg + var(--look-x) * 4deg)}.buddy--listening .buddy-eye{height:25px;top:51px}.buddy--listening .buddy-brow{opacity:1;transform:translateY(-5px)}.buddy--listening .buddy-mouth{width:16px;height:10px;left:103px}.buddy--thinking .buddy-eyes{transform:translate(8px,-7px)}.buddy--thinking .buddy-brow.right{opacity:1;transform:translateY(-7px)rotate(-12deg)}.buddy--thinking .buddy-mouth{border-width:0 0 4px;border-radius:4px;width:16px;height:0;top:98px;left:112px;transform:rotate(-10deg)}.buddy--thinking .buddy-thought{opacity:1;transform:scale(1)}.buddy--thinking .buddy-arm.right{transform:rotate(150deg)translate(-8px,20px)}.buddy--talking .buddy-mouth{background:#532819;border:0;border-radius:10px 10px 14px 14px;width:22px;height:14px;animation:.32s ease-in-out infinite alternate buddy-talk;left:100px}.buddy--happy .buddy-mouth,.buddy--celebrate .buddy-mouth{background:linear-gradient(#532819 60%,#e2735a 60%);border:0;border-radius:4px 4px 20px 20px;width:34px;height:18px;left:94px}.buddy--happy .buddy-eye,.buddy--celebrate .buddy-eye{border-radius:12px 12px 4px 4px;height:12px;animation:none;top:60px}.buddy--happy .buddy-eye:after,.buddy--celebrate .buddy-eye:after{display:none}.buddy--happy .buddy-arm.right{animation:.9s ease-in-out 2 buddy-wave}.buddy--happy .buddy-cheek,.buddy--celebrate .buddy-cheek{background:#f69b74}.buddy--celebrate .buddy-figure{animation:buddy-jump .7s var(--ease-out) 3}.buddy--celebrate .buddy-arm.left{transform:rotate(150deg)translate(4px,30px)}.buddy--celebrate .buddy-arm.right{transform:rotate(-150deg)translate(-4px,-10px)}.buddy-confetti{pointer-events:none;position:absolute;top:60px;left:130px}.buddy-confetti i{--angle:0deg;opacity:0;width:10px;height:14px;animation:buddy-confetti 1.3s var(--ease-out) forwards;background:#c8462a;border-radius:3px;position:absolute}.buddy-confetti i:nth-child(3n){background:#43705a}.buddy-confetti i:nth-child(3n+1){background:#e5b54a}.buddy-confetti i:nth-child(4n){border-radius:50%;width:9px;height:9px}.buddy-confetti i:first-child{--angle:0deg}.buddy-confetti i:nth-child(2){--angle:26deg;animation-delay:50ms}.buddy-confetti i:nth-child(3){--angle:52deg}.buddy-confetti i:nth-child(4){--angle:78deg;animation-delay:.1s}.buddy-confetti i:nth-child(5){--angle:104deg}.buddy-confetti i:nth-child(6){--angle:130deg;animation-delay:50ms}.buddy-confetti i:nth-child(7){--angle:156deg}.buddy-confetti i:nth-child(8){--angle:182deg;animation-delay:.12s}.buddy-confetti i:nth-child(9){--angle:208deg}.buddy-confetti i:nth-child(10){--angle:234deg;animation-delay:50ms}.buddy-confetti i:nth-child(11){--angle:260deg}.buddy-confetti i:nth-child(12){--angle:286deg;animation-delay:.1s}.buddy-confetti i:nth-child(13){--angle:312deg}.buddy-confetti i:nth-child(14){--angle:338deg;animation-delay:80ms}.buddy--concerned .buddy-brow{opacity:1}.buddy--concerned .buddy-brow.left{transform:rotate(-16deg)translateY(-2px)}.buddy--concerned .buddy-brow.right{transform:rotate(16deg)translateY(-2px)}.buddy--concerned .buddy-mouth{border-width:4px 4px 0;border-top-style:solid;border-top-color:#532819;border-bottom-style:none;border-bottom-color:currentColor;border-radius:20px 20px 0 0;width:22px;height:12px;top:92px;left:100px}.buddy--concerned .buddy-sweat{opacity:1;animation:2.4s ease-in infinite buddy-sweat}.buddy--concerned .buddy-alert{opacity:1;animation:2.4s ease-in-out infinite buddy-nudge;transform:scale(1)}.buddy--concerned .buddy-arm.right{transform:rotate(155deg)translate(-12px,24px)}.buddy--error .buddy-figure{animation:.5s ease-in-out 2 buddy-shake}.buddy--error .buddy-eye{border-radius:4px;height:6px;animation:none;top:62px}.buddy--error .buddy-eye:after{display:none}.buddy--error .buddy-mouth{border:4px solid #532819;border-radius:50%;width:12px;height:12px;top:90px;left:105px}.buddy--error .buddy-brow{opacity:1;transform:translateY(-4px)rotate(8deg)}.buddy--error .buddy-alert{opacity:1;background:#9a3426;transform:scale(1);box-shadow:0 6px #6d241a}@keyframes buddy-breathe{0%,to{transform:translateY(0)scale(1)}50%{transform:translateY(-3px)scale(1.012,.99)}}@keyframes buddy-shadow{0%,to{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(.94)}}@keyframes buddy-blink{0%,45%,49%,92%,96%,to{transform:scaleY(1)}47%,94%{transform:scaleY(.1)}}@keyframes buddy-dot{0%,to{opacity:.5;transform:translateY(0)}50%{opacity:1;transform:translateY(-5px)}}@keyframes buddy-talk{0%{height:6px;top:92px}to{height:16px;top:86px}}@keyframes buddy-wave{0%,to{transform:rotate(150deg)translate(-8px,20px)}50%{transform:rotate(185deg)translate(-8px,20px)}}@keyframes buddy-jump{0%,to{transform:translateY(0)scale(1)}20%{transform:translateY(4px)scale(1.06,.92)}55%{transform:translateY(-34px)scale(.96,1.05)}}@keyframes buddy-confetti{0%{opacity:1;transform:rotate(var(--angle)) translateY(0) rotate(0deg)}to{opacity:0;transform:rotate(var(--angle)) translateY(-150px) rotate(320deg)}}@keyframes buddy-sweat{0%,30%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(26px)}}@keyframes buddy-nudge{0%,80%,to{rotate:12deg}85%{rotate:-4deg}90%{rotate:20deg}}@keyframes buddy-shake{0%,to{transform:translate(0)}25%{transform:translate(-7px)}75%{transform:translate(7px)}}@media (prefers-reduced-motion:reduce){.buddy-figure,.buddy-eyes{transform:none}}
.chat{right:var(--space-6);bottom:var(--space-6);z-index:45;background:var(--color-surface);border:1px solid var(--color-line-strong);border-radius:var(--radius-xl);width:390px;max-width:calc(100vw - 24px);height:600px;max-height:calc(100dvh - 110px);box-shadow:var(--shadow-lg);animation:chat-in .35s var(--ease-out);flex-direction:column;display:flex;position:fixed;overflow:hidden}.chat--inline{z-index:auto;width:100%;max-width:none;height:520px;max-height:none;animation:none;position:relative;inset:auto}@keyframes chat-in{0%{opacity:0;transform:translateY(16px)scale(.98)}}.chat__header{align-items:center;gap:var(--space-3);padding:var(--space-3) var(--space-4);border-bottom:1px solid var(--color-line);background:var(--color-bg);display:flex}.chat__avatar{border-radius:var(--radius-md);background:var(--color-accent-soft);place-items:center;width:52px;height:52px;display:grid;overflow:visible}.chat__avatar .buddy{margin:4px 0 0 2px}.chat__title{flex:1;min-width:0}.chat__title strong,.chat__title small{display:block}.chat__title strong{font-size:var(--text-base)}.chat__title small{font-size:var(--text-xs);color:var(--color-muted);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.chat--concerned .chat__title small{color:var(--color-warn);font-weight:650}.chat__messages{overscroll-behavior:contain;padding:var(--space-5) var(--space-4);gap:var(--space-4);flex-direction:column;flex:1;display:flex;overflow-y:auto}.msg{max-width:88%;animation:msg-in .3s var(--ease-out);flex-direction:column;display:flex;position:relative}@keyframes msg-in{0%{opacity:0;transform:translateY(8px)}}.msg--assistant{align-self:flex-start;align-items:flex-start}.msg--user{align-self:flex-end;align-items:flex-end}.msg__bubble{font-size:var(--text-sm);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:18px;padding:10px 14px;line-height:1.55}.msg--assistant .msg__bubble{background:var(--color-surface-2);color:var(--color-ink);border-bottom-left-radius:6px}.msg--user .msg__bubble{background:var(--color-accent);color:#fff;border-bottom-right-radius:6px}.msg--pending .msg__bubble{opacity:.75}.msg--error .msg__bubble{background:var(--color-danger-soft);color:var(--color-danger)}.msg__reaction{border-radius:var(--radius-pill);background:var(--color-surface);border:2px solid var(--color-bg);min-width:28px;height:28px;box-shadow:var(--shadow-md);animation:reaction-pop .45s var(--ease-spring);place-items:center;padding:0 5px;font-size:14px;line-height:1;display:grid;position:absolute;top:-12px}.msg--user .msg__reaction{left:-14px}.msg--assistant .msg__reaction{right:-14px}@keyframes reaction-pop{0%{transform:scale(0)}70%{transform:scale(1.25)}}.tapback{margin-top:4px;position:relative}.tapback__toggle{border-radius:var(--radius-pill);width:28px;height:28px;color:var(--color-muted);opacity:.7;place-items:center;transition:opacity .15s,background-color .15s;display:inline-grid}.msg:hover .tapback__toggle,.tapback__toggle:focus-visible,.tapback__toggle[aria-expanded=true]{opacity:1;background:var(--color-surface-2)}.tapback__menu{z-index:3;border-radius:var(--radius-pill);background:var(--color-surface);border:1px solid var(--color-line);box-shadow:var(--shadow-lg);animation:reaction-pop .3s var(--ease-spring);transform-origin:0 100%;gap:2px;padding:5px;display:flex;position:absolute;bottom:calc(100% + 4px);left:0}.tapback__menu button{width:36px;height:36px;transition:transform .15s var(--ease-spring);border-radius:50%;font-size:18px}.tapback__menu button:hover{transform:scale(1.25)}.tapback__menu button.is-active{background:var(--color-accent-soft)}.typing{gap:5px;padding:14px 16px;display:flex}.typing i{background:var(--color-muted);border-radius:50%;width:7px;height:7px;animation:1.1s ease-in-out infinite typing}.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}@keyframes typing{0%,60%,to{opacity:.45;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}.stream-caret{vertical-align:-2px;background:var(--color-accent);width:2px;height:1em;margin-left:2px;animation:.8s step-end infinite caret;display:inline-block}@keyframes caret{50%{opacity:0}}.chat__chips{gap:var(--space-2);padding:0 var(--space-4) var(--space-3);scrollbar-width:none;display:flex;overflow-x:auto}.chip{border-radius:var(--radius-pill);border:1px solid var(--color-line-strong);background:var(--color-surface);font-size:var(--text-xs);color:var(--color-ink-soft);flex-shrink:0;padding:7px 12px;font-weight:650;transition:border-color .15s,color .15s,transform .15s}.chip:hover{border-color:var(--color-accent);color:var(--color-accent-ink);transform:translateY(-1px)}.chat__composer{gap:var(--space-2);padding:var(--space-3);border-top:1px solid var(--color-line);display:flex}.chat__composer .input{border-radius:var(--radius-pill);padding-inline:var(--space-4)}.chat__send{border-radius:50%;width:44px;padding:0}.chat__confetti{pointer-events:none;position:absolute;top:45%;left:50%}.chat__confetti i{background:var(--color-accent);opacity:0;width:9px;height:13px;animation:chat-confetti 1.4s var(--ease-out) forwards;border-radius:2px;position:absolute}.chat__confetti i:nth-child(3n){background:var(--color-green)}.chat__confetti i:nth-child(3n+1){background:#e5b54a}.chat__confetti i:nth-child(odd){animation-duration:1.7s}.chat__confetti i:first-child{--x:-150px;--y:-220px}.chat__confetti i:nth-child(2){--x:-110px;--y:-260px}.chat__confetti i:nth-child(3){--x:-70px;--y:-200px}.chat__confetti i:nth-child(4){--x:-30px;--y:-280px}.chat__confetti i:nth-child(5){--x:10px;--y:-240px}.chat__confetti i:nth-child(6){--x:50px;--y:-290px}.chat__confetti i:nth-child(7){--x:90px;--y:-210px}.chat__confetti i:nth-child(8){--x:130px;--y:-250px}.chat__confetti i:nth-child(9){--x:160px;--y:-180px}.chat__confetti i:nth-child(10){--x:-160px;--y:-140px}.chat__confetti i:nth-child(11){--x:-120px;--y:-170px}.chat__confetti i:nth-child(12){--x:-50px;--y:-150px}.chat__confetti i:nth-child(13){--x:30px;--y:-170px}.chat__confetti i:nth-child(14){--x:110px;--y:-150px}.chat__confetti i:nth-child(15){--x:150px;--y:-120px}.chat__confetti i:nth-child(16){--x:-90px;--y:-110px}.chat__confetti i:nth-child(17){--x:70px;--y:-120px}.chat__confetti i:nth-child(18){--x:0px;--y:-320px}@keyframes chat-confetti{0%{opacity:1;transform:translate(0)rotate(0)}70%{opacity:1}to{opacity:0;transform:translate(var(--x), calc(var(--y) + 260px)) rotate(540deg)}}.chat-launcher{right:var(--space-6);bottom:var(--space-6);z-index:40;align-items:center;gap:var(--space-2);border-radius:var(--radius-pill);background:var(--color-ink);color:var(--color-night-text);box-shadow:var(--shadow-lg);font-weight:700;font-size:var(--text-sm);transition:transform .2s var(--ease-spring);padding:6px 18px 6px 6px;display:inline-flex;position:fixed}.chat-launcher:hover{transform:translateY(-3px)}.chat-launcher__face{background:var(--color-accent-soft);border-radius:50%;place-items:center;width:46px;height:46px;display:grid;overflow:hidden}.chat-launcher__face .buddy{margin:6px 0 0 2px}.chat-launcher__dot{background:var(--color-accent-light);border-radius:50%;width:9px;height:9px;animation:1.8s infinite ping;box-shadow:0 0 #f08a6299}@keyframes ping{70%{box-shadow:0 0 0 10px #f08a6200}to{box-shadow:0 0 #f08a6200}}@media (max-width:700px){.chat{width:auto;max-width:none;height:calc(100dvh - 110px);bottom:84px;left:12px;right:12px}.chat--inline{height:500px;bottom:auto;left:auto;right:auto}.chat-launcher{right:var(--space-4);bottom:84px}.chat-launcher__label{display:none}.chat-launcher{padding:5px}}
