.typst-document { width: 100%; }
.typst-document .typst-document-page { display: block; width: 100%; max-width: 100%; height: auto; margin: 0 0 1.5rem; background: transparent; }
.typst-reading { margin-block: 1.5rem; }
.typst-reading summary { cursor: pointer; }
@media print { .typst-document-page { break-inside: avoid; } }
.typst-page { position: relative; margin-block-end: 1.5rem; }
.typst-page-canvas { position: relative; }
.typst-page-canvas > .typst-document-page { margin: 0; }
.typst-note-ref { position: absolute; display: block; min-width: 12px; min-height: 16px; border: 0 !important; box-shadow: none !important; text-decoration: none !important; background: transparent; z-index: 1; scroll-margin-block: 5rem; }
.typst-note-ref:focus-visible, .typst-sidenote:focus-visible { outline: 2px solid var(--rubric, #a8382a); outline-offset: 3px; }
.typst-note-ref:hover { background: var(--azure-soft, #dde3f5); opacity: .45; }
.typst-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.typst-page .typst-sidenote { float: none; clear: none; box-sizing: border-box; width: 100%; max-width: none; margin: .75rem 0 1.25rem; padding-inline-start: .95rem; border-inline-start: 1px solid var(--rubric-dim, #a8382a); font-family: inherit; font-size: 14px; line-height: 1.45; color: var(--ink-2, inherit); overflow-wrap: anywhere; scroll-margin-block: 5rem; }
.typst-sidenote .n { display: block; font: 11px/1.45 var(--mono, ui-monospace, monospace); color: var(--rubric, #a8382a); margin-block-end: .3rem; }
.typst-sidenote .footnote-backref { font-family: var(--mono, ui-monospace, monospace); }
.typst-note-visual .typst-document-page { width: 100%; max-width: 224px; margin: 0 0 .4rem; }
.typst-note-body > :last-child { margin-block-end: 0; }
.typst-page-section { position: relative; overflow: clip; }
.typst-page-section > .typst-document-page { position: absolute; inset-inline-start: 0; max-width: none; margin: 0; }
.typst-document[data-note-mode="margin"] .typst-sidenote { position: absolute; inset-inline-start: calc(100% + var(--gutter, 2rem)); width: var(--margin, 14rem); margin: 0; }
@media print { .typst-sidenote { break-inside: avoid; } .typst-note-ref { background: transparent; } }

/* em-sized layouts preserve the site's actual body size, including mobile/Reader scaling. */
.typst-responsive { width: 100%; }
.typst-responsive > .typst-layout { width: calc(var(--typst-layout-width) * var(--typst-zoom, 1)); }
.typst-responsive:not([data-layout-ready]) > .typst-layout { display: none; }
.typst-responsive:not([data-layout-ready]) > .typst-layout:last-of-type { display: block !important; }
.typst-layout[hidden] { display: none !important; }
.typst-responsive.typst-layout-scroll { overflow-x: auto; }

/* Semantic documents inherit the surrounding article, without a paper surface. */
.typst-html { position: relative; font-family: inherit; font-size: calc(1em * var(--typst-zoom, 1)); line-height: inherit; color: inherit; background: transparent; overflow-wrap: anywhere; }
.typst-html p { font-family: inherit; font-size: inherit; line-height: inherit; }
.typst-html img { max-width: 100%; height: auto; }
.typst-html pre { overflow-x: auto; white-space: pre; }
.typst-html table { display: block; max-width: 100%; overflow-x: auto; }
.typst-html math { font-size: inherit; }
/* Keep the MathML inner layout: ordinary block display stacks equation symbols. */
.typst-html math[display="block"] { display: block math; max-width: 100%; overflow-x: auto; margin-block: 1em; }
.typst-html [role="doc-noteref"] { scroll-margin-block: 5rem; }
.typst-html [role="doc-endnotes"] { margin-block-start: 2rem; font-size: 14px; line-height: 1.45; }
.typst-html-note { position: static; float: none; clear: none; box-sizing: border-box; width: 100%; max-width: none; margin: .75rem 0 1.25rem; padding-inline-start: .95rem; border-inline-start: 1px solid var(--rubric-dim, #a8382a); font-family: inherit; font-size: 14px; line-height: 1.45; color: var(--ink-2, inherit); scroll-margin-block: 5rem; }
.typst-html-note .n { display: block; font: 11px/1.45 var(--mono, ui-monospace, monospace); color: var(--rubric, #a8382a); margin-block-end: .3rem; }
.typst-html-note p { margin-block: .5rem; }
.typst-html[data-note-mode="margin"] > .typst-html-note { position: absolute; inset-inline-start: calc(100% + var(--gutter, 2rem)); width: var(--margin, 14rem); margin: 0; }
.typst-html-note:focus-visible, .typst-html [role="doc-noteref"]:focus-visible { outline: 2px solid var(--rubric, #a8382a); outline-offset: 3px; }
/* Essential Typst MathML alignment, scoped to plugin content. */
.typst-html mtable { math-style: inherit; }
.typst-html mtd { math-depth: auto-add; math-style: compact; math-shift: compact; }
.typst-html mtable.aligned mtd:nth-child(odd), .typst-html mtable.right-align mtd, .typst-html mtd.right-align { text-align: right; justify-items: end; }
.typst-html mtable.aligned mtd:nth-child(even), .typst-html mtable.cases mtd, .typst-html mtable.left-align mtd, .typst-html mtd.left-align { text-align: left; justify-items: start; }
.typst-html mtable.multiline-equation mtd { math-depth: inherit; math-style: inherit; math-shift: inherit; padding: 0; }
.typst-html mtable.multiline-equation mtr:not(:last-child) mtd { padding-bottom: .5em; }
.typst-html mfrac { padding-inline: 0; margin-inline: .1em; }
@media print { .typst-html-note { break-inside: avoid; } }
