.user-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.topbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}

.topbar-title-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    align-self: flex-start;
    margin-top: 2px;
    overflow: hidden;
    border-radius: 10px;
    border: 0;
    background: transparent;
}

.topbar-profile-trigger {
    padding: 0;
    color: var(--zn-member-accent-text);
    cursor: pointer;
    text-decoration: none;
}

.topbar-profile-trigger:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--zn-member-accent-border-strong) 76%, transparent);
    outline-offset: 3px;
}

.topbar-title-mark-image {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    object-position: center;
    transform: none;
    transform-origin: center;
}

.topbar-profile-image {
    transform: scale(1.08);
}

.topbar-profile-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    border-radius: inherit;
    background: var(--zn-member-accent-soft);
    color: var(--zn-member-accent-text);
    font-weight: 800;
    letter-spacing: 0;
}

.topbar-title-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.user-app-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.user-app-nav-link,
.surface-switcher-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid var(--zn-member-border);
    background: var(--zn-member-bg-surface-hover);
    color: var(--zn-member-text-secondary);
    font-size: 0.86rem;
    font-weight: 700;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.user-app-nav-link.is-active,
.surface-switcher-link.is-active {
    border-color: var(--zn-member-accent-border);
    background: var(--zn-member-accent-surface);
    color: var(--zn-member-accent-text);
}

.surface-switcher-link.surface-switcher-operator {
    border-color: color-mix(in srgb, var(--zn-success, #33c27f) 42%, var(--zn-member-border));
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--zn-success, #33c27f) 16%, transparent),
        0 0 18px color-mix(in srgb, var(--zn-success, #33c27f) 18%, transparent);
}

.surface-switcher-link.surface-switcher-operator.is-active {
    border-color: color-mix(in srgb, var(--zn-success, #33c27f) 54%, var(--zn-member-accent-border));
    background: color-mix(in srgb, var(--zn-success, #33c27f) 12%, var(--zn-member-bg-surface-hover));
    color: var(--zn-member-text-primary);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--zn-success, #33c27f) 24%, transparent),
        0 0 24px color-mix(in srgb, var(--zn-success, #33c27f) 24%, transparent);
}

.surface-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.user-header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex: 0 0 auto;
    margin-left: auto;
    margin-right: max(6px, env(safe-area-inset-right));
}

.user-header-logout-form {
    display: inline-flex;
    margin: 0;
}

.user-header-logout-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid color-mix(in srgb, #ef3b32 72%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, #ef3b32 12%, var(--zn-member-bg-surface-faint));
    color: #d83a34;
    box-shadow: 0 6px 16px rgba(89, 43, 26, 0.12);
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.user-header-logout-button:hover,
.user-header-logout-button:focus-visible {
    background: color-mix(in srgb, #ef3b32 20%, var(--zn-member-bg-card));
    box-shadow: 0 8px 20px rgba(89, 43, 26, 0.16);
    transform: translateY(-1px);
}

.user-header-logout-button:focus-visible {
    outline: 2px solid rgba(239, 59, 50, 0.34);
    outline-offset: 3px;
}

.user-header-logout-icon {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.znode-user-version {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: end;
    color: var(--zn-member-text-muted);
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.surface-switcher-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.surface-switcher-user {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.surface-switcher-user .surface-switcher-link {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    min-height: 46px;
    padding: 0;
    border-radius: 14px;
}

.surface-switcher-user .surface-switcher-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.surface-switcher-user .surface-switcher-link:hover .surface-switcher-label,
.surface-switcher-user .surface-switcher-link:focus-visible .surface-switcher-label {
    top: calc(100% + 8px);
    left: 50%;
    z-index: 30;
    width: auto;
    height: auto;
    min-width: max-content;
    padding: 6px 9px;
    margin: 0;
    overflow: visible;
    clip: auto;
    border: 1px solid var(--zn-member-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--zn-member-bg-card) 96%, transparent);
    color: var(--zn-member-text-primary);
    box-shadow: var(--zn-shadow-soft);
    font-size: 0.72rem;
    line-height: 1;
    transform: translateX(-50%);
    pointer-events: none;
}

.surface-switcher-button {
    font: inherit;
    cursor: pointer;
}


body.user-body-meetings .topbar-title,
body.user-body-workspace .topbar-title {
    width: 100%;
    align-items: flex-start;
}

body.user-body-meetings .topbar-title-copy,
body.user-body-workspace .topbar-title-copy {
    width: auto;
    flex: 0 1 auto;
}

.workspace-brand-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.workspace-brand-line h1 {
    min-width: 0;
}

body.user-body-meetings .surface-switcher-user,
body.user-body-workspace .surface-switcher-user {
    width: auto;
    max-width: none;
    justify-content: flex-start;
}

body.user-body-meetings .surface-switcher-user .surface-switcher-link,
body.user-body-workspace .surface-switcher-user .surface-switcher-link {
    flex: 0 0 124px;
    width: 124px;
    min-width: 124px;
    min-height: 58px;
    border-radius: 18px;
}
