.language-switcher {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  margin-left: 2px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.main-nav .language-switcher a,
.commercial-main-nav .language-switcher a {
  min-width: 28px;
  padding: 6px 7px !important;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  border: 0;
  border-radius: 999px;
}

.main-nav .language-switcher a:hover,
.main-nav .language-switcher a[aria-current="page"],
.commercial-main-nav .language-switcher a:hover,
.commercial-main-nav .language-switcher a[aria-current="page"] {
  color: var(--navy);
  background: var(--yellow);
  border: 0;
}

@media (max-width: 1180px) {
  .language-switcher {
    align-self: flex-start;
    margin: 6px 0 2px;
  }

  .main-nav .language-switcher a,
  .commercial-main-nav .language-switcher a {
    padding: 7px 9px !important;
  }
}

/* Latin copy must wrap at word boundaries. The Chinese shell deliberately uses
   aggressive character wrapping on small screens, which is not suitable for
   English or Spanish. */
html:lang(en) h1,
html:lang(en) h2,
html:lang(en) h3,
html:lang(en) p,
html:lang(en) li,
html:lang(en) dd,
html:lang(es) h1,
html:lang(es) h2,
html:lang(es) h3,
html:lang(es) p,
html:lang(es) li,
html:lang(es) dd {
  word-break: normal !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
}

/* Latin navigation labels need a compact desktop transition before the
   shared Chinese shell changes to the mobile menu at 1020px. */
@media (min-width: 1021px) and (max-width: 1380px) {
  html:lang(en) .nav-inner,
  html:lang(es) .nav-inner {
    width: min(100% - 28px, var(--container)) !important;
    gap: 8px !important;
  }

  html:lang(en) .site-header .brand,
  html:lang(es) .site-header .brand {
    min-width: 140px !important;
    gap: 8px !important;
  }

  html:lang(en) .main-nav,
  html:lang(es) .main-nav {
    gap: 5px !important;
    font-size: 12px !important;
  }

  html:lang(en) .main-nav .nav-cta,
  html:lang(es) .main-nav .nav-cta {
    min-width: 0 !important;
    padding-inline: 8px !important;
  }

  html:lang(es) .nav-toggle {
    display: inline-grid !important;
    place-items: center;
  }

  html:lang(es) .main-nav {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 72px !important;
    display: none !important;
    padding: 18px 20px 24px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    background: var(--navy) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  }

  html:lang(es) .main-nav.open {
    display: flex !important;
  }

  html:lang(es) .main-nav a {
    padding: 10px 0 !important;
  }

  html:lang(es) .main-nav .nav-cta {
    width: 100% !important;
  }
}

/* At the narrow end of the desktop range, English labels no longer have
   enough room to remain readable as a single row. Use the same accessible
   menu pattern as Spanish before any horizontal scrolling can appear. */
@media (min-width: 1021px) and (max-width: 1279px) {
  html:lang(en) .nav-toggle {
    display: inline-grid !important;
    place-items: center;
  }

  html:lang(en) .main-nav {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 72px !important;
    display: none !important;
    padding: 18px 20px 24px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    background: var(--navy) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  }

  html:lang(en) .main-nav.open {
    display: flex !important;
  }

  html:lang(en) .main-nav a {
    padding: 10px 0 !important;
  }

  html:lang(en) .main-nav .nav-cta {
    width: 100% !important;
  }
}

@media (max-width: 980px) {
  .commercial-main-nav .language-switcher {
    display: flex;
    width: fit-content;
  }
}

@media (max-width: 700px) {
  html:lang(en) .commercial-mobile-cta:has(> a:nth-child(4)),
  html:lang(es) .commercial-mobile-cta:has(> a:nth-child(4)) {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  html:lang(en) .commercial-mobile-cta:has(> a:nth-child(4)) > a,
  html:lang(es) .commercial-mobile-cta:has(> a:nth-child(4)) > a {
    min-width: 0;
    padding: 7px 4px;
    font-size: 12px;
    line-height: 1.18;
  }

  html:lang(en) .cta-strip,
  html:lang(es) .cta-strip {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden;
  }

  html:lang(en) .cta-strip > *,
  html:lang(es) .cta-strip > *,
  html:lang(en) .cta-strip .section-actions,
  html:lang(es) .cta-strip .section-actions,
  html:lang(en) .cta-strip .btn,
  html:lang(es) .cta-strip .btn {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html:lang(en) .cta-strip .btn,
  html:lang(es) .cta-strip .btn {
    white-space: normal !important;
    text-align: center;
  }
}
@media (max-width: 640px) {
  html:lang(en) .support-policy-topic strong,
  html:lang(es) .support-policy-topic strong {
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
}
