/* SVG figures preserved from source notes. Two background variants. */
figure.diagram {
  margin: 1.75em 0;
  border-radius: 10px;
  padding: 1.5em !important;
  overflow-x: auto;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
figure.diagram svg {
  max-width: 100%;
  height: auto;
  display: inline-block;
}
figure.diagram img {
  max-width: 100%;
  height: auto;
  display: inline-block;
  border-radius: 6px;
}
figure.diagram figcaption {
  margin-top: 0.85em;
  color: #b8b09a;
  font-size: 0.88em;
  font-style: italic;
}
figure.diagram-dark { background: #16140f; }
figure.diagram-light { background: #fbf7ee; }
figure.diagram-light figcaption { color: #6b6357; }
figure.diagram .svg-title {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
}
figure.diagram .svg-sub {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
}
figure.diagram .svg-mono {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 11px;
}
figure.diagram-dark text { fill: #ece6d4; }

/* Rapid Recall callout, distinctive teal */
.md-typeset .tip:not(details) {
  border-left: 4px solid #50b4b4;
}

/* Mermaid diagrams larger and on a panel */
.mermaid {
  background: #1a1a1f;
  border: 1px solid #2b2b35;
  border-radius: 8px;
  padding: 1em;
  margin: 1.25em 0;
  text-align: center;
}
.mermaid svg {
  max-width: 100% !important;
  height: auto !important;
  min-height: 200px;
}

/* Heading hierarchy + tables polish */
.md-typeset h2 {
  margin-top: 2em;
  padding-top: 0.5em;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.md-typeset h3 { margin-top: 1.5em; }
.md-typeset code { background: rgba(255, 255, 255, 0.07); }
.md-typeset table:not([class]) { border: 1px solid rgba(255, 255, 255, 0.1); }
.md-typeset table:not([class]) th { background: rgba(80, 180, 180, 0.08); }
.md-grid { max-width: 1300px; }
