/* Wallet belongs to the right-hand brand group in the shared RTL header. */
.topbar .header-key-balance {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 42px;
    padding: 4px 10px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: rgba(16, 32, 59, .07);
    box-shadow: none;
    color: #344054 !important;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .16s, box-shadow .16s;
}
.topbar .header-key-balance img { display: block; flex: 0 0 auto; width: 28px; height: 28px; object-fit: contain; }
.topbar .header-key-balance strong { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.topbar .header-key-balance:hover { background: rgba(16, 32, 59, .12); color: #10203b !important; }
.topbar .header-key-balance:focus-visible { outline: 3px solid #0076a8; outline-offset: 3px; }
.compact-drawer-icon > svg, .drawer-icon > svg { width: 22px; height: 22px; }
body:is(.site-header-light-text, .figma-v18-body.header-clear):not(.video-library-body):not(.video-detail-body):not(.commerce-body) .topbar .header-key-balance { background: rgba(7, 19, 43, .42); color: #fff !important; }
body:is(.site-header-light-text, .figma-v18-body.header-clear):not(.video-library-body):not(.video-detail-body):not(.commerce-body) .topbar .header-key-balance:hover { background: rgba(7, 19, 43, .65); }
@media (max-width: 1080px) {
    .topbar:has(.header-key-balance) { grid-template-columns: minmax(0, 1fr) auto; }
    .topbar:has(.header-key-balance) .topbar-navigation { display: none; }
}
@media (max-width: 540px) {
    .topbar .header-key-balance { gap: 3px; min-height: 40px; padding: 4px 6px; border-radius: 11px; }
    .topbar .header-key-balance img { width: 28px; height: 28px; }
    .topbar .header-key-balance strong { font-size: 12px; }
    .header-key-label, .header-key-guest-label { display: none; }
    .topbar:has(.header-key-balance) .topbar-start { gap: 5px; }
    .topbar:has(.header-key-balance):has(.learning-status) .academy-brand-wordmark { display: none; }
    .topbar:has(.header-key-balance):has(.learning-status) .site-brand-logo { max-width: 30px; }
}
@media (max-width: 380px) {
    .topbar:has(.header-key-balance) .academy-brand-wordmark { display: none; }
    .topbar:has(.header-key-balance) .site-brand-logo { max-width: 30px; }
    .topbar:has(.header-key-balance) .topbar-actions { gap: 5px; }
    .topbar:has(.header-key-balance) .account-button { width: 36px; height: 36px; }
    .topbar:has(.header-key-balance) .learning-stat { flex-direction: column; gap: 0; padding: 2px 4px; min-height: 36px; }
    .topbar:has(.header-key-balance) .learning-stat-icon,
    .topbar:has(.header-key-balance) .learning-stat-icon svg { width: 16px; height: 16px; font-size: 13px; }
    .topbar:has(.header-key-balance) .learning-stat strong { font-size: .65rem; }
}
@media (prefers-reduced-motion: reduce) { .topbar .header-key-balance { transition: none; } }
