/* =====================================================================
   chat.css — استایل مشترک چت بازارچه (SkinNebula)
   از market.css جدا شده. همراه با js/chat.js و chat-widget.html استفاده کن.
   وابستگی: bootstrap-icons.css  +  فونت Vazirmatn/Estedad
   ===================================================================== */

/* متغیرها: روی خودِ چت/دکمه/تولتیپ تعریف شدن تا به متغیرهای صفحه‌ی میزبان دست نزنن */
:root{--chat-w:300px;--hdr:62px}
.chat,.fab,.role-tip{color-scheme:dark;--bg:#14172a;--s1:#181228;--s2:#241b3f;--s3:#2f2560;--line:rgba(197,191,238,.17);--v:#6E5FD4;--v2:#C5BFEE;--t:#f3f2fb;--m:#bcbfe0;--ok:#5fd3a6;--bad:#f28b8b;--gold:#f2c46d}

/* ریست محلیِ چت (جایگزین * و button/input سراسری market.css) */
.chat,.chat *,.chat *::before,.chat *::after{box-sizing:border-box}
.chat *{margin:0;padding:0}
.chat button,.chat input,.fab{font:inherit;color:inherit}
.chat button,.fab{cursor:pointer;border:0;background:none}
.chat :focus-visible,.fab:focus-visible{outline:2px solid var(--v2);outline-offset:2px}

/* جابه‌جایی محتوای صفحه کنار چت: به محتوای اصلی و فوتر کلاس chat-offset بده */
.chat-offset{margin-right:var(--chat-w);transition:margin .25s}
body.chat-closed .chat-offset{margin-right:0}
@media(max-width:1100px){.chat-offset,body.chat-closed .chat-offset{margin-right:0}}
@media(prefers-reduced-motion:reduce){.chat,.chat *,.fab{transition:none!important}}

/* chat */
.chat{display:flex;flex-direction:column;height:100%;background:var(--s1);border-inline-start:1px solid var(--line);min-height:0}
.chat h2{font-size:15px;padding:14px 16px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:8px}
.chat .dot{width:8px;height:8px;border-radius:50%;background:var(--ok)}.chat h2 span{font-size:12px;color:var(--m);font-weight:400;margin-inline-end:auto}
.chat .x{display:none;font-size:20px;color:var(--m)}
.chat .msgs{flex:1;overflow:auto;padding:12px;display:flex;flex-direction:column;gap:8px}
.chat .m{max-width:88%;background:var(--s3);border-radius:12px 12px 12px 3px;padding:7px 11px;font-size:13px;line-height:1.7;word-break:break-word;align-self:flex-start}
.chat .m b{display:block;font-size:11px;color:var(--v2)}.chat .m i{font-style:normal;font-size:10px;color:var(--m);margin-inline-start:6px}
.chat .m.me{align-self:flex-end;background:var(--v);border-radius:12px 12px 3px 12px}.chat .m.me b{color:#fff}
.chat .m.sys{align-self:center;max-width:100%;background:none;color:var(--m);font-size:12px;text-align:center;border:1px dashed var(--line)}
.fab{display:none}
/* ===== چت (سبک splits.gg): ثابت زیر هدر؛ محتوا و فوتر کنارش ===== */
:root{--chat-w:300px;--hdr:62px}
.chat{position:fixed;top:var(--hdr);bottom:0;right:0;left:auto;height:auto;width:var(--chat-w);z-index:9;background:var(--s1);border:0;border-left:1px solid var(--line);transition:transform .25s}
body.chat-closed .chat{transform:translateX(100%)}
[id^="goftino"],[class^="goftino"],iframe[src*="goftino"]{display:none!important}
.chat-top{display:flex;align-items:center;gap:8px;padding:12px;border-bottom:0}
.ct-ic{width:38px;height:36px;border-radius:9px;display:grid;place-items:center;background:var(--s2);color:var(--t);font-size:17px}
.ct-room{flex:1;display:flex;align-items:center;justify-content:space-between;height:36px;padding:0 12px;border-radius:9px;background:var(--s2);font-size:13px;font-weight:700}
.chat .x{display:none;width:36px;height:36px;border-radius:9px;background:var(--s2);font-size:14px}
.pin{margin:2px 10px 8px;padding:12px;border-radius:10px;background:linear-gradient(135deg,#3d3524,#241b3f);border:1px solid rgba(245,196,81,.25);display:flex;flex-direction:column;gap:8px}
.pin-row{display:flex;align-items:center;gap:10px}.pin-row>div{display:flex;flex-direction:column;line-height:1.3}
.pin-ic{width:34px;height:34px;display:grid;place-items:center;color:var(--gold);font-size:22px}
.pin small{font-size:12px;font-weight:800;color:var(--gold)}.pin b{font-size:17px}
.pin p{font-size:12px;color:var(--m);line-height:1.7}
.pin button{height:34px;border-radius:6px;background:#f5a524;color:#1b1206;font-weight:800;font-size:13px}.pin button:hover{filter:brightness(1.1)}
.chat .msgs{flex:1;overflow:auto;padding:4px 0;gap:0}
.chat .m{align-self:stretch;max-width:100%;display:flex;gap:10px;align-items:flex-start;padding:8px 12px;background:none;border-radius:0;font-size:13px;line-height:1.6}
.chat .m.me{background:none}
.chat .av{flex:none;width:36px;height:36px;border-radius:8px;display:grid;place-items:center;font-weight:800;font-size:15px;color:#fff}
.chat .m .mb{flex:1;min-width:0;padding-top:6px;word-break:break-word}
.chat .lv{display:inline-block;margin-inline-end:6px;padding:0 5px;min-width:22px;text-align:center;border:1px solid #c9922c;border-radius:4px;background:rgba(245,196,81,.14);color:var(--gold);font-size:11px;font-weight:800;line-height:17px;vertical-align:1px}
.chat .m .mb b{display:inline;font-size:13px;font-weight:800;color:var(--t);unicode-bidi:isolate}
.chat .mb .co{font-weight:800}.chat .mb .tx{display:inline;color:#e2e5f5;unicode-bidi:plaintext}
.chat .mb i{display:none}
/* رویدادها (آگهی جدید/خرید) مثل بنرِ طلایی «Tipped RAIN» */
.chat .m.sys{align-self:stretch;justify-content:flex-start;align-items:center;margin:6px 0;padding:14px 14px;border:0;border-inline-start:4px solid #f5a524;background:linear-gradient(90deg,rgba(245,165,36,.2),rgba(245,165,36,.06));color:var(--gold);font-size:13px;font-weight:800;text-align:start}
.cin-wrap{padding:10px 12px 6px;border:0}
.cin-box{display:flex;align-items:center;gap:6px;height:42px;padding:0 6px 0 4px;border-radius:10px;background:var(--s2);border:1px solid var(--line)}
.cin-box input{flex:1;min-width:0;height:100%;background:none;border:0;padding:0 8px;font-size:13px}
.cin-box input:focus-visible{outline:0}.cin-box:focus-within{border-color:var(--v)}
.ci-btn{flex:none;width:32px;height:32px;border-radius:7px;background:var(--s3);color:var(--t);display:grid;place-items:center;font-size:13px}
.ci-btn:hover{background:var(--v)}.ci-btn i{transform:scaleX(-1)}
.chat-foot{display:flex;align-items:center;justify-content:space-between;padding:6px 14px 14px;font-size:12px;color:var(--m)}
.chat-foot a{display:flex;align-items:center;gap:6px;font-weight:700;color:var(--t)}
.chat-foot>span{display:flex;align-items:center;gap:6px;color:var(--ok);font-weight:700}
/* پنل ایموجی */
.cin-wrap{position:relative}
.cin-box .emo-btn{background:none;font-size:18px;color:var(--m)}.cin-box .emo-btn:hover,.emo-btn.active{color:var(--gold);background:var(--s3)}
.emo{display:none;position:absolute;bottom:calc(100% - 2px);inset-inline:12px;max-height:210px;overflow:auto;padding:8px;gap:2px;grid-template-columns:repeat(7,1fr);background:var(--s2);border:1px solid var(--line);border-radius:12px;box-shadow:0 -10px 30px rgba(25,26,50,.5);z-index:5}
.emo.on{display:grid}
.emo button{height:34px;border-radius:7px;font-size:20px;line-height:1;display:grid;place-items:center}
.emo button:hover{background:var(--s3)}
.emo::-webkit-scrollbar{width:4px}.emo::-webkit-scrollbar-thumb{background:var(--s3)}
/* ۱) آیکون‌ها: فونت آیکون (نه فارسی) و وسط‌چین */
.chat i.bi,.bar i.bi,.fab i.bi,.pin i.bi,.ct-ic i.bi,.chat-foot i.bi,.card i.bi,.modal i.bi,.btn i.bi,.x i.bi{font-family:"bootstrap-icons"!important;font-style:normal;font-weight:400!important;line-height:1;display:inline-block;vertical-align:middle}
.chat i.bi::before,.bar i.bi::before,.fab i.bi::before,.pin i.bi::before,.btn i.bi::before{display:block;line-height:1;vertical-align:0!important}
.ct-ic,.ci-btn,.fab,.chat .x{display:grid;place-items:center;line-height:1;padding:0}
/* ۲) فونتِ خواناتر برای چت */
.chat{font-family:'Estedad','Vazirmatn',system-ui,sans-serif;-webkit-font-smoothing:antialiased}
.chat .m{font-size:14.5px;line-height:1.9;padding:9px 12px}
.chat .m .mb{padding-top:5px}
.chat .m .mb b{font-size:14.5px;font-weight:800}
.chat .mb .tx{color:#f4f4fc;font-weight:500;letter-spacing:0}
.chat .m.sys{font-size:14px;font-weight:700}
.cin-box input{font-size:14px;font-weight:500;font-family:inherit}.cin-box input::placeholder{color:#9ea4cf}
.ct-room,.pin p,.chat-foot{font-size:13px}.pin p{color:#cacee9;line-height:1.8}
/* رنگ: اسم رنگی، متن کمی کم‌رنگ‌تر تا از هم جدا باشن */
.chat .mb .tx{color:#d4d8ef;font-weight:400}
.chat .m .mb b,.chat .mb .co{font-weight:800}.chat .mb .co{color:#9ea4cf}
/* فاصله‌ها جمع‌وجورتر */
.chat .m{padding:5px 12px;gap:9px;line-height:1.75}
.chat .m .mb{padding-top:2px}
.chat .av{width:34px;height:34px;font-size:14px}
.chat .m.sys{margin:3px 0;padding:9px 14px;line-height:1.6}
.chat-top{padding:10px 12px 8px}
.pin{margin:0 10px 6px;padding:10px 12px;gap:6px}
.pin p{line-height:1.6;font-size:12.5px}.pin button{height:32px}
.chat .msgs{padding:2px 0}
.cin-wrap{padding:8px 12px 4px}.cin-box{height:40px}
.chat-foot{padding:4px 14px 10px}
.chat .x{display:none}
/* دکمه‌ی باز/بسته کردن، چسبیده به لبه‌ی چت */
.fab{display:grid;place-items:center;position:fixed;right:var(--chat-w);left:auto;bottom:110px;z-index:9;width:36px;height:36px;border-radius:8px 0 0 8px;background:var(--s2);color:var(--t);border:1px solid var(--line);border-right:0;font-size:15px;transition:right .25s}
body.chat-closed .fab{right:0}
/* سایز متوسط: چت روی صفحه می‌افتد */
@media(max-width:1100px){
.chat,body.chat-closed .chat{top:0;z-index:40;transform:translateX(100%);box-shadow:0 0 40px rgba(25,26,50,.7)}
.chat.open,body.chat-closed .chat.open{transform:none}
.chat .x{display:grid;place-items:center}
.fab,body.chat-closed .fab{left:auto;right:16px;bottom:calc(16px + env(safe-area-inset-bottom,0px));width:52px;height:52px;border-radius:50%;background:var(--v);border:0;font-size:22px;box-shadow:0 8px 24px rgba(110,95,212,.5)}
}
/* سایز کوچک: تمام‌صفحه */
@media(max-width:600px){
.chat,body.chat-closed .chat{width:100vw;border-left:0}
.chat-foot{padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))}
}
/* هدر چت: عنوان + آنلاین، دکمه‌های دیسکورد و تلگرام (سه‌بعدیِ فرورفته، ثابت) */
.chat .ct-room{cursor:default;gap:8px}
.ct-title{display:flex;align-items:center;gap:7px}.ct-title i.bi{color:var(--v2);font-size:15px}
.ct-online{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:var(--ok);white-space:nowrap}
.chat a.ct-ic.dc,.chat a.ct-ic.tg{color:#fff;border:0;border-radius:6px;transition:filter .15s,box-shadow .15s}
.chat a.ct-ic.dc{background:linear-gradient(180deg,#6f7af4,#5865F2);box-shadow:0 2px 0 #3c45b8,inset 0 1px 0 rgba(255,255,255,.3),inset 0 -2px 4px rgba(0,0,0,.18)}
.chat a.ct-ic.tg{background:linear-gradient(180deg,#44bdf2,#229ED9);box-shadow:0 2px 0 #15739f,inset 0 1px 0 rgba(255,255,255,.3),inset 0 -2px 4px rgba(0,0,0,.18)}
.chat a.ct-ic.dc:hover,.chat a.ct-ic.tg:hover{filter:brightness(1.1);transform:none}
.chat a.ct-ic:hover i.bi,.chat a.ct-ic:active i.bi{transform:none;font-size:17px}
.chat a.ct-ic.dc:active{box-shadow:0 0 0 #3c45b8,inset 0 2px 5px rgba(0,0,0,.3)}
.chat a.ct-ic.tg:active{box-shadow:0 0 0 #15739f,inset 0 2px 5px rgba(0,0,0,.3)}
.chat-top{padding-bottom:14px}

/* هدر چت: هم‌اندازه‌سازی سه المان + رنگ سبز جذاب برای عنوان */
.chat-top{align-items:stretch;gap:8px;padding:12px 12px 14px}
.chat-top .ct-ic,.chat-top .ct-room{height:42px;min-height:42px;box-sizing:border-box;border-radius:10px}
.chat-top .ct-ic{width:46px;flex:0 0 46px;font-size:19px}
.chat a.ct-ic.dc,.chat a.ct-ic.tg{border-radius:10px;overflow:visible}
.chat-top .ct-room{
  padding:0 12px;color:#fff;border:0;
  background:linear-gradient(180deg,#5cf08a,#22c55e 55%,#16a34a);
  box-shadow:0 2px 0 #0f7a36,0 4px 14px rgba(34,197,94,.35),inset 0 1px 0 rgba(255,255,255,.4),inset 0 -2px 4px rgba(0,0,0,.15);
  text-shadow:0 1px 1px rgba(0,0,0,.28);
}
.chat-top .ct-title{font-size:13.5px;font-weight:800;color:#fff}
.chat-top .ct-title i.bi{color:#fff;font-size:16px}
.chat-top .ct-online{color:#fff;background:rgba(0,0,0,.22);padding:3px 9px;border-radius:999px;font-size:12px}
.chat-top .ct-online .dot{background:#b7ffd0;box-shadow:0 0 0 3px rgba(183,255,208,.25)}
.chat .x{height:42px;width:42px;border-radius:10px}

/* فیکس له‌شدن هدر چت: جلوگیری از شکستن خط و فشرده‌تر کردن محتوا */
.chat-top{gap:6px}
.chat-top .ct-ic{width:42px;flex:0 0 42px}
.chat-top .ct-room{min-width:0;flex:1 1 0;padding:0 8px;gap:6px;overflow:hidden;white-space:nowrap}
.chat-top .ct-title{white-space:nowrap;flex:0 0 auto;font-size:13px;gap:0}
.chat-top .ct-title i.bi{display:none}
.chat-top .ct-online{white-space:nowrap;flex:0 0 auto;padding:2px 8px;font-size:11px;gap:5px;line-height:1.6}
.chat-top .ct-online .dot{width:7px;height:7px;flex:0 0 7px}
.chat-top .ct-online span{white-space:nowrap}

/* جدا کردن هدر چت از پیام‌ها */
.chat-top{
  position:relative;z-index:2;
  padding:14px 12px 14px;margin-bottom:8px;
  background:linear-gradient(180deg,rgba(34,197,94,.10),rgba(34,197,94,0) 90%),var(--s2);
  border-bottom:1px solid rgba(34,197,94,.35);
  box-shadow:0 8px 18px -8px rgba(0,0,0,.65),0 1px 0 rgba(255,255,255,.04) inset;
}
.chat-top::after{
  content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;
  background:linear-gradient(90deg,transparent,#22c55e,transparent);opacity:.7;
}
.chat .msgs{padding-top:6px}

/* خط جداکننده: صاف، سفید کم‌رنگ، با کمی فاصله از هدر */
.chat-top{
  background:none;border-bottom:0;box-shadow:none;
  margin-bottom:18px;padding-bottom:12px;
}
.chat-top::after{
  content:"";position:absolute;left:0;right:0;bottom:-9px;height:1px;
  background:rgba(255,255,255,.14);opacity:1;
}

/* بالاتر آوردن کادر نوشتن پیام */
.cin-wrap{padding-bottom:15px}

/* دکمه‌ی چت: مربع کوچک، همیشه پیدا، با فاصله از چت (مثل bandit.camp) */
.fab,body.chat-closed .fab{
  display:grid;place-items:center;position:fixed;z-index:60;
  width:44px;height:44px;border-radius:10px;
  right:calc(var(--chat-w) + 14px);left:auto;
  bottom:calc(20px + env(safe-area-inset-bottom,0px));
  background:var(--s2);color:var(--t);border:1px solid var(--line);
  font-size:19px;box-shadow:0 6px 18px rgba(0,0,0,.45);
  transition:right .25s,background .15s,border-color .15s;
}
body.chat-closed .fab{right:14px}
.fab:hover{background:var(--v);border-color:var(--v);color:#fff}
@media(max-width:1100px){
  .chat,body.chat-closed .chat{width:min(var(--chat-w),calc(100vw - 72px));border-left:1px solid var(--line)}
  .fab,body.chat-closed .fab{right:14px;width:44px;height:44px;border-radius:10px;background:var(--s2);border:1px solid var(--line);font-size:19px;box-shadow:0 6px 18px rgba(0,0,0,.45)}
  body.chat-open .fab{right:calc(min(var(--chat-w),calc(100vw - 72px)) + 14px)}
  body.chat-open::before{content:"";position:fixed;inset:0;background:rgba(5,6,16,.45);z-index:39;pointer-events:none}
}
@media(max-width:600px){
  .chat,body.chat-closed .chat{width:min(var(--chat-w),calc(100vw - 72px));border-left:1px solid var(--line)}
}

/* ===== گردی گوشه‌ها ۶، دکمه‌های برجسته (هاور = فرورفتن)، موبایل تمام‌صفحه ===== */
.chat-top .ct-ic,.chat-top .ct-room,.chat a.ct-ic.dc,.chat a.ct-ic.tg,.chat .x,
.fab,body.chat-closed .fab{border-radius:6px}

.chat .chat-top a.ct-ic.dc,.chat .chat-top a.ct-ic.tg,.fab,body.chat-closed .fab{
  transition:right .25s ease,transform .08s ease,box-shadow .08s ease,filter .15s;
}
.chat .chat-top a.ct-ic.dc{background:linear-gradient(180deg,#6f7af4,#5865F2);box-shadow:0 3px 0 #3c45b8,0 5px 8px rgba(0,0,0,.3),inset 0 1px 0 rgba(255,255,255,.3),inset 0 -2px 4px rgba(0,0,0,.18)}
.chat .chat-top a.ct-ic.tg{background:linear-gradient(180deg,#44bdf2,#229ED9);box-shadow:0 3px 0 #15739f,0 5px 8px rgba(0,0,0,.3),inset 0 1px 0 rgba(255,255,255,.3),inset 0 -2px 4px rgba(0,0,0,.18)}
.fab,body.chat-closed .fab{
  background:linear-gradient(180deg,#34396b,var(--s2));border:0;color:#fff;
  box-shadow:0 3px 0 #0b0c1a,0 6px 10px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,255,255,.18),inset 0 -2px 4px rgba(0,0,0,.2);
}
.chat .chat-top a.ct-ic.dc:hover,.chat .chat-top a.ct-ic.dc:active{transform:translateY(3px);filter:none;box-shadow:0 0 0 #3c45b8,inset 0 2px 5px rgba(0,0,0,.35)}
.chat .chat-top a.ct-ic.tg:hover,.chat .chat-top a.ct-ic.tg:active{transform:translateY(3px);filter:none;box-shadow:0 0 0 #15739f,inset 0 2px 5px rgba(0,0,0,.35)}
.fab:hover,.fab:active,body.chat-closed .fab:hover{
  transform:translateY(3px);background:linear-gradient(180deg,#34396b,var(--s2));border:0;
  box-shadow:0 0 0 #0b0c1a,inset 0 2px 5px rgba(0,0,0,.4);
}

/* دکمه‌ی بستن: فقط در سایز کوچک */
.chat .x,.chat .chat-top .x{display:none}
@media(max-width:600px){
  .chat,body.chat-closed .chat{width:100vw;max-width:100vw;border-left:0}
  .chat .chat-top .x{display:grid;place-items:center;width:42px;height:42px;flex:0 0 42px}
  .chat .chat-top a.ct-ic.tg{display:none}
  body.chat-open .fab{display:none}
  body.chat-open::before{display:none}
}

/* ===== چت واقعی: ظاهر جدید (رنگ‌ها، حباب پیام، گروه‌بندی، آواتار گرد) ===== */
.chat{background:linear-gradient(180deg,#1c1536 0%,#181a35 55%,#14172f 100%)}
.chat .msgs{padding:8px 10px 10px;gap:3px;scrollbar-width:thin;scrollbar-color:rgba(197,191,238,.28) transparent}
.chat .msgs::-webkit-scrollbar{width:5px}
.chat .msgs::-webkit-scrollbar-thumb{background:rgba(197,191,238,.25);border-radius:9px}

.chat .msgs .m{align-self:stretch;max-width:100%;display:flex;align-items:flex-end;gap:8px;padding:5px 0 0;background:none;border:0;border-radius:0;animation:chat-in .24s ease-out}
.chat .msgs .m.me{background:none}
.chat .msgs .m.cont{padding-top:0}

.chat .msgs .m .av{flex:none;width:34px;height:34px;border-radius:50%;font-size:14px;font-weight:800;overflow:hidden;box-shadow:0 0 0 2px var(--ring,rgba(197,191,238,.3)),0 4px 10px rgba(0,0,0,.35);cursor:pointer}
.chat .msgs .m.cont .av{visibility:hidden;height:1px;box-shadow:none}
.chat .av img{width:100%;height:100%;object-fit:cover;display:block}

.chat .msgs .m .mb{min-width:0;max-width:calc(100% - 46px);padding:6px 11px 7px;border-radius:14px 14px 4px 14px;
  background:rgba(255,255,255,.065);border:1px solid rgba(197,191,238,.12);transition:background .15s}
.chat .msgs .m:hover .mb{background:rgba(255,255,255,.09)}
.chat .msgs .m.cont .mb{border-radius:14px 4px 4px 14px}
.chat .msgs .m.me .mb{border-radius:14px 14px 4px 14px;background:linear-gradient(135deg,rgba(90,105,130,.45),rgba(65,78,102,.45));border-color:rgba(170,185,210,.3)}
.chat .msgs .m.me.cont .mb{border-radius:14px 4px 4px 14px}.chat .msgs .m .mtag{display:none}
.chat .msgs .m.me:hover .mb{background:linear-gradient(135deg,rgba(100,116,142,.52),rgba(74,87,113,.52))}

.chat .msgs .m .mhd{display:flex;align-items:baseline;gap:7px;line-height:1.4;margin-bottom:1px}
.chat .msgs .m.cont .mhd{display:none}
.chat .msgs .m .mn{display:block;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;font-weight:800;color:var(--nc,#c5bfee);unicode-bidi:plaintext;cursor:pointer}
.chat .msgs .m.me .mn{color:var(--nc,#c5bfee)}
.chat .msgs .m .mtag{font-size:10px;font-weight:700;padding:0 6px;border-radius:99px;background:rgba(255,255,255,.18);color:#fff;line-height:16px}
.chat .msgs .m .mt{margin-inline-start:auto;font-size:10.5px;color:rgba(255,255,255,.42);font-weight:500;white-space:nowrap}
.chat .msgs .m .tx{display:block;font-size:14px;line-height:1.75;font-weight:500;color:#efeefb;unicode-bidi:plaintext;overflow-wrap:anywhere;word-break:break-word}

.chat-day{align-self:center;margin:10px 0 6px;padding:2px 12px;border-radius:99px;background:rgba(255,255,255,.07);color:var(--m);font-size:11.5px;font-weight:600}

@keyframes chat-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.chat .msgs .m{animation:none}}

/* حالت خالی */
.chat-empty{margin:auto;padding:30px 16px;display:flex;flex-direction:column;align-items:center;gap:6px;color:var(--m);font-size:13px;text-align:center}
.chat-empty i{font-size:30px;color:var(--v2);opacity:.75;font-family:"bootstrap-icons"!important;font-style:normal}
.chat-empty b{color:var(--t);font-size:14px}

/* دکمه‌ی پیام جدید */
.chat-jump{position:absolute;left:0;right:0;margin:auto;width:max-content;bottom:74px;z-index:3;padding:6px 14px;border-radius:99px;
  background:linear-gradient(135deg,#7c6cf0,#5b4bd0);color:#fff;font-size:12.5px;font-weight:700;box-shadow:0 8px 22px rgba(91,75,208,.5);animation:chat-in .2s ease-out}
.chat-jump[hidden]{display:none}

/* ورودی */
.cin-wrap{position:relative}
.cin-box{background:rgba(255,255,255,.06);border:1px solid rgba(197,191,238,.2);transition:border-color .15s,box-shadow .15s}
.cin-box:focus-within{border-color:#8b7ff0;box-shadow:0 0 0 3px rgba(110,95,212,.28)}
#csend{background:linear-gradient(135deg,#7c6cf0,#5b4bd0);color:#fff;box-shadow:0 4px 12px rgba(91,75,208,.45)}
#csend:hover{filter:brightness(1.12);background:linear-gradient(135deg,#7c6cf0,#5b4bd0)}
#csend:disabled{opacity:.55;cursor:default}
#csend.sending i{animation:chat-pulse .8s ease-in-out infinite}
@keyframes chat-pulse{50%{opacity:.3}}
.chat-count{position:absolute;top:-9px;inset-inline-start:18px;padding:0 7px;border-radius:99px;background:#241d44;border:1px solid var(--line);font-size:11px;line-height:17px;color:var(--m);z-index:2}
.chat-count.warn{color:var(--gold)}
.chat-count.max{color:var(--bad)}
.chat-count[hidden]{display:none}
.chat-note{margin:0 2px 6px;padding:6px 10px;border-radius:9px;background:rgba(239,68,68,.14);border:1px solid rgba(239,68,68,.38);color:#fca5a5;font-size:12.5px;line-height:1.7;animation:chat-in .2s ease-out}
.cin-wrap.guest-chat .cin-box{cursor:pointer}
.cin-wrap.guest-chat #cin{cursor:pointer;pointer-events:none}
.cin-box #cin:disabled{opacity:.8}

/* ===== ریپلای ===== */
.chat .msgs .m .mb{position:relative}
.chat .msgs .m .mr{position:absolute;top:-11px;inset-inline-start:10px;width:24px;height:24px;border-radius:50%;display:grid;place-items:center;
  background:#2a2150;border:1px solid rgba(197,191,238,.35);color:#e6e3fb;opacity:0;transform:scale(.85);transition:opacity .12s,transform .12s,background .12s;z-index:2;box-shadow:0 4px 12px rgba(0,0,0,.4)}
.chat .msgs .m:hover .mr,.chat .msgs .m .mr:focus-visible{opacity:1;transform:none}
.chat .msgs .m .mr:hover{background:var(--v);color:#fff}
@media(hover:none){.chat .msgs .m .mr{opacity:.8;transform:none;top:-10px;width:22px;height:22px}}

/* نقل‌قول بالای پیام */
.chat .msgs .m .mq{display:flex;flex-direction:column;align-items:flex-start;gap:0;width:100%;margin:3px 0 4px;padding:3px 9px;text-align:start;border:0;border-inline-start:3px solid var(--qc,#8b7ff0);border-radius:4px 8px 8px 4px;
  background:rgba(0,0,0,.22);cursor:pointer;transition:background .15s}
.chat .msgs .m .mq:hover{background:rgba(0,0,0,.34)}
.chat .msgs .m.me .mq{background:rgba(0,0,0,.2)}
.chat .msgs .m .mq b{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;font-weight:800;color:var(--qc,#c5bfee);unicode-bidi:plaintext}
.chat .msgs .m .mq span{max-width:100%;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12.5px;line-height:1.6;color:rgba(255,255,255,.7);unicode-bidi:plaintext;overflow-wrap:anywhere}

/* هایلایت پیام اصلی بعد از پرش */
.chat .msgs .m.flash .mb{animation:chat-flash 1.8s ease-out}
@keyframes chat-flash{0%,35%{box-shadow:0 0 0 2px #f2c46d,0 0 22px rgba(242,196,109,.5);background:rgba(242,196,109,.22)}100%{box-shadow:0 0 0 0 transparent}}

/* نوار «پاسخ به …» بالای ورودی */
.chat-reply{display:flex;align-items:center;gap:8px;margin:0 2px 7px;padding:6px 6px 6px 10px;border-radius:10px;background:rgba(124,108,240,.16);border:1px solid rgba(197,191,238,.2);border-inline-start:3px solid var(--qc,#8b7ff0);animation:chat-in .18s ease-out}
.chat-reply[hidden]{display:none}
.chat-reply .rb{flex:1;min-width:0;display:flex;flex-direction:column;cursor:pointer}
.chat-reply .rb b{font-size:12px;font-weight:800;color:var(--qc,#c5bfee);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;unicode-bidi:plaintext}
.chat-reply .rb span{font-size:12.5px;color:rgba(255,255,255,.72);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;unicode-bidi:plaintext}
.chat-reply .rx{flex:none;width:26px;height:26px;border-radius:50%;display:grid;place-items:center;font-size:12px;color:var(--m);background:rgba(255,255,255,.07)}
.chat-reply .rx:hover{background:rgba(239,68,68,.3);color:#fff}

/* دکمه‌ی X (بستن چت) هم‌استایل دکمه‌ی دیسکورد ولی قرمز */
.chat .x{color:#fff;border:0;background:linear-gradient(180deg,#f87171,#e5484d);box-shadow:0 2px 0 #a8262c,inset 0 1px 0 rgba(255,255,255,.3),inset 0 -2px 4px rgba(0,0,0,.18);transition:filter .15s,box-shadow .15s}
.chat .x:hover{filter:brightness(1.1)}
.chat .x:active{box-shadow:0 0 0 #a8262c,inset 0 2px 5px rgba(0,0,0,.3)}
/* ===== استایل چت: بی‌جعبه با فلش ↩ ===== */
.chat{background:var(--s1)}
.chat .msgs{padding:8px;gap:1px}
.chat .msgs .m{gap:9px;padding:5px 6px;border-radius:2px;align-items:flex-start}
.chat .msgs .m.cont{padding-top:0}
.chat .msgs .m:hover{background:rgba(110,95,212,.08)}
.chat .msgs .m .av{width:32px;height:32px;border-radius:2px;box-shadow:0 0 0 1px rgba(255,255,255,.22)}
.chat .msgs .m .mb,
.chat .msgs .m.cont .mb,
.chat .msgs .m.me .mb,
.chat .msgs .m.me.cont .mb{flex:1;max-width:none;padding:0;background:none;border:0;border-radius:0;box-shadow:none}
.chat .msgs .m:hover .mb,
.chat .msgs .m.me:hover .mb{background:none}
.chat .msgs .m .mhd{margin-bottom:0}
.chat .msgs .m .mn{font-size:13px}
.chat .msgs .m .mt{color:var(--m)}
.chat .msgs .m .tx{font-size:13.5px;color:var(--t)}
.chat .msgs .m.me{background:rgba(110,95,212,.1)}
.chat .msgs .m.me:hover{background:rgba(110,95,212,.16)}
.chat .chat-day{background:var(--bg);border:1px solid var(--line);border-radius:2px;color:var(--m)}
.chat .cin-box{background:var(--s2);border:1px solid var(--line);border-radius:2px}
.chat .cin-box:focus-within{border-color:var(--v2);box-shadow:none}
.chat #csend,
.chat #csend:hover{background:linear-gradient(135deg,#7c6cf0,#5b4bd0);color:#fff;border-radius:2px;box-shadow:none}

.chat .msgs .m .mq,
.chat .msgs .m.me .mq{flex-direction:row;align-items:baseline;gap:0;margin:1px 0 3px;padding:0;background:none;border:0;border-radius:0}
.chat .msgs .m .mq:hover,
.chat .msgs .m.me .mq:hover{background:none}
.chat .msgs .m .mq:hover b{text-decoration:underline}
.chat .msgs .m .mq b{flex:none;max-width:110px;margin-inline-end:6px;font-size:11.5px}
.chat .msgs .m .mq b::before{content:"↩ ";font-weight:400}
.chat .msgs .m .mq span{display:block;white-space:nowrap;text-overflow:ellipsis;font-size:12px;color:var(--m)}
.chat .msgs .m .mr{top:1px;inset-inline-start:auto;inset-inline-end:2px;width:22px;height:22px;border-radius:2px;background:none;border-color:transparent;box-shadow:none;color:var(--v2)}
.chat .msgs .m .mr:hover{background:rgba(110,95,212,.22);color:#fff}
.chat .chat-reply{margin:0 0 6px;padding:6px 2px 4px;background:none;border:0;border-top:1px solid var(--line);border-radius:0}
.chat .chat-reply .rb b::before{content:"↩ ";font-weight:400}
.chat .chat-reply .rx{background:none}

@keyframes chat-flash{0%,35%{box-shadow:0 0 0 2px var(--v2),0 0 20px rgba(110,95,212,.45);background:rgba(110,95,212,.25)}100%{box-shadow:0 0 0 0 transparent}}
.chat .msgs .m.flash .mb{animation:chat-flash 1.8s ease-out}

/* برچسب «↩ پاسخ» با hover */
.chat .msgs .m .mr{width:auto;height:22px;padding:0 8px;gap:4px;display:none;grid-auto-flow:column;align-items:center;font-size:11.5px;font-weight:700;line-height:1}
.chat .msgs .m:hover .mr,.chat .msgs .m .mr:focus-visible{display:grid}
@media(hover:none){.chat .msgs .m .mr{display:grid;opacity:.55}}

/* فاصله‌ی عمودی یکدست؛ پیام‌های پشت‌سرهم وسط کادرشون بشینن */
.chat .msgs .m{padding:4px 6px}
.chat .msgs .m.cont{padding-top:2px;padding-bottom:2px}
.chat .msgs .m .tx{line-height:1.7}
.chat .msgs .m .mb{padding-top:0}

/* اسکرول چت صفحه‌ی سایت رو تکون نده */
.chat .msgs{overscroll-behavior:contain}

/* ===== چت: سبک «چت قابل تست» — خط ریپلای با خم اتصال، دکمه‌ی پاسخ روی هاور/لمس، منشن رنگی ===== */
.chat .msgs .m{position:relative;transition:background .6s}
.chat .msgs .m.sel{background:rgba(255,255,255,.045)}
.chat .msgs .m.rp{flex-wrap:wrap;margin-top:6px}

/* خط ریپلای بالای پیام */
.chat .msgs .m .mrp{all:unset;box-sizing:border-box;position:relative;flex:0 0 100%;display:flex;align-items:center;gap:6px;min-width:0;
  padding:2px 0 4px;padding-inline-start:44px;font-size:11.5px;color:var(--m);cursor:pointer}
.chat .msgs .m .mrp::before{content:"";position:absolute;inset-inline-start:22px;top:50%;bottom:0;width:18px;
  border-top:2px solid rgba(255,255,255,.22);border-inline-start:2px solid rgba(255,255,255,.22);border-start-start-radius:7px}
.chat .msgs .m .mrp:hover i,.chat .msgs .m .mrp:focus-visible i{color:#fff}
.chat .msgs .m .mrp .rav{flex:none;width:16px;height:16px;border-radius:4px;display:grid;place-items:center;font-size:8px;font-weight:700;color:#fff}
.chat .msgs .m .mrp b{flex:none;max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;font-weight:700;color:var(--qc,#c5bfee);unicode-bidi:plaintext}
.chat .msgs .m .mrp i{font-style:normal;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;unicode-bidi:plaintext}
.chat .msgs .m .mrp b::before{content:none}

/* منشن */
.chat .msgs .m .tx .mnt{background:rgba(139,127,240,.28);color:#d9d4ff;border-radius:4px;padding:0 4px}

/* دکمه‌ی «پاسخ»: گوشه‌ی بالای پیام، فقط با هاور یا انتخاب */
.chat .msgs .m .mr{position:absolute;top:-11px;inset-inline-start:auto;inset-inline-end:10px;width:auto;height:auto;display:none;align-items:center;gap:3px;
  padding:2px 7px;border:0;border-radius:3px;background:rgba(110,95,212,.3);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);
  box-shadow:0 2px 6px rgba(0,0,0,.3);font-size:10.5px;font-weight:500;color:#e6e2ff;opacity:1;transform:none;z-index:2;
  transition:background .12s,color .12s}
.chat .msgs .m .mr svg{width:11px;height:11px}
.chat .msgs .m:hover .mr,.chat .msgs .m.sel .mr,.chat .msgs .m .mr:focus-visible{display:flex}
.chat .msgs .m .mr:hover{background:var(--v);color:#fff}
.chat .msgs .m .mr:active{background:#52479F}
@media(hover:none){.chat .msgs .m .mr{display:none;opacity:1}.chat .msgs .m.sel .mr{display:flex}}

/* پرش به پیام اصلی: کل ردیف چشمک می‌زنه */
.chat .msgs .m.flash .mb{animation:none}
.chat .msgs .m.flash{animation:chat-flash-row 1.2s ease-out}
@keyframes chat-flash-row{0%,40%{background:rgba(139,127,240,.28)}100%{background:transparent}}
@media (prefers-reduced-motion:reduce){.chat .msgs .m.flash{animation:none;background:rgba(139,127,240,.28)}}

/* ===== هم‌شکل‌سازی کامل با «چت قابل تست» ===== */
.chat{background:#150f26}
.chat .msgs{padding:10px 0 8px;gap:0}
.chat .msgs .m,.chat .msgs .m.me,.chat .msgs .m.cont{gap:8px;padding:3px 12px 1px;margin-top:5px;border-radius:8px;align-items:flex-start;background:none}
.chat .msgs .m:hover,.chat .msgs .m.me:hover,.chat .msgs .m.sel{background:rgba(255,255,255,.045)}
.chat .msgs .m.rp{margin-top:6px}
.chat .msgs .m .av{width:28px;height:28px;border-radius:7px;font-size:11px;font-weight:700;margin-top:2px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.18)}
.chat .msgs .m .mhd{display:flex;align-items:baseline;gap:7px;margin:0}
.chat .msgs .m .mn,.chat .msgs .m.me .mn{font-size:13.5px;font-weight:700;color:#c5bfee}
.chat .msgs .m .tm{font-size:10.5px;font-weight:400;color:var(--m)}
.chat .msgs .m .tx{font-size:13.5px;line-height:1.6;font-weight:400;color:#ece9fb}
/* خط ریپلای: خم از وسطِ آواتار پیام بالا می‌ره */
.chat .msgs .m .mrp{padding-inline-start:52px;padding-bottom:2px}
.chat .msgs .m .mrp::before{inset-inline-start:26px;bottom:-2px}
/* جداکننده‌ی روز: خط دو طرف */
.chat .chat-day{align-self:stretch;display:flex;align-items:center;gap:10px;margin:12px 12px 6px;padding:0;
  background:none;border:0;border-radius:0;font-size:11px;font-weight:400;color:var(--m)}
.chat .chat-day::before,.chat .chat-day::after{content:"";flex:1;height:1px;background:var(--line)}
/* ورودی و دکمه‌ی ارسال */
.chat .cin-box{height:42px;border-radius:10px;background:rgba(255,255,255,.04)}
.chat .cin-box:focus-within{border-color:rgba(139,127,240,.6)}
.chat #csend,.chat #csend:hover{width:32px;height:32px;border-radius:8px;
  background:linear-gradient(180deg,#7d6ff0,#6E5FD4);box-shadow:inset 0 1px 0 rgba(255,255,255,.28),inset 0 -2px 0 #3a3178}
.chat #csend:hover{filter:brightness(1.1)}
.chat #csend:active{filter:brightness(.9);box-shadow:inset 0 3px 6px rgba(0,0,0,.4)}
.chat .msgs .m .mrp{padding-inline-start:40px}
.chat .msgs .m .mrp::before{inset-inline-start:14px;bottom:-6px}
.chat .msgs .m .mrp b{color:#c5bfee}

/* دکمه‌ی «پاسخ»: فونت فارسی ارتفاع خط بیشتری می‌خواد، وگرنه فشرده می‌شه */
.chat .msgs .m .mr{box-sizing:content-box;height:auto;min-height:16px;padding:3px 9px;gap:4px;font-size:11px;line-height:1.7;white-space:nowrap;overflow:visible;flex:none}
.chat .msgs .m .mr svg{flex:none;width:12px;height:12px}
.chat .msgs .m .mr span{line-height:1.7}

/* عکس پروفایل توی آواتار کوچیکِ خط ریپلای */
.chat .msgs .m .mrp .rav{overflow:hidden}
.chat .msgs .m .mrp .rav img{width:100%;height:100%;object-fit:cover;display:block}
/* متن نقل‌قول کم‌رنگ و آروم (چیزی که مهمه اسم و پیام اصلیه) */
.chat .msgs .m .mrp i{color:rgba(169,172,208,.85)}
/* دکمه‌ی «پاسخ»: هم‌اندازه‌ی چت تست */
.chat .msgs .m .mr{box-sizing:border-box;min-height:0;padding:2px 7px;gap:3px;font-size:10.5px;line-height:1.5;font-weight:500}
.chat .msgs .m .mr span{line-height:1.5}
.chat .msgs .m .mr svg{width:11px;height:11px}
/* توی پیامِ ریپلای‌دار، دکمه بیاد پایین‌تر از خط ریپلای تا روش نیفته */
.chat .msgs .m.rp .mr{top:24px}

/* ===== متن انگلیسی هم راست‌چین (همون راه‌حلِ چت تست: rtl + isolate + راست‌چین) ===== */
.chat .msgs .m .tx{unicode-bidi:isolate;direction:rtl;text-align:right}
/* هر منشن داخل خودش چپ‌به‌راست بمونه تا «@amir | @bandit» به‌هم نریزه، ولی کلِ چیپ توی جریان راست‌به‌چپ بشینه */
.chat .msgs .m .tx .mnt{unicode-bidi:isolate;direction:ltr}
/* متنِ نقل‌قول بالای پیام و نوار «پاسخ به» بالای ورودی */
.chat .msgs .m .mrp i{unicode-bidi:isolate;direction:rtl;text-align:right}
.chat-reply .rb span{unicode-bidi:isolate;direction:rtl;text-align:right}

/* گیفِ نقش کنار اسم + تولتیپ (مثلاً «صاحب سایت») */
.chat .msgs .m .mrole{display:inline-flex;align-items:center;flex:0 0 auto;align-self:center;cursor:help;outline:0;border-radius:0}
.chat .msgs .m .mrole img{display:block;width:21px;height:21px;object-fit:cover;border-radius:0;image-rendering:auto}
.chat .msgs .m .mrole:focus-visible{box-shadow:0 0 0 2px rgba(197,191,238,.6)}
.role-tip{position:fixed;z-index:100;pointer-events:none;padding:5px 10px;border-radius:8px;background:#0e0f1d;color:#fff;border:1px solid rgba(255,255,255,.14);box-shadow:0 6px 20px rgba(0,0,0,.45);font:700 12px/1.5 'Estedad','Vazirmatn',system-ui,sans-serif;white-space:nowrap;max-width:min(260px,90vw);overflow:hidden;text-overflow:ellipsis}
.role-tip[hidden]{display:none}
/* fix: گیفِ نقش هم‌تراز با اسم و ساعت */
.chat .msgs .m .mhd{align-items:center;min-height:21px}
.chat .msgs .m .mhd .mn,.chat .msgs .m .mhd .tm,.chat .msgs .m .mhd .mtag{line-height:21px}
.chat .msgs .m .mrole{align-self:center;line-height:0}
/* ===== هم‌اندازه و هم‌رنگ با چت CSGOGEM ===== */
.chat .msgs .m .mn,
.chat .msgs .m.me .mn{font-size:15px;font-weight:700;color:#f1f1f5;line-height:21px;max-width:170px}
.chat .msgs .m .tx{font-size:15px;line-height:1.55;font-weight:400;color:#a9b0bd}
.chat .msgs .m .tm{font-size:11px;color:#7f869a}
.chat .msgs .m .mhd{gap:8px}
.chat .msgs .m .mhd .mn,.chat .msgs .m .mhd .tm,.chat .msgs .m .mhd .mtag{line-height:21px}
.chat .msgs .m .mrp b{font-size:12.5px;color:#f1f1f5}
.chat .msgs .m .mrp i{font-size:12px}
.chat .msgs .m .tx .mnt{color:#e4e0ff}
.chat .msgs .m .av{width:32px;height:32px}

/* جهت RTL برای صفحه‌هایی که <html dir="rtl"> ندارن */
.chat,.fab,.role-tip{direction:rtl}

/* استقلال چت از استایل سراسری صفحه‌ی میزبان */
.chat{color:var(--t)}
.chat a,.chat a:hover{color:inherit;text-decoration:none}
.chat a.ct-ic{color:#fff}
.pin b{color:var(--t)}
.pin small{color:var(--gold)}
.cs-shop.chat-offset,
.cs-detail.chat-offset,
footer.chat-offset{width:auto}