/* ════════════════════════════════════════════════════
   Chat widget — bottom-left assistant. Self-contained.
   ════════════════════════════════════════════════════ */
.cb-launch{
  position:fixed;right:24px;bottom:24px;z-index:9500;
  display:flex;align-items:center;gap:11px;
  height:58px;padding:0 22px 0 16px;border:none;border-radius:999px;cursor:pointer;
  background:var(--accent,#6366F1);color:#fff;
  font-family:'Space Grotesk',system-ui,sans-serif;font-weight:600;font-size:.95rem;
  box-shadow:0 14px 34px -10px rgba(99,102,241,.75);
  transition:transform .25s cubic-bezier(.22,1,.36,1),box-shadow .25s,opacity .2s;
}
.cb-launch:hover{transform:translateY(-3px) scale(1.03)}
.cb-launch__icon{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:rgba(255,255,255,.2);flex-shrink:0}
.cb-launch__pulse{position:absolute;top:14px;right:18px;width:9px;height:9px;border-radius:50%;background:#4ade80;box-shadow:0 0 0 0 rgba(74,222,128,.6);animation:cb-ping 2s infinite}
@keyframes cb-ping{0%,100%{box-shadow:0 0 0 0 rgba(74,222,128,.6)}70%{box-shadow:0 0 0 9px rgba(74,222,128,0)}}
.cb-launch.cb-hidden{opacity:0;pointer-events:none;transform:scale(.8)}

/* Panel */
.cb-panel{
  position:fixed;right:24px;bottom:24px;z-index:9501;
  width:370px;max-width:calc(100vw - 32px);height:540px;max-height:calc(100vh - 48px);
  display:flex;flex-direction:column;overflow:hidden;
  background:#131316;border:1px solid rgba(255,255,255,.1);border-radius:20px;
  box-shadow:0 30px 70px -20px rgba(0,0,0,.7);
  opacity:0;transform:translateY(20px) scale(.96);pointer-events:none;transform-origin:bottom right;
  transition:opacity .28s cubic-bezier(.22,1,.36,1),transform .28s cubic-bezier(.22,1,.36,1);
  font-family:'Inter',system-ui,sans-serif;
}
.cb-panel.cb-open{opacity:1;transform:none;pointer-events:auto}

.cb-head{display:flex;align-items:center;gap:12px;padding:18px 18px;background:linear-gradient(135deg,#1c1c20,#131316);border-bottom:1px solid rgba(255,255,255,.08)}
.cb-head__av{position:relative;display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:var(--accent,#6366F1);color:#fff;font-family:'Space Grotesk',sans-serif;font-weight:700;font-size:1.1rem;flex-shrink:0}
.cb-head__av::after{content:'';position:absolute;right:-1px;bottom:-1px;width:12px;height:12px;border-radius:50%;background:#4ade80;border:2px solid #131316}
.cb-head__info{display:flex;flex-direction:column;line-height:1.2}
.cb-head__info b{font-family:'Space Grotesk',sans-serif;color:#fff;font-size:1rem}
.cb-head__info span{font-size:.78rem;color:#71717a}
.cb-head__close{margin-left:auto;width:34px;height:34px;border:none;border-radius:9px;background:rgba(255,255,255,.06);color:#a1a1aa;font-size:1.1rem;cursor:pointer;transition:background .2s,color .2s}
.cb-head__close:hover{background:rgba(255,255,255,.12);color:#fff}

/* Messages */
.cb-body{flex:1;overflow-y:auto;padding:18px;display:flex;flex-direction:column;gap:12px;scrollbar-width:thin;scrollbar-color:#3f3f46 transparent}
.cb-body::-webkit-scrollbar{width:6px}.cb-body::-webkit-scrollbar-thumb{background:#3f3f46;border-radius:6px}
.cb-msg{max-width:84%;padding:11px 15px;border-radius:15px;font-size:.92rem;line-height:1.5;animation:cb-rise .3s cubic-bezier(.22,1,.36,1)}
@keyframes cb-rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.cb-msg--bot{align-self:flex-start;background:#212126;color:#e4e4e7;border-bottom-left-radius:5px}
.cb-msg--user{align-self:flex-end;background:var(--accent,#6366F1);color:#fff;border-bottom-right-radius:5px}
.cb-msg a{color:var(--accent-2,#818CF8);border-bottom:1px solid currentColor}
.cb-msg--user a{color:#fff}

/* Typing */
.cb-typing{align-self:flex-start;display:flex;gap:4px;padding:13px 16px;background:#212126;border-radius:15px;border-bottom-left-radius:5px}
.cb-typing span{width:7px;height:7px;border-radius:50%;background:#71717a;animation:cb-blink 1.2s infinite}
.cb-typing span:nth-child(2){animation-delay:.2s}.cb-typing span:nth-child(3){animation-delay:.4s}
@keyframes cb-blink{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}

/* Quick replies */
.cb-chips{display:flex;flex-wrap:wrap;gap:8px;padding:0 18px 12px}
.cb-chip{font-family:'Space Grotesk',sans-serif;font-size:.82rem;font-weight:500;color:var(--accent-2,#818CF8);background:rgba(99,102,241,.12);border:1px solid rgba(99,102,241,.3);padding:8px 14px;border-radius:999px;cursor:pointer;transition:background .2s,transform .15s}
.cb-chip:hover{background:rgba(99,102,241,.22)}
.cb-chip:active{transform:scale(.95)}

/* Input */
.cb-input{display:flex;gap:9px;padding:14px;border-top:1px solid rgba(255,255,255,.08);background:#131316}
.cb-input input{flex:1;font-family:'Inter',sans-serif;font-size:.92rem;padding:12px 15px;border-radius:11px;border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.05);color:#fff;outline:none;transition:border-color .2s}
.cb-input input:focus{border-color:var(--accent,#6366F1)}
.cb-input input::placeholder{color:#52525b}
.cb-input button{display:grid;place-items:center;width:44px;height:44px;flex-shrink:0;border:none;border-radius:11px;background:var(--accent,#6366F1);color:#fff;cursor:pointer;transition:background .2s,transform .15s}
.cb-input button:hover{background:#5457e6}
.cb-input button:active{transform:scale(.92)}
.cb-chip:disabled,.cb-input button:disabled,.cb-input input:disabled{opacity:.5;cursor:not-allowed}

@media(max-width:520px){
  .cb-panel{left:16px;right:16px;width:auto;bottom:16px;height:calc(100vh - 32px)}
  .cb-launch{right:16px;bottom:16px}
}
@media(prefers-reduced-motion:reduce){
  .cb-launch,.cb-panel,.cb-msg{transition:none;animation:none}
  .cb-launch__pulse,.cb-typing span{animation:none}
}
