/* Пузырь уведомлений: мобильная версия — над иконкой, ПК — справа от пункта меню */
#navNotif .nav-icon-wrap,
.dt-nav-btn[data-screen="screenNotif"] .nav-icon-wrap { position: relative; }

/* штатный счётчик прячем только когда пузырь реально активен */
#navNotif.is-bubble-on #notifBadge,
.dt-nav-btn.is-bubble-on #dtNotifBadge { display: none !important; }
.notif-badge.show { display: flex !important; }

.notif-bubble {
  --tf: translateX(-50%);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--accent, #b39af4);
  color: #17131f;
  isolation: isolate;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
  transform: var(--tf) scale(.6);
  transform-origin: 50% 100%;
  opacity: 0;
  pointer-events: none;
  transition: transform .34s cubic-bezier(.2, 1.5, .4, 1), opacity .22s ease, padding .28s ease;
}

.notif-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 10px;
  height: 10px;
  background: var(--accent, #b39af4);
  transform: translate(-50%, -55%) rotate(45deg);
  border-radius: 2px;
}

.notif-bubble.is-detail,
.notif-bubble.is-compact { opacity: 1; pointer-events: auto; }
.notif-bubble.is-detail { transform: var(--tf) scale(1); }

/* сворачивание: не метка с конусом, а круг в углу иконки */
.notif-bubble.is-compact {
  --tf: none;
  left: auto;
  right: -9px;
  bottom: auto;
  top: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  gap: 0;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transform: scale(1);
  transform-origin: 50% 50%;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .32);
}
.notif-bubble.is-compact::after { display: none; }

.notif-bubble.is-pop { animation: notif-pop .4s ease; }

@keyframes notif-pop {
  0% { transform: var(--tf) scale(1); }
  45% { transform: var(--tf) scale(1.16); }
  100% { transform: var(--tf) scale(1); }
}

.notif-bubble-detail {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 72vw;
  overflow: hidden;
  transition: max-width .3s ease, opacity .24s ease, margin .3s ease;
}

.notif-bubble.is-compact .notif-bubble-detail {
  max-width: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
}

.notif-bubble-seg {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
  animation: notif-seg-in .3s ease both;
}
.notif-bubble-seg i { font-size: 12px; opacity: .8; }

@keyframes notif-seg-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.notif-bubble-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width .3s ease .05s, opacity .2s ease .05s;
}
.notif-bubble.is-compact .notif-bubble-compact { max-width: 80px; opacity: 1; align-self: center; line-height: 1; }

.notif-bubble.is-empty { opacity: 0; pointer-events: none; }

/* На экране создания поста пузырь скрыт: сайдбар уходит, круг висел бы отдельно */
.notif-bubble.is-suppressed { display: none !important; }

/* ── ПК: пузырь вылетает вправо от пункта меню ─────────────────────── */
.notif-bubble.is-pc {
  --tf: translateY(-50%);
  position: fixed;
  left: 0;
  top: 0;
  bottom: auto;
  transform-origin: 0 50%;
  max-width: min(70vw, 420px);
}

.notif-bubble.is-pc::after {
  left: -4px;
  top: 50%;
  transform: translate(0, -50%) rotate(45deg);
}

.notif-bubble.is-pc.is-compact {
  --tf: none;
  right: auto;
  bottom: auto;
  transform: none;
  transform-origin: 50% 50%;
  max-width: none;
  width: auto;
  min-width: 22px;
}
.notif-bubble.is-pc.is-compact::after { display: none; }

@media (max-width: 420px) {
  .notif-bubble { gap: 9px; padding: 6px 10px; font-size: 13px; }
  .notif-bubble-detail { gap: 9px; }
}
