.public-header {
    position: fixed;
    top: 16px;
    left: 24px;
    right: 24px;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    transition: top .18s ease, left .18s ease, right .18s ease, border-radius .18s ease, padding .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, backdrop-filter .18s ease;
}

body.public-header-scrolled .public-header {
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 24px;
    background: rgba(255,255,255,.94);
    border-color: #e5e3f5;
    border-left-color: transparent;
    border-right-color: transparent;
    border-top-color: transparent;
    border-radius: 0;
    box-shadow: 0 14px 36px rgba(17,24,39,.08);
    backdrop-filter: blur(14px);
}

.public-header > * {
    position: relative;
    z-index: 2;
}

.public-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #5b4ee8;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .08em;
    text-decoration: none;
}

.public-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    height: 30px;
    border-radius: 9px;
    background: #5b4ee8;
    color: #fff;
    padding: 0 13px;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .04em;
}

.public-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid #d8d4ff;
    border-radius: 12px;
    background: rgba(255,255,255,.92);
    color: #5b4ee8;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 10px 26px rgba(15,23,42,.08);
}

.public-menu-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    display: block;
}

.public-backdrop {
    display: none;
}

.public-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 0 18px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.public-nav a {
    color: #1a1730;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.public-nav a:hover {
    color: #5b4ee8;
}

.public-nav-brand,
.public-nav-actions {
    display: none;
}

.public-auth {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 285px;
}

.pill,
.auth-button,
.auth-cabinet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8d4ff;
    border-radius: 999px;
    background: rgba(255,255,255,.9);
    color: #3c3489;
    padding: 11px 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 10px 26px rgba(15,23,42,.08);
    cursor: pointer;
}

.pill.primary,
.auth-button.login,
.auth-button.primary,
.auth-cabinet {
    border-color: #5b4ee8;
    background: #5b4ee8;
    color: #fff;
}

.user-box,
.auth-user {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.92);
    border: 1px solid #e5e3f5;
    border-radius: 999px;
    padding: 6px 8px 6px 14px;
    box-shadow: 0 10px 26px rgba(15,23,42,.08);
}

.user-name,
.auth-user-email {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1a1730;
    font-size: 14px;
    font-weight: 500;
}

@media(max-width: 900px) {
    body.public-menu-open {
        overflow: hidden;
    }

    .public-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 120;
        align-items: center;
        justify-content: space-between;
        background: #fff;
        border-bottom: 1px solid #e5e3f5;
        border-radius: 0;
        padding: 12px 14px;
        box-shadow: 0 10px 28px rgba(17,24,39,.08);
        gap: 12px;
    }

    body.public-header-scrolled .public-header {
        background: #fff;
        border-color: transparent;
        border-bottom-color: #e5e3f5;
        box-shadow: 0 10px 28px rgba(17,24,39,.08);
        backdrop-filter: none;
    }

    .public-menu-toggle {
        display: flex;
        width: 42px;
        height: 42px;
        box-shadow: none;
        flex-shrink: 0;
    }

    .public-logo {
        flex: 1;
        justify-content: flex-start;
        font-size: 12px;
    }

    .public-logo-mark {
        min-width: auto;
        height: auto;
        border-radius: 10px;
        padding: 7px 12px;
        font-size: 12px;
    }

    .public-nav {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 110;
        width: min(320px, 86vw);
        flex: none;
        transform: translateX(-100%);
        transition: transform .22s ease;
        background: #fff;
        border-right: 1px solid #e5e3f5;
        box-shadow: 18px 0 60px rgba(15,23,42,.18);
        padding: 24px 18px;
        display: flex;
        align-items: stretch;
        justify-content: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    body.public-menu-open .public-nav {
        transform: translateX(0);
    }

    .public-nav-brand {
        display: flex;
        align-items: center;
        gap: 8px;
        color: #5b4ee8;
        font-size: 13px;
        font-weight: 900;
        letter-spacing: .08em;
        margin-bottom: 10px;
    }

    .public-nav a {
        display: flex;
        align-items: center;
        min-height: 46px;
        border: 1px solid transparent;
        border-radius: 12px;
        padding: 12px 14px;
    }

    .public-nav a:hover {
        background: #eeedfe;
        border-color: #d8d4ff;
    }

    .public-backdrop {
        position: fixed;
        inset: 0;
        z-index: 100;
        background: rgba(17,24,39,.58);
    }

    body.public-menu-open .public-backdrop {
        display: block;
    }

    .public-nav-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: auto;
        padding-top: 18px;
    }

    .public-nav-actions .pill,
    .public-nav-actions .auth-button,
    .public-nav-actions .auth-cabinet,
    .public-nav-actions .logout-mobile,
    .public-nav-actions .public-nav-logout {
        width: 100%;
        text-align: center;
        justify-content: center;
        box-shadow: none;
    }

    .public-nav-actions .logout-mobile,
    .public-nav-actions .public-nav-logout {
        border: 1px solid #f0c9bd;
        border-radius: 999px;
        background: #faece7;
        color: #993c1d;
        padding: 11px 14px;
        font-size: 14px;
        font-weight: 800;
        text-decoration: none;
    }

    .public-auth {
        min-width: 0;
        flex: 0 0 auto;
    }

    .public-auth > .pill:not(.primary),
    #authGuestActions .auth-button:not(.login) {
        display: none;
    }

    .pill.primary,
    .auth-button.login,
    .auth-cabinet {
        border-color: #d8d4ff;
        background: #fff;
        color: #3c3489;
        box-shadow: none;
        padding: 8px 12px;
        font-size: 13px;
    }

    .user-box .pill.primary,
    .auth-user .auth-cabinet {
        border-color: #5b4ee8;
        background: #5b4ee8;
        color: #fff;
    }

    .user-box,
    .auth-user {
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .user-name,
    .auth-user-email {
        display: none;
    }

    .public-nav-actions .auth-cabinet,
    .public-nav-actions .public-nav-logout {
        display: none;
    }

    body.is-authenticated .public-nav-actions .auth-button {
        display: none;
    }

    body.is-authenticated .public-nav-actions .auth-cabinet,
    body.is-authenticated .public-nav-actions .public-nav-logout {
        display: flex;
    }
}
