.reference-lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, .47fr);
  align-items: end;
  gap: clamp(24px, 6vw, 96px);
}

.reference-head h1 {
  margin-top: 16px;
}

.reference-head .lede {
  max-width: 40em;
}

.reference-map {
  margin: 0;
  padding: 8px clamp(14px, 3vw, 28px);
  background: var(--bg-ink);
  color: var(--on-ink);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

.reference-map > div {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 16px;
  padding-block: 12px;
}

.reference-map > div + div {
  border-top: 1px solid color-mix(in srgb, var(--on-ink) 20%, var(--clear));
}

.reference-map dt {
  color: var(--ink-link);
  font: 600 var(--fs-small)/1.6 var(--font-mono);
}

.reference-map dd {
  min-width: 0;
  margin: 0;
  font-weight: 650;
}

.reference-map small {
  display: block;
  color: var(--ink-muted);
  font-weight: 400;
}

.reference-toc-title {
  margin: 4px 12px;
  font-weight: 650;
}

.reference-layout .doc-body {
  width: 100%;
  max-width: var(--readw);
  line-height: 1.85;
}

.reference-opening {
  margin-bottom: clamp(24px, 4vw, 48px);
  color: var(--text-muted);
}

.reference-layout .doc-section + .doc-section {
  margin-top: clamp(36px, 6vw, 80px);
  padding-top: clamp(24px, 4vw, 48px);
  border-top: 1px solid var(--border);
}

.reference-layout .doc-section h2 {
  margin-top: 0;
}

.reference-layout .doc-section :is(.table-scroll, pre) {
  margin-block: 20px;
}

.reference-layout .reference-table {
  display: table;
}

.reference-layout .reference-table th[scope="row"] {
  min-width: 0;
}

.reference-layout .doc-section li + li {
  margin-top: 6px;
}

@media (max-width: 820px) {
  .reference-lead {
    grid-template-columns: minmax(0, 1fr);
  }

  .reference-map {
    max-width: 30rem;
  }
}

@media (max-width: 640px) {
  .reference-layout .toc ul {
    flex-wrap: wrap;
  }

  .reference-layout .toc li {
    min-width: 0;
    max-width: 100%;
  }
}