/* ===================== Повідомлення: дзвіночок, картки, сповіщення ===================== */
.pmsg-sec, .pmsg-card, .pmsg-toast, .pmsg-page {
  --pm-text: var(--text-default, #f2ebe1);
  --pm-muted: var(--text-secondary, #8a8090);
  --pm-card: var(--card, #18131c);
  --pm-line: var(--transparent-5-w, rgba(255, 255, 255, .06));
  --pm-accent: var(--span, #ff7a1a);
}

.pmsg-sec { border-bottom: 1px solid var(--pm-line); padding: .4rem .6rem .6rem; }
.pmsg-sec__head { display: flex; align-items: center; justify-content: space-between; padding: .35rem .3rem .5rem; font-size: .78rem; font-weight: 700; color: var(--pm-muted); text-transform: uppercase; letter-spacing: .06em; }
.pmsg-sec__all { background: none !important; border: 0; color: var(--pm-accent); font-size: var(--font-size-s, 12px); font-weight: 600; cursor: pointer; padding: 0; height: auto; width: auto; text-transform: none; letter-spacing: 0; }
.pmsg-sec__all:hover { color: var(--pm-text); }
.pmsg-sec__list { display: flex; flex-direction: column; gap: .4rem; max-height: 340px; overflow-y: auto; scrollbar-width: thin; }
.pmsg-sec__more { display: block; text-align: center; font-size: .82rem; color: var(--pm-muted); padding: .55rem 0 .1rem; text-decoration: none; }
.pmsg-sec__more:hover { color: var(--pm-accent); }

.pmsg-card {
  --pm-c: #4da3ff;
  position: relative; display: flex; gap: .7rem; padding: .7rem .75rem; border-radius: 12px;
  background: var(--transparent-2-w, rgba(255, 255, 255, .02)); border: 1px solid var(--pm-line); color: var(--pm-text);
  text-align: left; white-space: normal; transition: background .15s, border-color .15s;
}
.pmsg-card:hover { background: rgba(255, 255, 255, .05); }
.pmsg-card.is-unread { border-color: color-mix(in srgb, var(--pm-c) 45%, transparent); background: color-mix(in srgb, var(--pm-c) 7%, transparent); }
.pmsg-card.is-unread .pmsg-card__icon::after {
  content: ''; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--pm-c); border: 2px solid var(--bg-modal, #16111a); box-shadow: 0 0 8px var(--pm-c);
}
.pmsg-card.is-priority { box-shadow: inset 3px 0 0 var(--pm-c); }
.pmsg-card__icon {
  position: relative; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--pm-c) 18%, transparent); color: var(--pm-c);
}
.pmsg-card__icon svg { width: 18px; height: 18px; fill: currentColor; }
.pmsg-card__main { flex: 1; min-width: 0; }
.pmsg-card__meta { display: flex; align-items: center; gap: .4rem; font-size: var(--font-size-xs, 11px); color: var(--pm-muted); margin-bottom: .15rem; padding-right: 30px; }
.pmsg-card__cat { color: var(--pm-c); font-weight: 700; }
.pmsg-card__pin { display: inline-flex; color: var(--pm-accent); }
.pmsg-card__pin svg { width: 13px; height: 13px; fill: currentColor; }
.pmsg-card__time { margin-left: auto; white-space: nowrap; }
.pmsg-card__title { font-weight: 700; font-size: var(--font-size-m, 14px); line-height: 1.35; margin-bottom: .2rem; word-break: break-word; }
.pmsg-card__body { font-size: var(--font-size-s, 12px); line-height: 1.45; color: var(--text-custom, #c9bfb4); word-break: break-word; }
.pmsg-card__body b { color: var(--pm-text); }
.pmsg-link { color: var(--pm-accent); text-decoration: underline; text-underline-offset: 2px; }
.pmsg-link:hover { filter: brightness(1.15); }
.pmsg-card__btns { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.pmsg-btn {
  display: inline-flex; align-items: center; height: 30px; padding: 0 .8rem; border-radius: 8px; font-size: .8rem; font-weight: 700;
  text-decoration: none; color: #fff; background: color-mix(in srgb, var(--pm-c) 75%, #000); transition: filter .15s;
}
.pmsg-btn:hover { filter: brightness(1.12); color: #fff; }
.pmsg-card__x {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; cursor: pointer;
  display: grid; place-items: center; background: transparent; color: var(--pm-muted); opacity: .6;
}
.pmsg-card__x:hover { opacity: 1; background: rgba(255, 255, 255, .07); }
.pmsg-card__x svg { width: 14px; height: 14px; fill: currentColor; }

/* спливні сповіщення */
.pmsg-toasts { position: fixed; left: 20px; bottom: 20px; z-index: 99995; display: flex; flex-direction: column; gap: .6rem; pointer-events: none; }
.pmsg-toast {
  --pm-c: #4da3ff;
  pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: .7rem; width: min(340px, calc(100vw - 40px));
  padding: .8rem .9rem; border-radius: 14px; color: var(--pm-text);
  background: var(--bg-modal, rgba(22, 17, 26, .97)); border: 1px solid color-mix(in srgb, var(--pm-c) 45%, transparent);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .03);
  transform: translateX(-120%); opacity: 0; transition: transform .35s cubic-bezier(.2, 1.2, .4, 1), opacity .3s;
}
.pmsg-toast.is-in { transform: none; opacity: 1; }
.pmsg-toast.is-out { transform: translateX(-120%); opacity: 0; }
.pmsg-toast__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pmsg-toast__main span { font-size: .72rem; color: var(--pm-c); font-weight: 700; }
.pmsg-toast__main b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmsg-toast__x { background: none !important; border: 0; color: var(--pm-muted); cursor: pointer; padding: 4px; width: auto; height: auto; display: grid; }
.pmsg-toast__x svg { width: 14px; height: 14px; fill: currentColor; }

/* кольори категорій (подвійний клас — щоб перебити базові стилі) */
.pmsg-cat--info.pmsg-cat--info           { --pm-c: #4da3ff; }
.pmsg-cat--news.pmsg-cat--news           { --pm-c: #a07bff; }
.pmsg-cat--warning.pmsg-cat--warning     { --pm-c: #ffb02e; }
.pmsg-cat--gift.pmsg-cat--gift           { --pm-c: #3ddc84; }
.pmsg-cat--important.pmsg-cat--important { --pm-c: #ff4d5e; }

/* коли є наші повідомлення — ховаємо порожній стан стандартного дзвіночка */
.pmsg-sec:not([style*="none"]) ~ #main_notifications .no_notify { display: none; }
