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

/*
 * `lab-instance` is set on <body> only when settings.IS_LAB_PORTAL is
 * true (see templates/base.html and ohrid_public/context_processors.
 * portal) - i.e. only on ohrid_lab, never ohrid_prod. Overrides the
 * shared framework topbar color (`.topbar` background: var(--t-primary)
 * in traki_common's base.css) with --GREEN-LAB-NAV (see css/
 * constants.css), purely so a developer/manager can tell at a glance
 * which instance they're on - same reasoning as IS_LAB_PORTAL gating
 * the IDE/Deploy views themselves, applied to the chrome instead of a
 * permission check.
 */
body.lab-instance .topbar {
    background: var(--GREEN-LAB-NAV);
}

/* ── Language dropdown ───────────────────────────────────── */
.lang-dropdown {
    position: relative;
}

.lang-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    color: var(--t-surface);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    list-style: none;
    user-select: none;
    white-space: nowrap;
    transition: border-color 0.15s;
}

.lang-dropdown-trigger::-webkit-details-marker { display: none; }
.lang-dropdown-trigger::marker { display: none; }

.lang-dropdown[open] .lang-dropdown-trigger {
    border-color: rgba(255, 255, 255, 0.7);
}

.lang-chevron {
    font-size: 0.6rem;
    opacity: 0.75;
    transition: transform 0.15s;
}

.lang-dropdown[open] .lang-chevron {
    transform: rotate(180deg);
}

.lang-dropdown-card {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--t-surface);
    border: 1px solid var(--t-border);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgb(0 0 0 / 0.12);
    min-width: 150px;
    z-index: 200;
    overflow: hidden;
}

.lang-option {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    text-align: left;
    color: var(--t-primary);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.lang-option:hover { background: var(--t-surface-alt); }

.lang-option--active {
    font-weight: 700;
    background: var(--t-surface-alt);
}

/* ── Instance switch (lab <-> prod) ──────────────────────────
 * Only rendered for a user holding ProfileDeveloper (see
 * ohrid_public.context_processors.portal's `dev_instance_switch_url`)
 * - same translucent-pill look as `.lang-dropdown-trigger` above so it
 * reads as one topbar chrome family. The `--to-prod` modifier (only
 * added on lab, since that's the direction this button goes into prod
 * from) borrows the warm accent `profile_developer/nav.css` already
 * uses for the IDE nav link, since landing on prod is a live,
 * un-reviewed instance unlike lab - not just another neutral chrome
 * action.
 */
.instance-switch-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    color: var(--t-surface);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s;
}

.instance-switch-btn:hover {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.instance-switch-btn--to-prod {
    border-color: rgba(255, 201, 77, 0.55);
    color: #ffc94d;
}

.instance-switch-btn--to-prod:hover {
    border-color: rgba(255, 201, 77, 0.9);
    background: rgba(255, 201, 77, 0.12);
}
