/* تم‌ها */
:root{
  --acb-bg:#ffffff; --acb-text:#0f172a; --acb-primary:#ffb300;
  --acb-muted:#f7f7fb; --acb-border:#e7e9ef; --acb-shadow:0 14px 40px rgba(0,0,0,.10);
  --acb-grad: linear-gradient(135deg, #ffb300 0%, #ff6a00 100%);
}
[data-acb-theme="dark"]{
  --acb-bg:#0c1222; --acb-text:#e6edf6; --acb-primary:#ffc147;
  --acb-muted:#131a2c; --acb-border:#20283a; --acb-shadow:0 14px 40px rgba(0,0,0,.45);
  --acb-grad: linear-gradient(135deg, #ffc147 0%, #ff7a1a 100%);
}

/* دکمه شناور – چپِ میانه صفحه */
.acb-fab{
  position:fixed; width:62px; height:62px;
  background:var(--acb-bg); color:var(--acb-text); border-radius:18px; display:grid; place-items:center;
  box-shadow:var(--acb-shadow); cursor:pointer; z-index:2147483647; user-select:none; border:1px solid var(--acb-border);
  transition: transform .18s ease, box-shadow .18s ease;
}
.acb-fab.acb-left{ left:20px; right:auto; top:50%; transform:translateY(-50%); }
.acb-fab:hover{ transform: translateY(calc(-50% - 2px)); box-shadow:0 18px 50px rgba(0,0,0,.12); }
.acb-fab:active{ transform: translateY(-50%); }
.acb-fab[data-inline="1"]{ position:relative; left:auto; top:auto; transform:none; margin:10px 0; }

.acb-fab__logo{ width:28px; height:28px; object-fit:contain; border-radius:6px; display:block; }
.acb-fab__tag{
  position:absolute; top:-8px; right:-8px; padding:4px 8px; font-size:12px; font-weight:800; letter-spacing:.5px;
  color:#fff; background:var(--acb-grad); border-radius:999px; border:2px solid var(--acb-bg); box-shadow:var(--acb-shadow);
}
.acb-fab__badge{ position:absolute; bottom:-6px; left:-6px; background:#ef4444; color:#fff; width:22px; height:22px; border-radius:999px; display:grid; place-items:center; font-size:12px; box-shadow:var(--acb-shadow); }

/* پنل گفتگو – چپِ میانه، ارتفاع بیشتر */
.acb-panel{
  position:fixed; left:20px; right:auto; top:50%; transform:translateY(-50%) scale(.98);
  width:420px; max-height:86vh;
  background:var(--acb-bg); border:1px solid var(--acb-border); border-radius:20px; box-shadow:var(--acb-shadow);
  display:flex; flex-direction:column; opacity:0; pointer-events:none; transition:.22s cubic-bezier(.2,.8,.2,1); z-index:2147483647;
}
.acb-panel.is-open{ opacity:1; transform:translateY(-50%) scale(1); pointer-events:auto; }
.acb-panel[dir="rtl"]{ direction:rtl; }

.acb-panel__header{ position:relative; display:flex; align-items:center; justify-content:space-between; padding:12px 12px; border-bottom:1px solid var(--acb-border); background:linear-gradient(180deg, rgba(0,0,0,.03), transparent); }
.acb-title{ display:flex; align-items:center; gap:10px; }
.acb-title__logo{ width:28px; height:28px; object-fit:contain; border-radius:7px; }
.acb-title__text{ display:flex; flex-direction:column; line-height:1.2; }
.acb-title__text strong{ font-size:14px; color:var(--acb-text); }
.acb-title__text span{ font-size:12px; opacity:.8; }
.acb-title__ai{ margin-inline-start:8px; padding:4px 10px; font-size:12px; font-weight:700; color:#fff; border-radius:999px; background:var(--acb-grad); box-shadow:0 8px 24px rgba(255,106,0,.25); }
.acb-actions{ display:flex; gap:6px; }
.acb-actions button{ background:var(--acb-muted); color:var(--acb-text); border:1px solid var(--acb-border); border-radius:10px; padding:6px 10px; cursor:pointer; transition: background .15s ease, transform .1s ease; }
.acb-actions button:hover{ background:rgba(0,0,0,.05); }
.acb-actions button:active{ transform: translateY(1px); }

/* کشوی بانک اطلاعات */
.acb-kb{ position:absolute; inset:56px 0 0 0; background:var(--acb-bg); border-top:1px solid var(--acb-border); display:flex; flex-direction:column; }
.acb-kb[hidden]{ display:none; }
.acb-kb__header{ display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border-bottom:1px dashed var(--acb-border); }
.acb-kb__body{ padding:12px; overflow:auto; line-height:1.8; }

/* پیام‌ها */
.acb-messages{ padding:12px; overflow:auto; gap:10px; display:flex; flex-direction:column; background:var(--acb-bg); }
.acb-msg{ max-width:85%; padding:12px 14px; border-radius:14px; line-height:1.75; border:1px solid transparent; animation: acb-pop .2s ease both; word-wrap:break-word; }
@keyframes acb-pop { from{transform:translateY(4px); opacity:.0} to{transform:translateY(0); opacity:1} }
.acb-msg.user{ margin-inline-start:auto; background:var(--acb-primary); color:#1c1c1c; border-bottom-right-radius:6px; border-color:transparent; }
.acb-msg.bot{ background:var(--acb-muted); color:var(--acb-text); border-bottom-left-radius:6px; border:1px solid var(--acb-border); }
.acb-msg code{ font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background:rgba(0,0,0,.08); padding:2px 6px; border-radius:6px; display:inline-block; direction:ltr; }

/* تایپینگ */
.acb-thinking{ display:flex; align-items:center; }
.acb-dots{ display:inline-flex; gap:4px; }
.acb-dots i{ width:6px; height:6px; background:#9aa3af; border-radius:999px; display:inline-block; animation: acb-bounce 1s infinite; }
.acb-dots i:nth-child(2){ animation-delay:.15s; } .acb-dots i:nth-child(3){ animation-delay:.3s; }
@keyframes acb-bounce { 0%,80%,100%{ transform: translateY(0); opacity:.6 } 40%{ transform: translateY(-4px); opacity:1 } }

/* سریع */
.acb-quick{ display:flex; gap:8px; padding:8px 12px; flex-wrap:wrap; border-top:1px dashed var(--acb-border); background:var(--acb-bg); }
.acb-quick button{ padding:7px 12px; border-radius:999px; background:var(--acb-muted); border:1px solid var(--acb-border); cursor:pointer; color:var(--acb-text); transition: transform .12s ease, background .15s ease; }
.acb-quick button:hover{ transform: translateY(-1px); background:#fff; }

/* ورودی */
.acb-input{ display:flex; gap:8px; padding:10px; border-top:1px solid var(--acb-border); background:var(--acb-bg); }
.acb-input textarea{ flex:1; resize:none; border:1px solid var(--acb-border); border-radius:12px; padding:12px; background:transparent; color:var(--acb-text); max-height:220px; min-height:52px; line-height:1.65; transition:border .15s ease, box-shadow .15s ease; }
.acb-input textarea:focus{ outline:none; border-color:transparent; box-shadow:0 0 0 2px rgba(255,179,0,.35); }
.acb-send{ width:86px; border-radius:12px; background:var(--acb-grad); color:#1b1b1b; border:none; font-weight:800; cursor:pointer; box-shadow:0 10px 30px rgba(255,106,0,.28); transition: transform .12s ease, box-shadow .12s ease; }
.acb-send:hover{ transform: translateY(-1px); box-shadow:0 12px 36px rgba(255,106,0,.32); }
.acb-send:active{ transform: translateY(0); }

/* موبایل: برگردان به پایین راست تا با UI موبایل تداخل نکند */
@media (max-width: 480px){
  .acb-fab.acb-left{ left:auto; right:12px; top:auto; bottom:12px; transform:none; }
  .acb-panel.acb-left{ left:12px; right:12px; top:auto; bottom:86px; transform:none; width:auto; max-height:78vh; }
}

/* اطمینان از دیده‌شدن */
.acb-fab, .acb-panel { z-index: 2147483647 !important; }
