@media (min-width: 1024px) {
  .tc-topbar > .max-w-6xl {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 16px;
    row-gap: 0;
  }

  .tc-topbar__left {
    justify-self: start;
    min-width: 0;
  }

  .tc-topbar__center {
    justify-self: center;
    width: auto !important;
    max-width: 100%;
  }

  .tc-topbar__right {
    justify-self: end;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
  }

  .tc-topbar__right #userName {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.tc-topbar {
  position: sticky;
  top: 0;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
  will-change: transform;
}

.tc-topbar.is-scrolled {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.tc-topbar.is-scrolled > .max-w-6xl {
  padding-top: 0.45rem !important;
  padding-bottom: 0.45rem !important;
}

.tc-topbar.is-hidden {
  transform: translateY(-110%);
}

@media (prefers-reduced-motion: reduce) {
  .tc-topbar {
    transition: none;
  }
}

#portalMenu[data-open="0"],
#worldMenu[data-open="0"] {
  display: none;
}

#portalMenu[data-open="1"],
#worldMenu[data-open="1"] {
  display: block;
}

@media (max-width: 520px) {
  .tc-topbar > .max-w-6xl,
  .tc-topbar > .tc-shell {
    flex-wrap: wrap;
    row-gap: 8px;
    column-gap: 8px;
  }

  .tc-topbar > .max-w-6xl > :nth-child(1),
  .tc-topbar > .tc-shell > :nth-child(1) {
    order: 1;
    min-width: 0;
  }

  .tc-topbar > .max-w-6xl > :nth-child(2),
  .tc-topbar > .tc-shell > :nth-child(2) {
    order: 3;
    flex: 1 1 100%;
    min-width: 0;
  }

  .tc-topbar > .max-w-6xl > :nth-child(3),
  .tc-topbar > .tc-shell > :nth-child(3) {
    order: 2;
    margin-left: auto;
  }

  .tc-topbar #portalSwitcher,
  .tc-topbar #portalBtn {
    width: 100%;
    max-width: 100%;
  }

  .tc-topbar [data-i18n="topbar.slogan"] {
    display: none;
  }

  .tc-topbar .tc-brand {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #topbarAuthSlot #userName {
    display: none;
  }

  .tc-topbar a,
  .tc-topbar button {
    min-height: 40px;
  }
}
