/* CJK-specific tweaks for Chinese locale.
 *
 * Chinese fonts (Noto Sans SC, PingFang, Heiti) often add a wide-space gap
 * between Latin punctuation/symbols and CJK glyphs. We force the price
 * formatting blocks back to JetBrains Mono so € and digits render flush,
 * matching the screenshots from EN/RO. Also fixes line-height so the
 * receipt-like number columns don't grow taller than EN.
 */

html[lang="zh"] {
    /* Slightly tighter line-height for CJK so cards don't grow unexpectedly */
    --line-height-base: 1.65;
}

/* Mono / number readouts — keep Latin font even in ZH to avoid the "€  7.81" gap */
html[lang="zh"] [style*="JetBrains Mono"],
html[lang="zh"] .ph-price-amount,
html[lang="zh"] .cycle-card-price .amt,
html[lang="zh"] .sc-price,
html[lang="zh"] .os-value,
html[lang="zh"] .os-total span:last-child,
html[lang="zh"] .um-balance strong,
html[lang="zh"] td[style*="JetBrains Mono"],
html[lang="zh"] .badge,
html[lang="zh"] code,
html[lang="zh"] kbd,
html[lang="zh"] pre,
html[lang="zh"] .terminal-body {
    font-family: 'JetBrains Mono', 'SF Mono', 'Menlo', 'Consolas', monospace !important;
    font-feature-settings: "tnum" 1;  /* tabular numbers */
    letter-spacing: 0;
}

/* Money output: stop browsers/fonts inserting a half-width-space between
 * € and the digits when the surrounding text is Chinese. */
html[lang="zh"] .badge,
html[lang="zh"] [style*="JetBrains Mono"] {
    word-spacing: 0;
    letter-spacing: 0;
}

/* Buttons + primary actions in ZH: keep the Latin font for EN-only labels
 * (PayPal, Stripe, Crypto, etc.) so brand names look right. */
html[lang="zh"] .btn,
html[lang="zh"] .form-control,
html[lang="zh"] input,
html[lang="zh"] textarea,
html[lang="zh"] select {
    /* Use mixed stack so Chinese characters still render as Noto SC, but
     * Latin fallback comes from system fonts. */
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont,
                 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
}

/* Auth and small-form inputs: numeric placeholders should stay LTR even
 * if the page is ZH, so they line up with the labels. */
html[lang="zh"] input[type="email"],
html[lang="zh"] input[type="number"],
html[lang="zh"] input[type="tel"],
html[lang="zh"] input[type="url"] {
    direction: ltr;
}

/* Improve readability of small UI text in CJK */
html[lang="zh"] .text-sm,
html[lang="zh"] .text-muted {
    line-height: 1.55;
}
