/*
 * PE-Class 11984 — compact assessment, student summary and PAPS polish
 *
 * This file is intentionally limited to iPhone/Fold7-folded widths. Wide
 * workspaces keep their fixed record headers and table geometry unchanged.
 */

@media (max-width: 768px) {
  /* Mobile assessment: max-score/interval settings start collapsed. */
  body.mobileAssessmentView .assessConfig > .assessConfigTitle {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    min-height: 44px !important;
    margin: 0 0 10px !important;
    padding: 0 2px !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
  }

  body.mobileAssessmentView .assessConfig > .assessConfigTitle::after {
    content: "⌃";
    flex: 0 0 auto !important;
    width: 28px !important;
    height: 28px !important;
    border: 1px solid #d7e1ec !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #52697d !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 15px !important;
    line-height: 1 !important;
  }

  body.mobileAssessmentView .assessConfig.mobileAssessmentConfigCollapsed
  > .assessConfigTitle {
    margin-bottom: 0 !important;
  }

  body.mobileAssessmentView .assessConfig.mobileAssessmentConfigCollapsed
  > .assessConfigTitle::after {
    content: "⌄";
  }

  body.mobileAssessmentView .assessConfig.mobileAssessmentConfigCollapsed
  > #assessConfigCards {
    display: none !important;
  }

  /*
   * Student detail: remove only the old assessment-summary frame. The compact
   * year/semester controls share the heading row and the record cards remain
   * on the full-width row below.
   */
  html[data-pe-tab="students"] #app.studentScreen
  #studentDetail > .studentAssessmentSection {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    column-gap: 8px !important;
    row-gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  html[data-pe-tab="students"] #app.studentScreen
  #studentDetail > .studentAssessmentSection > h3 {
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: center !important;
    min-width: 0 !important;
    margin: 0 !important;
    font-size: clamp(14px, 3.75vw, 16px) !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
  }

  html[data-pe-tab="students"] #app.studentScreen
  #studentDetail > .studentAssessmentSection > #studentAssessmentSummary {
    display: contents !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  html[data-pe-tab="students"] #app.studentScreen
  .studentAssessmentSection #studentAssessmentSummary > .academicToolbar {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: max-content 64px max-content 52px !important;
    align-items: center !important;
    justify-self: end !important;
    gap: 3px !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html[data-pe-tab="students"] #app.studentScreen
  .studentAssessmentSection #studentAssessmentSummary > .academicToolbar > span {
    min-width: 0 !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  html[data-pe-tab="students"] #app.studentScreen
  .studentAssessmentSection #studentAssessmentSummary > .academicToolbar > select {
    width: 100% !important;
    min-width: 0 !important;
    height: 34px !important;
    min-height: 34px !important;
    margin: 0 !important;
    padding: 0 16px 0 4px !important;
    box-sizing: border-box !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 34px !important;
    text-align: center !important;
    text-align-last: center !important;
    white-space: nowrap !important;
  }

  html[data-pe-tab="students"] #app.studentScreen
  .studentAssessmentSection #studentAssessTable {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}
