/* Keep the brand, navigation and actions balanced across the public pages. */
.site-monochrome .help-nav { height: auto; }

html .site-monochrome .site-navigation {
  --site-compact-nav: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 1720px;
  height: 72px;
  min-height: 72px;
  margin-inline: auto;
  padding: 0 32px;
  gap: 16px;
}

html .site-monochrome .site-navigation > :is(.nav-logo, .brand) {
  flex: 0 0 auto;
  margin: 0;
}

html .site-monochrome .site-navigation > .nav-links {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin: 0 24px;
  white-space: nowrap;
}

html .site-monochrome .site-navigation .nav-links > :is(a, button) {
  flex-shrink: 0;
  font-size: 14px;
  letter-spacing: 0;
}

html .site-monochrome .site-navigation .nav-auth-trigger.is-authed {
  min-height: 38px;
}

html .site-monochrome .site-navigation .nav-auth-name {
  max-width: 80px;
}

html .site-monochrome .site-navigation > :is(.nav-cta, .download-btn, .invite-cta, .telegram-contact-trigger),
html .site-monochrome .site-navigation .i18n-language-button {
  box-sizing: border-box;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-height: 40px;
  padding: 0 16px;
  gap: 8px;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

html .site-monochrome .site-navigation > .i18n-language-switcher {
  margin: 0;
  order: 0;
}

html .site-monochrome .site-navigation .i18n-language-button {
  padding-inline: 12px;
  font-size: 12px;
}

html .site-monochrome .site-navigation > .nav-x-link {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
}

/* Reserve breathing room for the longer English labels and account badges. */
@media (max-width: 1480px) {
  html .site-monochrome .site-navigation > .nav-links {
    gap: 24px;
    margin-inline: 16px;
  }
}

@media (max-width: 1399px) {
  html .site-monochrome:not(.page-home) .site-navigation { --site-compact-nav: 1; }
  html .site-monochrome:not(.page-home) .site-navigation > .nav-links {
    display: none;
  }
  html .site-monochrome:not(.page-home) .site-navigation > :is(.nav-logo, .brand) {
    margin-right: auto;
  }
}

@media (max-width: 1679px) {
  html:is([data-locale="en"], [data-locale="vi"]) .site-monochrome:not(.page-home) .site-navigation { --site-compact-nav: 1; }
  html:is([data-locale="en"], [data-locale="vi"]) .site-monochrome:not(.page-home) .site-navigation > .nav-links {
    display: none;
  }
  html:is([data-locale="en"], [data-locale="vi"]) .site-monochrome:not(.page-home) .site-navigation > :is(.nav-logo, .brand) {
    margin-right: auto;
  }
}

@media (max-width: 1535px) {
  html[data-locale="ko"] .site-monochrome:not(.page-home) .site-navigation { --site-compact-nav: 1; }
  html[data-locale="ko"] .site-monochrome:not(.page-home) .site-navigation > .nav-links { display:none; }
  html[data-locale="ko"] .site-monochrome:not(.page-home) .site-navigation > :is(.nav-logo,.brand) { margin-right:auto; }
}

@media (max-width: 1279px) {
  html .site-monochrome .site-navigation { --site-compact-nav: 1; }
  html .site-monochrome .site-navigation > .nav-links {
    display: none;
  }
  html .site-monochrome .site-navigation > :is(.nav-logo, .brand) {
    margin-right: auto;
  }
}

/* Compact layouts retain every navigation action in an accessible disclosure. */
html .site-monochrome .site-navigation .site-menu-toggle { display: none; }
html .site-monochrome .site-navigation.is-compact { position: relative; }
html .site-monochrome .site-navigation.is-compact > :is(.nav-logo, .brand) {
  flex-shrink: 1;
  min-width: 0;
}
html .site-monochrome .site-navigation.is-compact > :is(.nav-logo, .brand) img {
  max-width: 100%;
  height: auto;
}
html .site-monochrome .site-navigation.is-compact .site-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 34px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
html .site-monochrome .site-navigation .site-menu-toggle svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
}
html .site-monochrome .site-navigation.is-compact.is-menu-open > .nav-links {
  display: flex;
  position: absolute;
  inset: 100% 12px auto;
  z-index: 80;
  flex-direction: column;
  align-items: stretch;
  margin: 0;
  padding: 12px;
  gap: 4px;
  max-height: min(70vh, 520px);
  overflow: auto;
  border: 1px solid rgba(100,116,139,.35);
  border-radius: 12px;
  background: #101319;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.16);
  white-space: normal;
}
html .site-monochrome .site-navigation.is-compact.is-menu-open > .nav-links > :is(a, button) {
  display: block;
  flex-shrink: 0;
  min-height: 40px;
  height: auto;
  padding: 10px 12px;
  text-align: start;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Compact the long download/contact labels before they reach the screen edge. */
@media (max-width: 768px) {
  html .site-monochrome .site-navigation > :is(.nav-cta, .download-btn, .invite-cta, .telegram-contact-trigger) {
    order: 0;
    flex: 0 0 40px;
    width: 40px;
    padding: 0;
    gap: 0;
    font-size: 0;
  }
  html .site-monochrome .site-navigation > :is(.download-btn, .telegram-contact-trigger) > span {
    display: none;
  }
}

@media (max-width: 640px) {
  html .site-monochrome .site-navigation {
    height: 64px;
    min-height: 64px;
    padding-inline: 20px;
    gap: 12px;
  }
}

@media (max-width: 560px) {
  html .site-monochrome .site-navigation {
    padding-inline: 16px;
    gap: 8px;
  }
  html .site-monochrome .site-navigation > :is(.nav-cta, .download-btn, .invite-cta, .telegram-contact-trigger, .nav-x-link) {
    order: 0;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    gap: 0;
    font-size: 0;
  }
  html .site-monochrome .site-navigation .i18n-language-button {
    height: 34px;
    min-height: 34px;
    padding-inline: 10px;
  }
}

/* Keep the full native language name beside the compact actions at 320px. */
@media (max-width: 360px) {
  html .site-monochrome .site-navigation {
    padding-inline: 12px;
    gap: 6px;
  }
}
