/* Keep the global shell geometrically stable while shared navigation/account scripts hydrate. */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar > .brand {
  flex: 0 0 auto;
  min-width: 190px;
}

.topbar > .nav {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
}

/* Legacy pages may still contain old links in their source. Never paint those links. */
.topbar:not([data-shell-ready="true"]) > .nav > * {
  display: none !important;
}

.topbar:not([data-shell-ready="true"]) > .site-nav-toggle {
  visibility: hidden;
}

/* Reserve the signed-in/account control footprint before site-account.js runs. */
@media (min-width: 1041px) {
  .topbar:not(:has(> .site-account-menu))::after {
    content: "";
    display: block;
    flex: 0 0 128px;
    width: 128px;
    height: 44px;
  }
}

@media (max-width: 1040px) {
  .topbar > .brand {
    min-width: 0;
  }

  .topbar > .nav {
    min-height: 0;
  }
}
