.math-scroll{box-sizing:border-box;width:100%;max-width:100%;min-width:0;overflow-x:auto;overflow-y:hidden;padding:12px 2px;scrollbar-width:thin;scrollbar-color:#b8cdc7 transparent;outline-offset:3px}
.math-scroll:focus-visible{outline:2px solid #148b86;border-radius:6px}
.math-scroll-hint{display:none;color:#71898d;font-size:calc(9px + var(--font-increase));line-height:1.5;margin:0 0 5px}
math,math *{font-family:"Times New Roman",serif}
/* Keep identifiers in Times New Roman's italic face instead of MathML's Unicode math-font fallback. */
math mi{text-transform:none;font-style:italic}
math mi[mathvariant="normal"]{font-style:normal}
/* Times New Roman has no stretchable math glyphs; scale its own brace to cover the cases. */
.math-case-brace{transform:scaleY(var(--case-brace-scale,1));transform-origin:center}
.math-scroll math{display:block;width:max-content;min-width:0;margin:0;font-size:calc(18px + var(--font-increase));color:#193e4a;line-height:1.6;text-align:left}
.math-scroll mtext{font-family:inherit;font-size:.9em}.math-cost,.math-rules,.math-reference,.math-substitutions,.math-substitution,.math-line{min-width:0;max-width:100%}
.math-cost{margin:12px 0;padding:8px 16px 10px;border:1px solid #d9e7e3;border-radius:12px;background:linear-gradient(120deg,#f4faf7,#fbfcfd)}
.math-cost .math-scroll{padding:14px 2px}.math-legend{font-size:calc(10px + var(--font-increase));line-height:1.85;color:#617b83;margin:9px 0 0;font-family:var(--font-sans,Arial,sans-serif);font-weight:400;white-space:normal;overflow-wrap:anywhere}
.math-rules{margin:14px 0}.math-line{display:block;padding:7px 0}.math-line>span{display:block;font-size:calc(10px + var(--font-increase));font-weight:600;color:#607c82}.math-line+.math-line{border-top:1px solid #e3ebe8}.math-line>.math-scroll{padding:9px 2px}
.math-reference.formula-box{padding:22px;border:1px solid #dbe8e3;background:#f8fbf9;color:#213e4b}.math-reference>.math-rules{margin:0 0 18px}.math-substitutions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.math-substitution{background:#fff;border:1px solid #e1e9e6;border-radius:10px;padding:17px}.math-substitution h4{margin:0 0 9px;color:#27675f;font-size:calc(13px + var(--font-increase))}.math-substitution .math-scroll math{font-size:calc(16px + var(--font-increase))}.math-total{margin-top:18px;padding:10px 16px;background:#eaf4ee;border-radius:10px;min-width:0}.math-total .math-scroll math{font-weight:600;color:#176651}
.hd-cost:has(.math-cost){min-width:0;max-width:100%}.md-constraints .math-cost{margin-bottom:6px}.math-storage-meta{line-height:1.8;margin:10px 0;font-size:calc(11px + var(--font-increase))}.notice:has(.math-cost){min-width:0}.math-reference .math-legend{color:#617b83}
@media(max-width:1000px){.math-substitutions{grid-template-columns:1fr}}
@media(max-width:600px){.math-scroll-hint{display:block}.math-cost{padding:6px 11px}.math-reference.formula-box{padding:16px 12px}.math-substitution{padding:13px 11px}.math-scroll math{font-size:calc(17px + var(--font-increase))}.math-total{padding:8px 11px}}
