/* The page's fonts per script (languages.js: applyDocumentLanguage sets <html data-script>; 2026-10-09).
   Chinese and Korean put their own Windows fonts first, or the Japanese fonts draw Chinese with Japanese glyph shapes.
   Japanese, English and the other Latin/Cyrillic languages keep each page's own fonts. Elements that must keep their
   font whatever the language (a decorative English title…) carry class="keep-font". */
html[data-script="zh-Hans"] body *:not(.keep-font):not(.keep-font *){font-family:'Segoe UI','Microsoft YaHei UI','Microsoft YaHei',system-ui,sans-serif!important}
html[data-script="zh-Hant"] body *:not(.keep-font):not(.keep-font *){font-family:'Segoe UI','Microsoft JhengHei UI','Microsoft JhengHei',system-ui,sans-serif!important}
html[data-script="ko"] body *:not(.keep-font):not(.keep-font *){font-family:'Segoe UI','Malgun Gothic',system-ui,sans-serif!important}
/* Longer languages (ru, es, pt-BR run 30-50% longer than English): words may break rather than leave their box. */
html[data-script="latin"]:not([lang="en"]) body{overflow-wrap:break-word}
/* A word in another language on any page (the language buttons: 简体中文, 한국어…) in that language's font. */
:not(html)[lang="zh-Hans"]{font-family:'Segoe UI','Microsoft YaHei UI','Microsoft YaHei',system-ui,sans-serif!important}
:not(html)[lang="zh-Hant"]{font-family:'Segoe UI','Microsoft JhengHei UI','Microsoft JhengHei',system-ui,sans-serif!important}
:not(html)[lang="ko"]{font-family:'Segoe UI','Malgun Gothic',system-ui,sans-serif!important}
/* Longer languages (and the pseudo-language): buttons, tabs and summaries wrap between words instead of running out of their box.
   Never break inside a word (overflow-wrap:anywhere would let flex boxes shrink to one letter: 2026-10-09).
   Japanese and English keep each page's own layout. */
html:not([lang="ja"]):not([lang="en"]) body :is(button,summary,label,a,.nav-item){white-space:normal!important;overflow-wrap:break-word}
/* Korean breaks lines between words (spaces), not inside a word between syllables ("날/씨"). Suggested by the palm lagoon chat, 2026-10-09. */
html[lang="ko"] body{word-break:keep-all}
