/* Build-time formula layout. Loaded by lesson and combined-unit reading pages. */
/* A lab keeps the maths face its own controls use (tests/e2e/explorers.spec.js); lesson text takes the reading face. */
:is(.pg-lesson, .pg-unit-read) :is(.lesson-page, .unit-reading) .m:not(:is(.explorer, section.tool) *) {
  font-family: var(--ui);
  font-size: 1em;
  color: inherit;
}
:is(.pg-lesson, .pg-unit-read) :is(.lesson-page, .unit-reading) .f:not(:is(.explorer, section.tool) *) { font-size: 1em; vertical-align: middle; margin: .15em .22em; line-height: 1.25; }
:is(.pg-lesson, .pg-unit-read) :is(.lesson-page, .unit-reading) .f:not(:is(.explorer, section.tool) *) > b { padding: 0 .3em .12em; font-weight: inherit; }
:is(.pg-lesson, .pg-unit-read) :is(.lesson-page, .unit-reading) .f:not(:is(.explorer, section.tool) *) > i { padding: .12em .3em 0; }
:is(.pg-lesson, .pg-unit-read) :is(.lesson-page, .unit-reading) sup:not(:is(.explorer, section.tool) *), :is(.pg-lesson, .pg-unit-read) :is(.lesson-page, .unit-reading) sub:not(:is(.explorer, section.tool) *) { font-size: max(14px, .72em); }
:is(.pg-lesson, .pg-unit-read) :is(.lesson-page, .unit-reading) .sq:not(:is(.explorer, section.tool) *) { vertical-align: baseline; }
:is(.pg-lesson, .pg-unit-read) :is(.lesson-page, .unit-reading) .rad:not(:is(.explorer, section.tool) *) { padding-top: .12em; }
:is(.pg-lesson, .pg-unit-read) .th.lesson .rule-first {
  padding: 22px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: 400 calc(22px * var(--text-scale, 1))/1.65 var(--ui);
  overflow-wrap: normal;
}
:is(.pg-lesson, .pg-unit-read) .formula-line {
  position: relative;
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: .2em 0 .4em;
  white-space: nowrap;
  text-align: left;
  scrollbar-width: thin;
}
:is(.pg-lesson, .pg-unit-read) .formula-line:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
:is(.pg-lesson, .pg-unit-read) .steps .s { min-width: 0; max-width: 100%; font: 400 calc(18px * var(--text-scale, 1))/1.65 var(--ui); color: var(--ink); }
:is(.pg-lesson, .pg-unit-read) .steps > li, :is(.pg-lesson, .pg-unit-read) .rule-block, :is(.pg-lesson, .pg-unit-read) :is(.lesson-page, .unit-reading) { min-width: 0; }
@media (forced-colors: active) {
  :is(.pg-lesson, .pg-unit-read) .formula-line:focus-visible { outline-color: CanvasText; }
  :is(.pg-lesson, .pg-unit-read) .th.lesson .rule-first { border-color: CanvasText; }
}
:is(.pg-lesson, .pg-unit-read) .rule-block > p:not(.rule-first) { font: 400 calc(18px * var(--text-scale, 1))/1.65 var(--ui); color: var(--ink); }
/* A display formula in the rule's explanation stands on its own line at the rule's size; the rule itself is the one card. */
:is(.pg-lesson, .pg-unit-read) .rule-block > p:not(.rule-first) .formula-line {
  box-sizing: border-box;
  padding: 6px 0 10px;
  margin: 4px 0;
  font-size: calc(22px * var(--text-scale, 1));
}

/* Keep absolute semantic companions inside a horizontally scrolling table. */
:is(.pg-lesson, .pg-unit-read) :is(.tbl, .tw) { position: relative; }
