.docs-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr) 184px;
  gap: 32px;
  max-width: 1344px;
  margin-inline: auto;
  padding: 48px 28px 100px;
}

.docs-layout > aside,
.docs-toc {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--header-height) - 48px);
  overflow: auto;
}

.docs-group {
  margin: 20px 12px 3px;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 700;
}

.docs-layout > aside a {
  display: block;
  padding: 7px 12px;
  border-radius: 8px;
  color: #626674;
  font-size: .9rem;
  line-height: 1.4;
}

.docs-layout > aside a:hover,
.docs-layout > aside a.active {
  color: var(--purple-dark);
  background: #f2efff;
}

.docs-toc {
  border-left: 1px solid var(--line);
  padding-left: 20px;
}

.docs-toc a {
  display: block;
  margin-top: 10px;
  color: #636775;
  font-size: .8rem;
  line-height: 1.4;
}

.docs-toc a:hover {
  color: var(--purple-dark);
}

.docs-chapter-bar {
  display: none;
}

.docs-content {
  min-width: 0;
}

.docs-content h1 {
  margin: 0 0 34px;
  font-size: 2.8rem;
  line-height: 1.12;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.docs-content h2 {
  margin: 54px 0 18px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 1.75rem;
  letter-spacing: -.025em;
}

.docs-content h3 {
  margin-top: 36px;
  font-size: 1.25rem;
}

.docs-content :is(h2, h3) {
  scroll-margin-top: calc(var(--header-height) + var(--chapter-bar-height, 0px) + 16px);
}

.docs-content p,
.docs-content li {
  color: #4f5360;
}

.docs-content a {
  color: var(--purple-dark);
  text-decoration: underline;
  text-decoration-color: #c9beff;
  text-underline-offset: 3px;
}

.docs-content pre {
  overflow: auto;
  padding: 20px;
  border-radius: 12px;
  background: #171820;
  color: #e9e9ef;
  font-size: .86rem;
  line-height: 1.7;
}

.docs-content :not(pre) > code {
  padding: 2px 6px;
  border-radius: 5px;
  background: #f0f1f5;
  color: #4f32c9;
  font-size: .88em;
  overflow-wrap: anywhere;
}

.docs-content blockquote {
  margin: 24px 0;
  padding: 12px 20px;
  border-left: 3px solid var(--purple);
  background: #f7f5ff;
  color: #56506c;
}

.docs-content table {
  display: block;
  width: 100%;
  overflow: auto;
  border-collapse: collapse;
}

.docs-content th,
.docs-content td {
  padding: 9px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.docs-content figure {
  margin: 24px 0 32px;
}

.docs-content figure a {
  display: block;
  width: fit-content;
  max-width: 100%;
  border-radius: 10px;
  cursor: zoom-in;
}

.docs-content figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: inherit;
}

.docs-content figcaption {
  margin: 8px 0 0;
  color: #595d69;
  font-size: .88rem;
  line-height: 1.5;
}

.docs-layout a:focus-visible,
.docs-chapter-bar :is(a, button):focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

@media (max-width: 1220px) {
  .docs-layout {
    grid-template-columns: 208px minmax(0, 1fr);
    max-width: 1120px;
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .docs-body {
    --chapter-bar-height: 46px;
  }

  .docs-chapter-bar {
    position: sticky;
    z-index: 12;
    top: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--chapter-bar-height);
    padding-inline: 24px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    font-size: .875rem;
    font-weight: 600;
  }

  .docs-chapter-bar :is(a, button) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
  }

  .docs-chapter-bar button {
    padding: 0 2px 0 12px;
    border: 0;
    color: var(--purple-dark);
    background: transparent;
    font: inherit;
    cursor: pointer;
  }

  .docs-chapter-bar button::after {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
  }

  .docs-chapter-bar button[aria-expanded="true"]::after {
    transform: translateY(2px) rotate(225deg);
  }

  .docs-layout {
    display: block;
    max-width: 850px;
    padding: 32px 24px 80px;
  }

  .docs-layout > aside {
    position: fixed;
    z-index: 11;
    inset: calc(var(--header-height) + var(--chapter-bar-height)) 0 0;
    display: none;
    align-self: stretch;
    max-height: none;
    padding: 12px 24px 28px;
    background: #fff;
    overscroll-behavior: contain;
  }

  .docs-body.nav-open .docs-layout > aside {
    display: block;
  }

  .docs-layout > aside a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
}

@media (max-width: 600px) {
  .docs-layout,
  .docs-chapter-bar {
    padding-inline: 18px;
  }

  .docs-content th,
  .docs-content td {
    min-width: 5.75rem;
  }

  .docs-content h1 {
    font-size: 2.2rem;
  }

  .docs-content h2 {
    font-size: 1.5rem;
  }
}

.docs-version {
  display: block;
  margin: 0 12px 8px;
  color: var(--muted);
  font-weight: 600;
}
