:root {
  --md-primary-fg-color: #172554;
  --md-primary-fg-color--light: #1d4ed8;
  --md-primary-fg-color--dark: #0f172a;
  --md-accent-fg-color: #2563eb;
}

.md-typeset {
  font-size: 0.78rem;
  line-height: 1.75;
}

.md-typeset h1 {
  font-weight: 700;
  color: var(--md-primary-fg-color);
}

.md-typeset h2 {
  margin-top: 2.2em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.md-typeset table:not([class]) {
  display: table;
  width: 100%;
  border-radius: 0.35rem;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--md-default-fg-color--lightest);
}

.md-typeset table:not([class]) th {
  background-color: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
}

.md-typeset img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.2rem auto;
  border-radius: 0.4rem;
  box-shadow: 0 0.3rem 1.2rem rgba(15, 23, 42, 0.12);
}

/* Doc screenshots: fill content width, scale down on narrow viewports (replaces fixed 625×375). */
.md-typeset img.doc-screenshot {
  width: 100%;
  max-width: 100%;
  height: auto;
}

/* Turn-type icons in tables: override global img margin/shadow. */
.md-typeset img.doc-turn-icon {
  display: inline-block;
  width: 56px;
  height: 56px;
  image-rendering: auto;
  margin: 0;
  padding: 0;
  border-radius: 6px;
  box-shadow: none;
  vertical-align: middle;
}

.md-typeset table td:has(> img.doc-turn-icon) {
  text-align: center;
  vertical-align: middle;
}

.md-typeset pre > code {
  font-size: 0.72rem;
}

/* Keep Mermaid text consistent with MkDocs body typography. */
.md-typeset .mermaid text,
.md-typeset .mermaid .nodeLabel,
.md-typeset .mermaid .edgeLabel {
  font-size: 12px !important;
}

/* Prevent narrow diagrams from being stretched to full width. */
.md-typeset .mermaid svg {
  width: auto !important;
  max-width: 100%;
}

.md-footer-copyright {
  margin: 0 auto !important;
}