.site-notify {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.header__bar .site-notify {
    order: 4;
}

.header__bar .header-user {
    order: 4;
}

/* Keep site header sticky on every viewport width. */
header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1100 !important;
}

/* Light theme: force high-contrast hamburger icon for mobile menu. */
html:not(.night) header .mobile-menu-button {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16' stroke='%23111111' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") !important;
    background-size: 20px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

.header-search-row {
    display: none;
}

html.header-search-detached .header-search-row {
    display: block;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 8px var(--container-pad) 0;
}

html.header-search-detached .header-search-row .search {
    position: static !important;
    display: flex !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    flex: 1 1 auto !important;
}

html.header-search-detached .header-search-row .search .search__wrap {
    width: 100% !important;
    max-width: none !important;
}

.site-notify__button {
    position: relative;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 14px;
    background: var(--glass-1);
    border: 1px solid var(--glass-stroke);
    color: var(--text);
}

.night .site-notify__button {
    background: var(--n-surface);
    border-color: var(--n-border);
    color: var(--n-text);
}

.site-notify__button:hover {
    background: var(--glass-2);
}

.night .site-notify__button:hover {
    background: var(--n-hover);
}

.site-notify__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 8px 18px var(--accent-soft);
}

.site-notify__dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(420px, calc(100vw - 32px));
    padding: 18px;
    border-radius: 20px;
    background: var(--glass-3);
    border: 1px solid var(--glass-stroke);
    box-shadow: var(--elev-2);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    z-index: 1500;
}

.night .site-notify__dropdown {
    background: rgba(15, 15, 16, 0.94);
    border-color: var(--n-border);
}

.site-notify__dropdown-head,
.site-notify-center__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.site-panel-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.site-panel-bar__main {
    flex: 1 1 auto;
    min-width: 0;
}

.site-panel-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    padding: 0 !important;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-2);
    box-shadow: none !important;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.site-panel-chevron .fal {
    font-size: 11px;
    line-height: 1;
}

.site-panel-chevron:hover {
    background: rgba(148, 163, 184, 0.14) !important;
    color: var(--text) !important;
    border-color: rgba(148, 163, 184, 0.26) !important;
}

.night .site-panel-chevron,
[data-theme="dark"] .site-panel-chevron,
[data-theme="ash"] .site-panel-chevron {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--n-text-muted);
}

.night .site-panel-chevron:hover,
[data-theme="dark"] .site-panel-chevron:hover,
[data-theme="ash"] .site-panel-chevron:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    color: var(--n-text-heading) !important;
}

.site-notify__dropdown-title,
.site-notify-center__title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0;
    text-transform: none;
}

.site-notify__dropdown-subtitle,
.site-notify-center__meta,
.subscribes-page__lead {
    margin: 6px 0 0;
    color: var(--text-3);
    font-size: 13px;
    line-height: 1.45;
}

.night .site-notify__dropdown-subtitle,
.night .site-notify-center__meta,
.night .subscribes-page__lead {
    color: var(--n-text-muted);
}

.site-notify__dropdown-link,
.site-notify__read-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--bg-2);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.night .site-notify__dropdown-link,
.night .site-notify__read-all {
    background: var(--n-surface-2);
    color: var(--n-text);
    border: 1px solid var(--n-border);
}

.site-notify__tabs {
    display: flex;
    gap: 8px;
    margin: 18px 0 14px;
    flex-wrap: wrap;
}

.site-notify__tab {
    height: 36px;
    min-width: 0;
    padding: 0 16px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-3);
    font-weight: 600;
}

.site-notify__tab:hover {
    background: var(--hover);
    color: var(--text);
}

.site-notify__tab.is-active {
    background: var(--accent);
    color: #fff;
}

.site-notify__list,
.site-notify-center__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 96px;
}

.site-notify-center {
    margin-top: 20px;
    padding: 24px;
    border-radius: 22px;
}

.site-notify-center__bar {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.night .site-notify-center__bar,
[data-theme="dark"] .site-notify-center__bar,
[data-theme="ash"] .site-notify-center__bar {
    border-bottom-color: var(--n-border);
}

.site-notify-center__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.site-notify-center__controls[hidden] {
    display: none !important;
}

.site-notify-center__controls .site-notify__tabs {
    margin: 0;
    flex: 1 1 auto;
}

.site-notify-center__toggle {
    flex: 0 0 auto;
}

.site-notify-center.is-collapsed .site-notify-item__action {
    display: none;
}

.push-subscribe-modal--guest .push-subscribe-modal__dialog {
    width: min(100%, 480px);
}

.push-subscribe-modal__guest-message {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(0, 113, 227, 0.08), rgba(0, 113, 227, 0.03));
    border: 1px solid rgba(0, 113, 227, 0.12);
}

.push-subscribe-modal__guest-text {
    font-size: 15px;
    line-height: 1.55;
    font-weight: 600;
    color: var(--text);
}

.push-subscribe-modal__guest-hint {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-3);
}

.push-subscribe-modal__secondary {
    height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    font-weight: 700;
    background: var(--bg-2);
    color: var(--text);
}

.push-subscribe-modal__secondary:hover {
    background: var(--hover);
}

.push-subscribe-modal__actions--guest {
    justify-content: flex-end;
    gap: 12px;
}

.push-subscribe-modal__actions--guest > button {
    flex: 1 1 180px;
}

.night .push-subscribe-modal__guest-message,
[data-theme="dark"] .push-subscribe-modal__guest-message,
[data-theme="ash"] .push-subscribe-modal__guest-message {
    background: linear-gradient(180deg, rgba(64, 156, 255, 0.16), rgba(64, 156, 255, 0.06));
    border-color: rgba(255, 255, 255, 0.08);
}

.night .push-subscribe-modal__guest-text,
[data-theme="dark"] .push-subscribe-modal__guest-text,
[data-theme="ash"] .push-subscribe-modal__guest-text {
    color: var(--n-text-heading);
}

.night .push-subscribe-modal__guest-hint,
[data-theme="dark"] .push-subscribe-modal__guest-hint,
[data-theme="ash"] .push-subscribe-modal__guest-hint {
    color: var(--n-text-muted);
}

.night .push-subscribe-modal__secondary,
[data-theme="dark"] .push-subscribe-modal__secondary,
[data-theme="ash"] .push-subscribe-modal__secondary {
    background: var(--n-surface-2);
    color: var(--n-text);
}

.night .push-subscribe-modal__secondary:hover,
[data-theme="dark"] .push-subscribe-modal__secondary:hover,
[data-theme="ash"] .push-subscribe-modal__secondary:hover {
    background: var(--n-hover);
}

.site-notify-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.65);
}

.night .site-notify-item {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.site-notify-item.is-unread {
    box-shadow: inset 3px 0 0 var(--accent);
}

.site-notify-item--compact {
    padding: 12px 14px;
}

.site-notify-item__main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.site-notify-item__icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    flex-shrink: 0;
}

.site-notify-item__content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.site-notify-item__title {
    font-size: 14px;
    line-height: 1.45;
    font-weight: 600;
    color: var(--text);
}

.night .site-notify-item__title {
    color: var(--n-text);
}

.site-notify-item__meta {
    font-size: 12px;
    color: var(--text-3);
}

.night .site-notify-item__meta {
    color: var(--n-text-muted);
}

.site-notify-item__action {
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.site-notify-empty {
    padding: 24px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.4);
    color: var(--text-3);
    text-align: center;
    line-height: 1.5;
}

.night .site-notify-empty {
    background: rgba(255, 255, 255, 0.03);
    color: var(--n-text-muted);
}

.site-notify__dropdown-footer {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
}

.subscribes-page__head {
    display: flex;
    justify-content: center;
}

.subscribes-page__lead {
    max-width: 760px;
    text-align: center;
}

@media (max-width: 768px) {
    .site-notify-center {
        padding: 20px 16px;
    }

    .site-notify-center__controls {
        flex-direction: column;
        align-items: stretch;
    }

    .site-notify-center__controls .site-notify__tabs {
        width: 100%;
    }

    .site-notify-center__controls .site-notify__read-all {
        width: 100%;
    }

    .push-subscribe-modal__actions--guest > button {
        flex-basis: calc(50% - 6px);
    }
}

@media (max-width: 1200px) {
    header .header__bar .site-notify {
        order: 4 !important;
        margin-left: auto !important;
    }

    header .header__bar .header-user {
        order: 4 !important;
        margin-left: 8px !important;
    }
}

@media (max-width: 768px) {
    html.header-search-detached header .header__bar {
        height: 48px !important;
        min-height: 48px !important;
        flex-wrap: nowrap !important;
        row-gap: 0 !important;
        padding-bottom: 0 !important;
    }

    html.header-search-detached header .header__bar .search {
        display: none !important;
    }

    header .header__bar .site-notify {
        margin-left: auto !important;
    }

    header .header__bar .header-user {
        margin-left: 8px !important;
    }

    .site-notify__dropdown {
        right: -56px;
        width: min(420px, calc(100vw - 16px));
    }

    .site-notify-center {
        padding: 18px;
    }

    .site-notify__dropdown-head,
    .site-notify-center__head,
    .site-notify-item {
        flex-direction: column;
        align-items: stretch;
    }

    .site-notify-item__action,
    .site-notify__read-all,
    .site-notify__dropdown-link {
        width: 100%;
    }

    .push-subscribe-modal__guest-message {
        padding: 14px 15px;
        border-radius: 16px;
    }

    .push-subscribe-modal__guest-text {
        font-size: 14px;
    }

    .push-subscribe-modal__actions--guest {
        flex-direction: column-reverse;
    }

    .push-subscribe-modal__actions--guest > button {
        width: 100%;
        flex-basis: auto;
    }
}
