:root {
  --optagent-border: color-mix(in srgb, var(--md-default-fg-color) 14%, transparent);
  --optagent-surface: color-mix(in srgb, var(--md-default-bg-color) 94%, var(--md-primary-fg-color));
}

.md-grid {
  max-width: 88rem;
}

.md-typeset {
  font-size: 0.82rem;
  line-height: 1.72;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  letter-spacing: 0;
}

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

.md-typeset h2 {
  border-bottom: 1px solid var(--optagent-border);
  font-weight: 500;
  padding-bottom: 0.35rem;
}

.md-typeset table:not([class]) {
  border: 1px solid var(--optagent-border);
  border-radius: 4px;
  display: table;
  font-size: 0.75rem;
  width: 100%;
}

.md-typeset table:not([class]) th {
  background: var(--optagent-surface);
  font-weight: 600;
}

.md-typeset pre > code {
  border-radius: 4px;
}

.md-source-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.docs-page-meta {
  align-items: center;
  border-bottom: 1px solid var(--optagent-border);
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  min-height: 2.4rem;
  padding-bottom: 0.55rem;
}

.md-source-actions__link {
  align-items: center;
  border: 1px solid var(--optagent-border);
  border-radius: 4px;
  color: var(--md-default-fg-color--light);
  display: inline-flex;
  font-size: 0.72rem;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
}

.md-source-actions__link:hover {
  border-color: var(--md-accent-fg-color);
  color: var(--md-accent-fg-color);
}

.md-source-actions__icon svg {
  fill: currentColor;
  height: 0.85rem;
  width: 0.85rem;
}

.docs-preview-banner {
  align-items: center;
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  min-height: 2rem;
}

.docs-preview-banner code {
  background: color-mix(in srgb, currentColor 12%, transparent);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
}

.mermaid-diagram {
  background: var(--md-default-bg-color);
  border: 1px solid var(--optagent-border);
  border-radius: 4px;
  margin: 1.2rem 0;
  min-height: 6rem;
  overflow: auto;
  padding: 1rem;
  position: relative;
  text-align: center;
}

.mermaid-diagram__toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.mermaid-diagram__fullscreen {
  color: var(--md-default-fg-color--light);
  cursor: pointer;
  font-size: 0.68rem;
}

.mermaid-diagram__fullscreen:hover {
  color: var(--md-accent-fg-color);
}

.mermaid-diagram:fullscreen {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
}

.mermaid-diagram svg {
  height: auto;
  max-width: 100%;
}

@media screen and (max-width: 44.984375em) {
  .md-typeset {
    font-size: 0.8rem;
  }

  .md-typeset table:not([class]) {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .docs-preview-banner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.4rem 0.8rem;
  }
}
