/* Shared header popovers: compact corners, readable rows and viewport-safe sizing. */
.fxm-site-header [data-fxm-lang-panel],
.fxm-site-header [data-fxm-user-menu-dropdown] {
  box-sizing: border-box;
  border: 1px solid #e6e8ef;
  border-radius: 8px;
  background: #fff;
  padding: 5px;
  box-shadow: 0 12px 32px -8px rgba(39,46,66,.16), 0 2px 6px rgba(39,46,66,.04);
  max-height: calc(100vh - 104px);
  max-height: calc(100dvh - 104px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.fxm-site-header [data-fxm-lang-panel] { width: 168px; }
.fxm-site-header [data-fxm-user-menu-dropdown] { width: 168px; border-radius: 10px; }
.fxm-site-header [data-fxm-lang-menu].invisible,
.fxm-site-header [data-fxm-user-menu-dropdown].invisible { pointer-events: none; }
.fxm-site-header [data-fxm-lang-menu],
.fxm-site-header [data-fxm-user-menu-dropdown] {
  transition-property: opacity, visibility;
  transition-duration: 160ms;
}
.fxm-site-header [data-fxm-lang-panel] a,
.fxm-site-header [data-fxm-user-menu-dropdown] a,
.fxm-site-header [data-fxm-user-menu-dropdown] button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 8px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  text-align: start;
  overflow-wrap: anywhere;
  transition: color 140ms ease, background-color 140ms ease;
}
.fxm-site-header [data-fxm-lang-panel] a + a { margin-top: 3px; }
.fxm-site-header [data-fxm-lang-panel] a:hover,
.fxm-site-header [data-fxm-user-menu-dropdown] a:hover {
  color: var(--color-primary, #4f34d9);
  background: #f6f5fc;
}
.fxm-site-header [data-fxm-lang-panel] a[aria-current] {
  color: var(--color-primary, #4f34d9);
  background: #f0edff;
}

.fxm-site-header [data-fxm-user-menu-dropdown] > div:first-child {
  padding: 8px 8px 10px;
  margin: 0 0 6px;
  border-color: #eceef4;
}
.fxm-site-header [data-fxm-user-menu-dropdown] > div:not(:first-child):not(:last-child) { padding: 3px 0; }
.fxm-site-header [data-fxm-user-menu-dropdown] > div:last-child {
  margin-top: 6px;
  padding-top: 6px;
  border-color: #eceef4;
}
.fxm-site-header [data-fxm-user-menu-dropdown] svg { flex-shrink: 0; width: 16px; height: 16px; }
.fxm-site-header [data-fxm-user-logout]:hover { color: #c92a36; background: #fff1f2; }
.fxm-site-header [data-fxm-lang-panel] a:focus-visible,
.fxm-site-header [data-fxm-user-menu-dropdown] a:focus-visible,
.fxm-site-header [data-fxm-user-menu-dropdown] button:focus-visible {
  outline: 2px solid var(--color-primary, #4f34d9);
  outline-offset: -2px;
  background: #f4f1ff;
}
@media (max-width: 480px) {
  .fxm-site-header [data-fxm-lang-menu] {
    position: fixed;
    top: 72px;
    right: 16px;
    left: auto;
    width: min(168px, calc(100vw - 32px));
    padding-top: 8px;
  }
  .fxm-site-header [data-fxm-lang-panel] { width: 100%; }
  .fxm-site-header [data-fxm-user-menu-dropdown] {
    position: fixed;
    top: 80px;
    right: 16px;
    left: auto;
    width: min(168px, calc(100vw - 32px));
    margin-top: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fxm-site-header [data-fxm-lang-menu],
  .fxm-site-header [data-fxm-user-menu-dropdown],
  .fxm-site-header [data-fxm-lang-panel] a,
  .fxm-site-header [data-fxm-user-menu-dropdown] a,
  .fxm-site-header [data-fxm-user-menu-dropdown] button { transition: none; }
}

.fxm-site-header .fxm-language-flag {
  flex: 0 0 20px;
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(39,46,66,.1);
}
.fxm-site-header .fxm-language-name { flex: 1; min-width: 0; }
.fxm-site-header .fxm-language-check { flex-shrink: 0; opacity: 0; }
.fxm-site-header [aria-current="true"] .fxm-language-check { opacity: 1; }
.fxm-site-header [data-fxm-header-email] { margin-top: 4px; }
@media (hover: hover) {
  .fxm-site-header [data-fxm-user-menu].is-open::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 0;
    width: 168px;
    height: 10px;
  }
}

/* Section disclosures keep the text link usable and give each category its own
   compact panel. The final toggle opens the complete navigation and App panel. */
.fxm-site-header [data-fxm-mega-nav] { position: relative; padding: 4px; gap: 2px; }
.fxm-site-header .fxm-nav-item {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  border-radius: 999px;
  transition: background-color 160ms ease;
}
.fxm-site-header .fxm-nav-item > [data-fxm-subnav-link] {
  padding: 8px 3px 8px 12px;
  white-space: nowrap;
}
.fxm-site-header .fxm-nav-submenu-toggle {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 32px;
  margin-right: 3px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(39,46,66,.45);
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}
.fxm-site-header .fxm-nav-submenu-toggle svg { width: 11px; height: 11px; transition: transform 160ms ease; }
.fxm-site-header .fxm-nav-item:hover,
.fxm-site-header .fxm-nav-item.is-open { background: #f4f1ff; }
.fxm-site-header .fxm-nav-item.is-open > [data-fxm-subnav-link],
.fxm-site-header .fxm-nav-submenu-toggle:hover,
.fxm-site-header .fxm-nav-submenu-toggle[aria-expanded="true"] { color: var(--color-primary, #4f34d9); }
.fxm-site-header .fxm-nav-submenu-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.fxm-site-header .fxm-nav-submenu-toggle:focus-visible,
.fxm-site-header [data-fxm-subnav-link]:focus-visible {
  outline: 2px solid var(--color-primary, #4f34d9);
  outline-offset: -2px;
}
.fxm-site-header .fxm-nav-submenu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 60;
  padding-top: 16px;
  /* Visibility changes immediately so the first keyboard action can receive
     focus in the same event; opacity alone handles the entrance. */
  transition: opacity 160ms ease;
}
.fxm-site-header .fxm-nav-submenu.invisible { visibility: hidden; pointer-events: none; }
.fxm-site-header .fxm-nav-submenu-box {
  box-sizing: border-box;
  width: 304px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 104px);
  max-height: calc(100dvh - 104px);
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #e6e8ef;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px -12px rgba(39,46,66,.20), 0 2px 6px rgba(39,46,66,.05);
}
.fxm-site-header .fxm-nav-submenu-box.is-tools { width: 510px; }
.fxm-site-header .fxm-header-login-icon { display: none; }
.fxm-site-header .fxm-nav-submenu-box .fxm-nav-mega-col {
  padding: 0;
  border: 0;
  max-height: none;
  overflow: visible;
}
@media (min-width: 768px) and (max-width: 1099.98px) {
  .fxm-site-header .fxm-nav-item > [data-fxm-subnav-link] { padding-left: 9px; font-size: 13px; }
  .fxm-site-header .fxm-nav-submenu-toggle { width: 21px; margin-right: 1px; }
}
/* Keep all four section names readable on tablet widths, including Thai and
   Vietnamese. Secondary account labels give way to their named icon button. */
@media (min-width: 768px) and (max-width: 1279.98px) {
  .fxm-site-header [data-fxm-header-bar] { padding-inline: 16px; gap: 8px; }
  .fxm-site-header [data-fxm-header-bar] > div:first-child img { width: clamp(116px, 12vw, 144px); height: auto; }
  .fxm-site-header [data-fxm-header-bar] > div:nth-child(2) { padding-inline: 0; }
  .fxm-site-header [data-fxm-mega-nav] { gap: 0; padding: 4px; }
  .fxm-site-header .fxm-nav-item > [data-fxm-subnav-link] { padding-left: 7px; padding-right: 1px; font-size: clamp(12px, 1.25vw, 14px); }
  .fxm-site-header .fxm-nav-submenu-toggle { width: 24px; }
  .fxm-site-header .fxm-nav-mega-toggle { width: 32px; height: 36px; }
  .fxm-site-header .fxm-header-end { gap: 6px; }
  .fxm-site-header [data-fxm-ai-open],
  .fxm-site-header [data-fxm-lang-trigger] { width: 36px; height: 36px; }
}
@media (min-width: 768px) and (max-width: 959.98px) {
  .fxm-site-header [data-fxm-auth-guest] { gap: 6px; }
  .fxm-site-header [data-fxm-auth-guest] > a { display: inline-flex; width: 36px; height: 36px; justify-content: center; padding: 0; gap: 0; }
  .fxm-site-header .fxm-header-login-icon { display: block; }
  .fxm-site-header .fxm-header-login-label,
  .fxm-site-header .fxm-header-register-label,
  .fxm-site-header [data-fxm-header-nickname],
  .fxm-site-header [data-fxm-user-menu-trigger] > svg { display: none; }
  .fxm-site-header [data-fxm-user-menu-trigger] { padding: 2px; }
}
@media (max-width: 767.98px) {
  .fxm-site-header .fxm-nav-submenu { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fxm-site-header .fxm-nav-item,
  .fxm-site-header .fxm-nav-submenu,
  .fxm-site-header .fxm-nav-submenu-toggle,
  .fxm-site-header .fxm-nav-submenu-toggle svg { transition: none; }
}
.fxm-site-header .fxm-nav-mega-toggle { flex-shrink: 0; }
.fxm-site-header .fxm-nav-mega-toggle svg path { transition: transform 160ms ease; }
.fxm-site-header .fxm-nav-mega-toggle svg path:first-child { transform-origin: 21px 6px; }
.fxm-site-header .fxm-nav-mega-toggle svg path:last-child { transform-origin: 21px 18px; }
.fxm-site-header [data-fxm-mega-toggle][aria-expanded="true"] { background: rgba(79, 52, 217, .08); color: var(--color-primary, #4f34d9); }
/* Open state: the outer lines shorten toward the right edge (staggered hamburger cinches up). */
.fxm-site-header [data-fxm-mega-toggle][aria-expanded="true"] svg path:first-child { transform: scaleX(.55); }
.fxm-site-header [data-fxm-mega-toggle][aria-expanded="true"] svg path:last-child { transform: scaleX(.75); }
.fxm-site-header .fxm-nav-dropdown {
  position: absolute;
  top: 100%;
  /* main.js centers the complete panel in the viewport, independently of the
     primary links, and keeps sixteen-pixel gutters at narrower sizes. */
  left: 0;
  z-index: 60;
  padding-top: 12px;
  transition-property: opacity, transform;
  transition-duration: 160ms;
}
/* pc-dist ships no `.invisible` utility, so hide the closed panel here: it then
   leaves the tab order and the accessibility tree (click or ↓ on the toggle opens it). */
.fxm-site-header .fxm-nav-dropdown.invisible { pointer-events: none; visibility: hidden; }
.fxm-site-header .fxm-nav-mega-box {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(1120px, calc(100vw - 48px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 104px);
  max-height: calc(100dvh - 104px);
  border: 1px solid #e6e8ef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 36px -14px rgba(39,46,66,.16), 0 2px 5px rgba(39,46,66,.03);
  overflow: hidden;
}
.fxm-site-header .fxm-nav-mega-col {
  box-sizing: border-box;
  min-width: 0;
  padding: 0 10px;
  border-left: 1px solid #eceef2;
}
.fxm-site-header .fxm-nav-mega-col:first-child { border-left: 0; }
/* Tools: flow the 10 calculators down ⌈n/2⌉ rows then across into a second
   column, so this column lands in the same height range as the other two
   (brokers/news) instead of running twice as tall as a single list. The row
   count comes from PHP as a custom property so it stays correct if the
   calculator catalog grows. is-scrollable is now just a safety net. */
.fxm-site-header .fxm-nav-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(var(--fxm-tools-rows, 5), auto);
  grid-auto-flow: column;
  column-gap: 8px;
}
.fxm-site-header .fxm-nav-tools-grid .fxm-nav-link { break-inside: avoid; }
.fxm-site-header .fxm-nav-section-title {
  margin: 14px 8px 4px;
  padding: 8px 0 0;
  border-top: 1px solid #eef0f5;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: rgba(39,46,66,.45);
}
.fxm-site-header .fxm-nav-mega-col > .fxm-nav-section-title:first-child { margin-top: 2px; padding-top: 0; border-top: 0; }
.fxm-site-header .fxm-nav-link {
  display: block;
  padding: 8px 8px;
  border-radius: 10px;
  color: #272e42;
  transition: background-color 140ms ease, color 140ms ease;
}
.fxm-site-header .fxm-nav-link:hover,
.fxm-site-header .fxm-nav-link:focus-visible {
  background: #f4f1ff;
  outline: none;
}
.fxm-site-header .fxm-nav-link.is-risk:hover { background: #fff4f4; }
.fxm-site-header .fxm-nav-link strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.fxm-site-header .fxm-nav-link small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(39,46,66,.5);
}
.fxm-site-header .fxm-nav-link:hover strong { color: var(--color-primary, #4f34d9); }
.fxm-site-header .fxm-nav-link.is-risk strong { color: #c9302c; }
.fxm-site-header .fxm-nav-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding: 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary, #4f34d9);
  transition: background-color 140ms ease;
}
.fxm-site-header .fxm-nav-more:hover { background: #f4f1ff; }
.fxm-site-header .fxm-nav-more span { transition: transform 140ms ease; }
.fxm-site-header .fxm-nav-more:hover span { transform: translateX(3px); }

/* The App and navigation share one scroll region; the final AI row stays
   visible below it even on a short viewport. Individual submenus stay compact. */
.fxm-site-header .fxm-mega-content {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  min-height: 0;
  padding: 0 4px 0 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d9dce4 transparent;
}
.fxm-site-header .fxm-mega-app { min-width: 0; padding: 18px 12px 18px 14px; border-right: 1px solid #eceaf3; background: linear-gradient(145deg, #fdfcfe 0%, #f6f3fc 100%); }
.fxm-site-header .fxm-mega-app-brand { margin: 0; color: #252735; font-size: 17px; font-weight: 600; line-height: 1.4; }
.fxm-site-header .fxm-mega-app-headline { margin: 10px 0 4px; color: #252735; font-size: 17px; font-weight: 600; line-height: 1.45; letter-spacing: -.02em; }
.fxm-site-header .fxm-mega-app-description { margin: 0; color: #777c88; font-size: 12px; line-height: 1.6; }
.fxm-site-header .fxm-mega-app-qr { display: flex; align-items: center; gap: 10px; margin: 14px 0; text-align: start; }
.fxm-site-header .fxm-mega-app-qr img { display: block; flex: 0 0 96px; width: 96px; height: 96px; padding: 4px; border: 1px solid #e8e9ee; border-radius: 8px; background: #fff; }
.fxm-site-header .fxm-mega-app-qr figcaption { min-width: 0; margin: 0; color: #343745; font-size: 12px; font-weight: 500; line-height: 1.5; }
.fxm-site-header .fxm-mega-app-qr small { display: block; margin-top: 2px; color: #8a8e99; font-size: 11px; font-weight: 400; }
.fxm-site-header .fxm-mega-app-downloads { display: grid; grid-auto-rows: 1fr; gap: 8px; }
.fxm-site-header .fxm-mega-download { position: relative; isolation: isolate; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 64px; box-sizing: border-box; padding: 10px; border: 1px solid var(--fxm-app-border); border-radius: 10px; overflow: hidden; background: var(--fxm-app-surface); color: #303341; text-align: start; text-decoration: none; transition: border-color 160ms ease, box-shadow 160ms ease; }
.fxm-site-header .fxm-mega-download--android { --fxm-app-surface: #edf8ef; --fxm-app-border: #dfefe2; --fxm-app-color: #4da45d; }
.fxm-site-header .fxm-mega-download--ios { --fxm-app-surface: #f3f3f7; --fxm-app-border: #e6e5ed; --fxm-app-color: #3e4143; }
.fxm-site-header .fxm-mega-download-icon { position: relative; z-index: 1; display: grid; place-items: center; flex: 0 0 40px; height: 40px; border-radius: 9px; background: var(--fxm-app-color); color: #fff; }
.fxm-site-header .fxm-mega-download-icon svg { width: 27px; height: 27px; }
.fxm-site-header .fxm-mega-download-copy { position: relative; z-index: 1; min-width: 0; }
.fxm-site-header .fxm-mega-download-watermark { position: absolute; right: -5px; bottom: -9px; z-index: 0; color: var(--fxm-app-color); opacity: .075; pointer-events: none; }
.fxm-site-header .fxm-mega-download-watermark svg { display: block; width: 65px; height: 65px; }
.fxm-site-header .fxm-mega-download strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.fxm-site-header .fxm-mega-download small { display: block; margin-top: 2px; color: #727986; font-size: 11px; line-height: 1.4; }
.fxm-site-header .fxm-mega-download:disabled { opacity: 1; cursor: default; }
.fxm-site-header a.fxm-mega-download:hover { border-color: var(--fxm-app-color); box-shadow: 0 2px 6px rgba(39, 46, 66, .06); }
.fxm-site-header .fxm-mega-sections { display: grid; grid-template-columns: 1fr 1fr 1.1fr 1.8fr; min-width: 0; padding-block: 18px; }
.fxm-site-header .fxm-mega-sections .fxm-nav-mega-col { display: flex; flex-direction: column; }
.fxm-site-header .fxm-mega-heading { display: flex; align-items: flex-start; gap: 6px; min-height: 26px; margin: 2px 4px 12px; color: #282b37; font-size: 16px; font-weight: 600; line-height: 1.5; }
.fxm-site-header .fxm-mega-sections .fxm-nav-link { padding: 7px 5px; border-radius: 6px; }
.fxm-site-header .fxm-mega-sections .fxm-nav-link strong { color: #373b49; font-size: 14px; font-weight: 400; line-height: 1.55; overflow-wrap: anywhere; }
.fxm-site-header .fxm-mega-sections .fxm-nav-link:hover strong { color: #4f34d9; }
.fxm-site-header .fxm-mega-sections .fxm-nav-link small { display: none; }
.fxm-site-header .fxm-mega-sections [data-fxm-mega-col="brokers"] > .fxm-nav-link:first-of-type small,
.fxm-site-header .fxm-mega-sections [data-fxm-mega-col="regulators"] > .fxm-nav-link:first-of-type small { display: block; margin-top: 4px; font-size: 11px; line-height: 1.6; color: #818592; }
.fxm-site-header .fxm-mega-sections .fxm-nav-section-title { margin: 12px 5px 5px; padding-top: 10px; color: #858a96; font-size: 12px; font-weight: 400; letter-spacing: 0; }
.fxm-site-header .fxm-nav-secondary-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 4px; }
html[lang="en-US"] .fxm-site-header [data-fxm-mega-col="brokers"] .fxm-nav-secondary-links { grid-template-columns: minmax(0, 1fr); }
.fxm-site-header [data-fxm-mega-col="news"] .fxm-nav-secondary-links { grid-template-columns: minmax(0, 1fr); }
.fxm-site-header .fxm-mega-sections .fxm-nav-more { justify-content: flex-start; margin-top: 10px; padding: 8px 5px 5px; font-size: 12px; font-weight: 500; }
.fxm-site-header .fxm-mega-sections .fxm-nav-tools-grid { column-gap: 10px; row-gap: 0; }
.fxm-site-header .fxm-mega-ai { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 20px; min-height: 66px; padding: 11px 16px; border-top: 1px solid #e9e5f3; background: #f8f6fd var(--fxm-img-ai-fine-texture-v1, url('../images/navigation/ai-fine-texture-v1.webp')) center 58% / cover no-repeat; }
.fxm-site-header .fxm-mega-ai-copy { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-width: 0; }
.fxm-site-header .fxm-mega-ai h2 { margin: 0; color: #303341; font-size: 16px; font-weight: 600; line-height: 1.5; }
.fxm-site-header .fxm-mega-ai p { margin: 0 0 0 8px; color: #737887; font-size: 12px; line-height: 1.7; }
.fxm-site-header .fxm-mega-ai-cta { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 14px; min-height: 42px; padding: 10px 20px; border: 1px solid #4f34d9; border-radius: 9px; background: #4f34d9; color: #fff; font-size: 13px; font-weight: 500; line-height: 1.5; transition: background-color 160ms ease; }
.fxm-site-header .fxm-mega-ai-cta:hover { background: #4027be; }
.fxm-site-header .fxm-mega-ai-cta:focus-visible,
.fxm-site-header .fxm-mega-download:focus-visible,
.fxm-site-header .fxm-mega-sections a:focus-visible { outline: 2px solid #4f34d9; outline-offset: 2px; }
.admin-bar .fxm-site-header .fxm-nav-mega-box { max-height: calc(100dvh - 136px); }
@media (min-width: 783px) {
  .admin-bar .fxm-site-header { top: var(--wp-admin--admin-bar--height, 32px); }
}
@media (min-width: 601px) and (max-width: 782px) {
  .admin-bar .fxm-site-header { top: var(--wp-admin--admin-bar--height, 46px); }
  .admin-bar .fxm-site-header .fxm-nav-mega-box { max-height: calc(100dvh - 150px); }
}
@media (min-width: 768px) and (max-width: 1199.98px) {
  .fxm-site-header .fxm-mega-content { grid-template-columns: 214px minmax(0, 1fr); }
  .fxm-site-header .fxm-mega-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
  .fxm-site-header .fxm-mega-sections .fxm-nav-mega-col:nth-child(odd) { border-left: 0; }
  .fxm-site-header .fxm-mega-sections .fxm-nav-more { margin-top: 12px; }
  .fxm-site-header .fxm-mega-heading { margin-bottom: 12px; }
  .fxm-site-header .fxm-mega-ai-copy { column-gap: 10px; row-gap: 3px; }
  .fxm-site-header .fxm-mega-ai p { flex-basis: 100%; margin: 0; }
}
@media (min-width: 768px) and (max-width: 899.98px) {
  .fxm-site-header .fxm-nav-mega-box { width: calc(100vw - 32px); }
  .fxm-site-header .fxm-mega-content { grid-template-columns: 196px minmax(0, 1fr); }
  .fxm-site-header .fxm-mega-app-qr img { flex-basis: 80px; width: 80px; height: 80px; }
  .fxm-site-header .fxm-mega-app { padding: 16px 12px 16px 16px; }
  .fxm-site-header .fxm-mega-sections { padding-block: 16px; }
  .fxm-site-header .fxm-nav-mega-col { padding-inline: 10px; }
  .fxm-site-header .fxm-mega-heading { gap: 7px; font-size: 15px; }
  .fxm-site-header .fxm-mega-sections .fxm-nav-tools-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
  .fxm-site-header .fxm-mega-download { padding-inline: 8px; gap: 8px; }
  .fxm-site-header .fxm-mega-download-icon { flex-basis: 34px; height: 34px; border-radius: 8px; }
  .fxm-site-header .fxm-mega-download-icon svg { width: 24px; height: 24px; }
  .fxm-site-header .fxm-mega-ai { padding-inline: 20px; gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .fxm-site-header .fxm-mega-download,
  .fxm-site-header .fxm-mega-ai-cta { transition: none; }
}



/* Narrow desktop (768-1279px): the language button shrinks to its globe icon so the
   centred nav does not run under the right-hand group (English / Vietnamese / Thai
   labels are long). The globe is the universal language cue; the dropdown and the
   button's aria-label still carry the full language names. */
@media (min-width: 768px) and (max-width: 1279.98px) {
  .fxm-site-header [data-fxm-lang-trigger] {
    justify-content: center;
    width: 36px;
    padding-inline: 0;
  }
  .fxm-site-header [data-fxm-lang-trigger] > span,
  .fxm-site-header [data-fxm-lang-trigger] > svg:last-of-type { display: none; }
}
