:root {
    /* Text sizes */
    --text-xs: 0.8125rem;
    --text-md: 0.9375rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;

    /* Shared body and table typography */
    --text-body: var(--text-sm);
    --text-table: var(--text-sm);

    /* Page titles */
    --text-page-title: 1.5rem;
    --leading-page-title: 1.333333;

    /* Line heights */
    --leading-ui: 1.5;
    --leading-body: 1.714286;

    /* Font weights */
    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
}

html {
    font-size: 100%;
}

body {
    font-size: var(--text-body);
    font-weight: var(--weight-normal);
    line-height: var(--leading-body);
}

/* Font families are managed by fonts/base.css. */
:where(button, input, select, textarea) {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: var(--leading-ui);
}

/* Tables use the same typography in every layout. */
table {
    font-family: inherit;
    font-size: var(--text-table);
    font-weight: var(--weight-normal);
    line-height: var(--leading-body);
}

th {
    font-weight: var(--weight-semibold);
}

td {
    font-weight: var(--weight-normal);
}

:where(h1, h2, h3, h4, h5, h6) {
    margin-block: 0 0.5em;
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-ui);
    overflow-wrap: anywhere;
}

:where(h1) {
    font-size: var(--text-page-title);
    font-weight: var(--weight-bold);
    line-height: var(--leading-page-title);
}

:where(p) {
    margin-block: 0 1em;
    overflow-wrap: anywhere;
}

:where(small) {
    font-size: var(--text-sm);
}

:where(strong, b) {
    font-weight: var(--weight-bold);
}

@media (min-width: 40rem) {
    :root {
        --text-page-title: 1.875rem;
        --leading-page-title: 1.2;
    }
}
/* Identifiers keep Latin glyphs regardless of the selected Persian font/digit styleset. */
.ui-latin,
.ui-username,
.form-field > .ui-username,
.form-field > .ui-latin {
    font-family: var(--app-latin-font-family, Arial, Helvetica, sans-serif);
    font-variant-alternates: normal;
    font-feature-settings: normal;
    font-variation-settings: normal;
    font-variant-numeric: normal;
    text-transform: none;
    direction: ltr;
    unicode-bidi: isolate;
}
