/*
 * PE-Class v1.16.12
 * MacBook PAPS final-column fit and calendar lesson-modal viewport fit.
 * iPad, Fold and non-macOS desktop layouts are intentionally excluded.
 */
@media (min-width:1001px) and (max-width:1800px) {
  html.pe87MacDesktop:not(.pe87Ipad):not(.pe87IpadRuntime):not(.pe87FoldWide)
  #papsTableBox.tableWrap {
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    padding-right:1px!important;
    overflow-x:hidden!important;
    box-sizing:border-box!important;
  }

  html.pe87MacDesktop:not(.pe87Ipad):not(.pe87IpadRuntime):not(.pe87FoldWide)
  #papsTableBox table.pe87Paps.dataTable {
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    table-layout:fixed!important;
    box-sizing:border-box!important;
  }

  /* Move one percentage point from grip records to the final grade column. */
  html.pe87MacDesktop:not(.pe87Ipad):not(.pe87IpadRuntime):not(.pe87FoldWide)
  #papsTableBox table.pe87Paps th:nth-child(6),
  html.pe87MacDesktop:not(.pe87Ipad):not(.pe87IpadRuntime):not(.pe87FoldWide)
  #papsTableBox table.pe87Paps td:nth-child(6) {
    width:17%!important;
  }

  html.pe87MacDesktop:not(.pe87Ipad):not(.pe87IpadRuntime):not(.pe87FoldWide)
  #papsTableBox table.pe87Paps th:nth-child(12),
  html.pe87MacDesktop:not(.pe87Ipad):not(.pe87IpadRuntime):not(.pe87FoldWide)
  #papsTableBox table.pe87Paps td:nth-child(12) {
    width:7%!important;
    min-width:0!important;
    padding-left:2px!important;
    padding-right:2px!important;
    overflow:hidden!important;
    white-space:nowrap!important;
    box-sizing:border-box!important;
  }

  html.pe87MacDesktop:not(.pe87Ipad):not(.pe87IpadRuntime):not(.pe87FoldWide)
  #papsTableBox .overallGradeBadge {
    display:inline-flex!important;
    width:min(100%,64px)!important;
    min-width:0!important;
    max-width:64px!important;
    margin:0 auto!important;
    padding:5px 3px!important;
    align-items:center!important;
    justify-content:center!important;
    font-size:10.5px!important;
    line-height:1.1!important;
    white-space:nowrap!important;
    box-sizing:border-box!important;
  }

  /*
   * Keep the MacBook lesson-registration modal inside the visible viewport.
   * The modal sits above the fixed site header, and its own header remains
   * visible if a short MacBook viewport needs internal scrolling.
   */
  html.pe87MacDesktop:not(.pe87Ipad):not(.pe87IpadRuntime):not(.pe87FoldWide)
  .calendarAddCModal {
    top:0!important;
    right:0!important;
    bottom:0!important;
    left:0!important;
    width:100vw!important;
    height:100dvh!important;
    min-height:0!important;
    align-items:flex-start!important;
    justify-content:center!important;
    padding:16px 22px!important;
    overflow:hidden!important;
    z-index:4990!important;
    box-sizing:border-box!important;
  }

  html.pe87MacDesktop:not(.pe87Ipad):not(.pe87IpadRuntime):not(.pe87FoldWide)
  .calendarAddCModal .calendarAddDialog {
    width:min(720px,calc(100vw - 44px))!important;
    max-height:calc(100dvh - 32px)!important;
    margin:0 auto!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    transform:none!important;
    -webkit-overflow-scrolling:touch;
    box-sizing:border-box!important;
  }

  html.pe87MacDesktop:not(.pe87Ipad):not(.pe87IpadRuntime):not(.pe87FoldWide)
  .calendarAddCModal .calendarAddHeader {
    position:sticky!important;
    top:0!important;
    z-index:8!important;
  }
}
