/* 1.22.51 — presentation only. No assessment data or input handlers change.
 * Compact phones omit template replacement; iPad landscape fits the O/X
 * workspace using bounded type/spacing, never clipping records or shrinking
 * interactive O/X targets below 44px. Short screens scroll the page, not a
 * second viewport inside the input table. */
@media (max-width:768px) {
  html:not(.pe87Ipad):not(.pe87IpadRuntime):not([data-pe-ipados="true"]):not(.pe87FoldWide):not([data-pe-fold-wide="true"])
    #replaceAssessTemplateBtn {
    display:none!important;
  }
}
/* A rotated phone can be wider than the compact breakpoint. Device markers
 * exclude iPad and an unfolded Fold; fine-pointer desktop windows are intact. */
@media (pointer:coarse) and (orientation:landscape) and (max-width:1000px) and (max-height:500px) {
  html:not(.pe87Ipad):not(.pe87IpadRuntime):not([data-pe-ipados="true"]):not(.pe87FoldWide):not([data-pe-fold-wide="true"])
    #replaceAssessTemplateBtn {
    display:none!important;
  }
}

@media screen and (min-width:769px) and (orientation:landscape) {
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide {
    --ox-ipad-text:clamp(11px,1.08vw,13px);
    --ox-ipad-secondary:clamp(11px,1vw,12px);
    --ox-ipad-row-space:clamp(0px,calc((100dvh - 650px) / 160),2px);
  }

  /* Removing the height limit is deliberate: twelve 44px touch rows cannot
   * fit a short browser viewport after its toolbars, without losing usable
   * targets. All rows stay in normal page flow, including long criterion names. */
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixPanel {
    overflow:visible;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixScroll {
    max-height:none;
    height:auto;
    /* With no height cap this has no vertical overflow. Horizontal access is
     * retained for a narrow Stage Manager window, rather than cropping pupils. */
    overflow:auto;
    overscroll-behavior:auto;
    scroll-padding:0;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixTable {
    width:100%;
    min-width:calc(164px + var(--ox-students,1) * 104px);
    font-size:var(--ox-ipad-text);
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixTable .oxMatrixCriterionCol {
    width:clamp(164px,17vw,208px);
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixTable[data-count="1"] .oxMatrixCriterionCol {
    width:52%;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixTable[data-count="2"] .oxMatrixCriterionCol {
    width:38%;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixTable th,
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixTable td {
    padding:var(--ox-ipad-row-space) 4px;
    text-align:center;
    vertical-align:middle;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixTable thead th,
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixTable .oxMatrixCorner {
    padding:6px 4px;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixTable .oxMatrixCriterion {
    padding:var(--ox-ipad-row-space) 6px;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixCriterionInner {
    min-height:44px;
    gap:6px;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixNumber {
    flex-basis:21px;
    width:21px;
    height:21px;
    font-size:11px;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixCriterionName,
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixName {
    font-size:var(--ox-ipad-text);
    line-height:1.35;
    white-space:normal;
    overflow-wrap:anywhere;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixGender,
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixResult .oxMatrixSummary {
    font-size:var(--ox-ipad-secondary);
    line-height:1.3;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixResult {
    gap:2px 5px;
    margin-top:3px;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxStudentBulk {
    margin-top:4px;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxStudentBulk .oxBulkButton {
    min-height:44px;
    font-size:var(--ox-ipad-secondary);
    padding:3px 2px;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixChoices {
    gap:4px;
    min-width:92px;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxMatrixChoice {
    flex:0 0 44px;
    width:44px;
    min-width:44px;
    max-width:44px;
    height:44px;
    min-height:44px;
    font-size:clamp(18px,1.65vw,21px);
  }

  /* Twelve criterion columns plus student/count/score/status fit within the
   * available landscape width. Historical criteria are NOT omitted: for very
   * large merged histories the existing scroll container remains available,
   * with a readable 38px minimum per criterion instead of microscopic text. */
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxResultsPanel {
    padding:12px;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxResultsTableScroll {
    container-type:inline-size;
    scroll-padding-left:86px;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxResultsTable {
    width:100%;
    min-width:calc(274px + var(--ox-results-criteria,0) * 38px + var(--ox-results-extra,0) * 72px);
    max-width:none;
    table-layout:fixed;
    font-size:var(--ox-ipad-text);
    font-size:clamp(11px,1.2cqw,13px);
    line-height:1.4;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxResultsTable th,
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxResultsTable td {
    min-width:0;
    padding:7px 3px;
    white-space:normal;
    word-break:keep-all;
    overflow-wrap:anywhere;
    text-align:center;
    vertical-align:middle;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxResultsTable thead th {
    padding:8px 3px;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxResultsTable .oxResultsStudent {
    width:84px;
    min-width:0;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxResultsTable .oxResultsCount {
    width:50px;
    min-width:0;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxResultsTable .oxResultsScore {
    width:54px;
    min-width:0;
    font-size:clamp(12px,1.15vw,15px);
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxResultsTable .oxResultsStatus {
    width:86px;
    min-width:0;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxResultsTable .oxResultsMeasurement {
    width:72px;
    min-width:0;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxResultsName {
    font-size:var(--ox-ipad-text);
    line-height:1.4;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxResultsDetailState,
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxResultsPreviousCount,
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxResultPriorCriterion {
    font-size:11px;
    line-height:1.4;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxResultAnswer {
    box-sizing:border-box;
    min-width:0;
    max-width:100%;
    min-height:26px;
    padding:3px 2px;
    font-size:clamp(12px,1.16vw,15px);
    line-height:1.3;
    white-space:normal;
    overflow-wrap:anywhere;
  }
  html:is(.pe87Ipad,.pe87IpadRuntime,[data-pe-ipados="true"]) .stationOx.oxWide .oxResultAnswer.isUnmarked {
    font-size:11px;
  }
}
