@import url('../design-system/praxis-modular.css?v=20260719-type-scale-1');
@import url('../design-system/app-shell-theme.css?v=20260719-type-scale-1');

body {
    --topbar-height: var(--app-topbar-height);
    --app-shell-frame-width: var(--site-content-frame-width, min(1420px, calc(100% - 40px)));
}

body.lesson-page {
    --lesson-fixed-topbar-height: var(--app-topbar-height);
}

.app-topbar-shell {
    position: sticky;
    top: 0;
    z-index: 1200;
    width: 100%;
    min-height: var(--app-topbar-height);
    overflow: visible;
    border: 0;
    border-bottom: 1px solid var(--app-topbar-shell-border);
    background: var(--app-topbar-surface);
    box-shadow: var(--app-topbar-shadow);
    color: var(--app-topbar-shell-ink);
    font-family: var(--site-font-body, var(--praxis-font-sans));
    -webkit-backdrop-filter: blur(18px) saturate(120%);
    backdrop-filter: blur(18px) saturate(120%);
}

.app-topbar-shell::after {
    display: none;
}

.app-topbar {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.app-topbar__inner {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: var(--app-shell-frame-width);
    min-height: var(--app-topbar-height);
    margin: 0 auto;
    padding: 5px 0;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    border-radius: 12px;
    color: var(--app-topbar-shell-ink);
    text-decoration: none;
    transition: color .18s ease, transform .18s ease;
}

.app-brand:hover {
    color: var(--app-topbar-shell-gold);
    transform: translateY(-1px);
}

.app-brand:focus-visible {
    outline: 3px solid var(--app-topbar-shell-focus);
    outline-offset: 3px;
}

.app-brand__mark {
    position: relative;
    display: block;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    overflow: visible;
    background: transparent;
}

.app-brand__mark img {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: 40px;
    height: 40px;
    max-width: none;
    object-fit: contain;
    filter: none;
    opacity: 1;
    transform: translate(-50%, -50%);
}

.app-brand__wordmark {
    color: currentColor;
    font-family: var(--site-font-display, var(--praxis-font-editorial));
    font-size: var(--font-size-600);
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1;
    white-space: nowrap;
    transform: translateY(-4px);
}

.app-topnav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    min-width: 0;
    margin-right: auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    box-shadow: none;
    flex-wrap: nowrap;
}

.app-topnav__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--app-topbar-shell-muted);
    font-family: var(--site-font-body, var(--praxis-font-sans));
    font-size: var(--font-size-200);
    font-weight: var(--site-weight-semibold, 650);
    letter-spacing: -.01em;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.app-topnav__link i {
    display: inline-grid;
    width: 18px;
    height: 18px;
    place-items: center;
    flex: 0 0 18px;
    color: var(--app-topbar-shell-muted);
    font-size: var(--font-size-300);
    line-height: 1;
    transition: color .18s ease;
}

.app-topnav__link:hover {
    border-color: var(--app-topbar-shell-active-border);
    background: var(--app-topbar-shell-control-hover);
    color: var(--app-topbar-shell-ink);
}

.app-topnav__link:hover i,
.app-topnav__link.is-active i {
    color: var(--app-topbar-shell-gold);
}

.app-topnav__link:focus-visible {
    outline: 3px solid var(--app-topbar-shell-focus);
    outline-offset: 1px;
}

.app-topnav__link.is-active {
    border-color: var(--app-topbar-shell-active-border);
    background: var(--app-topbar-shell-active);
    color: var(--app-topbar-shell-ink);
    box-shadow: inset 0 -2px 0 var(--app-topbar-shell-gold), inset 0 1px 0 var(--app-topbar-shell-control-inset);
}

.app-topbar__tools {
    position: relative;
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 8px;
    min-width: 0;
    flex-shrink: 0;
}

.app-mobile-menu-toggle,
.app-mobile-menu,
.app-mobile-account-menu,
.nav-search-wrap--mobile {
    display: none;
}

.app-topbar-shell .nav-search-wrap {
    position: relative;
    z-index: 1300;
    width: clamp(220px, 17vw, 300px);
    min-width: 0;
}

.app-topbar-shell .nav-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 38px;
    overflow: hidden;
    border: 1px solid var(--app-topbar-shell-border);
    border-radius: 12px;
    background: var(--app-topbar-shell-control);
    color: var(--app-topbar-shell-ink);
    box-shadow: inset 0 1px 0 var(--app-topbar-shell-control-inset);
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.app-topbar-shell .nav-search:hover,
.app-topbar-shell .nav-search:focus-within {
    border-color: var(--app-topbar-shell-active-border);
    background: var(--app-topbar-shell-control-hover);
    box-shadow: 0 0 0 3px var(--app-topbar-shell-focus);
}

.app-topbar-shell .nav-search-icon {
    position: absolute;
    top: 50%;
    left: 13px;
    display: inline-grid;
    width: 16px;
    height: 16px;
    place-items: center;
    color: var(--app-topbar-shell-subtle);
    font-size: var(--font-size-100);
    line-height: 1;
    pointer-events: none;
    transform: translateY(-50%);
}

.app-topbar-shell .nav-search-input {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0 12px 0 38px;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    caret-color: var(--app-topbar-shell-gold);
    font:inherit;
    font-size: var(--font-size-100);
    line-height: 1.2;
}

.app-topbar-shell .nav-search-input::placeholder {
    color: var(--app-topbar-shell-subtle);
    opacity: 1;
}

.app-topbar-shell .nav-search-input::-webkit-search-cancel-button {
    appearance: none;
    -webkit-appearance: none;
}

.nav-search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    z-index: 1301;
    padding: 8px;
    overflow: hidden;
    border: 1px solid var(--app-topbar-border);
    border-radius: 16px;
    background: var(--app-topbar-paper);
    box-shadow: var(--app-topbar-popover-shadow);
}

.nav-search-dropdown .ns-group {
    padding: 8px 10px 6px;
    color: var(--app-topbar-muted);
    font-size: var(--font-size-100);
    font-weight: var(--site-weight-bold, 800);
    letter-spacing: .07em;
    text-transform: uppercase;
}

.nav-search-dropdown .ns-item {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    color: var(--app-topbar-ink);
    text-decoration: none;
    transition: background .16s ease, color .16s ease;
}

.nav-search-dropdown .ns-item:hover,
.nav-search-dropdown .ns-item:focus-visible {
    background: var(--app-topbar-blue-soft);
}

.nav-search-dropdown .ns-item:focus-visible {
    outline: 3px solid var(--app-topbar-focus);
    outline-offset: -1px;
}

.nav-search-dropdown .ns-item-icon,
.nav-search-dropdown .ns-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--app-topbar-blue-soft);
    color: var(--app-topbar-blue);
    font-weight: var(--site-weight-bold, 800);
}

.nav-search-dropdown .ns-course-hint {
    display: block;
    margin-top: 3px;
    color: var(--app-topbar-muted);
    font-size: var(--font-size-100);
}

.nav-search-dropdown .ns-empty {
    padding: 14px 10px;
    color: var(--app-topbar-muted);
    font-size: var(--font-size-100);
    text-align: center;
}

.prototype-user-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.prototype-userbox {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 4px 10px 4px 7px;
    border: 1px solid var(--app-topbar-shell-border);
    border-radius: 14px;
    background: var(--app-topbar-shell-control);
    color: var(--app-topbar-shell-ink);
    box-shadow: inset 0 1px 0 var(--app-topbar-shell-control-inset);
    font:inherit;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.prototype-userbox:hover,
.prototype-userbox:focus-visible,
.prototype-user-menu.is-open .prototype-userbox {
    border-color: var(--app-topbar-shell-active-border);
    background: var(--app-topbar-shell-control-hover);
    box-shadow: 0 0 0 3px var(--app-topbar-shell-focus);
}

.prototype-userbox:focus-visible {
    outline: none;
}

.prototype-userbox__avatar {
    display: block;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border: 2px solid var(--app-topbar-shell-gold);
    border-radius: 999px;
    background: var(--app-topbar-shell-active);
    box-shadow: 0 0 0 2px var(--app-topbar-shell-control);
    object-fit: cover;
}

.prototype-userbox__text {
    display: grid;
    min-width: 74px;
    gap: 1px;
    text-align: left;
}

.prototype-userbox__text strong,
.prototype-userbox__text small {
    display: block;
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prototype-userbox__text strong {
    color: var(--app-topbar-shell-ink);
    font-size: var(--font-size-100);
    font-weight: var(--site-weight-bold, 750);
    line-height: 1.1;
}

.prototype-userbox__text small {
    color: var(--app-topbar-shell-muted);
    font-size: var(--font-size-100);
    font-weight: 500;
    line-height: 1.15;
}

.prototype-userbox__chevron {
    color: var(--app-topbar-shell-gold);
    font-size: var(--font-size-100);
    line-height: 1;
    transition: color .18s ease, transform .18s ease;
}

.prototype-user-menu__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1320;
    display: grid;
    gap: 2px;
    width: 344px;
    max-width: calc(100vw - 20px);
    padding: 8px;
    border: 1px solid var(--app-account-menu-border);
    border-radius: 16px;
    background: var(--app-account-menu-surface);
    box-shadow: var(--app-account-menu-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

.prototype-user-menu__dropdown::before {
    position: absolute;
    right: 0;
    bottom: 100%;
    left: 0;
    height: 11px;
    content: '';
}

.prototype-user-menu.is-open .prototype-user-menu__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.prototype-user-menu.is-open .prototype-userbox__chevron {
    transform: rotate(180deg);
}

.prototype-user-menu__dropdown form {
    margin: 0;
}

.prototype-user-menu__separator {
    height: 1px;
    margin: 3px 8px;
    background: var(--app-account-menu-divider);
}

.prototype-user-menu__theme {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 44px;
    padding: 4px 6px 4px 10px;
    border-radius: 10px;
    color: var(--app-topbar-ink);
}

.prototype-user-menu__theme-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: var(--font-size-100);
    font-weight: var(--site-weight-semibold, 650);
}

.prototype-user-menu__theme-label i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: var(--app-topbar-muted);
    font-size: var(--font-size-300);
}

.prototype-user-menu__theme-options {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--app-account-menu-border);
    border-radius: 10px;
    background: var(--app-account-menu-control);
}

.prototype-user-menu__theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--app-topbar-muted);
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

.prototype-user-menu__theme-btn:hover {
    background: var(--app-account-menu-hover);
    color: var(--app-topbar-ink);
}

.prototype-user-menu__theme-btn.is-active {
    border-color: var(--app-topbar-blue-border);
    background: var(--app-topbar-blue-soft);
    color: var(--app-topbar-blue);
    box-shadow: inset 0 0 0 1px var(--app-topbar-active-inset);
}

.prototype-user-menu__theme-btn:focus-visible {
    outline: 3px solid var(--app-topbar-focus);
    outline-offset: 1px;
}

.prototype-user-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--app-topbar-ink);
    font:inherit;
    font-size: var(--font-size-100);
    font-weight: var(--site-weight-semibold, 650);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}

.prototype-user-menu__item i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: var(--app-topbar-muted);
    font-size: var(--font-size-300);
    line-height: 1;
}

.prototype-user-menu__mode {
    min-height: 50px;
}

.prototype-user-menu__mode-copy {
    display: grid;
    flex: 1 1 auto;
    gap: 1px;
    min-width: 0;
}

.prototype-user-menu__mode-copy > span,
.prototype-user-menu__mode-copy > small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prototype-user-menu__mode-copy > small {
    color: var(--app-topbar-muted);
    font-weight: 500;
    line-height: 1.2;
}

.prototype-user-menu__mode-switch {
    position: relative;
    width: 34px;
    height: 20px;
    flex: 0 0 34px;
    border: 1px solid var(--app-account-menu-border);
    border-radius: 999px;
    background: var(--app-account-menu-control);
    transition: border-color .16s ease, background .16s ease;
}

.prototype-user-menu__mode-switch::after {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--app-topbar-muted);
    content: '';
    transition: background .16s ease, transform .16s ease;
}

.prototype-user-menu__mode[aria-checked="true"] .prototype-user-menu__mode-switch {
    border-color: var(--app-topbar-blue-border);
    background: var(--app-topbar-blue);
}

.prototype-user-menu__mode[aria-checked="true"] .prototype-user-menu__mode-switch::after {
    background: var(--app-account-menu-surface);
    transform: translateX(14px);
}

.prototype-user-menu__item:hover,
.prototype-user-menu__item:focus-visible,
.prototype-user-menu__item.is-active {
    background: var(--app-account-menu-hover);
    color: var(--app-topbar-ink);
}

.prototype-user-menu__item.is-active i {
    color: var(--app-topbar-blue);
}

.prototype-user-menu__item:focus-visible {
    outline: 3px solid var(--app-topbar-focus);
    outline-offset: -1px;
}

.prototype-user-menu__item--danger,
.prototype-user-menu__item--danger i {
    color: var(--app-topbar-coral);
}

.prototype-user-menu__item--danger:hover,
.prototype-user-menu__item--danger:focus-visible {
    background: var(--app-topbar-danger-soft);
    color: var(--app-topbar-coral);
}

.app-auth-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-auth-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--app-topbar-shell-ink);
    font-size: var(--font-size-100);
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.app-auth-link:hover,
.app-auth-link:focus-visible {
    border-color: var(--app-topbar-shell-active-border);
    background: var(--app-topbar-shell-control-hover);
    color: var(--app-topbar-shell-ink);
}

.app-auth-link:focus-visible {
    outline: 3px solid var(--app-topbar-shell-focus);
    outline-offset: 1px;
}

.app-auth-link--register {
    border-color: var(--app-topbar-shell-active-border);
    background: var(--app-topbar-shell-active);
    color: var(--app-topbar-shell-gold);
}

@media (max-width: 1520px) and (min-width: 1181px) {
    .app-topnav__link {
        gap: 6px;
        padding-right: 8px;
        padding-left: 8px;
    }
}

@media (max-width: 1450px) and (min-width: 1181px) {
    .app-topbar__inner {
        gap: 8px;
        padding-right: 0;
        padding-left: 0;
    }

    .app-topnav__link {
        gap: 5px;
        padding-right: 7px;
        padding-left: 7px;
        font-size: var(--font-size-200);
    }

    .app-topbar-shell .nav-search-wrap {
        width: 210px;
    }

    .app-topbar-shell .nav-search-input {
        padding-right: 12px;
    }
}

@media (max-width: 1320px) and (min-width: 1181px) {
    .app-topbar-shell .nav-search-wrap {
        width: 176px;
    }

    .app-topnav__link {
        gap: 0;
    }

    .app-topnav__link i {
        display: none;
    }

    .prototype-userbox__text {
        display: none;
    }
}

@media (max-width: 1180px) {
    :root {
        --app-topbar-height: 54px;
    }

    body {
        --app-shell-frame-width: var(--site-content-frame-width, calc(100% - 40px));
    }

    .app-topbar__inner {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        grid-template-areas: "menu brand auth";
        gap: 8px;
        min-height: var(--app-topbar-height);
        padding: 4px 0;
    }

    .app-mobile-menu-toggle {
        grid-area: menu;
        justify-self: start;
    }

    .app-brand {
        grid-area: brand;
        justify-self: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }

    .app-brand__mark {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .app-brand__mark img {
        width: 36px;
        height: 36px;
    }

    .app-brand__wordmark,
    .app-topnav {
        display: none;
    }

    .app-topbar__tools {
        grid-area: auth;
        justify-self: end;
        gap: 6px;
    }

    .app-topbar__tools > .nav-search-wrap:not(.nav-search-wrap--mobile),
    .app-auth-links {
        display: none;
    }

    .app-mobile-menu-toggle,
    .app-mobile-account-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        border: 1px solid var(--app-topbar-shell-border);
        border-radius: 12px;
        background: var(--app-topbar-shell-control);
        color: var(--app-topbar-shell-ink);
        font:inherit;
        font-size: var(--font-size-400);
        line-height: 1;
        cursor: pointer;
        transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
    }

    .app-mobile-menu-toggle:hover,
    .app-mobile-menu-toggle:focus-visible,
    .app-mobile-menu-toggle[aria-expanded="true"],
    .app-mobile-account-toggle:hover,
    .app-mobile-account-toggle:focus-visible,
    .app-mobile-account-toggle[aria-expanded="true"] {
        border-color: var(--app-topbar-shell-active-border);
        background: var(--app-topbar-shell-control-hover);
        box-shadow: 0 0 0 3px var(--app-topbar-shell-focus);
    }

    .app-mobile-menu-toggle:focus-visible,
    .app-mobile-account-toggle:focus-visible {
        outline: none;
    }

    .app-mobile-menu {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        z-index: 1340;
        display: block;
        width: min(360px, calc(100vw - 16px));
        max-height: calc(100vh - var(--app-topbar-height) - 20px);
        max-height: calc(100dvh - var(--app-topbar-height) - 20px);
        padding: 10px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        border: 1px solid var(--app-topbar-border);
        border-radius: 18px;
        background: var(--app-topbar-paper);
        color: var(--app-topbar-ink);
        box-shadow: var(--app-topbar-popover-shadow);
    }

    .app-mobile-menu[hidden] {
        display: none;
    }

    .app-mobile-menu__section + .app-mobile-menu__section {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--app-topbar-border);
    }

    .app-mobile-menu .nav-search-wrap {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .app-mobile-menu .nav-search {
        min-height: 44px;
        border-color: var(--app-topbar-border);
        background: var(--app-topbar-control);
        color: var(--app-topbar-ink);
        box-shadow: inset 0 1px 0 var(--app-topbar-control-inset);
    }

    .app-mobile-menu .nav-search:hover,
    .app-mobile-menu .nav-search:focus-within {
        border-color: var(--app-topbar-control-border-active);
        background: var(--app-topbar-control-hover);
        box-shadow: 0 0 0 3px var(--app-topbar-focus);
    }

    .app-mobile-menu .nav-search-icon,
    .app-mobile-menu .nav-search-input::placeholder {
        color: var(--app-topbar-subtle);
    }

    .app-mobile-menu .nav-search-input {
        caret-color: var(--app-topbar-blue);
        font-size: var(--font-size-300);
        line-height: 1.25;
    }

    .app-mobile-menu .nav-search-dropdown {
        position: static;
        max-height: min(48vh, 360px);
        margin-top: 8px;
        overflow: auto;
        box-shadow: none;
    }

    .app-mobile-menu .nav-search-dropdown .ns-course-hint {
        font-size: var(--font-size-100);
    }

    .app-mobile-menu__item {
        display: flex;
        align-items: center;
        gap: 11px;
        min-height: 44px;
        padding: 0 11px;
        border: 1px solid transparent;
        border-radius: 12px;
        color: var(--app-topbar-ink);
        font-size: var(--font-size-100);
        font-weight: 700;
        text-decoration: none;
        transition: border-color .16s ease, background .16s ease, color .16s ease;
    }

    .app-mobile-menu__item i {
        display: inline-flex;
        justify-content: center;
        width: 19px;
        color: var(--app-topbar-muted);
        font-size: var(--font-size-300);
    }

    .app-mobile-menu__item:hover,
    .app-mobile-menu__item:focus-visible {
        background: var(--app-topbar-sand);
        color: var(--app-topbar-ink);
    }

    .app-mobile-menu__item.is-active {
        border-color: var(--app-topbar-blue-border);
        background: var(--app-topbar-blue-soft);
    }

    .app-mobile-menu__item.is-active i {
        color: var(--app-topbar-blue);
    }

    .app-mobile-menu__item:focus-visible {
        outline: 3px solid var(--app-topbar-focus);
        outline-offset: -1px;
    }

    .prototype-userbox {
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        padding: 4px;
        border-radius: 12px;
    }

    .prototype-userbox__avatar {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .prototype-userbox__text,
    .prototype-userbox__chevron {
        display: none;
    }

    .prototype-user-menu:not(.is-open):focus-within .prototype-user-menu__dropdown,
    .prototype-user-menu:not(.is-open):hover .prototype-user-menu__dropdown {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-5px);
    }

    .prototype-user-menu.is-open .prototype-user-menu__dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .app-mobile-account-menu {
        position: relative;
        display: inline-flex;
        align-items: center;
    }

    .app-mobile-account-dropdown {
        position: absolute;
        top: calc(100% + 9px);
        right: 0;
        z-index: 1340;
        display: grid;
        gap: 2px;
        width: min(248px, calc(100vw - 16px));
        min-width: 0;
        padding: 8px;
        border: 1px solid var(--app-account-menu-border);
        border-radius: 16px;
        background: var(--app-account-menu-surface);
        box-shadow: var(--app-account-menu-shadow);
    }

    .prototype-user-menu__dropdown,
    .app-mobile-account-dropdown {
        max-height: calc(100dvh - var(--app-topbar-height, 55px) - 16px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .app-mobile-account-dropdown[hidden] {
        display: none;
    }

    .prototype-user-menu__theme-btn {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 650px) {
    .prototype-user-menu__dropdown {
        position: fixed;
        top: calc(var(--app-topbar-height) + 8px);
        right: 10px;
        width: min(344px, calc(100vw - 20px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-brand,
    .app-topnav__link,
    .app-topbar-shell .nav-search,
    .nav-search-dropdown .ns-item,
    .prototype-userbox,
    .prototype-userbox__chevron,
    .prototype-user-menu__dropdown,
    .prototype-user-menu__item,
    .prototype-user-menu__theme-btn,
    .app-auth-link,
    .app-mobile-menu-toggle,
    .app-mobile-account-toggle,
    .app-mobile-menu__item {
        transition: none;
    }

    .app-brand:hover {
        transform: none;
    }
}

.lesson-mobile-header-slot,
.lesson-account-drawer-backdrop,
.lesson-account-drawer__header,
.lesson-account-drawer__group-label,
.lesson-account-drawer__slot,
.lesson-account-drawer__mobile-only,
.notification-center__label,
.notification-center__chevron,
.prototype-user-menu__theme-btn-label {
    display: none;
}

@media (max-width: 640px), (max-width: 960px) and (max-height: 560px) and (orientation: landscape) {
    html[data-lesson-mobile-layout="pending"] body.lesson-page .app-topbar__inner,
    body.lesson-page.lesson-mobile-header-ready .app-topbar__inner {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "lesson auth";
        gap: 8px;
        width: 100%;
        max-width: none;
        padding: 5px 8px;
    }

    html[data-lesson-mobile-layout="pending"] body.lesson-page .lesson-mobile-header-slot,
    body.lesson-page.lesson-mobile-header-ready .lesson-mobile-header-slot {
        display: block;
        grid-area: lesson;
        min-width: 0;
        width: 100%;
    }

    html[data-lesson-mobile-layout="pending"] body.lesson-page .app-mobile-menu-toggle,
    html[data-lesson-mobile-layout="pending"] body.lesson-page .app-brand,
    html[data-lesson-mobile-layout="pending"] body.lesson-page .app-topbar__tools > .notification-center,
    body.lesson-page.lesson-mobile-header-ready .app-mobile-menu-toggle,
    body.lesson-page.lesson-mobile-header-ready .app-brand,
    body.lesson-page.lesson-mobile-header-ready .app-topbar__tools > .notification-center {
        display: none;
    }

    html[data-lesson-mobile-layout="pending"] body.lesson-page .app-topbar__tools,
    body.lesson-page.lesson-mobile-header-ready .app-topbar__tools {
        grid-area: auth;
        justify-self: end;
    }

    html[data-lesson-mobile-layout="pending"] body.lesson-page .lesson-mobile-header-slot {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 8px;
    }

    html[data-lesson-mobile-layout="pending"] body.lesson-page .lesson-mobile-header-slot::before,
    html[data-lesson-mobile-layout="pending"] body.lesson-page .lesson-mobile-header-slot::after {
        min-width: 0;
        min-height: 44px;
        border: 1px solid var(--app-topbar-shell-border);
        border-radius: 12px;
        background: var(--app-topbar-shell-control);
        box-shadow: inset 0 1px 0 var(--app-topbar-shell-control-inset);
        content: "";
    }

    body.lesson-page.lesson-mobile-account-menu-ready,
    body.lesson-page.lesson-mobile-account-drawer-open {
        overscroll-behavior: none;
    }

    body.lesson-page.lesson-mobile-account-drawer-open {
        overflow: hidden;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .lesson-account-drawer-backdrop {
        position: fixed;
        inset: var(--app-topbar-height, 54px) 0 0;
        z-index: 1360;
        display: none;
        width: 100%;
        padding: 0;
        border: 0;
        background: var(--app-topbar-drawer-scrim);
        cursor: pointer;
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
    }

    body.lesson-page.lesson-mobile-account-drawer-open .lesson-account-drawer-backdrop {
        display: block;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .prototype-user-menu__dropdown,
    body.lesson-page.lesson-mobile-account-menu-ready .app-mobile-account-dropdown {
        position: fixed;
        top: var(--app-topbar-height, 54px);
        right: 0;
        bottom: 0;
        left: auto;
        z-index: 1370;
        align-content: start;
        gap: 2px;
        width: min(390px, calc(100vw - 24px));
        max-width: none;
        height: calc(100dvh - var(--app-topbar-height, 54px));
        max-height: none;
        padding: 0 10px 18px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        border: 1px solid var(--app-account-menu-border);
        border-right: 0;
        border-bottom: 0;
        border-radius: 18px 0 0 0;
        background: var(--app-account-menu-surface);
        box-shadow: var(--app-account-menu-shadow);
        opacity: 0;
        visibility: hidden;
        transform: translateX(100%);
        transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .prototype-user-menu.is-open .prototype-user-menu__dropdown,
    body.lesson-page.lesson-mobile-account-menu-ready .app-mobile-account-menu.is-open .app-mobile-account-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }

    body.lesson-page.lesson-mobile-account-menu-ready .prototype-user-menu__dropdown::before {
        display: none;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .lesson-account-drawer__header {
        position: sticky;
        top: 0;
        z-index: 3;
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        align-items: center;
        gap: 10px;
        min-height: 70px;
        margin: 0 -2px 8px;
        padding: 10px 2px 8px;
        border-bottom: 1px solid var(--app-account-menu-divider);
        background: var(--app-account-menu-surface);
    }

    .lesson-account-drawer__avatar,
    .lesson-account-drawer__guest-icon {
        display: grid;
        width: 42px;
        height: 42px;
        place-items: center;
        border: 2px solid var(--app-topbar-shell-gold);
        border-radius: 999px;
        background: var(--app-account-menu-control);
        color: var(--app-topbar-blue);
        box-shadow: 0 0 0 2px var(--app-account-menu-surface);
        object-fit: cover;
    }

    .lesson-account-drawer__guest-icon {
        font-size: var(--font-size-400);
    }

    .lesson-account-drawer__identity {
        display: grid;
        min-width: 0;
        gap: 2px;
    }

    .lesson-account-drawer__identity strong,
    .lesson-account-drawer__identity small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .lesson-account-drawer__identity strong {
        color: var(--app-topbar-ink);
        font-size: var(--font-size-200);
        font-weight: var(--site-weight-bold, 800);
        line-height: 1.15;
    }

    .lesson-account-drawer__identity small {
        color: var(--app-topbar-muted);
        font-size: var(--font-size-100);
        font-weight: 600;
    }

    .lesson-account-drawer__close {
        display: inline-grid;
        width: 44px;
        height: 44px;
        padding: 0;
        place-items: center;
        border: 1px solid transparent;
        border-radius: 12px;
        background: transparent;
        color: var(--app-topbar-muted);
        font:inherit;
        cursor: pointer;
    }

    .lesson-account-drawer__close:hover,
    .lesson-account-drawer__close:focus-visible {
        border-color: var(--app-account-menu-border);
        background: var(--app-account-menu-hover);
        color: var(--app-topbar-ink);
        outline: none;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .lesson-account-drawer__group-label {
        display: block;
        padding: 10px 11px 6px;
        color: var(--app-topbar-muted);
        font-size: var(--font-size-100);
        font-weight: var(--site-weight-bold, 800);
        letter-spacing: .08em;
        line-height: 1;
        text-transform: uppercase;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .lesson-account-drawer__slot,
    body.lesson-page.lesson-mobile-account-menu-ready .lesson-account-drawer__mobile-only {
        display: block;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .lesson-account-drawer__slot--notifications {
        margin-top: 4px;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .lesson-account-drawer__slot .app-mobile-menu {
        position: static;
        display: block;
        width: 100%;
        max-height: none;
        padding: 0;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .app-mobile-menu__section + .app-mobile-menu__section {
        margin-top: 8px;
        padding-top: 8px;
        border-top-color: var(--app-account-menu-divider);
    }

    body.lesson-page.lesson-mobile-account-menu-ready .app-mobile-menu__item,
    body.lesson-page.lesson-mobile-account-menu-ready .prototype-user-menu__item {
        min-height: 48px;
        border-radius: 11px;
        font-size: var(--font-size-100);
        font-weight: 700;
    }

    body.lesson-page.lesson-mobile-auth-menu-ready .app-mobile-menu__item[data-lesson-account-duplicate] {
        display: none;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .notification-center {
        position: relative;
        display: block;
        width: 100%;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__toggle {
        display: flex;
        align-items: center;
        gap: 11px;
        width: 100%;
        height: 48px;
        padding: 0 11px;
        border: 1px solid transparent;
        border-radius: 11px;
        background: transparent;
        color: var(--app-topbar-ink);
        box-shadow: none;
        font-size: var(--font-size-100);
        font-weight: 700;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__toggle:hover,
    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__toggle:focus-visible,
    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__toggle[aria-expanded="true"] {
        border-color: transparent;
        background: var(--app-account-menu-hover);
        color: var(--app-topbar-ink);
        box-shadow: none;
        outline: none;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__toggle > .bi-bell {
        display: inline-flex;
        justify-content: center;
        width: 19px;
        color: var(--app-topbar-muted);
        font-size: var(--font-size-300);
    }

    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__label,
    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__chevron {
        display: inline-flex;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__label {
        order: 1;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__count {
        position: static;
        order: 2;
        min-width: 22px;
        height: 22px;
        margin-left: auto;
        padding: 0 6px;
        border: 0;
        line-height: 22px;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__chevron {
        order: 3;
        margin-left: auto;
        color: var(--app-topbar-muted);
        font-size: var(--font-size-100);
        transition: transform .18s ease;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__count:not([hidden]) + .notification-center__label + .notification-center__chevron {
        margin-left: 0;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__toggle[aria-expanded="true"] .notification-center__chevron {
        transform: rotate(180deg);
    }

    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__panel {
        position: static;
        width: 100%;
        max-height: none;
        margin-top: 4px;
        overflow: hidden;
        border-color: var(--app-account-menu-border);
        border-radius: 14px;
        background: var(--app-account-menu-control);
        color: var(--app-topbar-ink);
        box-shadow: none;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__panel > header {
        padding: 14px 13px 11px;
        border-bottom-color: var(--app-account-menu-divider);
    }

    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__list {
        max-height: none;
        overflow: visible;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .notification-item,
    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__achievements {
        background: transparent;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .notification-item:hover,
    body.lesson-page.lesson-mobile-account-menu-ready .notification-item:focus-visible,
    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__achievements:hover,
    body.lesson-page.lesson-mobile-account-menu-ready .notification-center__achievements:focus-visible {
        background: var(--app-account-menu-hover);
    }

    body.lesson-page.lesson-mobile-account-menu-ready .notification-item.is-unread {
        background: color-mix(in srgb, var(--app-topbar-blue-soft) 64%, var(--app-account-menu-control));
    }

    body.lesson-page.lesson-mobile-account-menu-ready .prototype-user-menu__theme {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 7px;
        min-height: max-content;
        padding: 8px 10px 10px;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .prototype-user-menu__theme-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 3px;
    }

    body.lesson-page.lesson-mobile-account-menu-ready .prototype-user-menu__theme-btn {
        gap: 7px;
        width: auto;
        height: 40px;
        padding: 0 9px;
        font:inherit;
        font-size: var(--font-size-100);
        font-weight: var(--site-weight-bold, 750);
    }

    body.lesson-page.lesson-mobile-account-menu-ready .prototype-user-menu__theme-btn-label {
        display: inline;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lesson-account-drawer-backdrop,
    .prototype-user-menu__dropdown,
    .prototype-user-menu__mode-switch,
    .prototype-user-menu__mode-switch::after,
    .app-mobile-account-dropdown,
    .notification-center__chevron {
        transition: none;
    }
}
