nav.site-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 2px 6px;
}

nav.site-nav a.site-nav-link,
nav.site-nav a.site-nav-link:last-child {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 clamp(5px, 1.5vw, 12px);
    border-radius: 8px;
    color: #514252;
    font-size: clamp(11px, 2.6vw, 13px);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

nav.site-nav a.site-nav-link:hover,
nav.site-nav a.site-nav-link[aria-current="page"] {
    color: #871b4b;
    background: #f8e8ef;
}

nav.site-nav a.site-nav-link:focus-visible {
    outline: 2px solid #9c1f56;
    outline-offset: 2px;
}

@media (max-width: 350px) {
    nav.site-nav { gap: 2px; }
    nav.site-nav a.site-nav-link { padding-inline: 4px; }
}

/* One header treatment across the home, Academy, tools, growth and analyzer pages. */
body > header {
    position: relative;
    top: auto;
    z-index: 10;
    height: auto;
    min-height: 66px;
    padding: 0;
    border-bottom: 1px solid #eadfe5;
    background: #fffdfbec;
    backdrop-filter: blur(12px);
}

/* Paid Growth uses a compact storefront header; keep it identical to the shared header. */
body.paid-studio > header {
    width: 100% !important;
    min-height: 66px !important;
    padding: 0 !important;
}
body.paid-studio > header > .header-inner {
    width: min(1120px, calc(100% - 32px)) !important;
    min-height: 66px !important;
    margin-inline: auto !important;
    padding: 8px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

body > header > :is(.journal-nav, .header-inner, .services-nav, .download-nav, .nav) {
    width: min(1120px, calc(100% - 32px));
    height: auto;
    min-height: 66px;
    margin-inline: auto;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 10px;
}

body > header :is(.wordmark, .brand, .services-brand) {
    display: inline-flex;
    align-items: baseline;
    flex: 0 0 auto;
    color: #241725;
    font: 800 22px/1 Inter, system-ui, sans-serif;
    letter-spacing: -.06em;
    text-decoration: none;
    white-space: nowrap;
}

body > header :is(.wordmark, .brand, .services-brand) span {
    color: #9c1f56;
    background: none;
    -webkit-text-fill-color: #9c1f56;
}

body > header .wordmark i {
    color: #9c1f56;
    font: inherit;
}

body > header .brand i { display: none; }
body > header .brand::after { content: '.'; color: #9c1f56; }

body > header nav.site-nav {
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

body > header nav.site-nav::-webkit-scrollbar { display: none; }

body > header nav.site-nav a.site-nav-link {
    min-height: 38px;
    padding-inline: 10px;
    color: #514252;
    font: 700 12px/1 Inter, system-ui, sans-serif;
    text-decoration: none;
}

body > header nav.site-nav a.site-nav-link:hover,
body > header nav.site-nav a.site-nav-link[aria-current="page"] {
    color: #871b4b;
    background: #f8e8ef;
    text-decoration: none;
}

@media (max-width: 480px) {
    body > header, body > header > :is(.journal-nav, .header-inner, .services-nav, .download-nav, .nav) { min-height: 62px; }
    body > header :is(.wordmark, .brand, .services-brand) { font-size: 20px; }
    body > header nav.site-nav { gap: 2px; }
    body > header nav.site-nav a.site-nav-link { min-height: 36px; padding-inline: 6px; font-size: 11px; }
}

/* Keep one consistent, reachable toolbar on every page and every phone width. */
@media (max-width: 600px) {
    body > header > :is(.journal-nav, .header-inner, .services-nav, .download-nav, .nav) {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: stretch;
        row-gap: 7px;
        padding: 9px 10px 8px;
    }
    body > header :is(.wordmark, .brand, .services-brand) {
        justify-self: center;
        margin-inline: auto !important;
    }
    body > header nav.site-nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: stretch;
        justify-content: stretch;
        flex-wrap: nowrap;
        overflow: visible;
        padding: 0;
        gap: 2px;
    }
    body > header nav.site-nav a.site-nav-link {
        min-width: 0;
        min-height: 34px;
        justify-content: center;
        padding-inline: 2px;
        font-size: 10px;
        letter-spacing: -.025em;
        white-space: nowrap;
    }
}

@media (max-width: 350px) {
    body > header :is(.wordmark, .brand, .services-brand) { font-size: 18px; }
    body > header nav.site-nav a.site-nav-link { padding-inline: 1px; font-size: 9px; }
}

/* Final shared mobile contract: page-specific styles must not hide or reflow the toolbar. */
body > header {
    background: #fffdfb !important;
    border-bottom: 1px solid #eadfe5 !important;
    box-shadow: 0 1px 0 rgba(63, 31, 52, .03) !important;
    isolation: isolate;
    overflow: visible !important;
}

/* Give the Academy/home hero a clean breathing line below the toolbar. */
body > header.journal-header,
body > header.academy-header { margin-bottom: 8px !important; }

@media (max-width: 600px) {
    body > header {
        height: auto !important;
        min-height: 96px !important;
    }
    body.paid-studio > header > .header-inner {
        width: 100% !important;
        min-height: 96px !important;
        padding: 9px 10px 8px !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 7px !important;
    }
    body > header > :is(.journal-nav, .header-inner, .services-nav, .download-nav, .nav) {
        width: 100% !important;
        min-height: 96px !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        align-content: center !important;
        justify-items: stretch !important;
        gap: 7px !important;
        padding: 9px 10px 8px !important;
    }
    body > header :is(.wordmark, .brand, .services-brand) {
        justify-self: center !important;
        margin: 0 auto !important;
    }
    body > header nav.site-nav,
    body > header .academy-header nav {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        box-sizing: border-box !important;
        gap: 2px !important;
        overflow: visible !important;
        justify-content: stretch !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    body > header nav.site-nav a.site-nav-link,
    body > header nav.site-nav a.site-nav-link:last-child,
    body > header .academy-header nav a {
        display: flex !important;
        min-width: 0 !important;
        width: auto !important;
        max-width: 100% !important;
        flex: none !important;
        min-height: 34px !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 2px !important;
        font-size: clamp(8px, 2.7vw, 10px) !important;
        letter-spacing: -.025em !important;
        white-space: nowrap !important;
        text-align: center !important;
        overflow: hidden !important;
        text-overflow: clip !important;
    }
}

@media (max-width: 350px) {
    body > header nav.site-nav a.site-nav-link,
    body > header nav.site-nav a.site-nav-link:last-child,
    body > header .academy-header nav a { font-size: 8px !important; }
}
