.prose {
  min-width: 0;
  max-width: 70ch;
  color: var(--color-text-body);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.prose,
.prose *,
.prose *::before,
.prose *::after {
  box-sizing: border-box;
}

.prose :where(ul, ol) {
  margin: 1em 0;
  padding: 0 0 0 1.75rem;
}

.prose > * + * {
  margin-top: 1.5rem;
}

.prose p {
  margin: 0 0 1.25rem;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
}

.prose :is(h2, h3, h4, h5, h6) {
  margin-block: 2em 0.75em;
  padding: 0;
  color: var(--color-text);
  background: none;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.035em;
  text-transform: none;
  text-wrap: balance;
  scroll-margin-top: 6rem;
}

.prose h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.prose h3 { font-size: 1.4rem; }
.prose h4 { font-size: 1.2rem; }
.prose :is(h5, h6) { font-size: 1rem; }

.prose :is(strong, th) {
  color: var(--color-text);
}

.prose a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }

.prose li {
  padding: 0;
  font-size: inherit;
  line-height: inherit;
  list-style: inherit;
}

.prose li + li {
  margin-top: 0.5rem;
}

.prose :is(ul, ol) :is(ul, ol) {
  margin-block: 0.5rem;
}

.prose blockquote {
  margin-inline: 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--color-accent);
  color: var(--color-text);
  font-size: inherit;
}

.prose :not(pre) > code {
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--color-accent);
  background: var(--color-code-bg);
  font: 0.9em var(--font-mono);
}

.prose hr {
  height: 0;
  margin-block: 2rem;
  border: 0;
  border-top: 1px solid var(--color-border-control);
  background: none;
  color: inherit;
  line-height: inherit;
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  border-radius: var(--radius-sm);
}

.prose .table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.prose table {
  overflow-wrap: normal;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.prose :is(th, td) {
  overflow-wrap: normal;
  padding: 0.65rem 1rem;
  border: 1px solid var(--color-border-control);
  font-size: inherit;
  line-height: inherit;
  text-align: left;
}

.prose th {
  background: var(--color-surface);
  font-weight: 700;
  text-transform: none;
}

.code-block {
  min-width: 0;
  margin-block: 1.5rem;
  border: 1px solid var(--color-border-hover);
  border-radius: var(--radius-sm);
  background: var(--color-code-bg);
}

.code-block pre {
  padding: 1.25rem;
  margin: 0;
}

.prose pre,
pre.code-block {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
  overflow-wrap: normal;
  color: var(--color-text-body);
  font: 0.9rem/1.6 var(--font-mono);
  tab-size: 4;
}

pre.code-block {
  padding: 1.25rem;
}

.prose pre code {
  display: block;
  min-width: max-content;
  color: inherit;
  font: inherit;
}

.prose sup {
  font-size: 0.75em;
}

.prose :is(a, pre, .table-scroll):focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}
