/* Current reading view only. Frozen edition assets and TeX remain unchanged.
   The generic mobile inline-math rule must not shrink-wrap display math:
   KaTeX positions equation numbers against the display's available width.
   On narrow screens a separate number row avoids collisions, including for
   formulas wider than the viewport. The number stays visible while scrolling.
   Only visual layout changes; KaTeX's MathML and equation text are retained. */
@media (max-width: 760px) {
  .avb-current .avb-article .katex-display > .katex {
    display: block;
    min-width: max-content;
  }

  .avb-current .avb-article .katex-display > .katex > .katex-html > .tag {
    position: sticky;
    right: 0;
    display: block;
    width: max-content;
    margin-top: .35em;
    margin-left: auto;
    text-align: right;
    line-height: 1.4;
  }

  /* The copied equation-height strut is unnecessary on the number's own row. */
  .avb-current .avb-article .katex-display > .katex > .katex-html > .tag > .strut {
    display: none;
  }
}
