/* Long display equations scroll locally instead of widening the article. */
.md-typeset div.arithmatex {
  max-width: 100%;
  overflow: auto;
}

/* Long reference-page titles must not expand Material's hidden mobile topic. */
.md-header__title { min-width: 0; overflow: hidden; }

.simulator-embed {
  width: 100%;
  height: clamp(32rem, 72vh, 56rem);
  margin: 1rem 0;
  overflow: hidden;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.25rem;
  background: #0b1220;
}

.simulator-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Complete test tables stay local to the article column and remain usable
   without JavaScript, including keyboard scrolling and instant navigation. */
.example-table-block { min-width: 0; max-width: 100%; margin: 1rem 0; }
.md-typeset .example-table-profile,
.md-typeset .example-table-help { font-size: 0.7rem; color: var(--md-default-fg-color--light); }
.example-table-scroll {
  max-width: 100%;
  max-height: 22rem;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.2rem;
}
.example-table-scroll:focus-visible { outline: 2px solid var(--md-accent-fg-color); outline-offset: 2px; }
.md-typeset .example-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.4;
}
.md-typeset .example-table th,
.md-typeset .example-table td {
  padding: 0.4rem 0.55rem;
  white-space: nowrap;
  text-align: right;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  background: var(--md-default-bg-color);
}
.md-typeset .example-table thead th { position: sticky; top: 0; z-index: 2; background: var(--md-code-bg-color); }
.md-typeset .example-table small { display: block; font-weight: normal; font-size: 0.6rem; }
.md-typeset .example-table tr > :first-child { position: sticky; left: 0; z-index: 1; text-align: left; border-right: 1px solid var(--md-default-fg-color--lightest); }
.md-typeset .example-table thead tr > :first-child { z-index: 3; }
.md-typeset .example-table tbody tr:nth-child(even) > * { background: var(--md-code-bg-color); }
.md-typeset .example-table tbody tr:hover > * { background: var(--md-accent-fg-color--transparent); }
.md-typeset .example-table code { font-size: inherit; padding: 0; background: none; }

.reference-table-scroll {
  max-height: 26rem;
  max-width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  margin: 1rem 0;
  border: 1px solid var(--md-default-fg-color--lightest);
}
.reference-table-scroll:focus-visible { outline: 2px solid var(--md-accent-fg-color); }
.md-typeset .reference-table-scroll .md-typeset__scrollwrap { margin: 0; }
.md-typeset .reference-table-scroll .md-typeset__table { display: block; padding: 0; }
.md-typeset .reference-table-scroll table { margin: 0; white-space: nowrap; }
.md-typeset .reference-table-scroll thead th { position: sticky; top: 0; z-index: 2; background: var(--md-code-bg-color); }
.md-typeset .reference-table-scroll tbody td:first-child { position: sticky; left: 0; z-index: 1; background: var(--md-default-bg-color); }
