/* Keep account/sign-out reachable without changing saved themes or browser zoom.
   A versioned URL bypasses the long-lived production asset cache. */
.app-shell-v2 .app-desktop-topbar {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    container: app-command-bar / inline-size;
}
.app-shell-v2 .app-topbar-context { display: none; }
.app-shell-v2 .app-topbar-actions { flex: 0 0 auto; min-width: 0; }
.app-shell-v2 .app-topbar-actions > * { flex-shrink: 0; }
.app-shell-v2 .app-topbar-search-slot {
    flex: 1 1 18rem;
    min-width: 2.5rem;
    max-width: 18rem;
    margin-inline-start: auto;
}
.app-shell-v2 .app-topbar-search-slot > ui-tooltip { display: block; width: 100%; }
.app-shell-v2 .app-topbar-search {
    max-width: 100%;
}
/* Important declarations in a cascade layer outrank unlayered important
   declarations. Override the legacy forced width in its own layer. */
@layer components {
    .app-shell-v2 .app-topbar-search {
        width: 100% !important;
        min-width: 0 !important;
    }
}
.app-shell-v2 .app-topbar-search > span {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    flex: 1 1 auto;
}
.app-shell-v2 .app-topbar-search > span > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-shell-v2 .app-topbar-search kbd { flex-shrink: 0; }
.app-shell-v2 .app-topbar-utils { flex: 0 0 auto; min-width: max-content; }
.app-shell-v2 .app-topbar-utils > * { flex-shrink: 0; }
.app-shell-v2 .app-topbar-utility-label { display: none; }

/* Respond to the actual header space (sidebar + zoom), not monitor size. */
@container app-command-bar (max-width: 58rem) {
    .app-shell-v2 .app-command-action-step { width: 2.25rem; padding-inline: 0; gap: 0; }
    .app-shell-v2 .app-command-action-step > span { display: none; }
}
@container app-command-bar (max-width: 44rem) {
    .app-shell-v2 .app-topbar-search-slot { flex: 0 0 2.5rem; margin-inline-start: auto; }
    .app-shell-v2 .app-topbar-search { justify-content: center; padding-inline: 0; gap: 0; }
    .app-shell-v2 .app-topbar-search > span { display: none; }
    .app-shell-v2 .app-topbar-utils { gap: .25rem; padding-inline-start: .5rem; }
}
@container app-command-bar (min-width: 85rem) {
    .app-shell-v2 .app-topbar-context { display: grid; flex: 0 0 auto; }
    .app-shell-v2 .app-topbar-utility-label { display: inline; }
}

/* Safe fallback for browsers without container queries. All links keep their
   accessible names and hover descriptions when their text becomes compact. */
@media (min-width: 1024px) and (max-width: 1279px) {
    .app-shell-v2 .app-command-action-step { width: 2.25rem; padding-inline: 0; gap: 0; }
    .app-shell-v2 .app-command-action-step > span { display: none; }
    .app-shell-v2 .app-topbar-search-slot { flex: 0 0 2.5rem; }
    .app-shell-v2 .app-topbar-search { justify-content: center; padding-inline: 0; gap: 0; }
    .app-shell-v2 .app-topbar-search > span { display: none; }
}
