/* Capitalize interface titles and actions without rewriting stored content.
   Keep existing acronym/brand casing (PDF, AO, RevisionPRO) intact. */
:where(h1, h2, h3, h4, h5, h6, button, a, label, legend, summary, th, dt,
    [role="heading"], [role="button"], [role="link"], [role="tab"],
    [role="menuitem"], input[type="button"], input[type="submit"], input[type="reset"],
    .header-title, .modal-title, .card-title, .builder-steps > li) {
    text-transform: capitalize;
}

/* Labels and links can wrap editable fields or source mathematics. Never let
   their inherited capitalization change how those values are displayed. */
:is(input:not([type="button"]):not([type="submit"]):not([type="reset"]), textarea,
    [contenteditable="true"], [contenteditable=""], pre, code, math, math-field,
    question-math, .ML__latex, .preserve-case,
    .question-document, .markscheme-document, .math-content-block),
:is([contenteditable="true"], [contenteditable=""], pre, code, math, math-field,
    question-math, .ML__latex, .preserve-case,
    .question-document, .markscheme-document, .math-content-block) * {
    text-transform: none;
}
