#nheader {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid #e4e7ec;
    box-shadow: 0 4px 20px rgba(16, 24, 40, 0.035);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

#nheader .nheader-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1180px, calc(100% - 40px));
    max-width: none;
    height: 70px;
    margin: 0 auto;
    padding: 0;
}

#nheader .nheader-brand {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
}

#nheader img {
    display: block;
    width: 155px;
    max-width: 100%;
    height: auto;
}

#nheader nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

#nheader nav a {
    margin: 0;
    padding: 9px 12px;
    border-radius: 999px;
    color: #475467;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.4;
    letter-spacing: -0.01em;
    text-decoration: none;
}

#nheader nav a:hover {
    color: #111827;
    background: #f2f4f7;
}

#nheader nav a[aria-current="page"] {
    color: #4d49e5;
    background: #ecebff;
}

/* Keep legacy Speaking pages aligned even when an older topic stylesheet is cached. */
body.speaking-page #nheader {
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom-color: #e4e7ec !important;
}

body.speaking-page #nheader .nheader-wrap {
    height: 70px !important;
}

body.speaking-page #nheader nav a {
    color: #475467 !important;
}

body.speaking-page #nheader nav a:hover {
    color: #111827 !important;
    background: #f2f4f7 !important;
}

body.speaking-page #nheader nav a[aria-current="page"] {
    color: #4d49e5 !important;
    background: #ecebff !important;
}

@media (max-width: 680px) {
    #nheader .nheader-wrap {
        width: min(100% - 28px, 1180px);
    }

    #nheader nav a {
        display: none;
    }

    #nheader nav a:nth-child(2),
    #nheader nav a:nth-child(3) {
        display: inline-flex;
        padding: 8px 9px;
        font-size: 12px;
    }
}

@media (max-width: 380px) {
    #nheader img {
        width: 140px;
    }

    #nheader nav a:nth-child(2) {
        display: none !important;
    }

    #nheader nav a:nth-child(3) {
        display: inline-flex !important;
    }
}
