/* Shayegan — اصلاحات سراسری UI (وب، PWA، اندروید، بازار، مایکت، iOS) — 1405/08/01 */

/* ۶-۲) رنگ اصلی برند (بنفش لوگو)؛ قرمز فقط برای خطا/حذف (btn-danger، toast-error) */
:root{--basecolor:#5b2a86;--shg-brand:#5b2a86;--shg-brand-d:#4b2272;--shg-brand-l:#efe6fa}

/* ۶-۳) کدها و لینک‌ها: چپ‌به‌راست با ارقام انگلیسی */
.shg-code,.ltr-code{direction:ltr!important;unicode-bidi:isolate;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace!important;font-variant-numeric:tabular-nums;letter-spacing:.3px}
#login_invite_code{direction:ltr;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}

/* ۳) منوی کشویی بالاتر از همهٔ لایه‌های صفحه (کارت حساب z=99999) و زیر مودال‌ها */
.pushy{z-index:999990!important}
.pushy-open-left .site-overlay,.pushy-open-right .site-overlay{z-index:999980!important;background-color:rgba(0,0,0,.5)!important;cursor:pointer;-webkit-tap-highlight-color:transparent}
body.pushy-open-left,body.pushy-open-right{overflow:hidden;touch-action:none}
.pushy .pushy-content{padding-bottom:env(safe-area-inset-bottom)}

/* ۲) هدر چت */
.chat-section-left .navbar-left{height:auto!important;min-height:56px;padding:8px 10px!important;display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:nowrap;border-bottom:1px solid #eee;background:#fff;overflow:hidden}
.chat-section-left .navbar-left .navbar-box{display:flex;align-items:center;gap:8px;min-width:0;height:auto!important}
.chat-section-left .navbar-left .navbar-box:first-child{flex:1 1 auto}
.chat-section-left .navbar-left .navbar-box:last-child{flex:0 0 auto}
.chat-section-left .backchatroom{flex:0 0 auto;align-self:center}
.chat-section-left .backchatroom a{display:inline-flex;align-items:center;gap:4px;white-space:nowrap;font-size:.85rem;line-height:1;padding:6px 8px;border-radius:8px;background:#f5f3f9;color:#333}
.chat-section-left .backchatroom a i{font-size:1.1rem;line-height:1}
.chat-section-left .titlebox{display:flex!important;flex-direction:row!important;flex-wrap:wrap;align-items:center;gap:2px 6px;min-width:0;height:auto!important;justify-content:flex-start!important}
.chat-section-left .titlebox .usertitle{flex:1 1 100%;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.5}
.chat-section-left .titlebox .usersubtitle{flex:0 0 auto;line-height:1.4;font-size:.75rem}
.chat-section-left .shg-chat-id{display:flex!important;flex-wrap:wrap;gap:6px;align-items:center;margin:0!important;min-width:0}
.chat-section-left .shg-chip{white-space:nowrap;line-height:1.5;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.chat-section-left .action-bar{display:flex;align-items:center;gap:6px;height:auto!important}
.chat-section-left .action-bar .btn{display:inline-flex;align-items:center;justify-content:center;gap:4px;height:36px;min-width:36px;padding:0 10px;margin:0!important;white-space:nowrap;line-height:1}
@media(max-width:575.98px){
  .chat-section-left .action-bar .btn{font-size:0;padding:0;width:36px}
  .chat-section-left .action-bar .btn i{font-size:15px}
  .chat-section-left .backchatroom a{font-size:0;padding:8px}
  .chat-section-left .backchatroom a i{font-size:1.2rem}
}

/* ۴) مودال‌ها در موبایل: Bottom Sheet با اسکرول داخلی و حاشیهٔ امن */
.modal-backdrop{z-index:999998!important}
@media(max-width:767.98px){
  .modal:not(.shg-no-sheet) .modal-dialog{position:fixed;left:0;right:0;bottom:0;top:auto;margin:0!important;width:100%;max-width:none!important;min-height:0!important;display:block;transform:translateY(100%);transition:transform .25s ease-out}
  .modal.show:not(.shg-no-sheet) .modal-dialog{transform:none!important}
  .modal:not(.shg-no-sheet) .modal-content{border-radius:18px 18px 0 0;border:0;max-height:calc(100vh - 56px);max-height:calc(100dvh - 56px);display:flex;flex-direction:column;overflow:hidden;padding-bottom:env(safe-area-inset-bottom)}
  .modal:not(.shg-no-sheet) .modal-content::before{content:"";display:block;width:40px;height:4px;border-radius:4px;background:#d6d3de;margin:8px auto 0;flex:0 0 auto}
  .modal:not(.shg-no-sheet) .modal-header,.modal:not(.shg-no-sheet) .modal-footer{flex:0 0 auto}
  .modal:not(.shg-no-sheet) .modal-body{flex:0 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;max-height:none}
  body.modal-open .mobile-navbar-bottom,body.modal-open .shg-inst{visibility:hidden}
}

/* ۶-۱) نشان «ویژه» روی گوشهٔ تصویر */
.agahi-card-thumb>div{position:relative}
.agahi-card-thumb .vije_flag{position:absolute!important;top:0!important;left:0!important;right:auto!important;z-index:2;pointer-events:none;width:28px}
.agahi-card-thumb .vije_flag img{width:100%;height:auto}
.shg-gal-wrap{position:relative}
.shg-gal-wrap>.vije_flag_dt{position:absolute!important;top:0;right:12px;left:auto;z-index:5;pointer-events:none;margin:0!important}

/* دکمه‌های اصلی با رنگ برند */
.btn-primary,.btn-submit:not(.outline){background-color:var(--shg-brand)!important;border-color:var(--shg-brand)!important;color:#fff!important}
.btn-primary:hover,.btn-submit:not(.outline):hover{background-color:var(--shg-brand-d)!important;border-color:var(--shg-brand-d)!important}
