body {
    .pcs-main-nav-wrapper {
        .pcs-main-nav {
            .pcs-main-nav-inner {
                display: flex;
                flex-direction: row;
                flex-grow: 1;

                &:not(:first-child) {
                    border-left: 2px solid rgba(0, 0, 0, 0.12);

                    .pcs-nav-item {
                        &:first-child {
                            a {
                                margin: auto;
                            }
                        }
                    }
                }

                .pcs-nav-item {
                    display: flex;
                    flex-grow: 1;
                    flex-shrink: 1;

                    &:not(:first-child) {
                        a {
                            margin: auto;
                        }
                    }

                    &:not(:last-child) {
                        border-right: 2px solid rgba(0, 0, 0, 0.12);
                    }
                }
            }
        }
    }

    /* CLIENTS-33540: main nav items. Marketing: 16px / 400 #2d2d2d, a short divider between items, burgundy on hover and active. */
    .nav-item.pcs-nav-border {
        position: relative;
        flex: 1 1 auto; /* as wide as its content plus an equal share, like marketing */

        &:not(:last-of-type)::after {
            content: "";
            position: absolute;
            right: 0;
            top: 50%;
            height: 28px;
            transform: translateY(-50%);
            border-right: 1px solid #989898;
        }

        /* Tripled class: Swift's color-scheme link rule is 0,5,1 and would win on color */
        > .nav-link.nav-link.nav-link {
            justify-content: center;
            width: 100%;
            padding: 14px 0 !important; /* beats py-3 px-5; 50px bar like marketing */
            line-height: 22px;
            font-size: 16px;
            font-weight: 400;
            color: #2d2d2d;

            &:hover,
            &:focus-visible,
            &.active,
            &:active {
                color: #741012;
                text-decoration: none !important; /* beats text-decoration-underline-hover */
            }

            /* Fake bold, no layout shift (marketing) */
            &:hover,
            &:focus-visible,
            &:active,
            &[aria-expanded="true"] {
                text-shadow: 0 0 .96px rgba(116, 16, 18, .96), 0 0 .96px rgba(116, 16, 18, .96);
            }

            &:focus-visible {
                outline: 2px solid #741012;
                outline-offset: -2px;
            }

            &[aria-expanded="true"] {
                color: #741012;
            }
        }

        /* CLIENTS-33540: dropdown panels and level-3 flyouts. Marketing: burgundy, white 16px / 600 centered items,
           panel centered under its nav item, flyout at the right edge of the hovered item. Opened by Custom/custom.js. */
        .dropdown-menu {
            top: calc(100% - 14px); /* overlaps the gray bar by 14px, like marketing */
            left: 0;
            transform: none;
            margin: 0;
            min-width: 190px;
            max-width: none;
            width: 100%; /* as wide as its nav item */
            box-shadow: 0 8px 16px rgba(0, 0, 0, .2);
            padding: 10px 15px;
            border: 0;
            border-radius: 0;
            background-color: #741012;

            &.pcs-flyout {
                top: 0;
                left: 100%;
                transform: none;
            }
        }

        .pcs-has-flyout {
            position: relative;
        }

        /* Tripled class: beats Swift's 0,5,1 color-scheme link rule, as above */
        .dropdown-item.dropdown-item.dropdown-item {
            padding-inline: 0;
            white-space: normal;
            text-align: center;
            font-size: 16px;
            font-weight: 600;
            line-height: 20px;
            color: #fff;
            background-color: transparent;

            &:hover,
            &:focus-visible,
            &[aria-expanded="true"] {
                text-decoration: underline;
            }

            &:focus-visible {
                outline: 2px solid #fff;
                outline-offset: 2px;
            }
        }
    }

    /* Nav items sit centered in a 1110px box (marketing) */
    ul:has(> .nav-item.pcs-nav-border) {
        width: min(1110px, calc(100vw - 60px)) !important; /* beats w-100; the parent is content-sized, so a percent max-width cannot cap it */
        max-width: 100%;
        margin-inline: auto;
        gap: 0 !important; /* beats gap-2 */
    }

    .pcs-header-nav {
        display: flex;
        padding: 0 0 0 8px;
        align-items: center;
        gap: 4px;

        .nav-item.pcs-nav-item {
            .icon-3 {
                border: 1px solid #e5e4e2;
                border-radius: 50%;
                background: #fff;
                padding: 7px; /* 1 + 7 + 16 + 7 + 1 = 32px */

                svg {
                    width: 16px;
                    height: 16px;
                }
            }

            .pcs-stacked-nav {
                display: flex;
                flex-direction: column;
                align-items: flex-start;

                span {
                    &:first-child {
                        font-weight: 900;
                        text-transform: uppercase;
                    }
                }
            }
        }
    }
}

/* CLIENTS-33761: mobile menu panel matches the marketing site.
   Marketing (390 wide): full-width #f1f1f1 panel, logo centered with the X at the right, 360px search pill,
   20px rows on a 60px pitch with #e5e4e2 dividers, a gray band with the burgundy button, contact lines, 40px social circles.
   The logo, search, button, contact and social blocks are paragraphs on the MobileMenuTop / MobileMenuBottom pages (OffCanvas.cshtml). */
/* Doubled class: the panel sits inside the mobile header's logo row, and header.css (loaded later) styles that row's columns */
.pcs-mobile-menu.pcs-mobile-menu {
    --bs-offcanvas-width: 100%;
    --swift-offcanvas-width: 100%; /* sub-levels use this width */
    --bs-offcanvas-bg: #f1f1f1;
    background-color: #f1f1f1;
    color: #2d2d2d;

    /* Top row: logo centered, X at the top right, search under it */
    .offcanvas-header {
        display: block;
        padding: 30px 0 !important; /* beats py-1 */

        > [data-bs-dismiss="offcanvas"] {
            position: absolute;
            top: 24px;
            right: 13px;
            z-index: 2;
        }
    }

    /* header.css makes the logo and button columns content-sized; in the panel every block fills the row */
    :is(.pcs-mobile-menu-top, .pcs-mobile-menu-bottom section:has([data-dw-itemtype="swift-v2_button"])) [data-swift-gridcolumn][data-dw-itemtype] {
        flex: 1 1 auto !important;
    }

    .pcs-mobile-menu-top {
        [data-dw-itemtype="swift-v2_logo"] > div {
            justify-content: center;
        }

        img {
            max-width: 100%;
            height: auto;
        }

        section + section {
            margin-top: 37px;
        }

        /* header.css styles the search pill for the bar; in the panel it fills the row */
        [data-dw-itemtype="swift-v2_searchfield"] {
            flex: 1 1 auto !important;

            .search-modal,
            .js-async-fetch-placeholder,
            .type-ahead-dropdown,
            .suggest-form {
                margin: 0 !important; /* the pill starts at the row edge, 360px wide */
            }

            .js-type-ahead-field {
                height: 41px;
                border-radius: 24px;
                font-size: 16px;
            }
        }
    }

    /* Rows: 20px / 28px on a 60px pitch, a divider inset 32px each side, parents bold, plain chevrons */
    .pcs-mobile-nav {
        .nav-link {
            font-size: 20px;
            line-height: 28px;
            color: #2d2d2d;
        }

        /* The chevron: a plain 6x10 glyph in a 42px tap target; the negative margin keeps the glyph at the row inset */
        .pcs-mobile-nav-item > label.nav-link {
            padding: 16px 12px 16px 24px;
            margin-right: -12px;

            > .btn {
                padding: 0 !important; /* beats p-1 */
                border: 0;
                background: none;
                color: #2d2d2d;

                svg {
                    width: 6px;
                    height: 10px;
                }
            }
        }

        /* Keyboard focus lands on the hidden checkbox; ring the chevron and the back arrow it drives (burgundy, as header.css) */
        .pcs-mobile-nav-item:has(> .sub-nav-check:focus-visible) > label.nav-link,
        .sub-nav-check:focus-visible ~ .sub-nav > div > .nav-header > label.nav-link {
            outline: 2px solid #741012;
            outline-offset: 2px;
        }

        &[data-swift-nav="main-nav"] {
            position: relative;
            z-index: 2; /* an open sub-level covers the blocks under the nav */

            > .pcs-mobile-nav-item {
                width: calc(100% - 64px) !important; /* beats w-100 */
                margin-inline: 32px;
                padding: 0 !important; /* beats py-1 */
                border-bottom: 1px solid #e5e4e2;

                > a.nav-link {
                    padding: 16px 0 15px;
                }

                &:has(> .sub-nav-check) > .nav-link {
                    /* Marketing's parent rows are buttons with no font-family, so they show the platform font. */
                    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
                    font-weight: 800;
                }
            }
        }

        /* Sub-level: a plain back arrow, no title bar, 20px / 400 items, no dividers */
        .sub-nav {
            left: 0; /* its row has a 32px inset; the sub-level covers the whole panel */

            .nav-header {
                padding: 43px 0 !important; /* beats py-1 */
                border-bottom: 0 !important; /* beats border-bottom */

                > label.nav-link {
                    padding: 11px 20px; /* 44px tall */

                    > .btn {
                        width: 22px;
                        height: 22px;
                        padding: 0 !important; /* beats p-1 */
                        border: 0;
                        background-color: #2d2d2d;
                        mask: url("/Files/Images/Icons/arrow-left.svg") center / contain no-repeat;

                        @media (forced-colors: active) {
                            background-color: CanvasText;
                            forced-color-adjust: none;
                        }

                        svg {
                            visibility: hidden;
                        }
                    }

                    /* The name stays for screen readers; the label already says "Go back to ..." */
                    > .fs-7 {
                        position: absolute;
                        width: 1px;
                        height: 1px;
                        overflow: hidden;
                        clip-path: inset(50%);
                        white-space: nowrap;
                    }
                }
            }

            .pcs-mobile-nav-item {
                padding: 0 17px !important; /* beats py-1 */

                > a.nav-link {
                    padding: 16px 0;
                    font-weight: 400;
                }
            }
        }
    }

    .pcs-mobile-menu-bottom {
        /* The button row: a gray band with the full-width burgundy button */
        section:has([data-dw-itemtype="swift-v2_button"]) {
            margin-top: 30px;
            padding: 24px 0;
            background-color: #e5e4e2;

            .btn {
                display: flex;
                width: 100%;
                height: 48px;
                justify-content: center;
                align-items: center;
                border-radius: 32px;
                font-size: 13px;
                font-weight: 700;
            }
        }

        /* Contact lines: label and value on one line, no icon circles */
        section:has([data-dw-itemtype="swift-v2_navigation"]) {
            padding: 24px 17px 0;

            .nav-wrapper {
                margin: 0;
            }

            nav {
                justify-content: flex-start !important; /* beats header.css space-evenly */
                text-align: start !important; /* beats text-end */
            }

            .pcs-header-nav {
                flex-direction: column;
                align-items: flex-start;
                gap: 0 !important; /* beats gap-2 */
                padding: 0;
                z-index: auto; /* Swift gives every .nav z-index 500, which would show it through an open sub-level */

                .nav-link {
                    padding: 8px 0 !important; /* beats p-2 */
                    color: #2d2d2d;
                }

                .icon-3 {
                    display: none;
                }

                .pcs-stacked-nav {
                    display: flex !important; /* beats d-none */
                    flex-direction: row;
                    align-items: baseline;
                    gap: 10px;
                    font-size: 16px;
                    line-height: 22px;

                    span:first-child {
                        font-weight: 700;
                    }
                }
            }
        }

        /* Socials: 40px burgundy circles, white glyph, 24px apart */
        section:has([data-dw-itemtype="swift-v2_logo"]) {
            padding: 24px 17px 40px;

            [data-swift-container] {
                column-gap: 24px !important;
            }

            [data-dw-itemtype="swift-v2_logo"] > div {
                width: 40px;
                height: 40px;
                justify-content: center;
                align-items: center;
                border-radius: 50%;
                background-color: #741012;
                color: #fff;
            }

            /* Glyph sizes as in the header top bar (header.css), measured on marketing */
            figure {
                width: auto !important; /* beats the inline width */
            }

            [data-dw-itemtype="swift-v2_logo"] {
                &:nth-child(1) svg { width: 10px; height: 18px; }
                &:nth-child(2) svg { width: 23px; height: 23px; margin: -3.85px; }
                &:nth-child(3) svg { width: 22.6px; height: 22.6px; margin: -4.7px -1.9px; }
                &:nth-child(4) svg { width: 26.7px; height: 26.7px; margin: -3.35px; }
                &:nth-child(5) svg { width: 20px; height: 20px; margin: -4px -3.5px; }
            }
        }
    }
}
