/* Header brand menu (multi-brand users on a brand studio domain). */
.brand-switch {
    position: relative;
    flex-shrink: 0;
}
.brand-switch-btn {
    --brand-switch-color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 2px 10px;
    border-radius: 9999px;
    border: 1px solid color-mix(in srgb, var(--brand-switch-color) 50%, transparent);
    background: color-mix(in srgb, var(--brand-switch-color) 13%, transparent);
    color: color-mix(in srgb, var(--brand-switch-color) 60%, #fff);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}
.brand-switch-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.brand-switch-btn svg {
    transition: transform 0.15s ease;
}
.brand-switch-btn[aria-expanded="true"] svg {
    transform: rotate(180deg);
}
.brand-switch-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}
.brand-switch-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 900;
    width: min(290px, calc(100vw - 32px));
    padding: 6px;
    background: #141c2b;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}
.brand-switch-menu[hidden] {
    display: none;
}
.brand-switch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.brand-switch-item svg {
    flex: none;
    color: var(--text-muted);
}
.brand-switch-item.current {
    background: rgba(96, 165, 250, 0.10);
    cursor: default;
}
.brand-switch-item.current svg {
    color: var(--accent);
}
.brand-switch-item:hover:not(.current),
.brand-switch-item:focus-visible {
    background: var(--surface-2);
    outline: none;
}
.brand-switch-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.brand-switch-name {
    font-size: 14px;
    font-weight: 700;
}
.brand-switch-domain {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.brand-switch-note {
    margin-top: 4px;
    padding: 7px 10px 4px;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--text-dim);
}

/* Phones: "Account & Users" shortens to "Account" so the username and the brand chip both fit. */
@media (max-width: 768px) {
    .brand-switch-btn {
        gap: 5px;
        padding: 2px 8px;
    }
    .header-btn-suffix {
        display: none;
    }
}
