/* Shared table boundary: wide records scroll locally, never stretch the page. */
.table-wrap,.account-table-wrap,.responsive-table-region{
  box-sizing:border-box;width:100%;max-width:100%;min-width:0;
  overflow:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;
  border:1px solid var(--line);border-radius:10px;background:var(--paper);
}
.table-wrap:focus-visible,.account-table-wrap:focus-visible,.responsive-table-region:focus-visible{
  outline:2px solid var(--purple);outline-offset:2px;
}
.main,.system-content,.system-content>main,.page,.page>*,.detail-grid>*,
.child-profile-tab-panel,#childSubmissionList,.submission-analysis,.analysis-columns>*{
  min-width:0;
}
@media(max-width:1000px){
  .detail-grid,.setup-track-grid{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:760px){
  .app,.system-shell,.main,.system-content{max-width:100%;min-width:0;box-sizing:border-box}
  .page-title,.page-title>.toolbar,.panel-head,.section-head{flex-wrap:wrap;min-width:0}
  .page-title>.toolbar{width:100%}
  .toolbar>.field,.submission-filters>.field{max-width:100%;min-width:0}
  .toolbar>input.search{width:100%;max-width:100%;min-width:0;flex:1 1 180px}
  .child-profile-tabs{min-width:0;flex-wrap:wrap}
  .child-profile-tabs .btn{min-width:0;white-space:normal;overflow-wrap:anywhere}
  .submission-filters{grid-template-columns:minmax(0,1fr)}
  .table-has-overflow::before{
    content:'Swipe horizontally to see all columns';display:block;position:sticky;left:0;
    width:max-content;max-width:100%;padding:8px 12px;font-size:11px;line-height:1.4;
    color:var(--muted);background:var(--paper);white-space:normal;
  }
  /* Restore native table semantics after the older mobile card rules. This
     keeps column headers, checkboxes and expandable colspan rows aligned. */
  .table-wrap>table,.account-table-wrap>table,.responsive-table-region>table{
    display:table!important;width:100%;min-width:640px!important;max-width:none!important;
    table-layout:auto;border-collapse:collapse;border-spacing:0;
  }
  .table-wrap>.submission-table{min-width:850px!important;table-layout:fixed}
  .account-table-wrap>.account-table{min-width:1100px!important}
  .table-wrap>table>thead,.account-table-wrap>table>thead,.responsive-table-region>table>thead{
    display:table-header-group;position:static;width:auto;height:auto;margin:0;
    overflow:visible;clip:auto;clip-path:none;white-space:normal;
  }
  .table-wrap>table>tbody,.account-table-wrap>table>tbody,.responsive-table-region>table>tbody{
    display:table-row-group;width:auto;
  }
  .table-wrap>table>tbody>tr,.account-table-wrap>table>tbody>tr,.responsive-table-region>table>tbody>tr{
    display:table-row;width:auto;padding:0;border:0;border-radius:0;
  }
  .table-wrap>table>tbody>tr[hidden],.account-table-wrap>table>tbody>tr[hidden],.responsive-table-region>table>tbody>tr[hidden]{display:none!important}
  .table-wrap>table>tbody>tr>td,.account-table-wrap>table>tbody>tr>td,.responsive-table-region>table>tbody>tr>td{
    display:table-cell;max-width:none;padding:12px 14px;vertical-align:top;
    border-bottom:1px solid var(--line);font-size:12px;overflow-wrap:anywhere;
  }
  .table-wrap>table>tbody>tr>td[data-label]::before{display:none!important;content:none!important}
  .table-wrap table th,.account-table-wrap table th{padding:12px 14px;vertical-align:top;text-align:left}
  .table-wrap table td input[type=checkbox],.account-table-wrap table td input[type=checkbox]{
    width:16px;min-width:16px;height:16px;margin:2px 0;vertical-align:middle;
  }
  .table-wrap table .row-actions,.account-table-wrap table .row-actions{display:flex;flex-wrap:wrap;gap:8px}
  .table-wrap table .row-more,.account-table-wrap table .row-more{white-space:nowrap}
  .submission-analysis-row>td{padding:14px!important}
  .analysis-columns{grid-template-columns:minmax(0,1fr)}
}

/* Learner profile disclosures: titles and metadata share one left edge. */
.profile-syllabus-subject.disclosure-row>summary{
  display:flex!important;flex-direction:column;align-items:flex-start!important;
  justify-content:flex-start;text-align:left;gap:4px!important;
}
.profile-syllabus-subject.disclosure-row>summary>b:first-child{
  flex:0 1 auto;flex-basis:auto;min-width:0;width:100%;text-align:left;
}
.profile-syllabus-subject.disclosure-row>summary>.muted{width:100%;text-align:left}
.profile-syllabus-subject>.profile-syllabus-table-wrap{
  width:auto;max-width:calc(100% - 32px);margin:14px 16px;
}
.profile-syllabus-topic.disclosure-row>summary{
  display:block!important;min-height:0;text-align:left;padding:4px 30px 4px 0!important;
}
.profile-syllabus-topic.disclosure-row>summary>b:first-child{
  display:block;min-width:0;flex:none;line-height:1.5;text-align:left;
}
.profile-syllabus-topic.disclosure-row>summary>small{display:block;margin-top:4px;text-align:left}
.profile-syllabus-topic.disclosure-row>summary:after{top:16px;right:4px}
.profile-bulk-actions{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:8px}
.profile-bulk-actions .btn{max-width:100%;white-space:normal;text-align:left;line-height:1.5}
@media(max-width:760px){
  .profile-syllabus-subject>.profile-syllabus-table-wrap{
    width:auto;max-width:calc(100% - 24px);margin:12px;overflow:visible;
  }
  /* Three fields per topic fit as a compact record; no sideways scrolling
     is needed to connect its name to coverage and understanding. */
  .profile-syllabus-table-wrap>.profile-syllabus-table{
    display:block!important;min-width:0!important;max-width:100%!important;width:100%;
  }
  .profile-syllabus-table-wrap>.profile-syllabus-table>thead{
    position:absolute;display:block;width:1px;height:1px;padding:0;margin:-1px;
    overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;
  }
  .profile-syllabus-table-wrap>.profile-syllabus-table>tbody{display:block;width:100%}
  .profile-syllabus-table-wrap>.profile-syllabus-table>tbody>tr{
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px;
    width:100%;padding:14px 12px;border-bottom:1px solid var(--line);
  }
  .profile-syllabus-table-wrap>.profile-syllabus-table>tbody>tr:last-child{border-bottom:0}
  .profile-syllabus-table-wrap>.profile-syllabus-table>tbody>tr>td{
    display:block;width:auto;min-width:0;max-width:100%;padding:0;border:0;
  }
  .profile-syllabus-table-wrap>.profile-syllabus-table>tbody>tr>td:first-child{grid-column:1/-1}
  .profile-syllabus-table-wrap>.profile-syllabus-table>tbody>tr>td[data-label]:not(:first-child)::before{
    display:block!important;content:attr(data-label)!important;font-size:10px;
    margin-bottom:4px;color:var(--muted);font-weight:550;text-transform:none;
  }
  .profile-syllabus-table-wrap>.profile-syllabus-table>tbody>tr>td:first-child::before{display:none!important}
  .profile-syllabus-table-wrap .profile-syllabus-topic{width:100%;margin:0}
  .profile-syllabus-table-wrap .profile-syllabus-topic ul{padding-left:18px;overflow-wrap:anywhere}
}
