/* Shared screen metrics, loaded after the individual SCH workspaces. */
@media screen {
    /* Heading heights are 125% of the shared baseline; text sizes stay fixed. */
    body.has-app-shell {
        --sch-section-heading-size: 1.18rem;
        --sch-section-heading-line: 1.875rem;
        --sch-subheading-size: 1rem;
        --sch-subheading-line: 1.5625rem;
        --sch-table-header-height: 2.1875rem;
        --sch-table-header-line: 1.125rem;
        --sch-table-header-padding: .25rem;
    }

    /* One line box per heading level; longer titles may grow and wrap. */
    :root body.has-app-shell .site-content :is(h1, h2, h3, h4):not(.visually-hidden) {
        box-sizing: border-box;
        height: auto;
        min-height: 0;
        padding-block: 0;
        font-family: var(--font-interface);
        font-weight: 500;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    :root body.has-app-shell .site-content h1:not(.visually-hidden) {
        font-size: var(--font-page-heading-size);
        line-height: 1.5;
    }

    :root body.has-app-shell .site-content h2:not(.visually-hidden) {
        font-size: var(--sch-section-heading-size);
        line-height: var(--sch-section-heading-line);
    }

    :root body.has-app-shell .site-content :is(h3, h4):not(.visually-hidden) {
        font-size: var(--sch-subheading-size);
        line-height: var(--sch-subheading-line);
    }

    /* UNT uses the same section and table heading typography. */
    :root body.has-app-shell.teacher-timetable-area .site-content {
        font-family: var(--font-interface);
    }

    :root body.has-app-shell.teacher-timetable-area table > thead > tr > :is(th, td) {
        font-family: var(--font-interface);
        font-size: var(--font-table-size);
        font-weight: 700;
    }

    :root body.has-app-shell.teacher-timetable-area .timetable-day-button,
    :root body.has-app-shell.teacher-timetable-area .timetable-day-button > :is(span, time) {
        font: inherit;
    }

    /* This title carries the section's reference gap itself. */
    :root body.has-app-shell .site-content h3.kor-control-notes-heading {
        padding-top: var(--sch-rule-heading-gap);
        padding-bottom: .35rem;
    }

    /* Table height is a minimum: wrapped labels and tall maths remain visible.
       Include cloned sticky tables that live outside .site-content.
       The two-row requirement-level header retains its original 30px rows. */
    :root body.has-app-shell table:not(.requirement-level-table) > thead > tr > :is(th, td) {
        box-sizing: border-box;
        height: var(--sch-table-header-height);
        padding-block: var(--sch-table-header-padding);
        line-height: var(--sch-table-header-line);
        vertical-align: middle;
    }

    :root body.has-app-shell table:not(.requirement-level-table) > thead > tr > :is(th, td)[rowspan="2"] {
        height: calc(2 * var(--sch-table-header-height));
    }

    :root body.has-app-shell table:not(.requirement-level-table) > thead > tr > :is(th, td)[rowspan="3"] {
        height: calc(3 * var(--sch-table-header-height));
    }

    /* Controls own their padding; do not add another layer on the cell. */
    :root body.has-app-shell .main-lzk-grid > thead > tr > th[data-roster-header],
    :root body.has-app-shell .timetable-grid > thead > tr > th[data-day-column],
    :root body.has-app-shell .learning-work-table > thead > tr > th[aria-sort],
    :root body.has-app-shell .student-results-roster-table > thead > tr > th,
    :root body.has-app-shell .curriculum-classification-data > thead > tr > .classification-conditions {
        padding-block: 0;
    }

    :root body.has-app-shell table > thead :is(.main-lzk-sort, .timetable-day-button, [data-work-sort]) {
        height: auto;
        min-height: calc(var(--sch-table-header-height) - 2px);
        padding-block: 0;
        line-height: inherit;
    }

    /* Preserve the three-row grid, its spanning cells and full-cell links. */
    :root body.has-app-shell .student-results-roster-table {
        --result-header-row: var(--sch-table-header-height);
    }

    /* The synchronized condition scrollbar fits inside the same header row. */
    :root body.has-app-shell table > thead .curriculum-condition-track > span {
        min-height: 0;
        padding-block: 0;
        line-height: inherit;
    }

    :root body.has-app-shell table > thead .curriculum-condition-scroll-master {
        scrollbar-width: thin;
    }

    :root body.has-app-shell table > thead .curriculum-condition-scroll-master::-webkit-scrollbar {
        height: 6px;
    }
}
