.nav,
.public-nav {
    display: flex;
    width: 100%;
    max-width: 1480px;
    height: 74px;
    align-items: center;
    margin: 0 auto;
    padding: 0 34px;
    border-bottom: 0;
    background: transparent;
}

.logo,
.public-logo {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    color: #081936;
    font-size: 21px;
    font-weight: 800;
}

.nav .mark,
.nav .logo-icon,
.public-nav .brand-mark {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    border-radius: 10px;
    background: linear-gradient(145deg, #3983ff, #1f63ef);
    color: #fff;
    font-size: 16px;
    box-shadow: 0 8px 18px rgba(23, 104, 237, .16);
}

.links,
.public-links {
    display: flex;
    align-self: stretch;
    align-items: center;
    gap: 54px;
    margin: 0 auto;
    font-size: 15px;
}

.links a,
.public-links a {
    position: relative;
    display: inline-flex;
    height: 100%;
    align-items: center;
    padding: 0;
    color: #23324d;
    font-weight: 400 !important;
}

.links a.active,
.links a:hover,
.public-links a.active,
.public-links a:hover {
    color: #1768ed;
}

.links a.active::after,
.public-links a.active::after {
    position: absolute;
    right: 0;
    bottom: 10px;
    left: 0;
    height: 2px;
    border-radius: 2px;
    background: #1768ed;
    content: "";
}

.auth,
.public-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.auth > a,
.public-auth > a {
    display: inline-flex;
    min-width: 76px;
    height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0 21px;
    border: 1px solid #b9cbea;
    border-radius: 7px;
    background: #fff;
    color: #1768ed;
    font-weight: 600;
    white-space: nowrap;
}

.auth > a.reg,
.auth > a.register,
.public-auth > a.public-register {
    min-width: 104px;
    border-color: #1768ed;
    background: #1768ed;
    color: #fff;
    box-shadow: 0 8px 18px rgba(23, 104, 237, .2);
}

@media (max-width: 900px) {
    .nav,
    .public-nav {
        height: 64px;
        padding: 0 20px;
    }

    .logo,
    .public-logo {
        max-width: 58%;
        gap: 8px;
        font-size: 17px;
    }

    .nav .mark,
    .nav .logo-icon,
    .public-nav .brand-mark {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        border-radius: 9px;
        font-size: 13px;
    }

    .links,
    .public-links {
        display: none;
    }

    .auth,
    .public-auth {
        margin-left: auto;
        gap: 7px;
    }

    .auth > a,
    .public-auth > a {
        min-width: 0;
        height: 34px;
        padding: 0 11px;
        font-size: 12px;
    }

    .auth > a.reg,
    .auth > a.register,
    .public-auth > a.public-register {
        min-width: 0;
        box-shadow: none;
    }

    .nav .auth > a:not(:first-child),
    .public-nav .public-auth > a:not(:first-child) {
        display: none;
    }

    .nav .auth > a:only-child,
    .public-nav .public-auth > a:only-child {
        display: inline-flex;
    }
}

/* Final public-header contract: page-local legacy rules must not alter it. */
body > .nav,
body > .public-nav {
    display: flex !important;
    width: 100% !important;
    max-width: 1480px !important;
    height: 74px !important;
    align-items: center !important;
    margin: 0 auto !important;
    padding: 0 34px !important;
    border: 0 !important;
    background: transparent !important;
}

body > .nav > .logo,
body > .public-nav > .public-logo {
    display: flex !important;
    min-width: 0 !important;
    align-items: center !important;
    gap: 12px !important;
    color: #081936 !important;
    font-size: 21px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}

body > .nav > .logo > .mark,
body > .nav > .logo > .logo-icon,
body > .public-nav > .public-logo > .brand-mark {
    display: inline-flex !important;
    width: 36px !important;
    height: 36px !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 36px !important;
    border-radius: 10px !important;
    background: linear-gradient(145deg, #3983ff, #1f63ef) !important;
    color: #fff !important;
    font-size: 16px !important;
}

body > .nav > .links,
body > .public-nav > .public-links {
    display: flex !important;
    height: 100% !important;
    align-items: center !important;
    align-self: auto !important;
    gap: 54px !important;
    margin: 0 auto !important;
    font-size: 15px !important;
    line-height: 1 !important;
}

body > .nav > .links > a,
body > .public-nav > .public-links > a {
    position: relative !important;
    display: inline-flex !important;
    height: 100% !important;
    align-items: center !important;
    padding: 0 !important;
    border: 0 !important;
    border-bottom: 0 !important;
    color: #23324d !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
}

body > .nav > .links > a.active,
body > .nav > .links > a:hover,
body > .public-nav > .public-links > a.active,
body > .public-nav > .public-links > a:hover {
    color: #1768ed !important;
}

body > .nav > .links > a.active::after,
body > .public-nav > .public-links > a.active::after {
    position: absolute !important;
    right: 0 !important;
    bottom: 10px !important;
    left: 0 !important;
    display: block !important;
    width: auto !important;
    height: 2px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 2px !important;
    background: #1768ed !important;
    content: "" !important;
}

body > .nav > .auth,
body > .public-nav > .public-auth {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
    font-size: 14px !important;
}

body > .nav > .auth > a,
body > .public-nav > .public-auth > a {
    display: inline-flex !important;
    min-width: 76px !important;
    height: 40px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 21px !important;
    border: 1px solid #b9cbea !important;
    border-radius: 7px !important;
    background: #fff !important;
    color: #1768ed !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
}

body > .nav > .auth > a.reg,
body > .nav > .auth > a.register,
body > .public-nav > .public-auth > a.public-register {
    min-width: 104px !important;
    border-color: #1768ed !important;
    background: #1768ed !important;
    color: #fff !important;
}

.app-shell.public-mode .global-user-header,
.app-shell.public-mode .topbar,
.app-shell.public-mode > .main > .global-user-header {
    display: none !important;
}

@media (max-width: 900px) {
    body > .nav,
    body > .public-nav {
        height: 64px !important;
        padding: 0 20px !important;
    }

    body > .nav > .logo,
    body > .public-nav > .public-logo {
        max-width: 58% !important;
        gap: 8px !important;
        font-size: 17px !important;
    }

    body > .nav > .logo > .mark,
    body > .nav > .logo > .logo-icon,
    body > .public-nav > .public-logo > .brand-mark {
        width: 32px !important;
        height: 32px !important;
        flex-basis: 32px !important;
        font-size: 13px !important;
    }

    body > .nav > .links,
    body > .public-nav > .public-links {
        display: none !important;
    }

    body > .nav > .auth,
    body > .public-nav > .public-auth {
        margin-left: auto !important;
    }

    body > .nav > .auth > a,
    body > .public-nav > .public-auth > a {
        min-width: 0 !important;
        height: 34px !important;
        padding: 0 11px !important;
        font-size: 12px !important;
    }

    body > .nav > .auth > a:not(:first-child),
    body > .public-nav > .public-auth > a:not(:first-child) {
        display: none !important;
    }

    body > .nav > .auth > a:only-child,
    body > .public-nav > .public-auth > a:only-child {
        display: inline-flex !important;
    }
}
