/* Shared desktop controls, with the same actions in the mobile account drawer. */
.topbar {
    min-height: 5.5rem;
    gap: 1rem;
    padding: 1rem clamp(1.25rem, 3vw, 2.5rem);
}
.topbar .workspace-heading { flex-basis: 11rem; gap: .7rem; }
.topbar .workspace-heading__icon { width: 40px; height: 40px; flex-basis: 40px; }
.topbar h1 { margin: 0; font-size: 1.35rem; line-height: 1.3; }
.user-menu .workspace-identity { display: flex; flex: 1 1 auto; align-items: center; gap: .65rem; min-width: 0; text-align: left; }
.user-menu .workspace-identity__image { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; overflow: hidden; border: 1px solid var(--slate-200); border-radius: .7rem; background: #f1f5fa; color: var(--navy-800); font-size: .85rem; font-weight: 750; }
.workspace-identity__image img { display: block; width: 100%; height: 100%; object-fit: contain; background: white; }
.workspace-identity--club .workspace-identity__image img { padding: .2rem; }
.user-menu .workspace-identity--coach .workspace-identity__image,
.user-menu .workspace-identity--athlete .workspace-identity__image { border-radius: 50%; }
.workspace-identity--coach .workspace-identity__image img,
.workspace-identity--athlete .workspace-identity__image img { object-fit: cover; }
.user-menu .workspace-identity--athlete .workspace-identity__image { flex-basis: 34px; width: 34px; height: 34px; border: 0; color: white; background: var(--navy-800); }
.workspace-identity__text { display: grid; gap: .2rem; min-width: 0; }
.workspace-identity__text strong { color: var(--navy-950); font-size: .85rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.user-menu .workspace-identity__text > span { color: var(--slate-500); font-size: .68rem; line-height: 1.4; }
.topbar > .user-menu { flex-wrap: nowrap; gap: 1rem; min-width: 0; }
.topbar .user-menu__context { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; min-width: 0; text-align: left; }
.topbar .club-switch-link {
    flex-direction: row;
    justify-content: space-between;
    gap: .8rem;
    height: 48px;
    max-width: 15rem;
    min-width: 0;
    padding: .35rem .75rem;
    border: 1px solid var(--slate-200);
    border-radius: .7rem;
    background: #f8fafc;
    color: var(--navy-950);
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
}
.club-switch-link__text { display: grid; gap: .1rem; min-width: 0; }
.topbar .club-switch-link__label { font-size: .63rem; font-weight: 600; line-height: 1.25; }
.topbar .club-switch-link strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy-950); font-size: .8rem; font-weight: 650; line-height: 1.4; }
.club-switch-link > svg { width: 16px; height: 16px; flex: 0 0 16px; }
.topbar .club-switch-link:hover { border-color: #c3cddd; background: #f1f5fa; }
.topbar .club-switch-name { display: block; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .75rem .85rem; border-radius: .7rem; background: #f8fafc; color: var(--slate-700); font-size: .8rem; font-weight: 600; }
.topbar .workspace-switcher { position: relative; display: block; min-width: 0; margin: 0; }
.topbar .workspace-switcher label { position: absolute; top: .35rem; left: .8rem; margin: 0; color: var(--slate-500); font-size: .63rem; line-height: 1.25; pointer-events: none; }
.topbar .workspace-switcher select {
    appearance: none;
    -webkit-appearance: none;
    width: 12.5rem;
    max-width: 100%;
    height: 48px;
    padding: 1.15rem 2rem .3rem .75rem;
    border: 1px solid var(--slate-200);
    border-radius: .7rem;
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .7rem center / 16px;
    color: var(--navy-950);
    font-family: inherit;
    font-size: .8rem;
    font-weight: 650;
    line-height: 1.4;
    cursor: pointer;
}
.topbar .workspace-switcher select:hover { border-color: #c3cddd; }
.workspace-account { position: relative; flex: 0 0 auto; min-width: 0; }
.workspace-account__summary { display: flex; align-items: center; gap: .6rem; min-height: 48px; max-width: 18rem; padding: .25rem .5rem .25rem .3rem; border: 1px solid transparent; border-radius: .8rem; list-style: none; cursor: pointer; color: var(--navy-950); }
.workspace-account__summary::-webkit-details-marker { display: none; }
.workspace-account__summary::marker { content: ''; }
.workspace-account__summary:hover,
.workspace-account[open] > summary { background: #f2f5f9; border-color: var(--slate-200); }
.workspace-account__summary .workspace-account__avatar { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; color: white; background: var(--navy-800); font-size: .85rem; font-weight: 700; }
.workspace-account__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; font-weight: 650; }
.workspace-account__chevron { flex: 0 0 15px; width: 15px; height: 15px; color: var(--slate-500); transition: transform .15s ease; }
.workspace-account[open] .workspace-account__chevron { transform: rotate(180deg); }
.workspace-account__panel { position: absolute; z-index: 100; top: calc(100% + .6rem); right: 0; width: min(19rem, calc(100vw - 2rem)); padding: .5rem; border: 1px solid var(--slate-200); border-radius: .9rem; background: white; box-shadow: 0 12px 36px rgb(7 22 47 / 12%); }
.workspace-account__panel .user-menu__identity { display: grid; gap: .25rem; max-width: none; padding: .7rem .65rem .85rem; margin-bottom: .35rem; border-bottom: 1px solid var(--slate-200); text-align: left; line-height: 1.45; }
.workspace-account__panel .user-menu__identity strong { color: var(--navy-950); font-size: .85rem; font-weight: 650; }
.workspace-account__panel .user-menu__email { color: var(--slate-500); font-size: .75rem; }
.workspace-account__panel .pwa-install-link,
.workspace-account__link,
.workspace-account__logout { display: flex; align-items: center; justify-content: flex-start; gap: .65rem; width: 100%; min-height: 44px; margin: 0; padding: .65rem; border: 0; border-radius: .5rem; background: transparent; color: var(--slate-700); text-align: left; text-decoration: none; font: inherit; font-size: .82rem; font-weight: 550; line-height: 1.4; cursor: pointer; }
.workspace-account__panel .pwa-install-link:hover,
.workspace-account__link:hover,
.workspace-account__logout:hover { background: #f2f5f9; text-decoration: none; }
.workspace-account__link > svg,
.workspace-account__logout > svg { width: 21px; height: 21px; flex: 0 0 21px; }
.topbar :is(.club-switch-link, .workspace-switcher select, .workspace-account__summary, .workspace-account__link, .workspace-account__logout):focus-visible { outline: 2px solid var(--blue-600); outline-offset: 3px; }
@media (min-width: 901px) and (max-width: 1200px) {
    .workspace-account__name,
    .workspace-identity--athlete .workspace-identity__text { display: none; }
    .topbar > .user-menu { gap: .6rem; }
    .topbar .club-switch-link { max-width: 12rem; }
    .topbar .workspace-switcher select { width: 11rem; }
}
@media (max-width: 900px) {
    .mobile-nav-panel .workspace-account__panel > .workspace-identity { padding: .35rem 0 .75rem; }
    .mobile-nav-panel .workspace-identity__text strong { color: white; font-size: .9rem; }
    .mobile-nav-panel .user-menu .workspace-identity__text > span { color: #c4cfdf; font-size: .75rem; }
    .mobile-nav-panel .workspace-account { display: none; }
    .mobile-nav-panel .user-menu .user-menu__context { display: flex; flex-direction: column; align-items: stretch; gap: .5rem; }
    .mobile-nav-panel .club-switch-link { flex-direction: row; align-items: center; justify-content: space-between; gap: .5rem; max-width: 100%; }
    .mobile-nav-panel .club-switch-link__label { color: #c4cfdf; font-size: .75rem; }
    .mobile-nav-panel .club-switch-link strong { color: white; font-size: .9rem; font-weight: 600; }
    .mobile-nav-panel .club-switch-name { color: #c4cfdf; }
    .mobile-nav-panel .workspace-account__panel { position: static; width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
    .mobile-nav-panel .workspace-account__panel .user-menu__identity { padding: .35rem 0 .75rem; border-color: rgb(255 255 255 / 12%); }
    .mobile-nav-panel .workspace-account__panel .user-menu__identity strong { color: white; }
    .mobile-nav-panel .workspace-account__panel .user-menu__email { color: #c4cfdf; }
    .mobile-nav-panel .workspace-account__panel .pwa-install-link,
    .mobile-nav-panel .workspace-account__link,
    .mobile-nav-panel .workspace-account__logout { padding-inline: 0; color: #c4cfdf; font-size: .9rem; }
    .mobile-nav-panel .workspace-account__panel .pwa-install-link:hover,
    .mobile-nav-panel .workspace-account__link:hover,
    .mobile-nav-panel .workspace-account__logout:hover { background: rgb(255 255 255 / 6%); }
}
@media (max-width: 620px) {
    .topbar > .user-menu { flex-wrap: wrap; }
    .topbar .user-menu__context { flex: 1 1 100%; }
    .topbar .club-switch-link,
    .topbar .workspace-switcher { flex: 1 1 9rem; max-width: 100%; }
    .topbar .workspace-switcher select { width: 100%; }
    .topbar .workspace-account { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
    .workspace-account__chevron { transition: none; }
}
