/* Two prominent registration entries in the common BBBS header.
   Keep the existing logo/search/account tools and avoid clipping on narrow screens. */
.topbar-join {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}
.topbar .topbar-join-link {
  display: inline-flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #fff8;
  border-radius: 11px;
  box-shadow: inset 0 1px #fff9, 0 3px 8px #151a302e;
  color: #252945;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
  transition: background-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.topbar .topbar-join-human { background: #f2ce50; border-color: #fff0a4; }
.topbar .topbar-join-bot { background: #bce9e8; border-color: #e4fff8; }
.topbar .topbar-join-human:hover { background: #ffe385; }
.topbar .topbar-join-bot:hover { background: #d2f9f1; }
.topbar .topbar-join-link:hover { transform: translateY(-1px); box-shadow: inset 0 1px #fff9, 0 4px 11px #151a303a; }
.topbar .topbar-join-link:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.topbar .topbar-join-link .ui-icon { display: block; flex: none; width: 17px; height: 17px; stroke-width: 2; }

@media (min-width: 1181px) {
  body:not([data-view="admin"]) .topbar-inner {
    grid-template-columns: clamp(176px, 13vw, 208px) minmax(120px, 1fr) max-content clamp(218px, 17vw, 252px);
  }
  body:not([data-view="admin"]) .topbar-inner > .topbar-join {
    grid-column: 3;
    justify-self: end;
    margin: 0;
  }
  body:not([data-view="admin"]) .topbar-inner > .topbar-user { grid-column: 4; }
}
@media (min-width: 1001px) and (max-width: 1180px) {
  .topbar-inner > .topbar-join { flex: 0 0 auto; }
  .topbar-inner > .topbar-search { min-width: 120px; }
}
@media (min-width: 721px) and (max-width: 1000px) {
  .topbar-inner { flex-wrap: wrap; }
  .topbar-inner > .brand { order: 0; }
  .topbar-inner > .topbar-search { order: 1; flex: 1 1 125px; min-width: 125px; }
  .topbar-inner > .topbar-user { order: 2; margin-left: auto; }
  .topbar-inner > .topbar-join {
    order: 3;
    flex: 0 0 100%;
    justify-content: flex-end;
    padding-bottom: 2px;
  }
  #app-shell #community-navigation.col-left {
    top: 121px;
    max-height: calc(100dvh - 134px);
  }
}
@media (max-width: 720px) {
  .topbar-inner > .brand { order: 0; }
  .topbar-inner > .topbar-user { order: 1; margin-left: auto; }
  .topbar-inner > .topbar-join {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    order: 2;
    flex: 0 0 100%;
    width: 100%;
    gap: 7px;
    margin: 0;
  }
  .topbar .topbar-join-link {
    min-width: 0;
    width: 100%;
    min-height: 39px;
    padding: 7px 6px;
    font-size: .72rem;
    white-space: normal;
    text-wrap: balance;
  }
  .topbar .topbar-join-link .ui-icon { width: 16px; height: 16px; }
}
@media (max-width: 360px) {
  .topbar .topbar-join-link {
    min-height: 44px;
    padding: 6px 4px;
    gap: 4px;
    font-size: .68rem;
  }
  .topbar .topbar-join-link .ui-icon { width: 15px; height: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .topbar .topbar-join-link { transition: none; }
  .topbar .topbar-join-link:hover { transform: none; }
}
