.docs-page {
  min-width: 320px;
  overflow-x: clip;
  color: var(--ink);
  background: var(--surface);
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 8px;
  transform: translateY(-160%);
  border: 1px solid var(--ink);
  padding: .65rem .8rem;
  background: #fff;
  color: var(--ink);
}

.skip-link:focus { transform: translateY(0); }

.docs-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line-strong);
  padding: 14px max(20px, calc((100vw - 1160px) / 2));
  background: rgba(243, 243, 239, .96);
  backdrop-filter: blur(16px);
}

.docs-brand {
  display: grid;
  gap: 2px;
  color: var(--ink);
  text-decoration: none;
}

.docs-brand span {
  color: var(--muted);
  font-size: .65rem;
  font-weight: 760;
  letter-spacing: .045em;
}

.docs-brand strong {
  font-size: 1.08rem;
  letter-spacing: -.04em;
}

.docs-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }

.docs-layout {
  display: grid;
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  grid-template-columns: 220px minmax(0, 760px);
  gap: clamp(32px, 6vw, 84px);
  justify-content: center;
  padding: 46px 0 80px;
}

.docs-toc {
  position: sticky;
  top: 112px;
  max-height: calc(100vh - 140px);
  align-self: start;
  overflow-y: auto;
  border-top: 2px solid var(--ink);
  padding-top: 14px;
}

.docs-toc > p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 760;
  letter-spacing: .045em;
}

.docs-toc ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.docs-toc a { display: block; border-radius: 3px; padding: 6px 7px; color: #4f524c; font-size: .74rem; line-height: 1.35; text-decoration: none; }
.docs-toc a:hover { background: var(--soft); color: var(--ink); }
.docs-toc .toc-level-3 a { padding-left: 19px; color: var(--muted); font-size: .7rem; }

.docs-content { min-width: 0; overflow-x: hidden; outline: none; }
.docs-content article > h1:first-child { margin-top: 0; }
.docs-content h1,
.docs-content h2,
.docs-content h3 {
  position: relative;
  scroll-margin-top: 104px;
  color: var(--ink);
  word-break: keep-all;
}

.docs-content h1 {
  margin: 0 0 32px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--ink);
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -.065em;
}

.docs-content h2 {
  margin: 52px 0 17px;
  padding-top: 13px;
  border-top: 1px solid var(--line-strong);
  font-size: 1.34rem;
  line-height: 1.3;
}

.docs-content h3 { margin: 30px 0 11px; font-size: 1rem; line-height: 1.4; }
.heading-anchor { margin-left: 7px; color: transparent; font-size: .72em; text-decoration: none; }
.docs-content h1:hover .heading-anchor,
.docs-content h2:hover .heading-anchor,
.docs-content h3:hover .heading-anchor,
.heading-anchor:focus { color: var(--accent); }

.docs-content p,
.docs-content li { color: #3f423d; font-size: .9rem; line-height: 1.78; overflow-wrap: break-word; word-break: keep-all; }
.docs-content p + p { margin-top: 12px; }
.docs-content ul,
.docs-content ol { display: grid; gap: 7px; margin: 13px 0 20px; padding-left: 1.35rem; }
.docs-content li::marker { color: var(--accent); font-weight: 760; }
.docs-content a { color: #254ccf; text-underline-offset: 3px; }
.docs-content strong { color: var(--ink); }
.docs-content hr { margin: 40px 0; border: 0; border-top: 1px solid var(--line); }

.docs-content blockquote {
  margin: 18px 0;
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  background: #f2f4fb;
}

.docs-content blockquote p { color: #3e4d7c; }
.docs-content code { border-radius: 3px; padding: .12em .32em; background: #ecece7; color: #30322f; font: .84em/1.5 "Cascadia Code", Consolas, monospace; }
.docs-content p code,
.docs-content li code,
.docs-content td code { overflow-wrap: anywhere; word-break: break-word; }
.docs-content pre { max-width: 100%; overflow-x: auto; margin: 16px 0 22px; border: 1px solid #32332f; border-radius: 5px; padding: 16px; background: #232421; color: #f4f4ee; }
.docs-content pre code { padding: 0; background: transparent; color: inherit; font-size: .78rem; line-height: 1.65; }

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 18px 0 24px;
  outline: none;
}

.table-scroll:focus-visible { outline: 3px solid rgba(49, 92, 246, .34); outline-offset: 2px; }

.docs-content .table-scroll table {
  display: table;
  width: max-content;
  min-width: 100%;
  margin: 0;
  border-collapse: collapse;
  table-layout: auto;
}

.docs-content th,
.docs-content td { min-width: 130px; border: 1px solid var(--line); padding: 10px 11px; color: #3f423d; font-size: .78rem; line-height: 1.55; text-align: left; word-break: keep-all; }
.docs-content th { background: #232421; color: #fff; }

.docs-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 64px;
  border-top: 1px solid var(--line-strong);
  padding-top: 18px;
}

.docs-footer p,
.docs-footer a { color: var(--muted); font-size: .7rem; }

@media (max-width: 840px) {
  .docs-header { position: static; display: block; padding: 16px 18px; }
  .docs-nav { justify-content: flex-start; margin-top: 13px; }
  .docs-layout { width: min(100% - 28px, 700px); grid-template-columns: 1fr; gap: 25px; padding-top: 26px; }
  .docs-toc { position: static; max-height: none; }
  .docs-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-toc .toc-level-3 { display: none; }
  .docs-content h1 { margin-bottom: 25px; }
  .docs-content h2 { margin-top: 42px; }
}

@media (max-width: 480px) {
  .docs-nav .button { flex: 1 1 auto; }
  .docs-toc ol { grid-template-columns: 1fr; }
  .docs-content h1 { font-size: 2.15rem; }
  .docs-footer { display: grid; }
}

@media print {
  .docs-header,
  .docs-toc,
  .skip-link,
  .heading-anchor { display: none; }
  .docs-layout { display: block; width: 100%; padding: 0; }
  .docs-content h1,
  .docs-content h2,
  .docs-content h3 { break-after: avoid; }
  .docs-content pre,
  .docs-content table { break-inside: avoid; }
}
