.hf-lt-badge{
  display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 6px;
  margin-inline-start:8px; border-radius:999px; background:#dc2626; color:#fff;
  font-size:11px; font-weight:800; line-height:1; vertical-align:middle;
}
#hfBell{ position:relative; display:inline-flex; align-items:center; }
.hf-bell-btn{
  position:relative; width:38px; height:38px; display:grid; place-items:center;
  border-radius:12px; cursor:pointer; font-size:17px; line-height:1;
  background:rgba(60,1,175,.08); border:1px solid rgba(60,1,175,.20); color:inherit;
}
.hf-bell-btn:hover{ background:rgba(60,1,175,.16); }
html[data-theme="dark"] .hf-bell-btn{ background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.16); }
.hf-bell-n{
  position:absolute; inset-block-start:-4px; inset-inline-end:-4px;
  min-width:18px; height:18px; padding:0 5px; border-radius:999px;
  background:#dc2626; color:#fff; font-size:10.5px; font-weight:800;
  display:grid; place-items:center; line-height:1;
}
.hf-bell-pop{
  position:absolute; inset-block-start:46px; inset-inline-end:0; z-index:9999;
  width:min(340px, 86vw); max-height:60vh; overflow:auto;
  background:#fff; border:1px solid rgba(19,21,44,.12); border-radius:14px;
  box-shadow:0 18px 50px rgba(15,23,42,.20); padding:8px;
}
html[data-theme="dark"] .hf-bell-pop{ background:#171A2E; border-color:rgba(255,255,255,.12); color:#EEF0F8; }
.hf-bell-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 8px 10px; }
.hf-bell-all{
  font:inherit; font-size:11.5px; cursor:pointer; padding:5px 9px; border-radius:999px;
  background:rgba(60,1,175,.10); border:1px solid rgba(60,1,175,.24); color:#3C01AF;
}
html[data-theme="dark"] .hf-bell-all{ background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.16); color:#EEF0F8; }
.hf-bell-row{
  display:flex; flex-direction:column; gap:3px; padding:9px 10px; border-radius:10px;
  text-decoration:none; color:inherit;
}
.hf-bell-row:hover{ background:rgba(60,1,175,.07); }
html[data-theme="dark"] .hf-bell-row:hover{ background:rgba(255,255,255,.07); }
.hf-bell-row b{ font-size:13px; }
.hf-bell-row span{ font-size:11px; opacity:.7; font-variant-numeric:tabular-nums; }
.hf-bell-empty{ padding:14px 10px; font-size:12.5px; opacity:.7; }
.hf-lt-toast{
  position:fixed; inset-block-end:20px; inset-inline-start:20px; z-index:99999;
  display:flex; flex-direction:column; gap:3px; cursor:pointer;
  padding:12px 16px; border-radius:14px; max-width:min(320px, 84vw);
  background:rgba(23,26,46,.88); color:#fff; backdrop-filter:blur(10px);
  border:1px solid rgba(255,255,255,.14); box-shadow:0 16px 40px rgba(0,0,0,.28);
  transition:opacity .5s ease, transform .5s ease;
}
.hf-lt-toast.go{ opacity:0; transform:translateY(10px); }
.hf-lt-toast b{ font-size:13.5px; }
.hf-lt-toast span{ font-size:11.5px; opacity:.8; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#letterLanes .lt-new{ position:relative; box-shadow:inset 3px 0 0 #dc2626; }
#letterLanes .lt-new::before{
  content:'جدید'; position:absolute; inset-inline-end:8px; inset-block-start:6px;
  background:#dc2626; color:#fff; font-size:10px; font-weight:800;
  padding:2px 7px; border-radius:999px; line-height:1.5; z-index:3;
}

/* پاپ‌آپ زنگ — همیشه داخل صفحه، بازشو به سمت متن */
.hf-bell-pop{
  inset-inline-end:auto !important; inset-inline-start:auto !important;
  right:0 !important; left:auto !important;
  inset-block-start:46px !important;
  width:min(340px, calc(100vw - 32px)) !important;
  direction:rtl; text-align:right;
}
@media (max-width:900px){
  .hf-bell-pop{
    position:fixed !important; right:12px !important; left:12px !important;
    width:auto !important; inset-block-start:64px !important;
  }
}
.hf-bell-head{ flex-direction:row !important; }
.hf-bell-row b{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* پاپ‌آپ زنگ — قفل داخل صفحه */
.hf-bell-pop{
  position:fixed !important;
  inset-block-start:58px !important;
  inset-inline-end:auto !important; inset-inline-start:auto !important;
  right:auto !important;
  left:16px !important;
  width:min(340px, calc(100vw - 32px)) !important;
  max-width:calc(100vw - 32px) !important;
  max-height:min(60vh, 420px) !important;
  overflow:auto !important;
  direction:rtl; text-align:right;
  box-sizing:border-box;
}
@media (max-width:900px){
  .hf-bell-pop{ left:12px !important; right:12px !important; width:auto !important; inset-block-start:66px !important; }
}

/* زنگ داخل همان نوار، هم‌قد دکمه‌های کنارش */
#hfBell{ flex:0 0 auto; align-self:center; }
#hfBell .hf-bell-btn{ width:36px; height:36px; font-size:16px; }
.hf-bell-pop{ inset-block-start:calc(100% + 8px) !important; }

/* پاپ‌آپ زنگ روی body — موقعیت با JS */
.hf-bell-pop.hf-bell-pop-fixed{
  position:fixed !important; z-index:100000 !important;
  inset:auto !important; margin:0 !important;
  overflow:auto !important; box-sizing:border-box !important;
  direction:rtl; text-align:right;
}

/* زنگ کمی به سمت چپ */
#hfBell{ margin-inline-end:14px !important; margin-inline-start:0 !important; }
@media (max-width:900px){ #hfBell{ margin-inline-end:8px !important; } }

/* زنگ — فاصلهٔ بیشتر از لبه */
#hfBell{ margin-inline-end:40px !important; }
@media (max-width:900px){ #hfBell{ margin-inline-end:14px !important; } }

/* پاپ‌آپ زنگ — مختصات ثابت، همیشه داخل صفحه */
.hf-bell-pop, .hf-bell-pop.hf-bell-pop-fixed{
  position:fixed !important;
  top:74px !important; bottom:auto !important;
  right:24px !important; left:auto !important;
  inset-inline-start:auto !important; inset-inline-end:auto !important;
  width:340px !important; max-width:calc(100vw - 48px) !important;
  max-height:min(60vh, 420px) !important; overflow:auto !important;
  transform:none !important; margin:0 !important;
  z-index:100000 !important; box-sizing:border-box !important;
  direction:rtl; text-align:right;
}
@media (max-width:900px){
  .hf-bell-pop, .hf-bell-pop.hf-bell-pop-fixed{
    top:66px !important; right:12px !important; left:12px !important;
    width:auto !important; max-width:none !important;
  }
}
/* سربرگ پاپ‌آپ مرتب */
.hf-bell-head{
  display:flex !important; align-items:center !important; justify-content:space-between !important;
  gap:10px !important; padding:4px 6px 10px !important; margin:0 !important;
  border-bottom:1px solid rgba(19,21,44,.10);
}
html[data-theme="dark"] .hf-bell-head{ border-bottom-color:rgba(255,255,255,.10); }
.hf-bell-head b{ font-size:13px !important; }
.hf-bell-list{ padding-top:6px; }

/* پاپ‌آپ زنگ — لنگر به خود زنگ، بازشو به سمت چپ، بدون position:fixed */
#hfBell{ position:relative !important; }
.hf-bell-pop, .hf-bell-pop.hf-bell-pop-fixed{
  position:absolute !important;
  top:calc(100% + 8px) !important; bottom:auto !important;
  right:0 !important; left:auto !important;
  inset-inline-start:auto !important; inset-inline-end:auto !important;
  width:320px !important; max-width:min(320px, calc(100vw - 32px)) !important;
  max-height:min(58vh, 400px) !important; overflow:auto !important;
  transform:none !important; margin:0 !important; z-index:100000 !important;
  box-sizing:border-box !important; direction:rtl; text-align:right;
}
@media (max-width:900px){
  .hf-bell-pop, .hf-bell-pop.hf-bell-pop-fixed{
    position:fixed !important; top:66px !important;
    right:12px !important; left:12px !important; width:auto !important; max-width:none !important;
  }
}

/* زنگ در انتهای سمت چپ نوار؛ پاپ‌آپ به سمت راست باز شود */
#hfBell{ position:relative !important; margin-inline-end:0 !important; margin-inline-start:10px !important; order:99; }
.hf-bell-pop, .hf-bell-pop.hf-bell-pop-fixed{
  position:absolute !important;
  top:calc(100% + 8px) !important; bottom:auto !important;
  left:0 !important; right:auto !important;
  inset-inline-start:auto !important; inset-inline-end:auto !important;
  width:320px !important; max-width:calc(100vw - 32px) !important;
  transform:none !important;
}
@media (max-width:900px){
  .hf-bell-pop, .hf-bell-pop.hf-bell-pop-fixed{
    position:fixed !important; top:66px !important; left:12px !important; right:12px !important;
    width:auto !important; max-width:none !important;
  }
}

/* ستاره برای نامه‌های تازه */
#letterLanes .lt-new{box-shadow:inset 3px 0 0 #e0a100 !important}
#letterLanes .lt-new::before{content:'★' !important;background:none !important;color:#e0a100 !important;font-size:18px !important;padding:0 !important;line-height:1 !important;inset-block-start:8px !important;inset-inline-end:10px !important;text-shadow:0 1px 2px rgba(0,0,0,.15)}
html[data-theme="dark"] #letterLanes .lt-new::before{color:#d8bd72 !important}
html[data-theme="dark"] #letterLanes .lt-new{box-shadow:inset 3px 0 0 #d8bd72 !important}
.hf-bell-row b::before{content:'★ ';color:#e0a100}
