/* =====================================================================
   LiveChat widget — سایت (حالت عادی + VIP)
   ===================================================================== */
.lc{
    --lc-bg:#ffffff; --lc-bg2:#f4f6fb; --lc-surface:#ffffff; --lc-line:rgba(20,28,45,.10);
    --lc-text:#1b2333; --lc-muted:#6b7488; --lc-them:#f1f3f8; --lc-them-text:#1b2333;
    --lc-me:linear-gradient(135deg,var(--lc-c2),var(--lc-c1)); --lc-me-text:var(--lc-on);
    --lc-shadow:0 30px 70px -24px rgba(16,24,40,.45); --lc-radius:22px; --lc-ease:cubic-bezier(.2,.9,.3,1.12);
    position:fixed; inset:auto; z-index:1002; font-family:inherit; line-height:1.7; color:var(--lc-text);
}
.lc[data-theme="dark"]{
    --lc-bg:#121725; --lc-bg2:#0d111c; --lc-surface:#1a2133; --lc-line:rgba(255,255,255,.09);
    --lc-text:#e9edf7; --lc-muted:#97a1b8; --lc-them:#212a3f; --lc-them-text:#e9edf7;
    --lc-shadow:0 30px 70px -24px rgba(0,0,0,.85);
}
.lc *{ box-sizing:border-box; }
.lc button{ font-family:inherit; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.lc [hidden]{ display:none !important; }

/* ---------- panel ---------- */
.lc-scrim{ position:fixed; inset:0; background:rgba(5,8,20,.45); opacity:0; pointer-events:none; transition:opacity .3s; }
.lc-panel{
    position:fixed; bottom:24px; width:390px; height:min(640px,calc(100vh - 48px)); display:flex; flex-direction:column; overflow:hidden;
    background:var(--lc-bg); border:1px solid var(--lc-line); border-radius:var(--lc-radius); box-shadow:var(--lc-shadow);
    opacity:0; visibility:hidden; transform:translateY(24px) scale(.96); transition:opacity .28s, transform .42s var(--lc-ease), visibility 0s .42s;
}
.lc-vip .lc-panel{ right:22px; transform-origin:100% 100%; }
.lc-basic .lc-panel{ left:22px; transform-origin:0 100%; }
.lc.lc-open .lc-panel{ opacity:1; visibility:visible; transform:none; transition:opacity .28s, transform .42s var(--lc-ease), visibility 0s; }

/* ---------- header ---------- */
.lc-head{ position:relative; display:flex; align-items:center; gap:12px; padding:16px 16px 14px; color:var(--lc-on);
    background:linear-gradient(135deg,var(--lc-c2),var(--lc-c1)); flex:0 0 auto; }
.lc-vip .lc-head::after{ content:""; position:absolute; width:180px; height:180px; top:-100px; inset-inline-end:-40px; border-radius:50%; background:rgba(255,255,255,.16); pointer-events:none; }
.lc-ava{ position:relative; flex:0 0 auto; width:46px; height:46px; border-radius:15px; display:grid; place-items:center; font-size:24px;
    background:rgba(255,255,255,.2); box-shadow:inset 0 0 0 1px rgba(255,255,255,.3); }
.lc-ava img{ width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.lc-ava i{ color:var(--lc-on); }
.lc-ava-dot{ position:absolute; bottom:-2px; inset-inline-end:-2px; width:13px; height:13px; border-radius:50%; background:#9aa3b5; border:2px solid var(--lc-c1); transition:background .3s; }
.lc.lc-admin-on .lc-ava-dot{ background:#22c55e; animation:lcDot 2s infinite; }
@keyframes lcDot{ 0%{ box-shadow:0 0 0 0 rgba(34,197,94,.55); } 70%{ box-shadow:0 0 0 7px rgba(34,197,94,0); } 100%{ box-shadow:0 0 0 0 rgba(34,197,94,0); } }
.lc-head-t{ flex:1; min-width:0; display:flex; flex-direction:column; line-height:1.45; }
.lc-head-t strong{ font-size:14.5px; font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--lc-on); }
.lc-head-t small{ font-size:12px; opacity:.9; color:var(--lc-on); }
.lc-x{ flex:0 0 auto; width:38px; height:38px; border:0; border-radius:12px; display:grid; place-items:center; font-size:21px; color:var(--lc-on); background:rgba(255,255,255,.16); transition:.2s; }
.lc-x:hover{ background:rgba(255,255,255,.28); transform:rotate(90deg); }
.lc-x i{ color:var(--lc-on); }
.lc-net{ flex:0 0 auto; padding:6px 12px; font-size:12px; text-align:center; color:#92400e; background:#fef3c7; }

/* ---------- messages ---------- */
.lc-body{ position:relative; flex:1; min-height:0; background:var(--lc-bg2); }
.lc-vip .lc-body{ background:radial-gradient(120% 60% at 100% 0%,color-mix(in srgb,var(--lc-c1) 9%,transparent),transparent 60%),var(--lc-bg2); }
.lc-msgs{ height:100%; overflow-y:auto; overscroll-behavior:contain; padding:14px 12px 8px; display:flex; flex-direction:column; gap:3px; scroll-behavior:auto; }
.lc-msgs::-webkit-scrollbar{ width:5px; } .lc-msgs::-webkit-scrollbar-thumb{ background:var(--lc-line); border-radius:9px; }
.lc-day{ align-self:center; margin:10px 0 6px; padding:3px 12px; font-size:11px; font-weight:700; color:var(--lc-muted); background:var(--lc-surface); border:1px solid var(--lc-line); border-radius:50px; }
.lc-older{ align-self:center; margin:2px 0 8px; padding:5px 14px; font-size:12px; color:var(--lc-muted); background:var(--lc-surface); border:1px solid var(--lc-line); border-radius:50px; }
.lc-m{ position:relative; display:flex; align-items:flex-end; gap:6px; max-width:86%; animation:lcIn .32s var(--lc-ease) both; }
@keyframes lcIn{ from{ opacity:0; transform:translateY(8px) scale(.98); } }
.lc-m.me{ align-self:flex-start; flex-direction:row; }
.lc-m.them{ align-self:flex-end; flex-direction:row-reverse; }
.lc[dir="ltr"] .lc-m.me{ align-self:flex-end; } .lc[dir="ltr"] .lc-m.them{ align-self:flex-start; }
.lc-m + .lc-m.me:not(.lc-m.them + .lc-m.me), .lc-m.them + .lc-m.them{ margin-top:0; }
.lc-m.me + .lc-m.them, .lc-m.them + .lc-m.me{ margin-top:8px; }
.lc-bub{ position:relative; min-width:64px; max-width:100%; padding:8px 12px 5px; border-radius:18px; font-size:14px; overflow-wrap:anywhere; word-break:break-word; }
.lc-m.me .lc-bub{ background:var(--lc-me); color:var(--lc-me-text); border-end-start-radius:6px; box-shadow:0 8px 18px -12px var(--lc-c1); }
.lc-m.them .lc-bub{ background:var(--lc-them); color:var(--lc-them-text); border-end-end-radius:6px; border:1px solid var(--lc-line); }
.lc-basic .lc-m.me .lc-bub{ background:var(--lc-c1); box-shadow:none; }
.lc-m.sys{ align-self:center; max-width:92%; }
.lc-m.sys .lc-bub{ text-align:center; background:var(--lc-surface); color:var(--lc-text); border:1px dashed var(--lc-line); font-size:13px; padding:10px 14px; }
.lc-txt{ white-space:pre-wrap; unicode-bidi:plaintext; }
.lc-txt a{ color:inherit; text-decoration:underline; text-underline-offset:3px; word-break:break-all; }
.lc-meta{ display:flex; align-items:center; justify-content:flex-end; gap:4px; margin-top:2px; font-size:10.5px; opacity:.72; direction:ltr; }
.lc-tick{ font-size:14px; line-height:1; }
.lc-tick.seen{ opacity:1; color:#7dd3fc; }
.lc-m.them .lc-tick{ display:none; }
.lc-m.pending .lc-bub{ opacity:.7; }
.lc-m.failed .lc-bub{ outline:2px solid #ef4444; }
.lc-fail{ display:block; margin-top:4px; font-size:11.5px; color:#fecaca; text-decoration:underline; background:none; border:0; padding:0; }
.lc-m.them .lc-fail{ color:#ef4444; }
.lc-rep{ flex:0 0 auto; width:28px; height:28px; border:0; border-radius:50%; display:grid; place-items:center; font-size:16px; color:var(--lc-muted);
    background:var(--lc-surface); box-shadow:0 2px 8px -3px rgba(0,0,0,.2); opacity:0; transform:scale(.7); transition:.2s; }
.lc-m:hover .lc-rep, .lc-m:focus-within .lc-rep{ opacity:1; transform:none; }
@media (hover:none){ .lc-rep{ opacity:.75; transform:none; width:26px; height:26px; } }
.lc-m.sys .lc-rep, .lc-m.pending .lc-rep{ display:none; }
.lc-m.flash .lc-bub{ animation:lcFlash 1.2s; }
@keyframes lcFlash{ 0%,60%{ box-shadow:0 0 0 3px color-mix(in srgb,var(--lc-c1) 55%,transparent); } }

/* quote */
.lc-quote{ display:block; margin:0 -4px 6px; padding:5px 9px; border-radius:10px; font-size:12px; line-height:1.5; cursor:pointer;
    border-inline-start:3px solid currentColor; background:rgba(0,0,0,.08); max-height:52px; overflow:hidden; }
.lc-m.them .lc-quote{ border-color:var(--lc-c1); background:color-mix(in srgb,var(--lc-c1) 8%,transparent); }
.lc-quote b{ display:block; font-size:11px; opacity:.85; }

/* image + file */
.lc-img{ display:block; margin:2px -6px 4px; border-radius:13px; overflow:hidden; background:rgba(0,0,0,.06); }
.lc-img img{ display:block; max-width:100%; max-height:260px; min-height:60px; margin:auto; object-fit:cover; }
.lc-filecard{ display:flex; align-items:center; gap:10px; margin:2px 0 4px; padding:8px 10px; border-radius:13px; text-decoration:none !important; color:inherit !important;
    background:rgba(0,0,0,.07); min-width:200px; }
.lc-m.them .lc-filecard{ background:var(--lc-surface); border:1px solid var(--lc-line); }
.lc-fileico{ flex:0 0 auto; width:40px; height:40px; border-radius:12px; display:grid; place-items:center; font-size:22px; background:rgba(255,255,255,.22); }
.lc-m.them .lc-fileico{ background:color-mix(in srgb,var(--lc-c1) 14%,transparent); color:var(--lc-c1); }
.lc-filecard span{ flex:1; min-width:0; display:flex; flex-direction:column; line-height:1.4; }
.lc-filecard b{ font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; direction:ltr; text-align:start; unicode-bidi:plaintext; }
.lc-filecard small{ font-size:11px; opacity:.75; }
.lc-prog{ height:4px; margin-top:6px; border-radius:4px; background:rgba(0,0,0,.12); overflow:hidden; }
.lc-prog i{ display:block; height:100%; width:0; background:currentColor; transition:width .2s; }
.lc-cancel{ background:none; border:0; color:inherit; font-size:18px; padding:0 2px; }

/* product card */
.lc-prods{ display:flex; flex-direction:column; gap:6px; margin:6px -4px 2px; }
.lc-prod{ display:flex; align-items:center; gap:10px; padding:7px; border-radius:14px; text-decoration:none !important; color:var(--lc-text) !important;
    background:var(--lc-surface); border:1px solid var(--lc-line); transition:transform .2s, box-shadow .2s; }
.lc-prod:hover{ transform:translateY(-2px); box-shadow:0 10px 22px -14px rgba(0,0,0,.4); }
.lc-prod img{ flex:0 0 auto; width:58px; height:58px; object-fit:contain; border-radius:10px; background:#fff; }
.lc-prod span{ flex:1; min-width:0; display:flex; flex-direction:column; line-height:1.5; }
.lc-prod b{ font-size:12.5px; font-weight:700; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.lc-prod em{ font-style:normal; font-size:12.5px; font-weight:800; color:var(--lc-c1); }
.lc[data-theme="dark"] .lc-prod em{ color:color-mix(in srgb,var(--lc-c1) 60%,#fff); }
.lc-prod small{ font-size:11px; color:var(--lc-muted); }
.lc-prod .lc-ns{ color:#ef4444; }
.lc-prod del{ font-size:11px; color:var(--lc-muted); }
.lc-off{ display:inline-block; margin-inline-start:5px; padding:0 6px; border-radius:6px; font-size:10.5px; font-style:normal; font-weight:800; color:#fff; background:#ef4444; }

/* new message chip + drop zone */
.lc-newchip{ position:absolute; bottom:12px; left:50%; transform:translateX(-50%); padding:6px 14px; border:0; border-radius:50px; font-size:12px; font-weight:700;
    color:var(--lc-on); background:linear-gradient(135deg,var(--lc-c2),var(--lc-c1)); box-shadow:0 10px 20px -10px var(--lc-c1); animation:lcIn .3s both; }
.lc-newchip i{ color:var(--lc-on); }
.lc-drop{ position:absolute; inset:10px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; border-radius:18px;
    border:2px dashed var(--lc-c1); background:color-mix(in srgb,var(--lc-bg) 88%,transparent); color:var(--lc-c1); font-weight:700; font-size:14px;
    opacity:0; pointer-events:none; transition:opacity .2s; }
.lc-drop i{ font-size:40px; }
.lc.lc-dragging .lc-drop{ opacity:1; }

/* typing */
.lc-typing{ flex:0 0 auto; padding:4px 16px; font-size:12px; color:var(--lc-muted); background:var(--lc-bg2); }
.lc-dots{ display:inline-flex; gap:3px; vertical-align:middle; margin-inline-end:4px; }
.lc-dots b{ width:6px; height:6px; border-radius:50%; background:var(--lc-c1); animation:lcBounce 1.2s infinite; }
.lc-dots b:nth-child(2){ animation-delay:.15s; } .lc-dots b:nth-child(3){ animation-delay:.3s; }
@keyframes lcBounce{ 0%,60%,100%{ transform:translateY(0); opacity:.5; } 30%{ transform:translateY(-4px); opacity:1; } }

/* ---------- composer ---------- */
.lc-foot{ flex:0 0 auto; padding:10px 10px calc(10px + env(safe-area-inset-bottom,0px)); background:var(--lc-bg); border-top:1px solid var(--lc-line); }
.lc-replybar{ display:flex; align-items:center; gap:8px; margin:0 2px 8px; padding:6px 10px; border-radius:12px; background:var(--lc-bg2); border-inline-start:3px solid var(--lc-c1); animation:lcIn .25s both; }
.lc-replybar > i{ color:var(--lc-c1); font-size:18px; }
.lc-replybar div{ flex:1; min-width:0; display:flex; flex-direction:column; line-height:1.4; }
.lc-replybar small{ font-size:11px; font-weight:700; color:var(--lc-c1); }
.lc-replybar span{ font-size:12px; color:var(--lc-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.lc-replyx{ border:0; background:none; color:var(--lc-muted); font-size:18px; }
.lc-blocked{ padding:12px; text-align:center; font-size:13px; border-radius:14px; color:#b91c1c; background:#fee2e2; }
.lc-compose{ display:flex; align-items:flex-end; gap:6px; margin:0; padding:5px; border-radius:20px; background:var(--lc-bg2); border:1px solid var(--lc-line); transition:border-color .2s, box-shadow .2s; }
.lc-compose:focus-within{ border-color:var(--lc-c1); box-shadow:0 0 0 3px color-mix(in srgb,var(--lc-c1) 16%,transparent); }
.lc-input{ flex:1; min-width:0; max-height:130px; min-height:40px; padding:8px 6px; margin:0; border:0 !important; outline:0 !important; resize:none; background:transparent !important;
    color:var(--lc-text); font-family:inherit; font-size:14px; line-height:1.6; box-shadow:none !important; }
.lc-input::placeholder{ color:var(--lc-muted); }
.lc-attach,.lc-send{ flex:0 0 auto; width:40px; height:40px; border:0; border-radius:15px; display:grid; place-items:center; font-size:21px; transition:.2s; }
.lc-attach{ background:transparent; color:var(--lc-muted); }
.lc-attach:hover{ color:var(--lc-c1); background:color-mix(in srgb,var(--lc-c1) 10%,transparent); }
.lc-send{ color:var(--lc-on); background:linear-gradient(135deg,var(--lc-c2),var(--lc-c1)); box-shadow:0 8px 16px -8px var(--lc-c1); }
.lc-send i{ color:var(--lc-on); }
.lc[dir="rtl"] .lc-send i{ transform:scaleX(-1); }
.lc-send:disabled{ opacity:.45; box-shadow:none; }
.lc-send:not(:disabled):hover{ transform:scale(1.06); }

/* ---------- launcher (حالت عادی) ---------- */
.lc-launcher{ position:fixed; left:22px; bottom:24px; z-index:1001; width:60px; height:60px; border:0; border-radius:50%; display:grid; place-items:center; cursor:pointer;
    font-size:28px; color:var(--lc-on); background:var(--lc-c1); box-shadow:0 14px 28px -10px var(--lc-c1); transition:transform .3s, opacity .3s; -webkit-tap-highlight-color:transparent; }
.lc-launcher i{ color:var(--lc-on); }
.lc-launcher:hover{ transform:translateY(-3px) scale(1.04); }
.lc-launcher.lc-hide{ opacity:0; transform:scale(.6); pointer-events:none; }
.lc-badge{ position:absolute; top:-3px; right:-3px; min-width:22px; height:22px; padding:0 6px; border-radius:50px; font-size:11px; font-weight:800; line-height:22px; text-align:center;
    color:#fff; background:#ef4444; box-shadow:0 0 0 3px #fff,0 6px 12px -4px rgba(239,68,68,.6); animation:lcPop .4s var(--lc-ease); }
@keyframes lcPop{ from{ transform:scale(0); } }
/* badge روی دکمه‌های VIP */
.vf-fab-badge{ flex:0 0 auto; min-width:22px; height:22px; padding:0 6px; border-radius:50px; background:#ef4444; color:#fff; font-size:11px; font-weight:800; line-height:22px; text-align:center;
    box-shadow:0 6px 12px -4px rgba(239,68,68,.6); }
.vf-fab-badge:empty{ display:none; }
.vf-fab-main .lc-badge{ top:-2px; right:-2px; box-shadow:0 0 0 3px var(--vf-bg,#fff); z-index:2; }

/* ---------- mobile ---------- */
@media (max-width:600px){
    .lc .lc-panel{ left:0 !important; right:0 !important; bottom:0; width:100%; height:100%; height:100dvh; border-radius:0; border:0; transform:translateY(40px); }
    .lc.lc-open .lc-scrim{ opacity:1; }
    .lc-launcher{ left:16px; bottom:calc(84px + env(safe-area-inset-bottom,0px)); width:56px; height:56px; }
    html.lc-lock, html.lc-lock body{ overflow:hidden !important; }
    .lc-rep{ opacity:.7; transform:none; }
}
@media (prefers-reduced-motion:reduce){ .lc *, .lc-launcher{ animation:none !important; transition:none !important; } }
