/* qxmd350: Play app + phone web + landscape/portrait.
   Question text ~MARKS reading size. Stem/solution figures fill the paper
   (lift the 240/280px laptop cap). Option figures stay compact. Table cells stay in-cell. */

html[data-qx-shell="app"],
html[data-qx-shell="app"] body {
  --nta-q: 18px;
  --nta-lh: 1.65;
  --qx-read-stem: 18px;
  --qx-read-opt: 18px;
  --qx-read-sol: 18px;
  --qx-read-lh: 1.65;
}
html[data-qx-shell="app"][data-font-scale="small"],
html[data-qx-shell="app"][data-font-scale="small"] body {
  --nta-q: 16px; --qx-read-stem: 16px; --qx-read-opt: 16px; --qx-read-sol: 16px;
}
html[data-qx-shell="app"][data-font-scale="large"],
html[data-qx-shell="app"][data-font-scale="large"] body {
  --nta-q: 20px; --qx-read-stem: 20px; --qx-read-opt: 20px; --qx-read-sol: 20px;
}
html[data-qx-shell="app"][data-font-scale="xlarge"],
html[data-qx-shell="app"][data-font-scale="xlarge"] body {
  --nta-q: 22px; --qx-read-stem: 22px; --qx-read-opt: 22px; --qx-read-sol: 22px;
}

html[data-qx-shell="app"] body #app-main .eg-test-root .eg-q-stem,
html[data-qx-shell="app"] body #app-main .eg-test-root .eg-opt,
html[data-qx-shell="app"] body #app-main .eg-test-root #egQArea,
html[data-qx-shell="app"] body #app-main .eg-test-root .qx-question-body,
html[data-qx-shell="app"] body #app-main .mtk-test-root .mtk-q-text,
html[data-qx-shell="app"] body #app-main .mtk-test-root .mtk-opt,
html[data-qx-shell="app"] body #app-main .mtk-test-root .mtk-opt-text,
html[data-qx-shell="app"] body #app-main .qzrr-cbt .mtk-q-text,
html[data-qx-shell="app"] body #app-main .qzrr-cbt .mtk-opt,
html[data-qx-shell="app"] body #app-main .qzrr-cbt .mtk-opt-text,
html[data-qx-shell="app"] body #app-main .qx-sol-flow,
html[data-qx-shell="app"] body #app-main #egSol,
html[data-qx-shell="app"] body #app-main .sol-body,
html[data-qx-shell="app"] body #app-main .eg-sol,
html[data-qx-shell="app"] body #app-main .qx-sol-card .qx-sol-flow,
html[data-qx-shell="app"] body #app-main #qaSolReveal .qx-sol-flow,
html[data-qx-shell="app"] body #app-main .allen-practice .mtk-q-text,
html[data-qx-shell="app"] body #app-main .allen-practice .mtk-opt-text {
  font-size: var(--nta-q, 18px) !important;
  line-height: var(--nta-lh, 1.65) !important;
}

html[data-qx-shell="app"] body #app-main .eg-q-stem img,
html[data-qx-shell="app"] body #app-main .mtk-q-text img,
html[data-qx-shell="app"] body #app-main .qx-question-body img,
html[data-qx-shell="app"] body #app-main .qx-diagram-slot img,
html[data-qx-shell="app"] body #app-main #qxDiagramSlot img,
html[data-qx-shell="app"] body #app-main .qx-diagram-seg img,
html[data-qx-shell="app"] body #app-main .qx-sol-flow img,
html[data-qx-shell="app"] body #app-main #egSol img,
html[data-qx-shell="app"] body #app-main .sol-body img,
html[data-qx-shell="app"] body #app-main .qx-sol-fig,
html[data-qx-shell="app"] body #app-main .tlx-qfig img,
html[data-qx-shell="app"] body #app-main .qx-tlx-stem img,
html[data-qx-shell="app"] body #app-main .qx-tlx-qimg {
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
}
html[data-qx-shell="app"] body #app-main .tlx-qfig img,
html[data-qx-shell="app"] body #app-main .qx-tlx-stem img,
html[data-qx-shell="app"] body #app-main .qx-tlx-qimg {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
}
html[data-qx-shell="app"] body #app-main .eg-opt img,
html[data-qx-shell="app"] body #app-main .mtk-opt img,
html[data-qx-shell="app"] body #app-main #qxOpts img,
html[data-qx-shell="app"] body #app-main .qzrr-opts img,
html[data-qx-shell="app"] body #app-main img.qx-opt-fig-img,
html[data-qx-shell="app"] body #app-main .qx-opt-diagram-slot img,
html[data-qx-shell="app"] body #app-main .qx-prac-opt img {
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  max-height: min(42vh, 320px) !important;
  object-fit: contain !important;
}
html[data-qx-shell="app"] body #app-main table img {
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  max-height: min(28vh, 220px) !important;
}

@media (max-width: 900px), (pointer: coarse) and (hover: none), (orientation: landscape) and (max-height: 580px) {
  :root, html, html[data-font-scale="medium"], html[data-font-scale="medium"] body {
    --nta-q: 18px;
    --nta-lh: 1.65;
    --qx-read-stem: 18px;
    --qx-read-opt: 18px;
    --qx-read-sol: 18px;
    --qx-read-lh: 1.65;
  }
  html[data-font-scale="small"], html[data-font-scale="small"] body {
    --nta-q: 16px; --qx-read-stem: 16px; --qx-read-opt: 16px; --qx-read-sol: 16px;
  }
  html[data-font-scale="large"], html[data-font-scale="large"] body {
    --nta-q: 20px; --qx-read-stem: 20px; --qx-read-opt: 20px; --qx-read-sol: 20px;
  }
  html[data-font-scale="xlarge"], html[data-font-scale="xlarge"] body {
    --nta-q: 22px; --qx-read-stem: 22px; --qx-read-opt: 22px; --qx-read-sol: 22px;
  }

  html body #app-main .eg-test-root .eg-q-stem,
  html body #app-main .eg-test-root .eg-opt,
  html body #app-main .eg-test-root #egQArea,
  html body #app-main .eg-test-root .qx-question-body,
  html body #app-main .mtk-test-root .mtk-q-text,
  html body #app-main .mtk-test-root .mtk-opt,
  html body #app-main .mtk-test-root .mtk-opt-text,
  html body #app-main .qzrr-cbt .mtk-q-text,
  html body #app-main .qzrr-cbt .mtk-opt,
  html body #app-main .qzrr-cbt .mtk-opt-text,
  html body #app-main .qx-sol-flow,
  html body #app-main #egSol,
  html body #app-main .sol-body,
  html body #app-main .eg-sol,
  html body #app-main .qx-sol-card .qx-sol-flow,
  html body #app-main #qaSolReveal .qx-sol-flow,
  html body #app-main .allen-practice .mtk-q-text,
  html body #app-main .allen-practice .mtk-opt-text,
  html body .eg-test-root .eg-q-stem,
  html body .eg-test-root .eg-opt,
  html body .mtk-test-root .mtk-q-text,
  html body .mtk-test-root .mtk-opt-text,
  html body .qzrr-cbt .mtk-q-text,
  html body .qzrr-cbt .mtk-opt-text {
    font-size: var(--nta-q, 18px) !important;
    line-height: var(--nta-lh, 1.65) !important;
  }

  html body #app-main .eg-q-stem img,
  html body #app-main .mtk-q-text img,
  html body #app-main .qx-question-body img,
  html body #app-main .qx-diagram-slot img,
  html body #app-main #qxDiagramSlot img,
  html body #app-main .qx-diagram-seg img,
  html body #app-main .qx-sol-flow img,
  html body #app-main #egSol img,
  html body #app-main .sol-body img,
  html body #app-main .qx-sol-fig,
  html body #app-main .tlx-qfig img,
  html body #app-main .qx-tlx-stem img,
  html body #app-main .qx-tlx-qimg,
  html body .eg-test-root .eg-q-stem img,
  html body .mtk-test-root .mtk-q-text img,
  html body .qzrr-cbt .mtk-q-text img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
  }
  html body #app-main .tlx-qfig img,
  html body #app-main .qx-tlx-stem img,
  html body #app-main .qx-tlx-qimg,
  html body .tlx-qfig img,
  html body .qx-tlx-stem img,
  html body .qx-tlx-qimg {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
  }
  html body #app-main .eg-opt img,
  html body #app-main .mtk-opt img,
  html body #app-main #qxOpts img,
  html body #app-main .qzrr-opts img,
  html body #app-main img.qx-opt-fig-img,
  html body #app-main .qx-opt-diagram-slot img,
  html body #app-main .qx-prac-opt img,
  html body .eg-test-root .eg-opt img,
  html body .mtk-test-root .mtk-opt img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    max-height: min(42vh, 320px) !important;
    object-fit: contain !important;
  }
  html body #app-main table img,
  html body .eg-test-root table img,
  html body .mtk-test-root table img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    max-height: min(28vh, 220px) !important;
  }

  html body #app-main .eg-test-root .eg-q-card,
  html body #app-main .mtk-test-root .mtk-q-wrap,
  html body .eg-test-root .eg-q-card {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  html body #app-main .eg-test-root > .eg-top,
  html body #app-main .eg-test-root .eg-top,
  html body .eg-test-root > .eg-top {
    min-height: 44px !important;
    height: auto !important;
    max-height: none !important;
  }
  html body #app-main .eg-test-root .eg-info-strip,
  html body .eg-test-root .eg-info-strip {
    min-height: 28px !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
  }
  html body #app-main .eg-test-root .eg-body,
  html body .eg-test-root .eg-body {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

html body .mtk-opt-letter,
html body .qx-opt-circle,
html[data-qx-shell="app"] body .mtk-opt-letter,
html[data-qx-shell="app"] body .qx-opt-circle {
  font-size: 14px !important;
}
