/* Workspace and dialog chrome only; exported report documents do not load this file. */
.main-area { max-width: none; }
body.has-dialog { overflow: hidden; }
.main-area > *, .overview-grid > *, .profile-main, .report-workspace > * { min-width: 0; }
.page-heading, .panel-title { flex-wrap: wrap; gap: 12px; }
.page-heading > *, .panel-title > *, .class-toolbar > * { min-width: 0; }
.page-heading h1, .panel-title h2, .profile-class, .identity-meta, .directory-student,
.profile-identity h2, .dialog-header h2 { overflow-wrap: anywhere; }
.class-toolbar select { max-width: 100%; }
.dialog-overlay { overscroll-behavior: none; }
.dialog-card { max-height: calc(100vh - 50px); max-height: calc(100dvh - 50px); min-height: 0; }
.dialog-header { gap: 12px; }
.dialog-header > div, .profile-topbar > div { min-width: 0; overflow-wrap: anywhere; }
.dialog-header .btn-close, .profile-topbar .btn-close { flex: 0 0 auto; }
.dialog-body { min-width: 0; overflow-wrap: anywhere; }
.dialog-footer { flex-wrap: wrap; }
.dialog-footer > span { min-width: 0; overflow-wrap: anywhere; }
.dialog-footer > button { flex-shrink: 0; }
.profile-main { min-height: 0; }
.profile-topbar { gap: 12px; }
.profile-topbar > div { flex: 1; }
.profile-topbar > .btn { flex-shrink: 0; margin-left: 0 !important; margin-right: 0 !important; }
.profile-identity > .min-width-0 { min-width: 0; flex: 1; }
.profile-toolbar { flex-wrap: wrap; }
.profile-tabs { max-width: 100%; flex-wrap: wrap; }
.profile-content, .profile-section { overflow-wrap: anywhere; }
.profile-homework > summary { cursor: pointer; }
.homework-scores .table-responsive { max-width: 100%; }
.homework-scores table { min-width: 600px; }
.homework-scores td { overflow-wrap: anywhere; }
.report-settings, .report-preview-pane { overscroll-behavior: contain; }

@media (max-width: 900px) {
    .report-workspace { display: block; overflow: auto; overscroll-behavior: contain; }
    .report-settings { width: 100%; overflow: visible; border-right: 0; border-bottom: 1px solid #e3eaf4; }
    .report-preview-pane { overflow: visible; padding: 16px; }
}
@media (max-width: 760px) {
    .dialog-overlay { padding: 8px; }
    .dialog-card { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
    .profile-overlay { padding: 0; }
    .profile-dialog { max-height: 100vh; max-height: 100dvh; }
    .dialog-header > div, .profile-topbar > div { max-height: 25vh; max-height: 25dvh; overflow: auto; }
    .profile-topbar { padding: 12px; gap: 8px; }
    .profile-toolbar .neutral-pill { white-space: normal; }
    .profile-tabs button { min-width: 0; padding: 8px 6px; }
    .tabs-row { flex-wrap: wrap; }
    .tabs-row .refresh-local { margin-left: 0 !important; }
    .homework-scores .panel-title > div { flex-wrap: wrap; }
}
/* A single body scroller keeps short screens usable even with long identifiers. */
@media (max-width: 760px), (max-height: 640px) {
    .profile-main { display: block; overflow: auto; overscroll-behavior: contain; }
    .profile-content { overflow: visible; min-height: 200px; }
}
@media (max-height: 480px) {
    .dialog-overlay { padding: 8px; }
    .dialog-card { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
    .profile-overlay { padding: 0; }
    .profile-dialog { height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; }
    .dialog-header, .dialog-footer { padding: 10px 16px; }
    .dialog-header .eyebrow { display: none; }
}
