.topbar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 30;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 96px;
    padding: 20px 40px 20px 72px;
    background: var(--header-bg-color);
    box-shadow: 0 4px 6px var(--shadow-black-10);
    font-family: Inter, sans-serif;
    font-weight: 400;
}

.topbar p {
    font-size: 1.25rem;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.topbar-logo {
    display: block;
    width: 32px;
    height: 39px;
    object-fit: contain;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.account-menu-wrapper {
    position: relative;
}

.help-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
}

.help-link img {
    width: 24px;
    height: 24px;
}

.help-link:hover {
    transform: scale(1.2);
}

.help-link:focus-visible {
    box-shadow: 0 0 0 2px var(--divider-color-blue);
    outline: none;
}

.account-avatar {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    background: var(--avatar-bg);
    border: 2px solid var(--avatar-border);
    border-radius: 50%;
    color: var(--text-user);
    font-family: Inter, sans-serif;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 120ms ease;
}

.account-avatar:hover,
.account-avatar:focus-visible {
    background: var(--avatar-bg-hover);
}

.account-avatar:focus-visible {
    outline: 2px solid var(--ui-light);
    outline-offset: 3px;
}

.account-menu {
    display: flex;
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 40;
    flex-direction: column;
    min-width: 150px;
    padding: 10px 0;
    background: var(--ui-dark);
    border-radius: 20px 0 20px 20px;
    box-shadow: 0 8px 18px var(--shadow-black-16);
    pointer-events: none;
    transition: opacity 120ms ease, transform 160ms ease, visibility 120ms ease;
    transform: translateX(24px);
}

.account-menu-wrapper.open .account-menu {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.account-menu a {
    margin: 0 8px;
    padding: 11px 12px;
    border-radius: 8px;
    color: var(--text-tertiary);
    font-family: Inter, sans-serif;
    font-size: 1rem;
    line-height: 120%;
    white-space: nowrap;
}

.account-menu a:hover,
.account-menu a:focus-visible {
    background: var(--ui-dark-hover);
    outline: none;
    color: var(--text-white);
}

@media (width <= 1024px) and (hover: none) and (pointer: coarse),
    (orientation: landscape) and (width >= 900px) and (height >= 600px) and (hover: none) and (pointer: coarse) {
    .topbar {
        height: 80px;
        padding: 20px 16px;
    }

    .account-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .account-menu {
        position: fixed;
        top: 80px;
        right: 0;
        min-width: 144px;
        border-radius: 20px 0 20px 20px;
        transform: translateX(100%);
    }

    .account-menu-wrapper.open .account-menu {
        transform: translateX(0);
    }
}
