/*
 * ECEDAIA compact density layer.
 *
 * This file intentionally changes only size, spacing and type density. It is
 * kept last in the cascade so deferred module styles cannot make one role
 * visually heavier than another.
 */

:root {
    --ec-compact-font: 0.82rem;
    --ec-compact-font-small: 0.72rem;
    --ec-compact-gap: 0.52rem;
    --ec-compact-gap-small: 0.34rem;
    --ec-compact-pad-y: 0.52rem;
    --ec-compact-pad-x: 0.64rem;
    --ec-compact-control-height: 34px;
}

/* Content rhythm and typography. The sidebar keeps its established size. */
.shell-app .shell-content {
    font-size: var(--ec-compact-font);
    line-height: 1.35;
}

.shell-app .shell-content :where(h1, h2, h3, h4, h5, h6) {
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
    margin-block: 0 !important;
}

.shell-app .shell-content :where(h1, h2) {
    font-weight: 700 !important;
}

.shell-app .shell-content h1 {
    font-size: 1.2rem !important;
}

.shell-app .shell-content h2 {
    font-size: 1.08rem !important;
}

.shell-app .shell-content :where(h3, h4, h5, h6) {
    font-size: 0.94rem !important;
    font-weight: 600 !important;
}

.shell-app .shell-content :where(p, li, td, small) {
    line-height: 1.35 !important;
}

.shell-app .shell-content p {
    font-size: 0.8rem;
    margin-block: 0.16rem;
}

.shell-app .shell-content small {
    font-size: var(--ec-compact-font-small);
}

.shell-app .shell-content :where(
    label,
    button,
    th,
    strong,
    b,
    [class*="__title"],
    [class*="__label"],
    [class*="__eyebrow"],
    [class*="__kicker"]
) {
    font-weight: 600 !important;
}

.shell-app .shell-content :where(
    [class*="__value"],
    .attendance-kpi-card__value,
    .super-admin-kpi__value,
    .portal-metric > strong,
    .teacher-operational-metric > strong,
    .school-pae-overview__metric > strong
) {
    font-weight: 700 !important;
}

.shell-app .shell-content > .shell-section + .shell-section {
    margin-top: 0.78rem !important;
    padding-top: 0.78rem !important;
}

.shell-app .shell-content :where(
    .shell-section,
    .workspace-shell,
    .workspace-switcher__content,
    .workspace-switcher__panel,
    .workspace-collection,
    .teacher-academic-shell,
    .teacher-planner-shell,
    .teacher-support-shell,
    .teacher-coordination-shell,
    .teacher-written-tests-shell,
    .communication-shell,
    .teacher-lms-main,
    .teacher-lms-activity-list,
    .teacher-lms-material-list,
    .teacher-lms-submission-list,
    .portal-shell,
    .portal-stack,
    .student-life-detail
) {
    gap: var(--ec-compact-gap) !important;
}

/* Headers and summary cards. */
.shell-app .shell-content .shell-hero {
    padding: 0.48rem 0.62rem !important;
}

.shell-app .shell-content .shell-hero__eyebrow {
    font-size: 0.66rem !important;
}

.shell-app .shell-content .shell-hero__title {
    font-size: 1.12rem !important;
    margin: 0.1rem 0 !important;
}

.shell-app .shell-content .shell-hero__copy {
    font-size: 0.78rem !important;
    line-height: 1.32 !important;
}

.shell-app .shell-content :where(
    .shell-card-grid,
    .attendance-kpi-grid,
    .super-admin-kpi-grid,
    .super-admin-panel-grid,
    .super-admin-action-grid,
    .portal-metric-grid,
    .portal-grid,
    .portal-dashboard-grid,
    .teacher-operational-metrics,
    .teacher-analytics-grid,
    .school-pae-overview__metrics,
    .school-pae-overview__closures,
    .school-pae-overview__periods
) {
    gap: 0.46rem !important;
}

.shell-app .shell-content :where(
    .shell-card,
    .attendance-kpi-card,
    .super-admin-kpi,
    .portal-metric,
    .teacher-operational-metric,
    .school-pae-overview__metric,
    .school-pae-overview__closure,
    .school-pae-overview__period,
    .teacher-lms-metric
) {
    min-height: 0 !important;
    padding: 0.48rem 0.58rem !important;
}

.shell-app .shell-content .shell-card__title {
    font-size: 0.84rem !important;
}

.shell-app .shell-content .shell-card__copy {
    font-size: 0.74rem !important;
    line-height: 1.32 !important;
    margin-top: 0.2rem !important;
}

.shell-app .shell-content :where(
    .attendance-kpi-card__value,
    .super-admin-kpi__value,
    .teacher-operational-metric strong,
    .school-pae-overview__metric strong
) {
    font-size: 1.22rem !important;
    line-height: 1 !important;
}

.shell-app .shell-content :where(
    .attendance-kpi-card__label,
    .super-admin-kpi__label,
    .portal-metric span
) {
    font-size: 0.78rem !important;
}

.shell-app .shell-content :where(
    .attendance-kpi-card__meta,
    .super-admin-kpi__meta,
    .portal-metric small
) {
    font-size: 0.68rem !important;
    line-height: 1.25 !important;
}

/* Panels, launchers and registries shared by every operational role. */
.shell-app .shell-content :where(
    .workspace-shell__panel,
    .super-admin-panel,
    .super-admin-action,
    .workspace-block,
    .workspace-launcher__view-head,
    .attendance-card,
    .attendance-correction-workspace,
    .teacher-academic-editor,
    .teacher-note-detail,
    .teacher-support-item,
    .teacher-report-analysis-field,
    .teacher-analytics-panel,
    .teacher-analytics-card,
    .teacher-coordination-alert-board,
    .teacher-coordination-dossier-hero,
    .teacher-observer-detail-hero,
    .teacher-observer-detail-card,
    .teacher-observer-section,
    .teacher-observer-ai-field,
    .teacher-observer-action-field,
    .teacher-observer-log-field,
    .teacher-written-tests-checklist,
    .teacher-written-tests-question,
    .teacher-written-tests-ai,
    .teacher-written-tests-response-card,
    .teacher-written-tests-ai-analysis,
    .teacher-lms-action-card,
    .teacher-lms-activity,
    .teacher-lms-submission,
    .communication-hero,
    .communication-panel,
    .communication-detail,
    .communication-message,
    .portal-panel,
    .portal-student-card,
    .student-life-search__panel,
    .student-life-block,
    .school-pae-overview,
    .school-pae-overview__table-card,
    .school-pae-overview__missing-card,
    .school-setup-guide-strip,
    .school-setup-guide-modal__hero,
    .school-setup-guide-modal__next,
    .school-setup-guide-step
) {
    padding: var(--ec-compact-pad-y) var(--ec-compact-pad-x) !important;
}

.shell-app .shell-content :where(
    .workspace-launcher,
    .workspace-launcher__detail,
    .workspace-launcher__view,
    .workspace-collection__head,
    .workspace-collection__toolbar,
    .workspace-collection__meta,
    .super-admin-panel__body,
    .super-admin-form,
    .super-admin-form__grid,
    .teacher-academic-selector-grid,
    .teacher-academic-editor__grid,
    .teacher-planner-panel,
    .teacher-planner-head,
    .teacher-planner-form,
    .teacher-planner-form--modal,
    .teacher-planner-selector-grid,
    .teacher-planner-summary-list,
    .teacher-support-form,
    .teacher-support-list,
    .teacher-report-workflow,
    .teacher-observer-detail-grid,
    .teacher-observer-timeline,
    .teacher-written-tests-checklists,
    .teacher-written-tests-options,
    .teacher-lms-layout,
    .teacher-lms-overview,
    .teacher-lms-split,
    .teacher-lms-workflow,
    .teacher-lms-action-board,
    .communication-layout,
    .communication-compose form,
    .communication-reply,
    .communication-step-grid,
    .communication-recipient-grid,
    .communication-thread-list,
    .communication-messages,
    .student-life-search__bar,
    .student-life-tab-list,
    .student-life-detail-tabs,
    .school-pae-overview__body
) {
    gap: var(--ec-compact-gap) !important;
}

.shell-app .shell-content .workspace-launcher-card {
    gap: 0.16rem !important;
    min-height: 58px !important;
    padding: 0.46rem 0.56rem !important;
}

.shell-app .shell-content .workspace-launcher-card__eyebrow {
    font-size: 0.64rem !important;
}

.shell-app .shell-content .workspace-launcher-card__title {
    font-size: 0.8rem !important;
}

.shell-app .shell-content .workspace-launcher-card__copy {
    font-size: 0.68rem !important;
    line-height: 1.26 !important;
}

.shell-app .shell-content .workspace-launcher-card__count {
    min-height: 26px !important;
    padding-inline: 0.42rem !important;
}

.shell-app .shell-content .workspace-switcher {
    gap: 0.52rem !important;
}

.shell-app .shell-content .workspace-switcher__tabs {
    gap: 0.38rem !important;
}

.shell-app .shell-content .workspace-switcher__tab {
    gap: 0.3rem !important;
    min-height: 32px !important;
    padding: 0.36rem 0.58rem !important;
    font-size: 0.74rem !important;
}

.shell-app .shell-content .workspace-switcher__tab-count {
    min-height: 22px !important;
    padding-inline: 0.34rem !important;
    font-size: 0.66rem !important;
}

.shell-app .shell-content :where(
    .workspace-collection__empty,
    .teacher-support-empty,
    .teacher-support-empty--compact,
    .teacher-planner-empty,
    .portal-inline-empty,
    .school-pae-overview__empty,
    .communication-form-note
) {
    padding: 0.5rem 0.6rem !important;
    font-size: 0.74rem !important;
    line-height: 1.3 !important;
}

.shell-app .shell-content .workspace-registry {
    gap: 0.3rem !important;
}

.shell-app .shell-content .workspace-registry__row {
    gap: 0.38rem !important;
    padding: 0.4rem 0.48rem !important;
}

.shell-app .shell-content .workspace-registry__cells {
    gap: 0.36rem !important;
}

.shell-app .shell-content .workspace-registry__cell strong {
    font-size: 0.72rem !important;
}

.shell-app .shell-content .workspace-registry__cell span {
    font-size: 0.65rem !important;
}

/* Forms and controls. */
.shell-app .shell-content :where(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
    select,
    textarea,
    .super-admin-form__control,
    .teacher-note-input
) {
    font-size: 0.8rem !important;
    min-height: var(--ec-compact-control-height) !important;
    padding: 0.4rem 0.56rem !important;
}

.shell-app .shell-content textarea {
    line-height: 1.35 !important;
    min-height: 72px !important;
}

.shell-app .shell-content :where(
    .super-admin-form__field,
    .teacher-academic-select,
    .teacher-planner-form label,
    .teacher-academic-editor label,
    .teacher-note-detail label,
    .teacher-support-form label,
    .communication-field,
    .student-photo-workspace__filters > label
) {
    gap: 0.22rem !important;
    font-size: 0.76rem !important;
}

.shell-app .shell-content :where(
    .button-primary,
    .button-secondary,
    .session-tool-button,
    .super-admin-item__action,
    .super-admin-form__submit,
    .workspace-collection__pager button,
    .teacher-planner-form__assistant-button,
    .teacher-planner-ai-card__apply,
    .teacher-coordination-nav__button,
    .teacher-coordination-quick-actions button,
    .teacher-coordination-report-hub__link,
    .student-life-search__button,
    .school-schedule-view-toggle
) {
    font-size: 0.74rem !important;
    min-height: 32px !important;
    padding: 0.36rem 0.58rem !important;
}

/* Academic, planning and classroom work. */
.shell-app .shell-content :where(
    .teacher-academic-pill,
    .teacher-academic-period-tip,
    .teacher-academic-activity-row,
    .teacher-academic-editor__summary,
    .teacher-planner-head__badge,
    .teacher-planner-feedback,
    .teacher-planner-form__assistant,
    .teacher-planner-text-card,
    .teacher-planner-ai-panel,
    .teacher-planner-ai-card,
    .teacher-planner-section > summary,
    .teacher-planner-reference-picker__summary,
    .teacher-planner-reference-option,
    .teacher-planner-chip,
    .teacher-planner-week,
    .teacher-planner-dba-item,
    .teacher-planner-component-card,
    .teacher-planner-usage-row,
    .teacher-lms-classroom,
    .teacher-lms-workflow__card,
    .teacher-lms-form__checks label,
    .teacher-lms-linked-activity,
    .teacher-lms-material
) {
    padding: 0.46rem 0.56rem !important;
}

.shell-app .shell-content :where(
    .teacher-academic-pills,
    .teacher-academic-toolbar,
    .teacher-academic-activity-list,
    .teacher-planner-stat-strip,
    .teacher-planner-reference-options,
    .teacher-planner-usage-list,
    .teacher-lms-source-chips,
    .teacher-lms-resource-chips,
    .teacher-lms-activity__stats
) {
    gap: var(--ec-compact-gap-small) !important;
}

.shell-app .shell-content .teacher-academic-toolbar {
    padding-top: 0.5rem !important;
}

.shell-app .shell-content .teacher-planner-feedback {
    font-size: 0.78rem !important;
    margin-bottom: 0.5rem !important;
}

.shell-app .shell-content .teacher-lms-action-card {
    min-height: 68px !important;
}

/* Attendance and PAE keep clear touch states while reducing surrounding bulk. */
.shell-app .shell-content .attendance-module,
.shell-app .shell-content .attendance-aside,
.shell-app .shell-content .attendance-roster {
    gap: 0.55rem !important;
}

.shell-app .shell-content .attendance-student {
    gap: 0.48rem !important;
    padding: 0.44rem 0.52rem !important;
}

.shell-app .shell-content .attendance-student__main {
    gap: 0.46rem !important;
}

.shell-app .shell-content .attendance-student__photo {
    height: 44px !important;
    width: 44px !important;
}

.shell-app .shell-content .attendance-student__name {
    font-size: 0.84rem !important;
}

.shell-app .shell-content .attendance-student__meta {
    font-size: 0.72rem !important;
    line-height: 1.28 !important;
}

.shell-app .shell-content .attendance-mark-grid {
    gap: 0.3rem !important;
}

.shell-app .shell-content .attendance-mark {
    min-height: 44px !important;
    padding: 0.34rem 0.16rem !important;
}

.shell-app .shell-content .attendance-mark__short {
    font-size: 0.76rem !important;
}

.shell-app .shell-content .attendance-mark__label {
    font-size: 0.58rem !important;
}

.shell-app .shell-content :where(
    .attendance-correction-workspace__item,
    .attendance-pae-window,
    .attendance-side-item,
    .pae-reservation__window,
    .pae-reservation-row,
    .pae-operator__message,
    .pae-operator-empty
) {
    padding: 0.46rem 0.56rem !important;
}

.shell-app .shell-content .pae-operator {
    padding-block: 0.6rem !important;
}

.shell-app .shell-content .pae-operator-student {
    gap: 0.34rem !important;
    min-height: 180px !important;
    padding: 0.46rem !important;
}

.shell-app .shell-content .pae-operator-student img {
    height: 112px !important;
}

/* Coordination, reports, observer and written tests. */
.shell-app .shell-content :where(
    .teacher-coordination-filter-head,
    .teacher-coordination-filter-advanced,
    .teacher-coordination-executive__card,
    .teacher-coordination-report-hub__card,
    .teacher-coordination-priority-item,
    .teacher-coordination-next-action,
    .teacher-coordination-alert-item,
    .teacher-analytics-insights article,
    .teacher-analytics-risk,
    .teacher-observer-student-quick,
    .teacher-observer-student-card,
    .teacher-observer-radiography__head,
    .teacher-observer-radiography-card,
    .teacher-observer-timeline__item,
    .teacher-observer-detail-list__item,
    .teacher-observer-detail-signature,
    .teacher-observer-detail-evidence,
    .teacher-observer-ai-status,
    .teacher-observer-toggle,
    .teacher-observer-stored-signature,
    .teacher-observer-evidence-item,
    .teacher-observer-signature-card,
    .teacher-observer-package-case,
    .teacher-observer-package-commitment,
    .teacher-written-tests-file,
    .teacher-curricular-resources,
    .teacher-curricular-resources__item,
    .teacher-written-tests-context-media,
    .teacher-written-tests-context-media__item,
    .teacher-written-tests-toggle,
    .teacher-written-tests-checklist__item,
    .teacher-written-tests-option__answer,
    .teacher-written-tests-option-read div,
    .teacher-written-tests-capture-item,
    .teacher-written-tests-answer-choice
) {
    padding: 0.48rem 0.58rem !important;
}

.shell-app .shell-content :where(
    .teacher-coordination-filter-grid,
    .teacher-coordination-executive,
    .teacher-coordination-priority-list,
    .teacher-coordination-alert-list,
    .teacher-analytics-insights,
    .teacher-observer-student-grid,
    .teacher-observer-radiography-grid,
    .teacher-observer-package-grid,
    .teacher-observer-detail-list,
    .teacher-written-tests-resource-list,
    .teacher-written-tests-question-list,
    .teacher-written-tests-capture-list
) {
    gap: var(--ec-compact-gap) !important;
}

.shell-app .shell-content .teacher-report-analysis-field__control {
    min-height: 86px !important;
}

.shell-app .shell-content .teacher-analytics-card--chart {
    min-height: 170px !important;
}

/* School administration, calendar, communication and student records. */
.shell-app .shell-content :where(
    .super-admin-banner,
    .super-admin-item,
    .super-admin-color-field,
    .super-admin-image-preview,
    .super-admin-palette-preview,
    .super-admin-search-results,
    .super-admin-search-results__selected,
    .super-admin-search-results__item,
    .super-admin-check-card,
    .school-schedule-summary-chip,
    .school-schedule-empty,
    .school-schedule-conflict,
    .school-vigilance-row,
    .school-calendar-modal__dialog,
    .school-calendar-event-detail,
    .school-calendar-empty,
    .school-calendar-form,
    .school-calendar-range-tools,
    .communication-notice,
    .communication-recipient-grid,
    .communication-choice-list,
    .communication-choice,
    .communication-upload,
    .communication-thread,
    .communication-reply,
    .student-life-result,
    .student-life-profile,
    .student-life-tab-card,
    .student-photo-workspace__metrics span,
    .student-photo-capture,
    .student-photo-capture__filename,
    .student-photo-camera
) {
    padding: 0.46rem 0.56rem !important;
}

.shell-app .shell-content .school-calendar-modal__content,
.shell-app .shell-content .school-calendar-modal__events,
.shell-app .shell-content .school-calendar-form,
.shell-app .shell-content .communication-notice-strip,
.shell-app .shell-content .communication-folder-tabs,
.shell-app .shell-content .communication-choice-list,
.shell-app .shell-content .communication-thread-list,
.shell-app .shell-content .student-life-search__results,
.shell-app .shell-content .student-photo-workspace__body,
.shell-app .shell-content .student-photo-capture__content {
    gap: var(--ec-compact-gap) !important;
}

.shell-app .shell-content .student-life-search__head {
    gap: 0.5rem !important;
}

.shell-app .shell-content .student-life-search__head h2 {
    font-size: 1.06rem !important;
    margin: 0.08rem 0 0.18rem !important;
}

.shell-app .shell-content .student-life-search__inputwrap {
    min-height: 40px !important;
    padding: 0.24rem !important;
}

.shell-app .shell-content .student-life-result {
    min-height: 50px !important;
}

.shell-app .shell-content .student-life-profile {
    gap: 0.5rem !important;
}

.shell-app .shell-content .student-life-profile__photo-button img {
    height: 58px !important;
    width: 58px !important;
}

.shell-app .shell-content .student-life-tab-list {
    gap: 0.24rem !important;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)) !important;
}

.shell-app .shell-content .student-life-tab-card {
    align-content: center !important;
    gap: 0.08rem !important;
    min-height: 44px !important;
    padding: 0.3rem 0.44rem !important;
}

.shell-app .shell-content .student-life-tab-card span {
    font-size: 0.58rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.08em !important;
    line-height: 1.05 !important;
}

.shell-app .shell-content .student-life-tab-card strong {
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    line-height: 1.1 !important;
}

.shell-app .shell-content .student-life-tab-card small {
    font-size: 0.62rem !important;
    font-weight: 500 !important;
    line-height: 1.1 !important;
}

.shell-app .shell-content .student-life-tab-panels {
    min-height: 0 !important;
}

.shell-app .shell-content .school-pae-overview__head h3 {
    font-size: 1.08rem !important;
}

.shell-app .shell-content .school-pae-overview__table th,
.shell-app .shell-content .school-pae-overview__table td,
.shell-app .shell-content .school-schedule-table th,
.shell-app .shell-content .school-schedule-table td,
.shell-app .shell-content .super-admin-schedule-grid__table th,
.shell-app .shell-content .super-admin-schedule-grid__table td {
    padding: 0.38rem 0.42rem !important;
}

/* Dialogs are compact without changing their visual treatment. */
.app-dialog-shell__dialog,
.teacher-note-modal__dialog,
.attendance-photo-modal__dialog {
    gap: 0.58rem !important;
    padding: 0.7rem 0.76rem !important;
}

.app-dialog-shell__dialog :where(h2, h3),
.teacher-note-modal__dialog :where(h2, h3) {
    font-size: 1.02rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

/* Standalone PAE and transport surfaces use the same visual density. */
.pae-shell,
.transport-shell {
    font-size: 0.84rem;
    line-height: 1.35;
}

.pae-shell :where(.hero, .panel),
.transport-shell :where(.hero, .panel) {
    gap: 8px !important;
    padding: 10px !important;
}

.pae-shell .hero h1,
.transport-shell .hero h1 {
    font-size: 1.28rem !important;
}

.pae-shell :where(input, select, textarea, button),
.transport-shell :where(input, select, textarea, button) {
    min-height: 38px !important;
    padding: 7px 9px !important;
}

.pae-shell textarea,
.transport-shell textarea {
    min-height: 64px !important;
}

@media (max-width: 720px) {
    :root {
        --ec-compact-font: 0.84rem;
        --ec-compact-gap: 0.46rem;
        --ec-compact-pad-y: 0.48rem;
        --ec-compact-pad-x: 0.54rem;
        --ec-compact-control-height: 42px;
    }

    .shell-app .shell-content {
        padding: 0.4rem 0.44rem 0.68rem !important;
    }

    .shell-app .shell-content :where(
        input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
        select,
        textarea,
        .super-admin-form__control,
        .teacher-note-input
    ),
    .pae-shell :where(input, select, textarea),
    .transport-shell :where(input, select, textarea) {
        font-size: 16px !important;
    }

    .shell-app .shell-content :where(
        .button-primary,
        .button-secondary,
        .session-tool-button,
        .super-admin-item__action,
        .super-admin-form__submit,
        .workspace-collection__pager button,
        .teacher-planner-form__assistant-button,
        .teacher-planner-ai-card__apply,
        .teacher-coordination-nav__button,
        .teacher-coordination-quick-actions button,
        .teacher-coordination-report-hub__link,
        .student-life-search__button,
        .school-schedule-view-toggle
    ) {
        min-height: 40px !important;
    }

    .shell-app .shell-content .attendance-student__photo {
        height: 48px !important;
        width: 48px !important;
    }

    .shell-app .shell-content .attendance-mark {
        min-height: 48px !important;
    }

    .shell-app .shell-content .pae-operator-student {
        min-height: 170px !important;
    }

    .pae-shell :where(input, select, textarea, button),
    .transport-shell :where(input, select, textarea, button) {
        min-height: 42px !important;
    }
}
