/* Shared account header, independent of page palettes and theme headers. */
.na-app-header {
    position: sticky;
    top: 0;
    z-index: 110;
    flex: none;
    width: 100%;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #eeeaf3;
    background: #fff;
    color: #2a0c62;
    font-family: var(--na-font-family, Inter, sans-serif);
    line-height: 1.4;
}
.na-app-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    max-width: 1180px;
    min-height: 60px;
    margin: 0 auto;
    padding: 8px 18px;
    box-sizing: border-box;
}
.na-app-header-brand,
.na-app-header-profile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    border-radius: 50%;
}
.na-app-header-brand { border-radius: 8px; }
.na-app-header .na-app-header-logo {
    display: block;
    width: 43px;
    height: 43px;
    max-width: none;
    object-fit: contain;
}
.na-app-header .na-app-header-logo-dark,
html[data-na-theme="dark"] .na-app-header .na-app-header-logo-light { display: none; }
html[data-na-theme="dark"] .na-app-header .na-app-header-logo-dark { display: block; }
.na-app-header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.na-app-header a { text-decoration: none !important; }
.na-app-header .na-app-header-icon,
.na-app-header .na-notification-bell {
    position: relative;
    display: grid !important;
    place-items: center !important;
    box-sizing: border-box;
    flex: 0 0 30px;
    width: 30px !important;
    height: 30px !important;
    min-height: 30px;
    margin: 0;
    padding: 0 !important;
    border: 1px solid #cec2de !important;
    border-radius: 50% !important;
    background: #fff !important;
    color: #2a0c62 !important;
    box-shadow: 0 6px 16px #2a0c6214;
    transition: background-color .15s ease, border-color .15s ease;
}
.na-app-header .na-app-header-icon:hover,
.na-app-header .na-notification-bell:hover { background: #f2edff !important; }
.na-app-header-actions svg { display: block; width: 16px; height: 16px; }
.na-app-header-avatar {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 30px;
    height: 30px;
    overflow: hidden;
    border: 1px solid #e7b900;
    border-radius: 50%;
    background: #ffcc00;
    color: #2a0c62;
    font-size: 13px;
    box-shadow: 0 6px 16px #ffcc003d;
}
.na-app-header-avatar-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.na-app-header .ni-badge,
.na-app-header .na-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border: 2px solid #fff !important;
    border-radius: 999px;
    background: #2a0c62;
    color: #fff;
    font: 700 10px/1 var(--na-font-family, Inter, sans-serif);
}
.na-app-header .na-notification-badge { background: #ef5368; }
.na-app-header [hidden], .na-app-header .is-hidden { display: none !important; }
.na-app-header a:focus-visible { outline: 3px solid #9d75d5; outline-offset: 4px; }
.na-app-header [data-tooltip] { position: relative; }
.na-app-header [data-tooltip]::after {
    position: absolute;
    z-index: 120;
    top: calc(100% + 9px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 9px;
    border-radius: 7px;
    background: #29241d;
    color: #fff;
    content: attr(data-tooltip);
    font-size: 11px;
    line-height: 1.4;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
}
.na-app-header [data-tooltip]:last-child::after { left: auto; right: 0; transform: none; }
.na-app-header [data-tooltip]:hover::after,
.na-app-header [data-tooltip]:focus-visible::after { opacity: 1; }

/* Keep the dashboard's dark account header consistent across every app page. */
html[data-na-theme="dark"] .na-app-header {
    background: #1e1a26;
    border-color: #393044;
    color: #f5f1fa;
}
html[data-na-theme="dark"] .na-app-header :is(.na-app-header-icon, .na-notification-bell) {
    background: #1e1a26 !important;
    border-color: #393044 !important;
    color: #f5f1fa !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
html[data-na-theme="dark"] .na-app-header :is(.na-app-header-icon, .na-notification-bell):hover {
    background: #282132 !important;
    border-color: #c7a3ed !important;
}
html[data-na-theme="dark"] .na-app-header :is(.ni-badge, .na-notification-badge) {
    border-color: #1e1a26 !important;
}
html[data-na-theme="dark"] .na-app-header a:focus-visible {
    outline-color: #c7a3ed;
}

/* Page titles and contextual actions sit below the account header. */
.na-page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    flex: none;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 20px 16px 12px;
    box-sizing: border-box;
    border-bottom: 1px solid #e7def5;
    background: #f3eefb;
    color: #29114f;
}
.na-page-toolbar .na-page-heading { flex: 1; min-width: 0; gap: 16px; }
.na-page-toolbar .na-page-title-wrapper { display: block; flex: 1; min-width: 0; }
.na-page-toolbar h1,
.na-page-toolbar .na-page-title,
.na-page-toolbar .na-page-title-text,
.na-page-toolbar .naps-nav-name {
    flex: 1;
    min-width: 0;
    margin: 0;
    font: 800 22px/1.3 var(--na-font-family, Inter, sans-serif);
    letter-spacing: -.02em;
    text-transform: none;
    overflow-wrap: anywhere;
    color: inherit;
}
.na-page-toolbar .na-page-subtitle { margin: 0; color: #695481; font-size: 12px; font-weight: 600; line-height: 1.5; }
.na-page-toolbar .na-profile-header-actions { flex: none; flex-wrap: wrap; }
body .na-page-toolbar .na-app-back-button,
body .na-page-toolbar .naps-nav-back,
html[data-na-theme="dark"] .na-page-toolbar .na-app-back-button,
html[data-na-theme="dark"] .na-page-toolbar .naps-nav-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    min-width: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: #ffcc00;
    color: #29114f;
    box-shadow: none;
    text-decoration: none;
    cursor: pointer;
}
body .na-page-toolbar .na-app-back-button::before { inset: 0; }
body .na-page-toolbar .na-app-back-button svg,
body .na-page-toolbar .naps-nav-back svg { width: 24px; height: 24px; stroke-width: 2.5; }
body .na-page-toolbar .na-app-back-button:hover,
body .na-page-toolbar .naps-nav-back:hover { background: #f3c200; color: #29114f; box-shadow: none; }
.na-page-toolbar :is(a, button):focus-visible { outline: 3px solid #a56de2; outline-offset: 3px; }
.na-page-toolbar-meta {
    display: flex;
    flex: 0 0 100%;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 12px;
    min-width: 0;
    min-height: 26px;
}
.na-toolbar-unread { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; font-weight: 700; }
.na-toolbar-unread-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: #fb3e78; }
.na-toolbar-unread.is-read .na-toolbar-unread-dot { background: #b7abc8; }
body .na-page-toolbar .na-notifications-mark-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    max-width: 100%;
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    box-shadow: none;
    font: 700 12px/1.5 var(--na-font-family, Inter, sans-serif);
    letter-spacing: normal;
    text-transform: none;
}
body .na-page-toolbar .na-notifications-mark-all svg { flex: none; width: 18px; height: 18px; color: #9329ff; }
body .na-page-toolbar .na-notifications-mark-all:hover:not(:disabled) { color: #8025d9; }
html[data-na-theme="dark"] .na-page-toolbar { background: var(--na-dark-surface); border-color: var(--na-dark-border); color: var(--na-dark-text); }
html[data-na-theme="dark"] .na-page-toolbar .na-page-subtitle { color: var(--na-dark-muted); }

/* Root-level header support for centered sign-in and onboarding layouts. */
body.na-auth-page, body.na-community-home-page { flex-direction: column; justify-content: flex-start; padding: 0; }
.na-auth-page > .na-auth-container { margin: auto; padding: 28px 20px; box-sizing: border-box; }
.na-auth-page > .na-app-header ~ .na-auth-shell { min-height: calc(100dvh - 73px); }
.na-community-home-container { margin: auto; padding: 32px 20px; box-sizing: border-box; }
.na-language-switcher { position: relative; top: auto; right: auto; align-self: center; width: max-content; margin: 16px auto; }
body.na-dashboard-page .na-dashboard-shell { min-height: calc(100svh - 73px) !important; }

@media (min-width: 769px) {
    .na-page-toolbar { padding-inline: max(32px, calc((100% - 1116px) / 2)); }
    .na-app-header-inner { width: min(calc(100% - 64px), 1180px); padding: 12px 32px; }
    .na-app-header .na-app-header-icon,
    .na-app-header .na-notification-bell { flex-basis: 36px; width: 36px !important; height: 36px !important; }
    .na-app-header-avatar { width: 36px; height: 36px; }
    .na-auth-page > .na-app-header ~ .na-auth-shell { min-height: calc(100dvh - 81px); }
    body.na-dashboard-page .na-dashboard-shell { min-height: calc(100svh - 81px) !important; }
}
