html,
body,
button,
input,
select,
textarea {
    font-family: var(--app-font-family, ui-sans-serif, system-ui, sans-serif);
}

body {
    font-synthesis: none;
    font-kerning: normal;
    font-optical-sizing: auto;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

code,
kbd,
pre,
samp {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

html[data-script="persian"] :where(body, button, input, select, textarea, h1, h2, h3, h4, p, a, label),
html[data-script="arabic"] :where(body, button, input, select, textarea, h1, h2, h3, h4, p, a, label),
html[data-script="urdu"] :where(body, button, input, select, textarea, h1, h2, h3, h4, p, a, label) {
    letter-spacing: normal;
}

html[data-script="persian"] body,
html[data-script="arabic"] body,
html[data-script="hebrew"] body {
    line-height: 1.72;
}

html[data-script="urdu"] body {
    line-height: 1.9;
}

html[data-script="devanagari"] body,
html[data-script="bengali"] body,
html[data-script="thai"] body {
    line-height: 1.7;
}

html[data-script="chinese"] body,
html[data-script="japanese"] body,
html[data-script="korean"] body {
    line-height: 1.65;
}

html[data-script="persian"] :where(h1, h2, h3, h4, h5, h6),
html[data-script="arabic"] :where(h1, h2, h3, h4, h5, h6),
html[data-script="hebrew"] :where(h1, h2, h3, h4, h5, h6) {
    line-height: 1.45;
}

html[data-script="urdu"] :where(h1, h2, h3, h4, h5, h6) {
    line-height: 1.75;
}

html[data-script="devanagari"] :where(h1, h2, h3, h4, h5, h6),
html[data-script="bengali"] :where(h1, h2, h3, h4, h5, h6),
html[data-script="thai"] :where(h1, h2, h3, h4, h5, h6),
html[data-script="chinese"] :where(h1, h2, h3, h4, h5, h6),
html[data-script="japanese"] :where(h1, h2, h3, h4, h5, h6),
html[data-script="korean"] :where(h1, h2, h3, h4, h5, h6) {
    line-height: 1.5;
}

html[data-script="persian"] :where(button, input, select, textarea),
html[data-script="arabic"] :where(button, input, select, textarea),
html[data-script="hebrew"] :where(button, input, select, textarea) {
    line-height: 1.6;
}

html[data-script="urdu"] :where(button, input, select, textarea) {
    line-height: 1.85;
}

[dir="rtl"] bdi[dir="auto"],
[dir="rtl"] .auto-dir {
    unicode-bidi: isolate;
}
