.notifications-page {
    max-width: 720px;
    margin: 32px auto 64px;
    padding: 0 16px;
}

.notifications-card {
    padding: 28px 24px 32px;
}

.notifications-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.notifications-header h1 {
    margin: 0 0 6px;
    font-size: 1.75rem;
}

.notifications-subtitle {
    margin: 0;
    color: rgba(30, 45, 60, 0.72);
    font-size: 0.95rem;
}

.notifications-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.notifications-mark-all,
.notifications-filter-toggle,
.notifications-load-more {
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow:
        0 4px 10px rgba(42, 78, 112, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font: inherit;
    color: #1a2a3a;
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        background 0.12s ease;
}

.notifications-mark-all:hover,
.notifications-filter-toggle:hover,
.notifications-load-more:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
}

.notifications-mark-all:active,
.notifications-filter-toggle:active,
.notifications-load-more:active {
    transform: translateY(1px);
    box-shadow:
        inset 0 2px 4px rgba(120, 145, 168, 0.18),
        inset 0 -1px 0 rgba(255, 255, 255, 0.9);
}

.notifications-mark-all[hidden],
.notifications-filter-toggle[hidden] {
    display: none !important;
}

.notifications-empty {
    margin: 24px 0;
    color: rgba(30, 45, 60, 0.7);
}

.notifications-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notifications-item {
    display: block;
    width: 100%;
    text-align: left;
    text-decoration: none;
    color: inherit;
    border: 0;
    border-radius: 12px;
    padding: 14px 14px;
    margin-bottom: 8px;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.notifications-item:hover {
    background: rgba(255, 255, 255, 0.55);
}

.notifications-item.is-unread {
    background: rgba(255, 255, 255, 0.82);
    box-shadow: inset 3px 0 0 rgba(42, 98, 150, 0.7);
}

.notifications-item.is-unread .notifications-item-title::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: #1f4f7a;
    vertical-align: middle;
}

.notifications-item-title {
    display: block;
    font-weight: 650;
    margin-bottom: 4px;
}

.notifications-item-body {
    display: block;
    color: rgba(30, 45, 60, 0.75);
    font-size: 0.92rem;
    margin-bottom: 6px;
}

.notifications-item-meta {
    display: block;
    font-size: 0.8rem;
    color: rgba(30, 45, 60, 0.55);
}

.notifications-load-more {
    display: block;
    width: 100%;
    margin-top: 12px;
}

.notifications-load-more[hidden] {
    display: none !important;
}

@media (max-width: 800px) {
    .notifications-header {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Keep the wrapper transparent to the existing desktop/tablet flow. */
.notifications-content { display: contents; }

/* Use Upload's exact stable viewport measurement and Compare's shared phone
   geometry. Reserve both banners before their markup finishes parsing. */
@media (max-width: 600px) {
    .page-notifications[data-ad-layout="responsive"] {
        --mobile-layout-viewport-unit: var(--upload-viewport-unit, 1svh);
        display: flex;
        flex-direction: column;
        height: calc(var(--mobile-layout-viewport-unit) * 100);
        min-height: calc(var(--mobile-layout-viewport-unit) * 100);
    }
    .page-notifications [hidden] { display: none !important; }
    .page-notifications .navbar { flex-shrink: 0; margin-top: 12px; }

    .page-notifications[data-ad-layout="responsive"] .responsive-ads-shell {
        flex: 1 0 0;
        /* Keep room for the heading, actions and a usable scroll region on
           unusually short screens; the outer page may scroll in that case. */
        min-height: calc(240px + var(--compare-ad-height) * 2 + var(--compare-gap) * 3
            + max(10px, calc(16px - var(--compare-compact-space) * .375), var(--compare-gap)));
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "top" "content" "right";
        grid-template-rows: minmax(var(--compare-ad-height), auto)
            minmax(240px, 1fr) minmax(var(--compare-ad-height), auto);
        align-items: stretch;
        gap: var(--compare-gap);
        padding: var(--compare-gap) var(--mobile-page-gutter)
            max(10px, calc(16px - var(--compare-compact-space) * .375), var(--compare-gap));
    }
    .page-notifications .responsive-ads-shell [data-ad-slot="left"],
    .page-notifications .notifications-page > [data-ad-anchor="middle"] { display: none; }

    .page-notifications[data-ad-layout="responsive"] .responsive-ads-shell > :is([data-ad-slot="top"], [data-ad-slot="right"]) {
        position: relative; top: auto; width: 100%;
        min-height: var(--compare-ad-height); padding: var(--compare-ad-mat-padding); gap: 0;
        --surface-radius: clamp(12px, 3.5vw, 18px);
        background: #fff; border: 1px solid rgba(145, 174, 195, .5);
        box-shadow: 0 2px 6px rgba(24, 70, 105, .055);
        overflow: visible;
    }
    .page-notifications .responsive-ad::before,
    .page-notifications .responsive-ad::after { content: none; }
    .page-notifications .responsive-ad-label {
        font-family: inherit; font-size: clamp(10px, 2.9vw, 14px);
        font-weight: 650; letter-spacing: .055em; color: #58708b;
    }
    .page-notifications :is(.responsive-ad-creative, .responsive-ad-creative > ins, .responsive-ad-creative iframe) {
        overflow: visible; border-radius: 0;
    }
    .page-notifications .responsive-ad-creative:not(:empty) { display: block; width: 100%; }
    .page-notifications .responsive-ad:has(> .responsive-ad-creative:not(:empty)) > [data-ad-placeholder] { display: none; }
    .page-notifications .responsive-ad-creative :is(img, video, iframe) { max-width: none; }

    .page-notifications .responsive-ads-shell > .site-ads-content,
    .page-notifications .responsive-ads-shell .notifications-page {
        display: flex; flex-direction: column; min-width: 0; min-height: 0;
    }
    .page-notifications .responsive-ads-shell .notifications-page {
        flex: 1 1 0; margin: 0; padding: 0;
    }
    .page-notifications .notifications-card {
        --surface-radius: clamp(22px, 6vw, 30px);
        display: flex; flex-direction: column; flex: 1 1 0;
        width: 100%; min-width: 0; min-height: 0;
        gap: var(--compare-section-gap); padding: var(--compare-card-padding);
    }
    .page-notifications .notifications-header {
        flex-shrink: 0; gap: var(--compare-control-gap); margin-bottom: 0;
    }
    .page-notifications .notifications-header h1 { font-size: clamp(30px, 8.5vw, 36px); line-height: 1.1; }
    .page-notifications .notifications-subtitle { font-size: clamp(16px, 3.8vw, 18px); line-height: 1.35; }
    .page-notifications .notifications-actions { gap: clamp(6px, 2vw, 10px); }
    .page-notifications .notifications-actions button,
    .page-notifications .notifications-load-more {
        min-height: 44px; padding: 8px 12px; font-size: clamp(13px, 3.5vw, 15px);
        white-space: nowrap; -webkit-tap-highlight-color: transparent;
    }
    .page-notifications .notifications-content {
        display: flex; flex-direction: column; flex: 1 1 0;
        min-width: 0; min-height: 0; gap: var(--compare-control-gap);
        overflow-y: auto; overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }
    .page-notifications .notifications-content > * { flex-shrink: 0; }
    .page-notifications .notifications-content:has(> .notifications-empty:not([hidden])) { justify-content: center; }
    .page-notifications .notifications-empty { margin: 0; padding: 20px 8px; text-align: center; font-size: 16px; line-height: 1.4; }
    .page-notifications .notifications-list:empty { display: none; }
    .page-notifications .notifications-item { padding: clamp(10px, 3vw, 14px); margin-bottom: var(--compare-control-gap); overflow-wrap: anywhere; }
    .page-notifications .notifications-item-title { font-size: 15px; line-height: 1.35; }
    .page-notifications .notifications-item-body { font-size: 14px; line-height: 1.4; }
    .page-notifications .notifications-item-meta { font-size: 12px; line-height: 1.3; }
    .page-notifications .notifications-load-more { align-self: center; width: min(100%, 240px); margin-top: 4px; }

    /* With ads disabled, the shared shell becomes a block and cannot stretch
       this page's flex children. Keep one content row so the card and its
       scrolling list receive the available height. The minimum also leaves
       room for the guest banner, heading and a usable list on short phones. */
    body.page-notifications[data-ads-hidden="true"] > .responsive-ads-shell {
        display: grid !important;
        grid-template-areas: "content";
        grid-template-rows: minmax(360px, 1fr);
    }
}
