/* One fixed workspace; long content remains accessible inside its own region. */
@media screen {
    html:has(> body.zlw-viewport) { height: 100%; min-height: 0; overflow: hidden; overscroll-behavior: none; }
    body.has-app-shell.zlw-viewport {
        position: fixed; inset: 0; width: 100%; height: 100dvh; min-height: 0;
        overflow: hidden; overscroll-behavior: none;
        --zlw-heading-gap: .35rem; --zlw-section-gap: .75rem;
    }
    .has-app-shell.zlw-viewport .site-main {
        display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; min-width: 0;
        padding-top: .45rem; padding-bottom: .45rem; overflow: hidden;
    }
    .zlw-viewport .site-content {
        flex: 1 1 auto; min-height: 0; min-width: 0; overflow: auto;
        overscroll-behavior: contain; scrollbar-width: none; scroll-padding-top: .5rem;
    }
    .zlw-viewport .site-content::-webkit-scrollbar { display: none; }
    .zlw-viewport .site-content:focus-visible { outline: 1px solid var(--line); outline-offset: -1px; }
    .zlw-viewport :is(.table-scroll, .main-lzk-grid-scroll) { max-width: 100%; overscroll-behavior: contain; scrollbar-width: thin; }
    .zlw-viewport .site-content [id] { scroll-margin-top: .5rem; }
    .zlw-viewport:is(.student-results-page, .main-lzk-viewport, .embedded-week-planning, .embedded-practice) .site-content { overflow: hidden; }
    .zlw-viewport.embedded-practice .site-main {
        flex: none; height: calc(100dvh - var(--topbar-height) - var(--math-workbench-current-height, 410px));
    }
    .zlw-viewport .task-system-sticky-header { top: 0; }
    .zlw-viewport .site-content :is(.teacher-panel-heading, .curriculum-subsection > header, .curriculum-general-section > header, .week-planning-summary-heading) {
        margin-bottom: var(--zlw-heading-gap);
    }
    .zlw-viewport .site-content :is(.teacher-panel-heading, .curriculum-subsection > header, .curriculum-general-section > header, .week-planning-summary-heading) h2 {
        margin: 0; color: var(--navy-deep); font-family: var(--font-interface); font-size: 1.18rem; font-weight: 500; line-height: 1.15;
    }
    .zlw-viewport .teacher-panel { margin-top: var(--zlw-section-gap); padding-top: var(--zlw-section-gap); }
    .zlw-viewport .task-system-table-sticky-heading,
    .zlw-viewport .curriculum-model-classification-sticky { padding-top: var(--zlw-section-gap); padding-bottom: var(--zlw-heading-gap); }
    .zlw-viewport .curriculum-general-section > .task-system-table-sticky-heading { padding-top: 0; }
    .zlw-viewport .curriculum-subsection { margin-top: var(--zlw-section-gap); padding-top: 0; }
    .zlw-viewport .curriculum-time-section,
    .zlw-viewport .curriculum-classification-section { margin-top: 0; }
    .zlw-viewport .week-planning-panel { padding-top: 0 !important; margin-top: 0; }
    .zlw-viewport .week-planning-summary { margin-bottom: var(--zlw-section-gap); }
    .zlw-viewport .week-planning-summary .table-scroll { width: min(800px, 100%); }
    .zlw-viewport .week-planning-summary-table :is(th, td) { width: auto; padding: .38rem .55rem; }
    .zlw-viewport .week-planning-summary-table th { width: 38%; background: var(--teal-light); color: var(--muted); }
    .zlw-viewport .week-planning-summary-table td { width: 12%; text-align: right; }
    .zlw-viewport .week-planning-table-scroll { border-color: var(--line); }
    .zlw-viewport .week-table :is(th, td) { padding: .25rem .5rem; line-height: 1.2; }
    .zlw-viewport .week-table thead th { background: var(--teal-light); color: var(--muted); }
    .zlw-viewport .week-table :is(.week-topic-list, .week-topic-list li, .week-notes small) { margin-block: .12rem; }
    .zlw-viewport .week-table :is(.catalog-status, .row-link) { padding-block: .15rem; }
    /* Temporary compact overview retains every counter, table, filter and feed. */
    .zlw-dashboard .site-content { font-size: .65rem; line-height: 1.2; --font-table-size: .65rem; }
    .zlw-dashboard .site-content :is(h1, h2, h3, strong, .metric-card strong, .access-status-grid strong) { font-size: .75rem !important; }
    .zlw-dashboard .site-content :is(p, small, label, .eyebrow, input, select, .button, .data-table, .data-table th, .access-status, .catalog-status) { font-size: .65rem; }
    .zlw-dashboard .site-content :is(.page-header, .teacher-panel, .metric-card, .access-status-grid article, .catalog-item) { padding: .35rem; margin-block: .3rem; }
    .zlw-dashboard .site-content :is(.metric-grid, .access-status-grid, .teacher-two-column, .teacher-panel-heading, .teacher-filter) { gap: .4rem; }
    .zlw-dashboard .site-content :is(.button, input, select) { min-height: 0; padding: .2rem .35rem; }
    .zlw-dashboard .site-content :is(th, td, .teacher-activity-list li) { padding: .15rem .35rem; }
    .zlw-dashboard .site-content :is(p, dl, ol, h1, h2, h3) { margin-block: .25rem; }
}

@media screen {
    .zlw-viewport.has-math-workbench:not(.embedded-practice) .site-main { padding-bottom: calc(var(--math-workbench-current-height, 410px) + .45rem); }
}
@media screen {
    .zlw-viewport .page-header { top: 0; }
    .zlw-dashboard .site-content :is(.page-header, .metric-card, .access-status-grid article) { min-height: 0; }
    .zlw-dashboard .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: .3rem; }
    .zlw-dashboard .metric-card { gap: .25rem; }
    @media (max-width: 620px) { .zlw-dashboard .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
}