/* ==========================================================================
   The bell's pop-up (#notificationPopupModal.ntfp, Oct 2026)
   --------------------------------------------------------------------------
   Markup: the head in includes/navigation_functions.php
   (renderNavigationNotificationControl), the body from
   user/notifications.php?action=check&ajax=1&context=modal, i.e. THE
   notification row of the Notifications page (includes/social_page_ui.php
   scmNtfRow / scmNtfDayGroups / scmNtfPopupHtml). Behaviour:
   includes/js/notification-popup.js. Linked on every page by
   renderNavigationSharedActionCss(), public header and admin header alike.

   The row follows the page's row (themes/default/css/social-modern.css
   sections D-G and K): the picture, a .84rem/800 subject over one line of
   text and the meta line (type pill + time), the unread tint, the inset bar
   and the dot. Rows reach the pop-up's edges on both sides; the day captions
   sit between them and stay pinned while the list scrolls.

   Desktop: a panel under the bell (the script places it). Phones: a bottom
   sheet with a grab handle (swipe down to close), safe areas, 44 px targets.
   Colours are theme tokens (literals only as var() fallbacks and neutral
   black/white alphas): light, dark and every skin follow.
   ========================================================================== */

/* ---- Tokens (the page's --sc-* set, same sources) ------------------------ */
#notificationPopupModal {
    --ntfp-bg: var(--theme-surface, var(--bs-body-bg));
    --ntfp-soft: var(--theme-surface-2, var(--bs-tertiary-bg));
    --ntfp-soft-2: var(--theme-surface-3, var(--bs-secondary-bg));
    --ntfp-line: var(--theme-border, var(--bs-border-color));
    --ntfp-ring: rgba(0, 0, 0, .08);
    --ntfp-ink: var(--theme-ink, var(--bs-body-color));
    --ntfp-muted: var(--theme-ink-muted, var(--bs-secondary-color));
    --ntfp-primary: var(--theme-primary, var(--bs-primary));
    --ntfp-primary-rgb: var(--theme-primary-rgb, 200, 16, 46);
    --ntfp-primary-ink: color-mix(in oklab, var(--ntfp-primary) 80%, var(--ntfp-ink));
    --ntfp-accent: var(--theme-accent, var(--bs-warning));
    --ntfp-accent-rgb: var(--theme-accent-rgb, 244, 178, 35);
    --ntfp-accent-ink: color-mix(in oklab, var(--ntfp-accent) 62%, var(--ntfp-ink));
    --ntfp-on-accent: var(--theme-on-accent, #2b2100);
    --ntfp-ok: var(--theme-success, var(--bs-success));
    --ntfp-ok-rgb: var(--theme-success-rgb, 25, 135, 84);
    --ntfp-ok-ink: var(--theme-success-strong, var(--bs-success));
    --ntfp-bad: var(--theme-danger, var(--bs-danger));
    --ntfp-bad-rgb: var(--theme-danger-rgb, 220, 53, 69);
    --ntfp-bad-ink: var(--theme-danger-strong, var(--bs-danger));
    --ntfp-info: var(--theme-info, var(--bs-info));
    --ntfp-info-rgb: var(--theme-info-rgb, 13, 202, 240);
    --ntfp-info-ink: color-mix(in oklab, var(--ntfp-info) 60%, var(--ntfp-ink));
    --ntfp-on: var(--theme-on-primary, #fff);
    --ntfp-gold-on-primary: var(--theme-accent-on-primary, var(--ntfp-accent));
    --ntfp-hover: color-mix(in oklab, var(--ntfp-soft) 75%, var(--ntfp-bg));
    --ntfp-radius: var(--theme-radius-lg, 1.1rem);
    --ntfp-ease: var(--ease-out, cubic-bezier(.2, .8, .2, 1));
    --ntfp-shadow: 0 24px 60px rgba(0, 0, 0, .2), 0 3px 10px rgba(0, 0, 0, .08);
}
[data-bs-theme="dark"] #notificationPopupModal {
    --ntfp-bg: var(--bs-tertiary-bg, var(--theme-surface-2));
    --ntfp-soft: color-mix(in oklab, var(--theme-ink, #fff) 6%, var(--ntfp-bg));
    --ntfp-soft-2: color-mix(in oklab, var(--theme-ink, #fff) 11%, var(--ntfp-bg));
    --ntfp-line: color-mix(in oklab, var(--theme-ink, #fff) 12%, transparent);
    --ntfp-ring: rgba(255, 255, 255, .1);
    --ntfp-primary-ink: var(--theme-link, var(--ntfp-ink));
    --ntfp-accent-ink: var(--ntfp-accent);
    --ntfp-ok-ink: color-mix(in oklab, var(--ntfp-ok) 58%, white);
    --ntfp-bad-ink: color-mix(in oklab, var(--ntfp-bad) 58%, white);
    --ntfp-info-ink: color-mix(in oklab, var(--ntfp-info) 70%, white);
    --ntfp-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .04);
}
#notificationPopupModal [hidden] { display: none !important; }

/* ---- The panel: under the bell on desktop -------------------------------- */
#notificationPopupModal .ntfp-dialog {
    position: fixed;
    top: var(--ntfp-top, 4.6rem);
    right: var(--ntfp-right, 1rem);
    width: min(29rem, calc(100vw - 1.5rem));
    max-width: none;
    margin: 0;
    pointer-events: none;
}
#notificationPopupModal.fade .ntfp-dialog {
    opacity: 0;
    transform: translateY(-.6rem) scale(.96);
    transform-origin: var(--ntfp-origin, 90%) 0;
    transition: transform .26s var(--ntfp-ease), opacity .18s ease;
}
#notificationPopupModal.show .ntfp-dialog { opacity: 1; transform: none; }
@media (min-width: 576px) {
    body:has(#notificationPopupModal.show) > .modal-backdrop.show { opacity: .22; }
}

#notificationPopupModal .ntfp-sheet {
    display: flex; flex-direction: column;
    max-height: calc(100dvh - var(--ntfp-top, 4.6rem) - 1rem);
    overflow: hidden;
    border: 1px solid var(--ntfp-ring);
    border-radius: var(--ntfp-radius);
    background: var(--ntfp-bg);
    color: var(--ntfp-ink);
    box-shadow: var(--ntfp-shadow);
    pointer-events: auto;
}
#notificationPopupModal .ntfp-grab { display: none; }

/* ---- Head: bell, title, count, close | All / Unread, Mark All Read -------- */
#notificationPopupModal .ntfp-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: .55rem;
    padding: .75rem .75rem .65rem 1rem;
    border: 0; border-bottom: 1px solid var(--ntfp-line); border-radius: 0;
    background: transparent;
}
/* All / Unread + Mark All Read on the title's row, right of the title (owner, 11 Oct: "it
   should be on the right side of Notifications"): compact there - the switch's words only,
   Mark All Read its icon (title + aria-label carry the words). Phones: their own row. */
#notificationPopupModal .ntfp-tools { display: flex; align-items: stretch; gap: .4rem; margin-left: auto; min-width: 0; }
/* Mark All Read the same height as the switch beside it (owner, 11 Oct: "sizes should be the
   same as the left side"): it stretches to the switch's height, a pill like it. */
#notificationPopupModal .ntfp-tools .ntfp-hbtn { align-self: stretch; height: auto; min-height: 0; justify-content: center; border-radius: 999px; }
#notificationPopupModal .ntfp-tools .ntfp-seg { align-self: center; }
#notificationPopupModal .ntfp-head .modal-title { flex: 0 1 auto; }
#notificationPopupModal .ntfp-head .ntfp-x { margin-left: 0; }
/* Every width, phones too (owner, 11 Oct: "it should match the big screen"): one row. */
#notificationPopupModal .ntfp-tools .ntfp-seg-btn i { display: none; }
#notificationPopupModal .ntfp-tools .ntfp-seg-btn { padding: .24rem .65rem; }
#notificationPopupModal .ntfp-tools .ntfp-hbtn-txt { display: none; }
#notificationPopupModal .ntfp-tools .ntfp-hbtn { padding: .28rem .6rem; }
#notificationPopupModal .ntfp-bell {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 2rem; height: 2rem; border-radius: .65rem;
    background: var(--ntfp-primary); color: var(--ntfp-gold-on-primary);
    font-size: .85rem;
}
#notificationPopupModal.show .ntfp-bell i { animation: ntfpRing .9s .12s var(--ntfp-ease) both; transform-origin: 50% 8%; }
#notificationPopupModal .modal-title {
    margin: 0; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--ntfp-ink); font-size: 1rem; font-weight: 800; line-height: 1.2; letter-spacing: 0;
}
#notificationPopupModal .ntfp-count {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    min-width: 1.35rem; height: 1.3rem; padding: 0 .4rem;
    border-radius: 999px;
    background: var(--ntfp-accent); color: var(--ntfp-on-accent);
    font-size: .7rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1;
}
#notificationPopupModal .ntfp-count.is-bump { animation: ntfpBump .45s var(--ntfp-ease); }
#notificationPopupModal .ntfp-x {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 2.1rem; height: 2.1rem; margin-left: auto; padding: 0;
    border: 1px solid var(--ntfp-line); border-radius: 50%;
    background: var(--ntfp-soft); color: var(--ntfp-muted);
    font-size: .9rem; cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}
#notificationPopupModal .ntfp-x:hover { background: var(--ntfp-soft-2); color: var(--ntfp-ink); }

#notificationPopupModal .ntfp-bar {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    padding: 0 .75rem .65rem 1rem;
    border-bottom: 1px solid var(--ntfp-line);
}
/* All / Unread: the page's switch (.sc-seg), with a thumb that slides between the two. */
#notificationPopupModal .ntfp-seg {
    position: relative; isolation: isolate;
    display: inline-flex; gap: .15rem; padding: .15rem;
    border: 1px solid color-mix(in oklab, var(--ntfp-line) 70%, transparent); border-radius: 999px;
    background: var(--ntfp-soft);
}
#notificationPopupModal .ntfp-seg.has-thumb::before {
    content: ""; position: absolute; z-index: -1;
    top: .15rem; bottom: .15rem; left: 0;
    width: var(--ntfp-thumb-w, 0); transform: translateX(var(--ntfp-thumb-x, 0));
    border-radius: 999px; background: var(--ntfp-primary);
    transition: transform .28s var(--ntfp-ease), width .28s var(--ntfp-ease);
}
#notificationPopupModal .ntfp-seg-btn {
    position: relative;
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .24rem .7rem;
    border: 0; border-radius: 999px; background: transparent;
    color: var(--ntfp-muted); font-size: .74rem; font-weight: 800; line-height: 1.3; white-space: nowrap;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease;
}
#notificationPopupModal .ntfp-seg-btn i { font-size: .8em; }
#notificationPopupModal .ntfp-seg-btn:hover { color: var(--ntfp-ink); }
#notificationPopupModal .ntfp-seg-btn.is-on { background: var(--ntfp-primary); color: var(--ntfp-on); }
#notificationPopupModal .ntfp-seg.has-thumb .ntfp-seg-btn.is-on { background: transparent; }
#notificationPopupModal .ntfp-seg-dot { width: .42rem; height: .42rem; border-radius: 50%; background: var(--ntfp-primary); }
#notificationPopupModal .ntfp-seg-btn.is-on .ntfp-seg-dot { background: var(--ntfp-accent); }
#notificationPopupModal .ntfp-hbtn {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .28rem .8rem;
    border: 1px solid var(--ntfp-line); border-radius: 999px;
    background: var(--ntfp-soft); color: var(--ntfp-ink);
    font-size: .74rem; font-weight: 800; line-height: 1.3; white-space: nowrap;
    box-shadow: none; cursor: pointer;
    transition: background-color .2s ease, opacity .2s ease;
}
#notificationPopupModal .ntfp-hbtn i { color: var(--ntfp-primary-ink); font-size: .85em; }
#notificationPopupModal .ntfp-hbtn:hover { background: var(--ntfp-soft-2); }
#notificationPopupModal .ntfp-hbtn:disabled { opacity: .6; cursor: progress; }
#notificationPopupModal :is(.ntfp-x, .ntfp-seg-btn, .ntfp-hbtn, .ntfp-pill, .ntfp-link, .sc-ibtn):focus-visible,
#notificationPopupModal .sc-nrow-link:focus-visible {
    outline: 2px solid var(--ntfp-primary); outline-offset: 1px;
}
#notificationPopupModal .sc-nrow-link:focus-visible { outline-offset: -2px; border-radius: .6rem; }

/* ---- Body: the list scrolls, captions stay pinned ------------------------- */
#notificationPopupModal .ntfp-body {
    position: relative;
    flex: 1 1 auto; min-height: 0;
    padding: 0;
    overflow-x: hidden; overflow-y: auto;
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    scrollbar-width: thin; scrollbar-color: var(--ntfp-soft-2) transparent;
    transition: opacity .18s ease;
}
#notificationPopupModal .ntfp-body.is-swapping { opacity: .35; }
#notificationPopupModal .sc-ntf { display: block; }
#notificationPopupModal .sc-cap {
    position: sticky; top: 0; z-index: 2;
    display: flex; align-items: center;
    margin: 0; padding: .45rem 1rem .35rem;
    border-bottom: 1px solid color-mix(in oklab, var(--ntfp-line) 60%, transparent);
    background: color-mix(in oklab, var(--ntfp-bg) 90%, transparent);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    color: var(--ntfp-muted); font-size: .62rem; font-weight: 800; letter-spacing: .06em; line-height: 1.3; text-transform: uppercase;
}
#notificationPopupModal .sc-box,
#notificationPopupModal .sc-nrows {
    padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible;
}

/* ---- THE row ------------------------------------------------------------- */
#notificationPopupModal .sc-nrow {
    position: relative;
    display: flex; align-items: center; gap: .6rem;
    padding: .6rem 1rem;
    border-bottom: 1px solid color-mix(in oklab, var(--ntfp-line) 60%, transparent);
    transition: background-color .2s ease;
}
#notificationPopupModal .sc-nrows > .sc-nrow:last-child { border-bottom: 0; }
#notificationPopupModal .sc-day + .sc-day .sc-cap { border-top: 1px solid color-mix(in oklab, var(--ntfp-line) 60%, transparent); }
#notificationPopupModal .sc-nrow:hover { background-color: var(--ntfp-hover); }
#notificationPopupModal .sc-nrow-link {
    display: flex; align-items: center; gap: .7rem; flex: 1 1 auto; min-width: 0;
    padding: 0;
    color: var(--ntfp-ink); text-decoration: none;
}
#notificationPopupModal .sc-nrow-link:hover { color: var(--ntfp-ink); }
#notificationPopupModal .sc-nrow-main { display: flex; flex-direction: column; gap: .05rem; min-width: 0; flex: 1 1 auto; }
#notificationPopupModal .sc-nrow-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; font-weight: 800; line-height: 1.3; }
#notificationPopupModal .sc-nrow-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ntfp-muted); font-size: .74rem; line-height: 1.35; }
#notificationPopupModal .sc-nrow-meta {
    display: flex; flex-wrap: nowrap; align-items: center; gap: .45rem;
    margin-top: .12rem; overflow: hidden; white-space: nowrap;
    color: var(--ntfp-muted); font-size: .66rem; font-weight: 700; line-height: 1.3;
}
#notificationPopupModal .sc-ntype { padding: .02rem .45rem; border-radius: 999px; background: rgba(var(--ntfp-primary-rgb), .1); color: var(--ntfp-primary-ink); font-size: .62rem; font-weight: 800; letter-spacing: .02em; }
#notificationPopupModal .sc-ntype.is-ok { background: rgba(var(--ntfp-ok-rgb), .14); color: var(--ntfp-ok-ink); }
#notificationPopupModal .sc-ntype.is-info { background: rgba(var(--ntfp-info-rgb), .14); color: var(--ntfp-info-ink); }
#notificationPopupModal .sc-ntype.is-accent { background: rgba(var(--ntfp-accent-rgb), .2); color: var(--ntfp-accent-ink); }
#notificationPopupModal .sc-ntype.is-bad { background: rgba(var(--ntfp-bad-rgb), .12); color: var(--ntfp-bad-ink); }

/* Unread: the tint, the inset accent bar, the dot after the subject. */
#notificationPopupModal .sc-nrow.is-unread {
    padding-left: 1.3rem;
    background-image: linear-gradient(90deg, rgba(var(--ntfp-primary-rgb), .08), transparent 70%);
    box-shadow: inset 3px 0 0 var(--ntfp-primary);
}
[data-bs-theme="dark"] #notificationPopupModal .sc-nrow.is-unread { background-image: linear-gradient(90deg, rgba(var(--ntfp-primary-rgb), .2), transparent 70%); }
#notificationPopupModal .sc-nrow.is-unread .sc-nrow-title::after {
    content: ""; display: inline-block; width: .45rem; height: .45rem; margin-left: .4rem; vertical-align: .1em;
    border-radius: 50%; background: var(--ntfp-primary);
}
/* Marked read in place: the bar and the dot fade out. */
#notificationPopupModal .sc-nrow.is-reading { transition: background-color .3s ease, box-shadow .35s ease, padding-left .3s var(--ntfp-ease); }

/* The picture: a face bubble, two crests, an avatar or an icon tile (2.5rem). */
#notificationPopupModal .sc-nvis { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 2.5rem; height: 2.5rem; }
#notificationPopupModal .sc-nvis--face :is(img, .player-face-bubble) { max-width: 2.5rem; max-height: 2.5rem; }
#notificationPopupModal .sc-nvis--match { border-radius: .7rem; background: var(--ntfp-soft); }
#notificationPopupModal .sc-nvis--match .sc-nvis-h,
#notificationPopupModal .sc-nvis--match .sc-nvis-a { position: absolute; display: inline-flex; width: 1.55rem; height: 1.55rem; }
#notificationPopupModal .sc-nvis--match .sc-nvis-h { left: .1rem; top: .1rem; }
#notificationPopupModal .sc-nvis--match .sc-nvis-a { right: .1rem; bottom: .1rem; }
#notificationPopupModal .sc-nvis--match :is(img, svg, .sc-crest) { width: 100% !important; height: 100% !important; max-width: none; margin: 0 !important; object-fit: contain; }
#notificationPopupModal .sc-av { position: relative; display: inline-flex; flex: 0 0 auto; width: 2.5rem !important; height: 2.5rem !important; }
#notificationPopupModal .sc-av > img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: center 25%; background: var(--ntfp-soft); }
#notificationPopupModal .sc-av-ini {
    display: grid; place-items: center; width: 100%; height: 100%;
    border-radius: 50%;
    background: rgba(var(--ntfp-primary-rgb), .12); color: var(--ntfp-primary-ink);
    font-size: 1rem; font-weight: 900; line-height: 1;
}
#notificationPopupModal .sc-ico {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: .75rem;
    background: rgba(var(--ntfp-primary-rgb), .1); color: var(--ntfp-primary-ink);
    font-size: .95rem;
}
#notificationPopupModal .sc-ico--accent { background: rgba(var(--ntfp-accent-rgb), .18); color: var(--ntfp-accent-ink); }
#notificationPopupModal .sc-ico--ok { background: rgba(var(--ntfp-ok-rgb), .14); color: var(--ntfp-ok-ink); }
#notificationPopupModal .sc-ico--info { background: rgba(var(--ntfp-info-rgb), .14); color: var(--ntfp-info-ink); }
#notificationPopupModal .sc-ico--bad { background: rgba(var(--ntfp-bad-rgb), .12); color: var(--ntfp-bad-ink); }
#notificationPopupModal .sc-nbadge {
    position: absolute; right: -.2rem; bottom: -.2rem;
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.1rem; height: 1.1rem; border-radius: 50%;
    border: 2px solid var(--ntfp-bg);
    background: var(--ntfp-primary); color: var(--ntfp-on);
    font-size: .5rem;
}
#notificationPopupModal .sc-nbadge.is-ok, #notificationPopupModal .sc-nbadge.is-on { background: var(--ntfp-ok); }
#notificationPopupModal .sc-nbadge.is-info, #notificationPopupModal .sc-nbadge.is-assist { background: var(--ntfp-info); color: #fff; }
#notificationPopupModal .sc-nbadge.is-accent { background: var(--ntfp-accent); color: var(--ntfp-on-accent); }
#notificationPopupModal .sc-nbadge.is-bad, #notificationPopupModal .sc-nbadge.is-off { background: var(--ntfp-bad); }
#notificationPopupModal .sc-nbadge.is-goal { background: var(--ntfp-bg); color: var(--ntfp-ink); font-size: .6rem; }
#notificationPopupModal .sc-nbadge.is-yellow { background: var(--ntfp-bg); color: var(--theme-warning, #f2c200); }
#notificationPopupModal .sc-nbadge.is-red { background: var(--ntfp-bg); color: var(--ntfp-bad); }

/* Row actions: hidden until the row is hovered or focused (mouse / keyboard). */
#notificationPopupModal .sc-nrow-act {
    position: absolute; top: 50%; right: .75rem; z-index: 1;
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .3rem 0 .3rem 1.6rem;
    background: linear-gradient(90deg, transparent, var(--ntfp-hover) 1.3rem);
    opacity: 0; pointer-events: none;
    transform: translate(.6rem, -50%);
    transition: opacity .18s ease, transform .22s var(--ntfp-ease);
}
#notificationPopupModal .sc-nrow:hover .sc-nrow-act,
#notificationPopupModal .sc-nrow:focus-within .sc-nrow-act { opacity: 1; pointer-events: auto; transform: translate(0, -50%); }
#notificationPopupModal .sc-ibtn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 2rem; height: 2rem; padding: 0;
    border: 1px solid var(--ntfp-line); border-radius: 50%;
    background: var(--ntfp-bg); color: var(--ntfp-primary-ink);
    font-size: .72rem; box-shadow: none; cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}
#notificationPopupModal .sc-ibtn:hover { background: var(--ntfp-soft-2); }
#notificationPopupModal .sc-ibtn:active { transform: scale(.92); }
#notificationPopupModal .sc-ibtn:disabled { opacity: .55; cursor: progress; }
#notificationPopupModal .sc-ibtn--del { color: var(--ntfp-bad-ink); }
#notificationPopupModal .sc-ibtn--del:hover { border-color: rgba(var(--ntfp-bad-rgb), .45); }
/* Delete asks once: the first press arms the button (red, "Delete this notification?"),
   the second deletes; it disarms by itself after a few seconds. */
#notificationPopupModal .sc-ibtn--del.is-armed {
    border-color: transparent; background: var(--ntfp-bad); color: #fff;
    animation: ntfpArm 1.2s ease-in-out infinite;
}

/* Arriving (the poll found new alerts while the pop-up was open, or since it was last
   seen): the row slides in and glows in the accent, then settles. */
#notificationPopupModal .sc-nrow.is-arriving { animation: ntfpArrive .45s var(--ntfp-ease) both; }
#notificationPopupModal .sc-nrow.is-arriving::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: rgba(var(--ntfp-accent-rgb), .26);
    animation: ntfpGlow 2.6s ease-out .2s both;
}
/* Leaving (deleted, or read while the Unread tab is on): it slides out and the gap closes. */
#notificationPopupModal .sc-nrow.is-leaving {
    overflow: hidden;
    padding-top: 0 !important; padding-bottom: 0 !important;
    border-bottom-width: 0;
    opacity: 0; transform: translateX(2rem);
    transition: height .28s var(--ntfp-ease), padding .28s var(--ntfp-ease), opacity .2s ease, transform .28s var(--ntfp-ease);
}
#notificationPopupModal .sc-day.is-leaving { overflow: hidden; opacity: 0; transition: height .28s var(--ntfp-ease), opacity .2s ease; }
/* A fresh list: the rows rise in one after another. */
#notificationPopupModal .ntfp-list.is-fresh .sc-nrow { animation: ntfpRowIn .32s var(--ntfp-ease) both; animation-delay: calc(var(--ntfp-i, 0) * 28ms); }

/* ---- Loading, empty, foot ------------------------------------------------ */
#notificationPopupModal .ntfp-skel { display: flex; flex-direction: column; min-height: 12rem; }
#notificationPopupModal .ntfp-skel i {
    position: relative; display: block; height: 3.6rem;
    border-bottom: 1px solid color-mix(in oklab, var(--ntfp-line) 60%, transparent);
}
#notificationPopupModal .ntfp-skel i::before,
#notificationPopupModal .ntfp-skel i::after {
    content: ""; position: absolute;
    background: linear-gradient(90deg, var(--ntfp-soft) 0%, var(--ntfp-soft-2) 45%, var(--ntfp-soft) 90%);
    background-size: 220% 100%;
    animation: ntfpShimmer 1.3s linear infinite;
}
#notificationPopupModal .ntfp-skel i::before { left: 1rem; top: .55rem; width: 2.5rem; height: 2.5rem; border-radius: 50%; }
#notificationPopupModal .ntfp-skel i::after { left: 4.2rem; right: 3rem; top: .95rem; height: .55rem; border-radius: 999px; box-shadow: 0 .95rem 0 -.05rem var(--ntfp-soft); }
#notificationPopupModal .ntfp-skel i:nth-child(odd)::after { right: 6rem; }

#notificationPopupModal .ntfp-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
    min-height: 12rem; padding: 2rem 1.5rem;
    text-align: center;
    animation: ntfpRowIn .35s var(--ntfp-ease) both;
}
#notificationPopupModal .ntfp-empty-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 3.2rem; height: 3.2rem; margin-bottom: .4rem; border-radius: 1rem;
    background: rgba(var(--ntfp-primary-rgb), .1); color: var(--ntfp-primary-ink);
    font-size: 1.25rem;
}
#notificationPopupModal .ntfp-empty.is-unread .ntfp-empty-ico { background: rgba(var(--ntfp-ok-rgb), .14); color: var(--ntfp-ok-ink); }
#notificationPopupModal .ntfp-empty b { color: var(--ntfp-ink); font-size: .95rem; font-weight: 800; }
#notificationPopupModal .ntfp-empty small { max-width: 18rem; color: var(--ntfp-muted); font-size: .78rem; line-height: 1.4; }
#notificationPopupModal .ntfp-link {
    display: inline-flex; align-items: center; gap: .35rem; margin-top: .5rem;
    color: var(--ntfp-primary-ink); font-size: .76rem; font-weight: 800; text-decoration: none;
}
#notificationPopupModal .ntfp-link:hover { text-decoration: underline; }

#notificationPopupModal .ntfp-foot {
    position: sticky; bottom: 0; z-index: 2;
    padding: .65rem .9rem;
    border-top: 1px solid var(--ntfp-line);
    background: var(--ntfp-bg);
}
/* View All: the site's solid pill (.sc-pill--solid / .mb-pill): flat, no shadow. */
#notificationPopupModal .ntfp-pill {
    display: flex; align-items: center; justify-content: center; gap: .45rem;
    width: 100%; min-height: 2.4rem; padding: .45rem 1rem;
    border: 1px solid transparent; border-radius: 999px;
    background: var(--ntfp-primary); color: var(--ntfp-on);
    font-size: .8rem; font-weight: 800; line-height: 1.25; text-decoration: none; white-space: nowrap;
    box-shadow: none;
    transition: background-color .2s ease, transform .15s ease;
}
#notificationPopupModal .ntfp-pill i { font-size: .85em; }
#notificationPopupModal .ntfp-pill:hover { background: color-mix(in oklab, var(--ntfp-primary) 88%, black); color: var(--ntfp-on); }
#notificationPopupModal .ntfp-pill:active { transform: scale(.98); }
#notificationPopupModal .ntfp-pill-go { transition: transform .2s var(--ntfp-ease); }
#notificationPopupModal .ntfp-pill:hover .ntfp-pill-go { transform: translateX(3px); }

/* ---- Touch screens: the actions stay on screen, 44 px targets ------------- */
@media (hover: none), (pointer: coarse) {
    #notificationPopupModal .sc-nrow-act {
        position: static; gap: .75rem; padding: 0; margin-left: .25rem;
        background: none; opacity: 1; pointer-events: auto; transform: none;
    }
    #notificationPopupModal .sc-ibtn::before { content: ""; position: absolute; inset: -.375rem; border-radius: 50%; }
    #notificationPopupModal .ntfp-x { width: 2.75rem; height: 2.75rem; margin-right: -.3rem; }
    #notificationPopupModal .ntfp-seg-btn { min-height: 2.75rem; padding: .3rem .9rem; }
    #notificationPopupModal .ntfp-hbtn { min-width: 2.75rem; min-height: 2.75rem; justify-content: center; padding: .3rem .9rem; }
    #notificationPopupModal .ntfp-pill { min-height: 2.75rem; }
    #notificationPopupModal .sc-nrow { min-height: 3.75rem; }
}

/* ---- Phones: a bottom sheet ---------------------------------------------- */
@media (max-width: 575.98px) {
    #notificationPopupModal .ntfp-dialog {
        top: auto; right: 0; bottom: 0; left: 0;
        width: 100%; max-width: none; margin: 0;
    }
    #notificationPopupModal.fade .ntfp-dialog {
        opacity: 1;
        transform: translateY(105%);
        transition: transform .34s var(--ntfp-ease);
    }
    #notificationPopupModal.show .ntfp-dialog { transform: translateY(var(--ntfp-drag, 0px)); }
    #notificationPopupModal .ntfp-dialog.is-dragging { transition: none; }
    #notificationPopupModal .ntfp-sheet {
        max-height: min(86dvh, calc(100dvh - env(safe-area-inset-top, 0px) - 2.75rem));
        border-width: 1px 0 0;
        border-radius: 1.35rem 1.35rem 0 0;
    }
    #notificationPopupModal .ntfp-grab {
        display: flex; justify-content: center; flex: 0 0 auto;
        padding: .5rem 0 .1rem; touch-action: none; cursor: grab;
    }
    #notificationPopupModal .ntfp-grab span { width: 2.5rem; height: .3rem; border-radius: 999px; background: var(--ntfp-soft-2); }
    #notificationPopupModal .ntfp-head { padding: .2rem .75rem .45rem max(1rem, env(safe-area-inset-left, 0px)); touch-action: none; }
    /* One row as on the big screen: title, count, the switch, Mark All Read, Close. */
    #notificationPopupModal .ntfp-head { flex-wrap: nowrap; gap: .4rem; padding-bottom: .6rem; }
    #notificationPopupModal .ntfp-head .modal-title { flex: 0 1 auto; min-width: 0; font-size: .95rem; }
    /* Phones keep the two rows, the tabs compact (owner, 11 Oct: "on mobile the tabs are more
       compact"): the site's pill size, not the 44 px touch boxes. */
    #notificationPopupModal .ntfp-tools .ntfp-seg { padding: .12rem; }
    #notificationPopupModal .ntfp-tools .ntfp-seg-btn { min-height: 0; padding: .22rem .6rem; font-size: .74rem; line-height: 1.3; }
    #notificationPopupModal .ntfp-tools .ntfp-hbtn { min-width: 0; min-height: 0; padding: .26rem .6rem; font-size: .74rem; line-height: 1.3; }
    #notificationPopupModal .ntfp-head .ntfp-x { width: 2.2rem; height: 2.2rem; margin-right: 0; }
    #notificationPopupModal .sc-nrow { padding-left: max(1rem, env(safe-area-inset-left, 0px)); padding-right: max(.75rem, env(safe-area-inset-right, 0px)); }
    #notificationPopupModal .sc-nrow.is-unread { padding-left: max(1.3rem, env(safe-area-inset-left, 0px)); }
    #notificationPopupModal :is(.ntfp-skel, .ntfp-empty) { min-height: 14rem; }
    #notificationPopupModal .ntfp-foot { padding-bottom: calc(.65rem + env(safe-area-inset-bottom, 0px)); }
}
/* The "Install app" pill (includes/js/install-prompt.js, z-index 1054) sits above every
   modal (1050): while the sheet is open it would cover View All. It steps aside. */
body:has(#notificationPopupModal.show) .slb-install-pill { visibility: hidden; }
/* Phones: Mark All Read is its icon (title + aria-label carry the words; the Portuguese
   label does not fit beside the switch). */
@media (max-width: 439.98px) {
    #notificationPopupModal .ntfp-hbtn-txt { display: none; }
    #notificationPopupModal .ntfp-hbtn { padding-left: .75rem; padding-right: .75rem; }
}

/* The narrowest phones: the bell tile steps aside so the words keep their room. */
@media (max-width: 399.98px) {
    #notificationPopupModal .ntfp-head .ntfp-bell { display: none; }
}

/* ---- Motion -------------------------------------------------------------- */
@keyframes ntfpRing { 0% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(7deg); } 80% { transform: rotate(-4deg); } 100% { transform: rotate(0); } }
@keyframes ntfpBump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes ntfpRowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ntfpArrive { from { opacity: 0; transform: translateY(-.9rem); } to { opacity: 1; transform: none; } }
@keyframes ntfpGlow { from { opacity: 1; } to { opacity: 0; } }
@keyframes ntfpShimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes ntfpArm { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--ntfp-bad-rgb), .35); } 50% { box-shadow: 0 0 0 .3rem rgba(var(--ntfp-bad-rgb), 0); } }

@media (prefers-reduced-motion: reduce) {
    #notificationPopupModal.fade .ntfp-dialog { transform: none !important; transition: opacity .15s linear; }
    #notificationPopupModal.show .ntfp-bell i,
    #notificationPopupModal .ntfp-count.is-bump,
    #notificationPopupModal .ntfp-list.is-fresh .sc-nrow,
    #notificationPopupModal .sc-nrow.is-arriving,
    #notificationPopupModal .ntfp-empty,
    #notificationPopupModal .sc-ibtn--del.is-armed,
    #notificationPopupModal .ntfp-skel i::before,
    #notificationPopupModal .ntfp-skel i::after { animation: none !important; }
    /* The new rows still stand out, without movement: a steady tint that fades. */
    #notificationPopupModal .sc-nrow.is-arriving::after { animation: ntfpGlow 2.6s linear both !important; }
    #notificationPopupModal :is(.sc-nrow, .sc-nrow-act, .sc-ibtn, .ntfp-seg-btn, .ntfp-hbtn, .ntfp-pill, .ntfp-pill-go, .ntfp-body),
    #notificationPopupModal .ntfp-seg.has-thumb::before { transition: none !important; }
    #notificationPopupModal .sc-nrow-act { transform: translate(0, -50%); }
}
@media (prefers-reduced-motion: reduce) and ((hover: none) or (pointer: coarse)) {
    #notificationPopupModal .sc-nrow-act { transform: none; }
}
