.md-typeset table:not([class]) {
  display: table;
  width: 100%;
  border: 1px solid var(--spm-rule);
  border-collapse: collapse;
  background: var(--spm-surface);
  font-size: .72rem;
}

.md-typeset table:not([class]) th {
  padding: .68rem .75rem;
  border-bottom: 2px solid var(--spm-rule-strong);
  background: var(--spm-surface-raised);
  color: var(--spm-ink);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .025em;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
}

.md-typeset table:not([class]) td {
  padding: .68rem .75rem;
  border-color: var(--spm-rule);
  color: var(--spm-ink-muted);
  line-height: 1.52;
  vertical-align: top;
}

.md-typeset table:not([class]) tbody tr:hover {
  background: color-mix(in srgb, var(--spm-action) 5%, transparent);
}

.md-typeset pre,
.md-typeset :where(.highlight) pre {
  border: 1px solid var(--spm-rule);
  border-radius: .25rem;
  box-shadow: none;
}

[data-md-color-scheme="default"] .md-typeset .highlight .s2 {
  color: var(--spm-code-string-light);
}

[data-md-color-scheme="default"] .md-typeset .highlight .kn {
  color: var(--spm-code-keyword-light);
}

[data-md-color-scheme="default"] .md-typeset .highlight .nn {
  color: var(--spm-code-name-light);
}

.md-typeset .admonition,
.md-typeset details {
  border: 1px solid var(--spm-rule);
  border-left: 3px solid var(--spm-action);
  border-radius: .25rem;
  background: var(--spm-surface);
  box-shadow: none;
}

.md-typeset .admonition.warning,
.md-typeset details.warning {
  border-left-color: var(--spm-warning);
}

.md-typeset .admonition.danger,
.md-typeset details.danger,
.md-typeset .admonition.failure,
.md-typeset details.failure {
  border-left-color: var(--spm-danger);
}

.md-typeset .admonition.success,
.md-typeset details.success {
  border-left-color: var(--spm-success);
}

.md-typeset .admonition-title,
.md-typeset summary {
  background: var(--spm-surface-raised);
}

.spm-science-figure {
  margin: 1.7rem 0;
  padding: 1rem;
  overflow: auto;
  border-block: 1px solid var(--spm-rule);
  background: var(--spm-surface);
}

.spm-science-figure svg {
  display: block;
  min-width: 42rem;
  width: 100%;
  height: auto;
}

.spm-science-figure figcaption,
.spm-media-caption {
  margin-top: .8rem;
  color: var(--spm-ink-muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .59rem;
  line-height: 1.5;
}

.arithmatex {
  color: var(--spm-ink);
}

/* MathJax and Material provide inline margins that the reading surface normalizes. */
.arithmatex mjx-container[display="true"] {
  margin: 1.4rem 0 !important;
  padding: 1rem;
  overflow-x: auto;
  border-block: 1px solid var(--spm-rule);
  background: var(--spm-surface);
}

.spm-media-frame {
  margin: 1.1rem 0;
}

.spm-media-frame img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--spm-rule);
  border-radius: .2rem;
  background: var(--spm-media-black);
  object-fit: contain;
}

.spm-panel img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: .9rem;
  border: 1px solid var(--spm-rule);
}

.pdf-reader-frame {
  margin-top: 1.5rem;
}

/* Material's embedded-content rules otherwise win over the shared reader frame. */
.pdf-reader-frame iframe {
  width: 100%;
  min-height: min(78vh, 62rem);
  border: 1px solid var(--spm-rule) !important;
  border-radius: .3rem !important;
  background: var(--spm-surface);
  box-shadow: 0 12px 35px var(--spm-shadow);
}

.spm-token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: .75rem;
  margin: 1rem 0;
}

.spm-swatch {
  min-height: 5rem;
  padding: .7rem;
  border: 1px solid var(--spm-rule);
  background: var(--swatch, var(--spm-surface));
  color: var(--swatch-ink, var(--spm-ink));
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .58rem;
}

.spm-fixture-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin: 1rem 0;
}
