#yx-language{position:relative;display:inline-flex;align-items:center;gap:3px;flex:0 1 auto;max-width:142px;min-height:36px;border:1px solid currentColor;border-color:color-mix(in srgb,currentColor 25%,transparent);border-radius:8px;padding:0 5px;color:inherit;background:transparent;font:500 13px/1.25 system-ui,sans-serif}#yx-language>span:first-child{font:600 20px/1 system-ui,sans-serif;pointer-events:none}#yx-language select{appearance:auto;box-sizing:border-box;width:auto;max-width:112px;min-width:0;padding:5px 1px;margin:0;border:0;background:transparent;color:inherit;cursor:pointer;font:inherit}#yx-language option{background:white;color:#163047}#yx-language:focus-within{outline:2px solid #419fed;outline-offset:2px}#yx-language.yx-floating-language{position:fixed;z-index:2147483000;bottom:max(9px,env(safe-area-inset-bottom));left:max(9px,env(safe-area-inset-left));background:#f9fcff;color:#16334b;box-shadow:0 2px 10px #1232}.yx-language-notice:not(:empty){position:absolute;z-index:1;top:100%;left:0;padding:6px 8px;background:#fff;color:#713228;min-width:145px;border-radius:5px;font-size:12px}#yx-language.yx-floating-language .yx-language-notice{top:auto;bottom:100%}html:not(:lang(zh-CN)) :is(.site-header,.tools-heading,.cases-header,.proof-intro){overflow-wrap:break-word}html:not(:lang(zh-CN)) :is(.header-actions,.site-header nav){min-width:0}html:not(:lang(zh-CN)) :is(.tool-card,.ta-panel,.integrated-tool){overflow-wrap:break-word}@media(max-width:760px){#yx-language{max-width:100px;min-height:36px}#yx-language select{max-width:79px;font-size:12px}.site-header .header-actions{gap:4px!important}html:not(:lang(zh-CN)) .site-header .login-link{padding:6px 3px}.site-header .yx-language-notice{left:auto;right:0}}@media print{#yx-language{display:none!important}}
.yx-lang-code{display:none}html:not(:lang(zh-CN)) .site-header .brand{gap:8px}html:not(:lang(zh-CN)) .site-header .brand small{max-width:155px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:.07em}html:not(:lang(zh-CN)) .site-header .header-actions{gap:clamp(6px,.7vw,12px)}html:not(:lang(zh-CN)) .site-header .workbench{white-space:nowrap;gap:8px;padding-inline:12px}html:not(:lang(zh-CN)) .site-header nav{gap:clamp(10px,1.15vw,23px)}html:not(:lang(zh-CN)) .site-header nav a{font-size:clamp(12px,.92vw,15px)}
@media(min-width:761px) and (max-width:1239px){html:not(:lang(zh-CN)) .site-header nav{display:none;position:absolute;top:100%;left:0;right:0;margin:0;height:auto;background:#0a2339;color:white;padding:18px 26px;flex-direction:column;align-items:stretch;gap:0}html:not(:lang(zh-CN)) .site-header nav.open{display:flex}html:not(:lang(zh-CN)) .site-header nav a{padding:9px 0;font-size:15px}html:not(:lang(zh-CN)) .site-header .menu-toggle{display:flex;flex-direction:column;justify-content:center;gap:6px;padding:12px}html:not(:lang(zh-CN)) .site-header .header-actions{margin-inline-start:auto}}
@media(max-width:760px){.site-header{gap:8px!important;justify-content:space-between}.site-header .brand{min-width:0;flex:1 1 auto;gap:5px}.site-header .brand>span{min-width:0}.site-header .brand img{flex:0 0 auto}.site-header .brand strong{white-space:nowrap}.site-header .header-actions{flex:0 0 auto;gap:4px}.site-header .menu-toggle{flex:0 0 auto}html:not(:lang(zh-CN)) .site-header .brand small{max-width:100px;font-size:9px;letter-spacing:0}#yx-language{position:relative;max-width:unset;min-height:36px;height:36px;padding:0 7px;gap:3px}#yx-language .yx-lang-code{display:inline;font-size:11px;line-height:1;font-weight:650}#yx-language select{position:absolute;inset:0;width:100%;max-width:none;height:100%;opacity:0}.site-header .header-actions .login-link{max-width:104px;line-height:1.2;white-space:normal;text-align:center}.site-header .header-actions .member{max-width:105px;white-space:normal!important;line-height:1.2}}@media(max-width:420px){.site-header{padding-inline:12px!important}html:not(:lang(zh-CN)) .site-header .brand small{display:none}.site-header .brand strong{font-size:17px}.site-header .menu-toggle{padding:10px}.site-header .header-actions{gap:3px!important}}
@media(min-width:1240px) and (max-width:1650px){html:not(:lang(zh-CN)) .site-header{padding-inline:clamp(16px,2vw,33px)!important;gap:12px!important}html:not(:lang(zh-CN)) .site-header nav{margin-inline:auto;gap:clamp(8px,.85vw,14px);justify-content:center}html:not(:lang(zh-CN)) .site-header .brand small{max-width:135px}html:not(:lang(zh-CN)) .site-header nav a{letter-spacing:0}}
#yx-language.yx-docked-language{flex:none;align-self:center;justify-self:end;z-index:1}.integrated-tool-bar:has(>#yx-language){grid-template-columns:minmax(130px,1fr) auto minmax(70px,1fr) auto;gap:12px}.integrated-tool-account>span{max-width:min(22vw,240px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.yx-tool-heading-controls:has(>#yx-language){flex-wrap:wrap}.modal-header:has(>#yx-language){column-gap:10px}.modal-header>#yx-language{margin-left:4px}.admin-topbar>#yx-language{margin-inline-start:5px}@media(max-width:960px){.integrated-tool-bar:has(>#yx-language){grid-template-columns:minmax(75px,1fr) minmax(45px,auto) auto;gap:8px}.integrated-tool-bar:has(>#yx-language) .integrated-tool-title{display:none}}@media(max-width:420px){.integrated-tool-account>span{max-width:70px}.modal-header:has(>#yx-language){flex-wrap:wrap}.yx-tool-heading-controls:has(>#yx-language){gap:5px}}
/* Homepage controls. The native select still handles keyboard and touch input. */
#header .header-actions,
#header .header-actions > a,
#header #menuToggle {
  flex: 0 0 auto;
}
#header .header-actions > a {
  max-width: none;
  white-space: nowrap !important;
  line-height: 1.4;
}
#header #yx-language {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  flex: none;
  gap: 4px;
  width: auto;
  max-width: none;
  height: 38px;
  min-height: 38px;
  padding-inline: 8px;
  color: inherit;
  border: 1px solid #c9e4f25e;
  border-radius: 7px;
  background: #0a233938;
  white-space: nowrap;
}
#header #yx-language .yx-lang-code {
  display: inline;
  font: 650 12px/1 system-ui, sans-serif;
  letter-spacing: .02em;
}
#header #yx-language::after {
  content: '';
  width: 5px;
  height: 5px;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: translateY(-1px) rotate(45deg);
  pointer-events: none;
}
#header #yx-language select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
#header #yx-language:focus-within {
  outline: 2px solid #82dbff;
  outline-offset: 3px;
}
html:not(:lang(zh-CN)) #header .brand small {
  max-width: clamp(115px, 11vw, 176px);
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0;
}
html:not(:lang(zh-CN)) #header .brand strong,
html:not(:lang(zh-CN)) #home .hero-tags {
  letter-spacing: normal;
}
html:lang(th) #home :is(h1,.eyebrow,.film-label) {
  letter-spacing: normal;
  line-height: 1.35;
}
html:not(:lang(zh-CN)) #home .hero-tags {
  flex-wrap: wrap;
  row-gap: 6px;
}
/* Compact navigation at intermediate desktop widths: keep all actions in reach. */
@media (min-width:761px) and (max-width:1359px) {
  #header #navigation.open {
    display: flex;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    height: auto;
    max-height: calc(100dvh - 94px);
    overflow-y: auto;
    margin: 0;
    padding: 12px clamp(22px, 4.4vw, 62px);
    background: #0a2339;
    color: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  html:not(:lang(zh-CN)) #header #navigation:not(.open) { display: none; }
  #header #navigation.open a { padding-block: 10px; font-size: 15px; line-height: 1.45; }
  #header #navigation.open a.active::after { display: none; }
  #header .header-actions { margin-inline-start: auto; }
  html:not(:lang(zh-CN)) #header #menuToggle { display: inline-flex; }
  #header #menuToggle {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 42px;
    height: 42px;
    padding: 8px;
  }
  #header #menuToggle span { display: block; width: 22px; height: 2px; background: currentColor; }
}
@media (min-width:761px) and (max-width:1023px) {
  #header #navigation:not(.open) { display: none; }
  #header #menuToggle { display: inline-flex; }
}
@media (max-width:760px) {
  #header #navigation { top: 100%; max-height: calc(100dvh - 78px); overflow-y: auto; }
  #header .brand { min-width: 0; }
  #header .header-actions .workbench { gap: 5px; padding-inline: 9px; }
  #header .header-actions .login-link { padding-inline: 5px; }
  #header #yx-language { padding-inline: 6px; }
  html:not(:lang(zh-CN)) #home {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100svh;
  }
  html:not(:lang(zh-CN)) #home .hero-content {
    margin-block: 0;
    padding-top: clamp(118px, 21svh, 175px);
  }
  html:not(:lang(zh-CN)) #home .hero-bottom {
    position: relative;
    bottom: auto;
    margin-block: auto 0;
    padding-block: 24px;
    gap: 12px;
  }
  html:not(:lang(zh-CN)) #home h1 {
    font-size: clamp(31px, 7.7vw, 45px);
    line-height: 1.25;
    letter-spacing: normal;
    overflow-wrap: break-word;
  }
  html:lang(th) #home h1 { line-height: 1.4; }
}
@media (max-width:400px) {
  #header .header-actions .workbench svg { display: none; }
  #header #yx-language { gap: 3px; padding-inline: 5px; }
  #header #menuToggle { width: 36px; height: 40px; padding: 7px; }
}
/* Keep account dialog controls in the same order for every language. */
.modal:has(> form.demand-form input[name="password"]) > .modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}
.modal:has(> form.demand-form input[name="password"]) > .modal-header > div {
  min-width: 0;
}
.modal:has(> form.demand-form input[name="password"]) > .modal-header > #yx-language {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
}
.modal:has(> form.demand-form input[name="password"]) > .modal-header > .icon-button {
  grid-column: 3;
  grid-row: 1;
}
@media (max-width: 520px) {
  .modal:has(> form.demand-form input[name="password"]) > .modal-header {
    row-gap: 3px;
    padding-block: 10px;
  }
  .modal:has(> form.demand-form input[name="password"]) > .modal-header > div {
    display: contents;
  }
  .modal:has(> form.demand-form input[name="password"]) .modal-header .eyebrow {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
  }
  .modal:has(> form.demand-form input[name="password"]) .modal-header h2 {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
    overflow-wrap: anywhere;
  }
}
/* Keep all assistant tabs and the read-aloud control reachable on narrow screens. */
@media (max-width: 600px) {
  .trade-assistant-root .ta-panel .ta-nav {
    flex-wrap: wrap;
    column-gap: clamp(6px, 2vw, 12px);
    row-gap: 0;
    padding-inline: clamp(9px, 3vw, 16px);
  }
  .trade-assistant-root .ta-panel .ta-nav button { gap: 5px; }
  .trade-assistant-root .ta-panel .ta-nav .ta-auto-read { min-width: 36px; min-height: 36px; }
  .trade-assistant-root .ta-panel .ta-nav .ta-auto-read span { display: none; }
}

@media (max-width: 760px) {
  .fb-contacts-app .fc-sidebar { grid-template-columns: minmax(0, 1fr); }
  .fb-contacts-app .fc-sidebar > .fc-panel { min-width: 0; }
  .fb-contacts-app .fc-mode-switch > button,
  .fb-contacts-app .fc-sidebar .fc-start,
  .fb-contacts-app .fc-results-heading > .fc-button {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .fb-contacts-app .fc-results-heading,
  .outreach-workspace .outreach-section-head { flex-wrap: wrap; row-gap: 8px; }
  .outreach-workspace .outreach-section-head > * { min-width: 0; max-width: 100%; }
}
@media (max-width: 480px) {
  .integrated-tool-bar:has(> #yx-language) .integrated-tool-brand {
    max-width: 100%;
    gap: 5px;
  }
  .integrated-tool-bar:has(> #yx-language) .integrated-tool-brand img {
    flex: none;
    width: 38px;
    height: 32px;
  }
  .integrated-tool-bar:has(> #yx-language) .integrated-tool-brand span {
    min-width: 0;
    padding-inline-start: 5px;
    line-height: 1.2;
  }
}
@media (max-width: 760px) {
  .foreign-docs-tool :is(.section-actions, .product-table-actions, .preview-actions, .export-bar, .toolbar) {
    min-width: 0;
    max-width: 100%;
  }
  .foreign-docs-tool :is(.section-actions, .product-table-actions, .preview-actions, .export-bar, .toolbar) .btn {
    min-width: 0;
    max-width: 100%;
    padding-block: 6px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .foreign-docs-tool .product-table-actions { grid-template-columns: minmax(0, 1fr); }
  .foreign-docs-tool .preview-actions { flex-wrap: wrap; }
  .foreign-docs-tool .preview-actions .btn { flex: 1 1 9rem; }
}
