/* text-size.css: reading text follows the iPhone's text size (13 Nov 2026). Phone width only (linked with
   media="(max-width: 899px)"). features/text-size.js sets --rt (1 to 1.6) and data-rt on <html> when the person has
   picked a larger size; with the default size neither is set and nothing here applies.

   `zoom` scales the text, its line height and its own padding together, so one rule per element keeps each
   screen's own sizes as the base (no copied pixel values to drift). Only leaf text gets it, never a box that holds
   other zoomed text (zoom multiplies) and never a drag surface (zoom shifts its touch maths).
   Kept fixed on purpose: top bars, the tab bar, counters, timers, chips, letter badges and buttons. */

/* The Sim Lab "Scenario" chip sits inside the scenario text, so it undoes the zoom it inherits. */
html[data-rt] body .sl-scn-prose .isl-scn-k { zoom: calc(1 / var(--rt, 1)); }

html[data-rt] body :is(
  /* quiz (also the 60-question set and the drills, which use the quiz screen) */
  #page-quiz .q-scenario-body, #page-quiz .option .opt-text, #page-quiz #exp-text, #page-quiz #exp-wrong-explain,
  /* full exam */
  #page-exam .q-scenario-body, #page-exam #exam-options .opt-text, #page-exam #exam-wrong-explain,
  /* Sim Lab and Decision Lab (also lab questions inside the exam) */
  .sl-scn-prose, .sl-analyze-line,
  /* Daily Review */
  #page-sr-review .sr-option-text, #page-sr-review .sr-explanation,
  /* answer review and exam results */
  #ios-review .ia-qa-q, #ios-review .ia-otx, #ios-review .ia-qa-ex, #ios-exam-results .ie-sdet
) { zoom: var(--rt, 1); }

/* Questions and lab step headings are already large (quiz 22px, exam 18px, Daily Review 20px, lab steps 15.5px bold),
   so they grow at half the rate, as the iPhone's own headings do. At the cap the quiz question reaches about 28px
   instead of 35px, which leaves the answers on screen. */
html[data-rt] body :is(#page-quiz #q-text, #page-exam #exam-q-text, #page-sr-review .sr-question, .sl-step .sl-prompt) { zoom: calc(1 + (var(--rt, 1) - 1) / 2); }

/* Diagram questions in Sim Lab (sim-lab-scene-ui.js): the pick line, hints, the list version and the notes grow like
   reading text; the printouts grow at half rate, like headings, so their columns stay on screen. */
html[data-rt] body :is(#page-sim-lab, #page-decision-lab, #page-exam .exam-pbq) :is(.sl-scene-pick, .sl-locate-hint, .sl-scene-ev-sub, .sl-scene-text li) { zoom: var(--rt, 1); }
html[data-rt] body :is(#page-sim-lab, #page-decision-lab, #page-exam .exam-pbq) .sl-scene-term { zoom: calc(1 + (var(--rt, 1) - 1) / 2); }

/* Lab answers you drag, match or sort: these get a bigger font instead of zoom, because zoom would throw off
   where a finger lands while dragging. The base sizes are the ones lift-ios.css sets for these items. Lab dropdowns and
   typing boxes never go below 16px (dg-system.css forces 16px !important on touch screens so iPhone doesn't zoom in
   on a tap), hence the max() and the !important here. */
html[data-rt] body :is(#page-sim-lab.isl-practice, #page-sim-lab.isl-exam, #page-exam .exam-pbq, #page-decision-lab.idl-practice, #page-decision-lab.idl-exam) :is(.sl-order-row, .sl-chip, .sl-match-l, .sl-match-r) { font-size: calc(13px * var(--rt, 1)); }
html[data-rt] body :is(#page-sim-lab.isl-practice, #page-sim-lab.isl-exam, #page-exam .exam-pbq, #page-decision-lab.idl-practice, #page-decision-lab.idl-exam) :is(.sl-cfg-select, .sl-field-input) { font-size: max(16px, calc(13.5px * var(--rt, 1))) !important; }
