/*
 * Font stacks per language. The app sets its text in var(--font); a page in another language redefines it on the root element
 * with the system fonts that cover its script first (every mainstream OS ships them), so English pages keep the stack of app.css
 * untouched and nothing here changes a pixel of them. The one script a desktop commonly lacks a font for is CJK (a Linux
 * desktop or kiosk without a CJK package draws boxes), so the Simplified Chinese and Korean subsets the PDF writer embeds are
 * offered as web fonts at the end of their stacks, each limited by unicode-range: a browser fetches one only to draw a character
 * in that range that no earlier font of the stack has, and an English page never does. The CJK fonts Linux distributions install
 * (WenQuanYi, Droid Sans Fallback, UnDotum, Baekmuk) come before the web font, so a machine that has one downloads nothing.
 */
html:lang(vi) { --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; }
html:lang(en-XA) { --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "DejaVu Sans", sans-serif; }
html:lang(zh-Hans), html:lang(zh) { --font: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans SC", "WenQuanYi Micro Hei", "WenQuanYi Zen Hei", "Droid Sans Fallback", "Segoe UI", Roboto, Arial, "Amp-Hour Noto Sans SC", sans-serif; }
html:lang(ko) { --font: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK KR", "Noto Sans KR", "Source Han Sans KR", "NanumGothic", "UnDotum", "Baekmuk Gulim", "WenQuanYi Zen Hei", "Droid Sans Fallback", "Segoe UI", Roboto, Arial, "Amp-Hour Noto Sans KR", sans-serif; }
/* Korean breaks a line between words, never inside one; a word too long for its box still wraps. A Korean document inside a page
   in another language carries its own lang attribute and takes the same rule. The other way round, a document or a typed text in
   another language inside a Korean page breaks its lines as its own language does (Chinese between any two characters). */
html:lang(ko), [lang]:lang(ko) { word-break: keep-all; overflow-wrap: break-word; }
:lang(ko) [lang]:not(:lang(ko)) { word-break: normal; }
html:lang(ar), html:lang(ar-XB) { --font: system-ui, -apple-system, "Segoe UI", "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", "Arabic UI Text", Tahoma, Roboto, Arial, "DejaVu Sans", sans-serif; }

@font-face {
  font-family: "Amp-Hour Noto Sans SC";
  src: url(/fonts/NotoSansSC-Regular.v2.ttf) format("truetype");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+2E80-2EFF, U+2F00-2FDF, U+3000-303F, U+31C0-31EF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF;
}
@font-face {
  font-family: "Amp-Hour Noto Sans KR";
  src: url(/fonts/NotoSansKR-Regular.v2.ttf) format("truetype");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+1100-11FF, U+3000-303F, U+3130-318F, U+A960-A97F, U+AC00-D7AF, U+D7B0-D7FF, U+FF00-FFEF;
}
