/* Rendered Markdown (documentation pages and previews). */
.prose {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  overflow-wrap: anywhere;
}
.prose > :first-child {
  margin-top: 0;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  position: relative;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.018em;
  line-height: 1.25;
}
.prose h1 {
  font-size: 2.15rem;
  letter-spacing: -0.028em;
  margin: 0 0 1rem;
}
.prose h2 {
  font-size: 1.5rem;
  margin: 2.6em 0 0.8em;
  padding-top: 0.2em;
}
.prose h3 {
  font-size: 1.2rem;
  margin: 2em 0 0.6em;
}
.prose h4 {
  font-size: 1.02rem;
  margin: 1.8em 0 0.5em;
}
.prose .heading-anchor {
  margin-left: 0.4em;
  color: var(--text-subtle);
  font-weight: 500;
  opacity: 0;
  transition: opacity var(--dur) var(--ease), color var(--dur);
  text-decoration: none;
}
.prose :is(h1, h2, h3, h4):hover .heading-anchor,
.prose .heading-anchor:focus-visible {
  opacity: 1;
}
.prose .heading-anchor:hover {
  color: var(--brand-text);
}

.prose p,
.prose ul,
.prose ol,
.prose dl,
.prose blockquote,
.prose table,
.prose details,
.prose figure {
  margin: 0 0 1.15em;
}
.prose a {
  color: var(--brand-text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--brand-border);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--dur);
}
.prose a:hover {
  text-decoration-color: currentColor;
}
.prose strong {
  font-weight: 650;
}
.prose ul,
.prose ol {
  padding-left: 1.4em;
}
.prose li {
  margin: 0.3em 0;
}
.prose li::marker {
  color: var(--text-subtle);
}
.prose ul.contains-task-list {
  list-style: none;
  padding-left: 0.2em;
}
.prose .task-list-item > label {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.prose .task-list-item input {
  margin: 0;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}
.prose blockquote {
  padding: 0.2em 0 0.2em 1.1em;
  border-left: 3px solid var(--border-strong);
  color: var(--text-muted);
}
.prose img,
.prose video {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  height: auto;
}
.prose iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-muted);
}
.prose kbd {
  display: inline-block;
  padding: 0.05em 0.45em;
  font-family: var(--font-mono);
  font-size: 0.8em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--bg-subtle);
}
.prose mark {
  background: color-mix(in srgb, #facc15 35%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}
.prose details {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.6em 1em;
}
.prose summary {
  cursor: pointer;
  font-weight: 600;
}

/* Tables */
.prose table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.92em;
}
.prose th,
.prose td {
  padding: 0.6em 1em;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.prose th {
  background: var(--bg-subtle);
  font-weight: 600;
  color: var(--text);
}
.prose tr:last-child td {
  border-bottom: 0;
}
.prose td[align='center'],
.prose th[align='center'] {
  text-align: center;
}

/* Inline code */
.prose :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.15em 0.4em;
  border-radius: 5px;
  background: var(--inline-code-bg);
  border: 1px solid var(--code-border);
}

/* Code blocks (wrapped in .code-frame by the client) */
.code-frame {
  position: relative;
  margin: 0 0 1.3em;
  border: 1px solid var(--code-border);
  border-radius: var(--radius-lg);
  background: var(--code-bg);
  overflow: hidden;
}
.code-frame-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--code-border);
  font-size: 12px;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-subtle);
  font-family: var(--font-sans);
  font-size: 12px;
  text-transform: none;
  transition: background var(--dur), color var(--dur), border-color var(--dur);
}
.copy-button:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border);
}
.copy-button.copied {
  color: var(--success);
}
.prose pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  tab-size: 2;
}
.prose pre code {
  font-family: inherit;
  background: none;
  border: 0;
  padding: 0;
}
.prose > pre.code-block,
.comment-body pre {
  border: 1px solid var(--code-border);
  border-radius: var(--radius-lg);
  background: var(--code-bg);
  margin: 0 0 1.2em;
}

/* Mermaid */
.prose pre.mermaid {
  display: flex;
  justify-content: center;
  margin: 0 0 1.3em;
  padding: 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  color: var(--text-subtle);
  white-space: pre-wrap;
}
.prose pre.mermaid[data-rendered='true'] {
  white-space: normal;
  color: inherit;
}
.prose pre.mermaid svg {
  max-width: 100%;
  height: auto;
}

/* Callouts */
.prose .callout {
  --c: var(--info);
  --c-bg: var(--info-bg);
  margin: 0 0 1.3em;
  padding: 14px 16px 14px 18px;
  border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
  border-left: 3px solid var(--c);
  background: var(--c-bg);
  border-radius: var(--radius);
  font-size: 0.95em;
}
.prose .callout > :last-child {
  margin-bottom: 0;
}
.prose .callout-title {
  margin: 0 0 0.35em;
  font-weight: 650;
  font-size: 0.82em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c);
}
.prose .callout-note {
  --c: var(--text-muted);
  --c-bg: var(--bg-subtle);
}
.prose .callout-tip,
.prose .callout-success {
  --c: var(--success);
  --c-bg: var(--success-bg);
}
.prose .callout-warning {
  --c: var(--warning);
  --c-bg: var(--warning-bg);
}
.prose .callout-danger,
.prose .callout-error {
  --c: var(--danger);
  --c-bg: var(--danger-bg);
}

/* Syntax highlighting (highlight.js classes), light + dark */
.hljs-comment,
.hljs-quote {
  color: #8a8a99;
  font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in,
.hljs-meta .hljs-keyword {
  color: #7c3aed;
}
.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-meta .hljs-string {
  color: #15803d;
}
.hljs-number,
.hljs-literal,
.hljs-symbol,
.hljs-bullet {
  color: #c2410c;
}
.hljs-title,
.hljs-title.function_,
.hljs-section {
  color: #2563eb;
}
.hljs-attr,
.hljs-attribute,
.hljs-variable,
.hljs-template-variable,
.hljs-property {
  color: #0e7490;
}
.hljs-type,
.hljs-class .hljs-title,
.hljs-title.class_ {
  color: #b45309;
}
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class {
  color: #be185d;
}
.hljs-deletion {
  color: #dc2626;
}
.hljs-meta {
  color: #6b7280;
}
.hljs-emphasis {
  font-style: italic;
}
.hljs-strong {
  font-weight: 700;
}

:root[data-theme='dark'] .hljs-comment,
:root[data-theme='dark'] .hljs-quote {
  color: #6b6b7b;
}
:root[data-theme='dark'] .hljs-keyword,
:root[data-theme='dark'] .hljs-selector-tag,
:root[data-theme='dark'] .hljs-built_in,
:root[data-theme='dark'] .hljs-meta .hljs-keyword {
  color: #c4a7ff;
}
:root[data-theme='dark'] .hljs-string,
:root[data-theme='dark'] .hljs-regexp,
:root[data-theme='dark'] .hljs-addition,
:root[data-theme='dark'] .hljs-meta .hljs-string {
  color: #86efac;
}
:root[data-theme='dark'] .hljs-number,
:root[data-theme='dark'] .hljs-literal,
:root[data-theme='dark'] .hljs-symbol,
:root[data-theme='dark'] .hljs-bullet {
  color: #fdba74;
}
:root[data-theme='dark'] .hljs-title,
:root[data-theme='dark'] .hljs-title.function_,
:root[data-theme='dark'] .hljs-section {
  color: #93c5fd;
}
:root[data-theme='dark'] .hljs-attr,
:root[data-theme='dark'] .hljs-attribute,
:root[data-theme='dark'] .hljs-variable,
:root[data-theme='dark'] .hljs-template-variable,
:root[data-theme='dark'] .hljs-property {
  color: #67e8f9;
}
:root[data-theme='dark'] .hljs-type,
:root[data-theme='dark'] .hljs-class .hljs-title,
:root[data-theme='dark'] .hljs-title.class_ {
  color: #fcd34d;
}
:root[data-theme='dark'] .hljs-tag,
:root[data-theme='dark'] .hljs-name,
:root[data-theme='dark'] .hljs-selector-id,
:root[data-theme='dark'] .hljs-selector-class {
  color: #f9a8d4;
}
:root[data-theme='dark'] .hljs-deletion {
  color: #fca5a5;
}
