main {
  padding: 74px 0 72px;
}

.hero {
  max-width: 900px;
  margin-bottom: 32px;
}

h1 {
  margin: 18px 0 16px;
  font-size: clamp(42px, 8vw, 76px);
  line-height: 1;
  letter-spacing: 0;
}

.lead {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.doc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.doc-stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.doc-stat strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 20px;
}

.doc-stat span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

.toc,
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toc {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 116px);
  overflow: auto;
  padding: 18px;
}

.toc strong {
  display: block;
  margin-bottom: 12px;
}

.toc a {
  display: block;
  padding: 9px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  border-top: 1px solid var(--line);
  border-radius: var(--radius);
  transition: color .18s ease, background .18s ease, padding-left .18s ease;
}

.toc a:hover {
  color: var(--text);
  background: var(--surface-2);
  padding-left: 4px;
}

.content {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.card {
  padding: clamp(22px, 4vw, 32px);
  overflow: hidden;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
  scroll-margin-top: 92px;
}

.card:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 10px 26px rgba(0, 0, 0, .24);
}

.card h2 {
  margin-bottom: 12px;
  font-size: clamp(26px, 4vw, 38px);
}

.card h3 {
  margin: 22px 0 10px;
  color: var(--accent);
  font-size: 20px;
}

.card h4 {
  margin: 16px 0 8px;
  color: var(--text);
  font-size: 16px;
}

.card p {
  color: var(--muted);
  line-height: 1.7;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.mini {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color .18s ease, background .18s ease;
}

.mini:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
}

.mini strong {
  display: block;
  margin-bottom: 6px;
}

.mini span,
li {
  color: var(--muted);
  line-height: 1.65;
}

.stats-grid {
  grid-template-columns: repeat(4, 1fr);
}

.stat-tile .stat-number {
  display: block;
  margin: 8px 0;
  color: var(--text);
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  line-height: 1;
}

.table-wrap {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--text);
  background: var(--surface-2);
}

td {
  color: var(--muted);
}

tr:last-child td {
  border-bottom: 0;
}

ul,
ol {
  margin: 10px 0 0;
  padding-left: 20px;
}

code {
  color: var(--accent-2);
  overflow-wrap: anywhere;
}

.function-list {
  columns: 2;
  column-gap: 28px;
}

.function-list li {
  break-inside: avoid;
  margin-bottom: 4px;
  font-size: 14px;
}

.file-note {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .07);
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 980px) {
  .layout,
  .grid,
  .stats-grid,
  .doc-stats {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .function-list {
    columns: 1;
  }
}
