/* ---------- ویجت چت‌بات ---------- */
.cb-launcher{
  position:fixed; bottom:20px; inset-inline-start:20px; width:58px; height:58px; border-radius:50%;
  background:var(--roof); color:#fff; border:none; cursor:pointer; z-index:500;
  box-shadow:0 10px 30px -8px rgba(0,0,0,.45);
  display:flex; align-items:center; justify-content:center;
  transition:background .6s ease, transform .2s ease;
}
.cb-launcher:hover{ transform:scale(1.06); }
.cb-launcher svg{ width:26px; height:26px; }
.cb-launcher .cb-x{ display:none; }
.cb-launcher.cb-open .cb-bubble{ display:none; }
.cb-launcher.cb-open .cb-x{ display:block; }

.cb-panel{
  position:fixed; bottom:88px; inset-inline-start:20px; width:min(370px, calc(100vw - 32px));
  max-height:min(70vh, 560px); background:#fff; border-radius:22px; overflow:hidden; z-index:500;
  box-shadow:0 24px 60px -16px rgba(0,0,0,.4); display:flex; flex-direction:column;
}
.cb-panel[hidden]{ display:none; }
.cb-head{
  background:linear-gradient(135deg, var(--roof), var(--accent)); color:#fff; padding:14px 18px;
  display:flex; align-items:center; justify-content:space-between; font-weight:800; flex:none;
}
.cb-close{ background:rgba(255,255,255,.25); border:none; color:#fff; width:28px; height:28px; border-radius:50%; cursor:pointer; font-size:.85rem; flex:none; }

.cb-body{ flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:10px; background:var(--cream); }
.cb-msg{ max-width:85%; padding:10px 14px; border-radius:16px; font-size:.88rem; line-height:1.8; word-break:break-word; }
.cb-msg.cb-bot{ align-self:flex-start; background:#fff; color:var(--ink); border-bottom-left-radius:4px; box-shadow:0 2px 8px rgba(0,0,0,.06); }
.cb-msg.cb-user{ align-self:flex-end; background:var(--roof); color:#fff; border-bottom-right-radius:4px; }
.cb-msg a{ text-decoration:underline; color:inherit; }

.cb-typing{ display:flex; align-items:center; gap:4px; padding:14px; }
.cb-typing span{ width:6px; height:6px; border-radius:50%; background:var(--ink-soft); display:inline-block; animation:cbBlink 1s infinite ease-in-out; }
.cb-typing span:nth-child(2){ animation-delay:.15s; }
.cb-typing span:nth-child(3){ animation-delay:.3s; }
@keyframes cbBlink{ 0%,80%,100%{ opacity:.25; } 40%{ opacity:1; } }

.cb-chips{ display:flex; flex-wrap:wrap; gap:6px; padding:0 14px 10px; flex:none; }
.cb-chip{ border:1.5px solid rgba(63,90,108,.25); background:#fff; border-radius:999px; padding:6px 12px; font-size:.78rem; cursor:pointer; color:var(--ink); font-family:inherit; }
.cb-chip:hover{ border-color:var(--roof); color:var(--roof); }

.cb-form{ display:flex; gap:8px; padding:12px 14px; border-top:1px solid rgba(63,90,108,.12); background:#fff; flex:none; }
.cb-input{ flex:1; min-width:0; border:1.5px solid rgba(63,90,108,.2); border-radius:999px; padding:10px 16px; font-family:inherit; font-size:.88rem; background:var(--cream); color:var(--ink); }
.cb-input:focus{ outline:none; border-color:var(--roof); }
.cb-send{ width:40px; height:40px; border-radius:50%; border:none; background:var(--roof); color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center; flex:none; }
.cb-send:disabled{ opacity:.5; cursor:default; }

@media (max-width:480px){
  .cb-panel{ inset-inline-start:10px; inset-inline-end:10px; width:auto; bottom:82px; }
  .cb-launcher{ inset-inline-start:14px; bottom:14px; }
}
