.prose {
  font-family: var(--serif);
  line-height: 1.65;
  font-size: clamp(1.125rem, 1rem + .3vw, 1.25rem);
}

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

.prose h2,
.prose h3 {
  font-family: var(--serif);
  font-weight: 700;
  scroll-margin-top: 2rem;
}

/* markdown-it-anchor uses headerLink(): the whole heading text IS the link.
   Style it as normal heading text (always visible); it just becomes clickable. */
.prose h2 a.header-anchor,
.prose h3 a.header-anchor {
  color: inherit;
  text-decoration: none;
}

.prose h2 a.header-anchor:hover,
.prose h3 a.header-anchor:hover {
  color: var(--accent);
}

.prose pre,
.prose code {
  font-family: var(--mono);
}

.prose pre {
  background: var(--surface-2);
  padding: 1em;
  overflow-x: auto;
  border-radius: 0.25em;
  line-height: 1.5;
}

.prose code {
  background: var(--surface-2);
  padding: 0.2em 0.4em;
  border-radius: 0.2em;
  font-size: 0.9em;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.prose blockquote {
  border-left: 0.25em solid var(--accent);
  margin-left: 0;
  padding-left: 1em;
  opacity: 0.9;
}

.prose .callout--danger {
  border-left-color: var(--danger);
}

/* Tables:  readable on the dark ground, horizontally scrollable when narrow. */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75em 0;
  font-family: var(--sans-text);
  font-size: var(--step--1);
  line-height: 1.4;
  display: block;
  overflow-x: auto;
}

.prose thead th {
  font-family: var(--label);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: left;
  border-bottom: 2px solid var(--rule);
}

.prose th,
.prose td {
  padding: 0.55em 0.8em;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.prose tbody tr:nth-child(even) {
  background: var(--surface-2);
}

.prose td code,
.prose th code {
  font-size: 0.85em;
  white-space: nowrap;
}

.prose{overflow-wrap:break-word;}
.prose h2{font-size:clamp(1.5rem,3vw,1.85rem);line-height:1.15;margin-top:2.5em;padding-top:0;}
.prose h3{font-size:1.4rem;line-height:1.25;}
.prose blockquote{font-family:var(--serif);font-size:1.25em;line-height:1.4;opacity:1;}
.prose > p:first-child{font-size:1.1em;}
.prose li + li{margin-top:.5em;}

/* Shiki emits both palettes at build time; line numbers are never copied. */
.prose .code-sample{margin:1.75rem 0;border:1px solid var(--rule);border-radius:0;overflow:hidden;background:var(--surface-2);}
.code-sample__bar{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.65rem 1rem;border-bottom:1px solid var(--rule);font:700 .8rem/1.5 var(--sans-text);color:var(--text-2);overflow-wrap:anywhere;}
.code-sample__bar button{font:inherit;color:var(--accent);background:transparent;border:1px solid var(--rule);border-radius:4px;padding:.3rem .65rem;cursor:pointer;white-space:nowrap;}
.prose .code-sample pre{margin:0;padding:1.25rem 0;border-radius:0;font-size:.875rem;line-height:1.75;tab-size:4;overflow:auto;}
.prose .code-sample code{display:block;min-width:100%;width:max-content;font-variant-ligatures:none;}
.code-sample .line{display:inline-block;width:100%;padding-right:1.5rem;}
.code-sample .line::before{content:attr(data-line);display:inline-block;min-width:3ch;margin-right:1.5rem;padding-left:1rem;text-align:right;color:var(--text-2);user-select:none;}
.code-sample .is-highlighted{background-image:linear-gradient(color-mix(in srgb,var(--accent) 12%,transparent),color-mix(in srgb,var(--accent) 12%,transparent));box-shadow:inset 3px 0 var(--accent);}
:root[data-theme="dark"] .shiki,:root[data-theme="dark"] .shiki span{color:var(--shiki-dark)!important;background-color:var(--shiki-dark-bg)!important;}
