    /* Desktop: fixed navbar height from CSS variable */
    @media (min-width: 992px) {
        .navbar.app-navbar {
            height: var(--navbar-height);
            min-height: var(--navbar-height);
            max-height: var(--navbar-height);
        }
        .navbar.app-navbar .container {
            height: 100%;
        }
        .navbar.app-navbar .navbar-brand {
            height: 100%;
        }
        /* Centered nav: let two rows determine natural height instead of fixed constraint */
        body.nav-style-centered .navbar.app-navbar {
            height: auto;
            min-height: auto;
            max-height: none;
        }
        body.nav-style-centered .navbar.app-navbar .navbar-brand {
            height: auto;
        }
    }
    /* Mobile: compact navbar, natural height */
    @media (max-width: 991.98px) {
        .navbar.app-navbar {
            padding: 6px 0 !important;
        }
        .navbar.app-navbar .brand-avatar {
            width: auto !important;
            height: 32px !important;
            max-height: 32px !important;
            max-width: 180px !important;
            object-fit: contain !important;
            aspect-ratio: auto !important;
        }
        .navbar.app-navbar .navbar-brand {
            position: relative !important;
            left: auto !important;
            transform: none !important;
            max-width: calc(100% - 60px) !important;
            min-width: 0 !important;
        }
    }
    .navbar.app-navbar .container {
        display: flex;
        align-items: center;
    }
    .navbar.app-navbar .navbar-brand {
        display: flex;
        align-items: center;
        padding: 0;
        margin: 0;
        color: var(--app-navbar-text) !important;
    }
    .navbar.app-navbar .brand-avatar {
        margin-top: 0;
        margin-bottom: 0;
    }

    /* Standard nav: respect the user's logo size slider directly; width is free so
       landscape wordmark logos can extend horizontally. */
    @media (min-width: 992px) {
        body:not(.nav-style-centered):not(.layout-admin-sidebar) .navbar.app-navbar .brand-avatar {
            width: auto !important;
            height: clamp(32px, var(--navbar-logo-size), 140px) !important;
            max-height: 140px !important;
            max-width: 480px !important;
            aspect-ratio: auto !important;
            object-fit: contain !important;
        }
    }

    /* Dark style: light text on dark background. The phone menu sits beside the
       navbar and paints the same background (--app-navbar-background), so it
       takes the same light text; without it the menu was dark on dark. */
    body.nav-style-dark .navbar.app-navbar,
    body.nav-style-dark .mobile-drawer {
        --app-navbar-text: rgba(255, 255, 255, 0.92);
        --app-navbar-hover: #ffffff;
    }
    body.nav-style-dark .navbar.app-navbar .nav-link {
        color: rgba(255, 255, 255, 0.85) !important;
    }
    body.nav-style-dark .navbar.app-navbar .nav-link:hover,
    body.nav-style-dark .navbar.app-navbar .nav-link:focus {
        color: #ffffff !important;
        background: rgba(255, 255, 255, 0.1);
    }
    body.nav-style-dark .navbar.app-navbar .navbar-brand {
        color: #ffffff !important;
    }

    /* Branded style: white text on gradient (the phone menu too, as above) */
    body.nav-style-branded .navbar.app-navbar,
    body.nav-style-branded .mobile-drawer {
        --app-navbar-text: #ffffff;
        --app-navbar-hover: #ffffff;
    }
    body.nav-style-branded .navbar.app-navbar .nav-link {
        color: rgba(255, 255, 255, 0.9) !important;
    }
    body.nav-style-branded .navbar.app-navbar .nav-link:hover,
    body.nav-style-branded .navbar.app-navbar .nav-link:focus {
        color: #ffffff !important;
        background: rgba(255, 255, 255, 0.15);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    }
    body.nav-style-branded .navbar.app-navbar .navbar-brand {
        color: #ffffff !important;
    }

    /* Stadium style: floating inset pill on desktop (the look the picker
       promises). Implemented with margins + width so it works for both the
       fixed navbar (normal pages) and the sticky in-flow navbar (ticker
       pages). The navbar-measure script adds the float offset of fixed
       navbars to --navbar-real-height, so content clears the pill. Mobile
       keeps a flat full-width bar (see the mobile override below). */
    body.nav-style-stadium .navbar.app-navbar {
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12), 0 1px 0 rgba(15, 23, 42, 0.06);
        border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    }
    @media (min-width: 992px) {
        body.public-page.has-ticker.nav-style-stadium {
            background-color: var(--slms-background) !important;
        }
        body.nav-style-stadium .navbar.app-navbar {
            margin: 14px 18px 0 !important;
            width: calc(100% - 36px) !important;
            border-radius: 18px !important;
            border: 1px solid rgba(15, 23, 42, 0.08);
            box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16), 0 2px 10px rgba(0, 0, 0, 0.07);
        }
        /* Ticker hub pages keep ticker, nav, and hero in normal flow. */
        html.hub-page body.has-ticker.nav-style-stadium #main-content {
            margin-top: 0 !important;
        }
    }
    body.nav-style-stadium .navbar.app-navbar .nav-link:hover,
    body.nav-style-stadium .navbar.app-navbar .nav-link:focus {
        background: rgba(0, 0, 0, 0.04);
        transform: translateY(-1px);
    }

    /* ---------- Centered nav style ----------
       One band in the header's own colour (--app-navbar-background, worked out
       with its text colours in theme_colors._nav_colors): a slim utility strip
       over the links row, and the crest between the two link groups, hanging
       below the bar like a club badge. The sizes are set on :root in base.html
       (--centered-utility-height, --centered-links-height, --centered-logo-top,
       --centered-logo-height). Once the page scrolls, base.html adds
       .centered-compact and the header folds to one row with the crest inside
       it, so the crest never sits over what's being read. */
    body.nav-style-centered .navbar.app-navbar {
        flex-direction: column;
        padding: 0;
        border-radius: 0;
        background: var(--app-navbar-background, var(--slms-surface, #ffffff));
        border-bottom: 1px solid color-mix(in srgb, var(--app-navbar-text, #1f2937) 10%, transparent);
        box-shadow: 0 12px 28px -20px rgba(0, 0, 0, 0.5);
        /* The same timing as the rows' heights, so a sticky header's spacer
           (below) grows exactly as much as the header shrinks. */
        transition: margin-bottom 0.28s ease, box-shadow 0.28s ease, background-color 0.3s ease;
    }

    /* Row 1: utility strip (search and social on the left, account on the right). */
    .centered-utility-bar {
        display: flex;
        align-items: center;
        width: min(1460px, calc(100vw - 40px));
        margin: 0 auto;
        padding: 0 clamp(1rem, 1.8vw, 1.45rem);
        position: relative;
        height: var(--centered-utility-height, 40px);
        overflow: visible;
        z-index: 3;
        transition: height 0.28s ease, opacity 0.2s ease 0.08s, visibility 0s;
    }
    .centered-utility-bar .centered-utility-left {
        flex: 1 1 0;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        min-width: 0;
        position: relative;
        z-index: 2;
    }
    .centered-utility-bar .centered-utility-right {
        flex: 1 1 0;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        min-width: 0;
        position: relative;
        z-index: 2;
        gap: 0.3rem;
    }
    .centered-utility-bar .centered-utility-icon-link {
        width: 32px;
        height: 32px;
        padding: 0 !important;
        border-radius: 999px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: transparent;
        border: 0;
        color: var(--app-navbar-text) !important;
        opacity: 0.75;
        box-shadow: none;
    }
    .centered-utility-bar .centered-utility-icon-link i {
        font-size: 1rem !important;
    }
    .centered-utility-bar .centered-utility-icon-link::before,
    .centered-utility-bar .centered-utility-icon-link::after {
        display: none !important;
    }
    .centered-utility-bar .centered-utility-icon-link:hover,
    .centered-utility-bar .centered-utility-icon-link:focus-visible {
        opacity: 1;
        background: color-mix(in srgb, var(--app-navbar-text, #1f2937) 12%, transparent) !important;
    }
    .centered-utility-bar .centered-utility-notification-link .notification-bell-badge {
        top: 0;
        right: -2px;
    }
    .centered-utility-bar .centered-user-trigger {
        min-height: 30px;
        padding: 0.12rem 0.55rem 0.12rem 0.14rem !important;
        border-radius: 999px !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 0.35rem !important;
        background: transparent;
        border: 1px solid color-mix(in srgb, var(--app-navbar-text, #1f2937) 20%, transparent);
        color: var(--app-navbar-text) !important;
        box-shadow: none;
    }
    .centered-utility-bar .centered-user-trigger:hover,
    .centered-utility-bar .centered-user-trigger:focus-visible {
        background: color-mix(in srgb, var(--app-navbar-text, #1f2937) 10%, transparent) !important;
    }
    .centered-utility-bar .centered-user-trigger::before,
    .centered-utility-bar .centered-user-trigger::after {
        display: none !important;
    }
    .centered-utility-bar .centered-user-avatar {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        border-radius: 999px !important;
        border: 0 !important;
        object-fit: cover;
    }
    .centered-utility-bar .centered-user-avatar--fallback {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0.72rem !important;
        font-weight: 700 !important;
    }
    .centered-utility-bar .centered-user-trigger span {
        max-width: clamp(76px, 7vw, 112px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.78rem;
        font-weight: 600;
    }
    /* Sign In for visitors: a quiet pill in the link colour, not a primary button. */
    .centered-utility-bar .site-signin-btn {
        min-height: 30px;
        padding: 0.2rem 0.85rem !important;
        border-radius: 999px !important;
        font-size: 0.78rem !important;
        font-weight: 600;
        background: transparent !important;
        border: 1px solid var(--centered-header-link, var(--app-navbar-text)) !important;
        color: var(--centered-header-link, var(--app-navbar-text)) !important;
        box-shadow: none !important;
    }
    .centered-utility-bar .site-signin-btn:hover,
    .centered-utility-bar .site-signin-btn:focus-visible {
        background: var(--centered-header-link, var(--app-navbar-text)) !important;
        color: var(--app-navbar-background, #ffffff) !important;
    }

    /* Row 2: the links, split around the crest. */
    .centered-nav-bar {
        --centered-bar-gutter: clamp(1rem, 2vw, 1.5rem);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin: 0;
        padding: 0 var(--centered-bar-gutter);
        min-height: var(--centered-links-height, 60px);
        position: relative;
        background: transparent;
        transition: min-height 0.28s ease;
    }
    .centered-nav-bar::before {
        display: none;
    }
    /* Links never break inside a label; if a menu is still too long for its side,
       a whole link moves to a second line rather than running under the crest. */
    .centered-nav-left,
    .centered-nav-right {
        display: flex;
        flex-wrap: wrap;
        align-content: center;
        align-self: stretch;
        align-items: center;
        min-width: 0;
        list-style: none;
        margin: 0;
        padding: 0;
        gap: 0.12rem;
        position: relative;
        z-index: 1;
    }
    /* The line between the rows is drawn by each link group, so it reaches the
       screen edges and stops short of the crest instead of running behind it. */
    .centered-nav-left::before,
    .centered-nav-right::before {
        content: "";
        position: absolute;
        top: 0;
        height: 1px;
        background: color-mix(in srgb, var(--app-navbar-text, #1f2937) 12%, transparent);
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    .centered-nav-left::before {
        left: calc(-1 * var(--centered-bar-gutter));
        right: 0;
    }
    .centered-nav-right::before {
        left: 0;
        right: calc(-1 * var(--centered-bar-gutter));
    }
    .centered-nav-left {
        justify-content: flex-end;
        flex: 1;
    }
    .centered-nav-right {
        justify-content: flex-start;
        flex: 1;
    }
    /* The crest, between the two link groups: its own width is the gap. Its top
       sits --centered-logo-top below the header's top edge and it hangs below the
       bar; the margins keep its outer box at the links row's height, so neither
       row grows. Overrides the logo alignment rules (margin-right: auto, or
       absolute centering) that base.html applies to every .navbar-brand. */
    body.nav-style-centered .navbar.app-navbar .centered-nav-bar .centered-nav-brand {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        z-index: 4 !important;
        flex: 0 0 auto;
        align-self: flex-start !important;
        display: flex !important;
        flex-direction: column;
        align-items: center !important;
        justify-content: center;
        gap: 0.2rem !important;
        height: var(--centered-logo-height, 136px) !important;
        margin:
            calc(var(--centered-logo-top, 8px) - var(--centered-utility-height, 40px))
            0
            calc(var(--centered-links-height, 60px) + var(--centered-utility-height, 40px) - var(--centered-logo-top, 8px) - var(--centered-logo-height, 136px))
            !important;
        padding: 0 clamp(0.9rem, 1.4vw, 1.5rem) !important;
        text-align: center;
        transition: height 0.28s ease, margin 0.28s ease;
    }
    body.nav-style-centered .navbar.app-navbar .centered-nav-bar .centered-nav-brand .brand-avatar {
        flex: 0 1 auto;
        min-height: 0;
        width: auto !important;
        height: var(--centered-logo-height, 136px) !important;
        max-height: 100% !important;
        /* A wide wordmark is held to this width (centred in the crest's height),
           so it leaves the links their room. */
        max-width: 240px !important;
        object-fit: contain !important;
        aspect-ratio: auto !important;
        filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.32));
        transition: height 0.28s ease, filter 0.28s ease;
    }
    body.nav-style-centered .navbar.app-navbar .centered-nav-bar .centered-nav-brand .brand-name-fallback {
        max-width: 15rem;
        white-space: normal;
        line-height: 1.05;
    }
    body.nav-style-centered .navbar.app-navbar .centered-nav-bar .centered-nav-brand .fw-semibold {
        flex: 0 0 auto;
        max-width: 15rem;
        font-size: 0.62rem;
        line-height: 1.1;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--slms-muted, #6b7280);
    }
    /* Menus that open from the header (account, notifications) in its colours. */
    body.nav-style-centered .navbar.app-navbar .dropdown-item,
    body.nav-style-centered .navbar.app-navbar .dropdown-header,
    body.nav-style-centered .navbar.app-navbar .dropdown-header .text-muted {
        color: var(--app-navbar-text) !important;
    }
    body.nav-style-centered .navbar.app-navbar .dropdown-header .text-muted {
        opacity: 0.7;
    }
    body.nav-style-centered .navbar.app-navbar .dropdown-item:hover,
    body.nav-style-centered .navbar.app-navbar .dropdown-item:focus {
        background: color-mix(in srgb, var(--app-navbar-text, #1f2937) 10%, transparent) !important;
    }
    body.nav-style-centered .navbar.app-navbar .dropdown-divider {
        border-color: color-mix(in srgb, var(--app-navbar-text, #1f2937) 14%, transparent);
    }

    @media (min-width: 992px) {
        /* Scrolled: one row, the crest inside it. */
        body.nav-style-centered .navbar.app-navbar.centered-compact {
            --centered-utility-height: 0px;
            --centered-links-height: var(--centered-compact-height, 58px);
            --centered-logo-top: 4px;
            --centered-logo-height: 50px;
        }
        body.nav-style-centered .navbar.app-navbar.centered-compact .centered-utility-bar {
            opacity: 0;
            visibility: hidden;
            overflow: hidden;
            transition: height 0.28s ease, opacity 0.12s ease, visibility 0s linear 0.28s;
        }
        body.nav-style-centered .navbar.app-navbar.centered-compact .centered-nav-left::before,
        body.nav-style-centered .navbar.app-navbar.centered-compact .centered-nav-right::before {
            opacity: 0;
        }
        body.nav-style-centered .navbar.app-navbar.centered-compact .centered-nav-brand .brand-avatar {
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
        }
        /* With the live ticker the header sits in the page (sticky) rather than
           fixed over it, so folding would pull the page up: the height it folds
           away comes back as space below it, in step with the fold. */
        body.has-ticker.nav-style-centered .navbar.app-navbar {
            margin-bottom: calc(var(--centered-full-height, 100px) - var(--centered-utility-height, 40px) - var(--centered-links-height, 60px)) !important;
        }
    }
    @media (max-width: 991.98px) {
        /* Phones: the crest a size up from the 32px every other style uses. */
        body.nav-style-centered .navbar.app-navbar .d-lg-none .brand-avatar:not([data-aspect="landscape"]) {
            height: 44px !important;
            max-height: 44px !important;
            max-width: 200px !important;
        }
    }
    @media (prefers-reduced-motion: reduce) {
        body.nav-style-centered .navbar.app-navbar,
        .centered-utility-bar,
        .centered-nav-bar,
        body.nav-style-centered .navbar.app-navbar .centered-nav-bar .centered-nav-brand,
        body.nav-style-centered .navbar.app-navbar .centered-nav-bar .centered-nav-brand .brand-avatar {
            transition: none !important;
        }
    }
    /* Nav link styling — high specificity to override base nav-link rules */
