.cb-acct { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }

.cb-acct-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    height: 40px; padding: 0 .85rem;
    border: 1px solid var(--cb-line); border-radius: var(--r-sm, 10px);
    background: transparent; color: var(--cb-ink);
    font-family: inherit; font-size: 1rem; font-weight: 700; line-height: 1;
    white-space: nowrap; text-decoration: none;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}
.cb-acct-btn:hover { color: var(--cb-ink); background: var(--cb-surface-2); }
.cb-acct-btn--primary { border-color: transparent; background: var(--cb-accent-fill, var(--cb-accent)); color: var(--cb-on-fill, #fff); }
.cb-acct-btn--primary:hover { background: var(--cb-accent-fill-hover, var(--cb-accent-hi)); color: var(--cb-on-fill, #fff); }
[data-bs-theme="dark"] .cb-acct-btn--primary:hover { background: var(--cb-accent-fill-hover, var(--cb-accent)); box-shadow: 0 0 0 3px var(--cb-accent-bg); }

.cb-acct-icon, .cb-acct-user {
    display: inline-flex; align-items: center; gap: .5rem; height: 40px;
    border: 1px solid var(--cb-line); border-radius: var(--r-sm, 10px);
    background: transparent; color: var(--cb-body);
    font-family: inherit; font-size: 1rem; line-height: 1; cursor: pointer;
    transition: color .18s ease, background-color .18s ease;
}
.cb-acct-icon { width: 40px; padding: 0; justify-content: center; font-size: 1.15rem; }
.cb-acct-user { max-width: 15rem; padding-block: 0; padding-inline: .3rem .65rem; color: var(--cb-ink); border-color: transparent; }
.cb-acct-icon:hover, .cb-acct-user:hover,
.cb-acct-icon.show, .cb-acct-user.show { color: var(--cb-ink); background: var(--cb-surface-2); }

.cb-avatar {
    flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
    display: inline-grid; place-items: center;
    background: var(--cb-accent-bg); color: var(--cb-accent-text, var(--cb-accent-hi));
    font-size: .95rem; font-weight: 700; line-height: 1;
}
.cb-acct-name { min-width: 0; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-acct-caret { font-size: .7rem; opacity: .7; }
.cb-acct-compact { display: none; }

.cb-acct-menu { min-width: 15rem; max-width: min(22rem, calc(100vw - 32px)); }
.cb-acct-head { display: grid; gap: .15rem; padding: .35rem .6rem .5rem; line-height: 1.3; }
.cb-acct-head-name { color: var(--cb-ink); font-weight: 700; overflow-wrap: anywhere; }
.cb-acct-head-mail { color: var(--cb-muted); font-size: .88em; overflow-wrap: anywhere; }
.cb-acct-menu .dropdown-item { display: flex; align-items: center; gap: .6rem; }
.cb-acct-menu .dropdown-item > .bi { flex: 0 0 auto; width: 1.1em; text-align: center; }
.cb-acct-menu form { margin: 0; }
.cb-nav .cb-acct-menu.show, .cb-nav .navbar-nav .cb-acct-menu.show { display: block; }

.cb-acct-btn:focus-visible, .cb-acct-icon:focus-visible, .cb-acct-user:focus-visible {
    outline: 2px solid var(--cb-accent-hi); outline-offset: 2px; box-shadow: none;
}

@media (min-width: 1200px) {
    .cb-acct--nav { margin-inline-start: .5rem; }
}
@media (min-width: 1200px) and (max-width: 1279.98px) {
    .cb-acct--nav > .cb-acct-btn--primary { display: none; }
    .cb-acct--nav .cb-acct-user { width: 40px; padding: 0; justify-content: center; }
    .cb-acct--nav .cb-acct-name, .cb-acct--nav .cb-acct-caret { display: none; }
}
@media (max-width: 1199.98px) {
    .cb-acct--nav { padding: .75rem 0 .5rem; }
    .cb-acct--nav > .cb-acct-btn { flex: 1 1 0; min-width: 0; height: 44px; }
    .cb-acct--nav.dropdown { display: block; }
    .cb-acct--nav .cb-acct-user { width: 100%; max-width: none; height: 44px; padding-inline: .8rem; border-color: transparent; }
    .cb-acct--nav .cb-acct-name { max-width: none; flex: 1 1 auto; text-align: start; }
}

.cb-acct--bar .cb-acct-btn, .cb-acct--bar .cb-acct-icon, .cb-acct--bar .cb-acct-user { height: 38px; }
.cb-acct--bar .cb-acct-icon { width: 38px; }
@media (max-width: 1399.98px) {
    .cb-acct--bar > .cb-acct-btn { display: none; }
    .cb-acct--bar > .cb-acct-compact { display: block; }
    .cb-acct--bar .cb-acct-user { width: 38px; padding: 0; justify-content: center; }
    .cb-acct--bar .cb-acct-name, .cb-acct--bar .cb-acct-caret { display: none; }
}

[dir="rtl"] .cb-acct .bi-box-arrow-in-right,
[dir="rtl"] .cb-acct .bi-box-arrow-right { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .cb-nav .cb-acct-menu[data-bs-popper] { right: auto; left: 0; }

@media (prefers-reduced-motion: reduce) {
    .cb-acct-btn, .cb-acct-icon, .cb-acct-user { transition: none; }
}
