.nav-badge.is-hidden,
.fx-bottom-notification-badge.is-hidden {
    display: none !important;
}

[data-fx-notification-link],
[data-fx-message-link] {
    position: relative;
}

.mobile-bottom-nav [data-fx-notification-link] {
    position: relative;
}

.fx-bottom-notification-badge {
    position: absolute;
    top: 4px;
    left: calc(50% + 8px);
    z-index: 2;
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border: 2px solid color-mix(in srgb, var(--card) 92%, transparent);
    border-radius: 999px;
    background: linear-gradient(135deg, #ff5d70, #df334d);
    color: #fff;
    box-shadow: 0 5px 14px rgba(223, 51, 77, .38);
    font-size: .64rem;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
}

[data-fx-notification-link].has-new-notification svg,
[data-fx-notification-link].has-new-notification > span:first-child {
    animation: fx-notification-bell .72s ease-in-out 2;
    transform-origin: 50% 10%;
}

.fx-notification-toast {
    position: fixed;
    right: 18px;
    bottom: 84px;
    z-index: 500;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 11px;
    width: min(380px, calc(100vw - 28px));
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
    border-radius: 16px;
    background: color-mix(in srgb, var(--card) 95%, transparent);
    color: var(--text);
    box-shadow: 0 20px 55px rgba(0, 0, 0, .34);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: fx-notification-toast-in .25s ease-out;
}

.fx-notification-toast > a {
    display: contents;
    color: inherit;
    text-decoration: none;
}

.fx-notification-toast-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 17%, var(--card-2));
    color: var(--accent);
    font-size: 1.1rem;
}

.fx-notification-toast-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.fx-notification-toast-copy strong,
.fx-notification-toast-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fx-notification-toast-copy small {
    color: var(--muted);
    font-size: .78rem;
}

.fx-notification-toast-close {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 1.15rem;
    cursor: pointer;
}

.fx-notification-toast-close:hover {
    background: var(--card-2);
    color: var(--text);
}

@keyframes fx-notification-bell {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-14deg); }
    55% { transform: rotate(12deg); }
    78% { transform: rotate(-7deg); }
}

@keyframes fx-notification-toast-in {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 760px) {
    .fx-notification-toast {
        right: 12px;
        bottom: calc(76px + env(safe-area-inset-bottom));
        width: calc(100vw - 24px);
    }
}

/* ForumX mobile viewport stability v2 */
html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
}

body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
}

body > *,
.site-header,
.site-main,
main,
footer,
.container,
.page-shell,
.content-shell {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

img,
video,
iframe,
canvas {
    max-width: 100%;
}

.mobile-bottom-nav {
    box-sizing: border-box !important;
    width: auto !important;
    max-width: none !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    right: max(10px, env(safe-area-inset-right)) !important;
    transform: none !important;
}

@media (max-width: 760px) {
    html,
    body {
        overflow-x: clip;
    }

    @supports not (overflow: clip) {
        html,
        body {
            overflow-x: hidden;
        }
    }

    .container,
    main,
    .site-main,
    .card,
    .panel,
    .forum-card,
    .fx-messenger,
    .fx-chat-layout,
    .fx-messenger-inbox {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .mobile-bottom-nav > a {
        min-width: 0;
    }
}
