/* ============================================================
   Docs page styles — sidebar TOC, readable article
   ============================================================ */

.docs {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 96px;
  align-items: start;
}
@media (max-width: 960px) {
  .docs { grid-template-columns: 1fr; padding: 24px 16px 64px; }
}

.docs__sidebar {
  position: sticky;
  top: 76px;
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding-right: 24px;
  border-right: 1px solid var(--line);
}
@media (max-width: 960px) {
  .docs__sidebar {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 24px;
    margin-bottom: 24px;
  }
}
.docs__sidebar-inner { padding: 8px 0; }
.docs__sidebar-title {
  font-size: 11px;
  font-family: var(--type-mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-mute);
  margin: 0 0 16px;
  padding: 0;
  font-weight: 500;
}

.toc { display: flex; flex-direction: column; gap: 2px; }
.toc__item {
  font-size: 13px;
  color: var(--text-dim);
  padding: 5px 10px;
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
  line-height: 1.4;
}
.toc__item:hover { color: var(--text); background: var(--bg-1); }
.toc__item--h3 { padding-left: 28px; font-size: 12.5px; color: var(--text-mute); }
.toc__item.is-active {
  color: var(--text);
  background: var(--bg-1);
  border-left-color: var(--accent);
}

.docs__article { min-width: 0; padding: 0 8px 0 32px; }
@media (max-width: 960px) { .docs__article { padding: 0; } }

.docs__hero {
  padding: 0 0 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.docs__title {
  font-size: clamp(36px, 4.4vw, 56px);
  font-weight: 600;
  letter-spacing: -.035em;
  margin: 12px 0 12px;
  line-height: 1.05;
}
.docs__subtitle {
  font-size: 18px;
  color: var(--text-dim);
  margin: 0 0 24px;
  max-width: 60ch;
  line-height: 1.5;
}
.docs__meta { display: flex; gap: 8px; flex-wrap: wrap; }

/* Body typography */
.docs__body { font-size: 15.5px; line-height: 1.7; color: var(--text); }
.docs__h1 { font-size: 36px; font-weight: 600; letter-spacing: -.03em; margin: 48px 0 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.docs__h2 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin: 56px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 76px;
}
.docs__h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 32px 0 12px;
  color: var(--text);
  scroll-margin-top: 76px;
}
.docs__h4 { font-size: 15px; font-weight: 600; margin: 24px 0 8px; color: var(--text); }
.docs__h5 { font-size: 14px; font-weight: 600; margin: 20px 0 6px; color: var(--text); }
.docs__h6 { font-size: 13px; font-weight: 600; margin: 16px 0 6px; color: var(--text-dim); }

.docs__body p { margin: 0 0 16px; color: var(--text-2); }
.docs__body strong { color: var(--text); font-weight: 600; }
.docs__body em { color: var(--text); font-style: italic; }
.docs__body code {
  font-family: var(--type-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--accent-hi);
}
.docs__body a {
  color: var(--accent-hi);
  text-decoration: underline;
  text-decoration-color: rgba(167,139,250,.4);
  text-underline-offset: 3px;
}
.docs__body a:hover { text-decoration-color: var(--accent); }

.docs__code {
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 16px 0 20px;
  font-family: var(--type-mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
}
.docs__code code { background: transparent; border: 0; padding: 0; color: inherit; font-size: inherit; }

.docs__table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  overflow: hidden;
}
.docs__table th, .docs__table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.docs__table th {
  background: var(--bg-2);
  color: var(--text);
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.docs__table td { color: var(--text-2); }
.docs__table tr:last-child td { border-bottom: 0; }
.docs__table code {
  background: var(--bg-2);
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--accent-hi);
  font-size: 12.5px;
}

.docs__list { padding-left: 24px; margin: 12px 0 20px; }
.docs__list li { margin: 4px 0; color: var(--text-2); }

.docs__quote {
  margin: 20px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: rgba(167,139,250,.05);
  border-radius: 0 6px 6px 0;
  color: var(--text-2);
  font-style: italic;
}
.docs__quote p { margin: 0; }

.docs__media { text-align: center; margin: 20px 0; }
.docs__media img { max-width: 100%; height: auto; border-radius: var(--r); }

.docs hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

.docs__footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 14px;
}

@media (prefers-color-scheme: light) {
  .docs__quote { background: rgba(124,58,237,.05); }
}
