.v5-site-navigation {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 8px;
  flex: 0 0 auto;
}

.v5-site-nav-link {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #d7e0e6;
  border-radius: 8px;
  background: #fff;
  color: #415766;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.v5-site-nav-link:hover:not(:disabled) {
  border-color: #aebfc9;
  background: #f7fafb;
}

.v5-site-nav-link.primary {
  border-color: #1f6b66;
  background: #1f6b66;
  color: #fff;
}

.v5-site-nav-link.primary:hover:not(:disabled) {
  border-color: #185954;
  background: #185954;
}

.v5-site-nav-link:disabled {
  cursor: wait;
  opacity: .65;
}

#authGateWebsiteLink {
  margin-top: 8px;
}

/* The topbar's own controls need ~1123px before the site navigation is even
   counted, so a single hard breakpoint at 900px left every viewport between
   900 and 1123 -- 1024x768 among them -- scrolling the whole document
   horizontally on every stage. Let both rows wrap at any width instead, so
   the bar reflows continuously rather than only under one breakpoint. */
.v5-topbar {
  flex-wrap: wrap;
  height: auto;
  min-height: var(--topbar);
  row-gap: 6px;
}

.v5-context,
.v5-topbar-right {
  flex-wrap: wrap;
  min-width: 0;
}

@media (max-width: 1150px) {
  .v5-topbar {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .v5-site-navigation {
    order: 20;
    width: 100%;
    justify-content: flex-end;
    margin: 6px 0 0;
  }
}

@media (max-width: 600px) {
  .v5-site-navigation {
    justify-content: stretch;
  }
  .v5-site-nav-link {
    flex: 1;
  }
}
