:root {
  --docs-header: 68px;
  --docs-sidebar: 286px;
  --docs-toc: 190px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--docs-header) + 28px);
}

.docs-page {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% -10%, rgba(165, 170, 216, 0.06), transparent 31rem),
    var(--background);
}

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  height: var(--docs-header);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 13, 0.92);
  backdrop-filter: blur(16px);
}

.docs-topbar-inner {
  display: flex;
  width: min(100% - 40px, 1440px);
  height: 100%;
  margin: 0 auto;
  align-items: center;
}

.docs-brand,
.docs-label,
.docs-actions a {
  text-decoration: none;
}

.docs-brand {
  color: var(--accent);
  font-weight: 650;
  letter-spacing: -0.035em;
}

.docs-divider {
  width: 1px;
  height: 18px;
  margin: 0 13px;
  background: var(--line);
}

.docs-label {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
}

.docs-actions {
  display: flex;
  margin-left: auto;
  gap: 22px;
}

.docs-actions a {
  color: var(--muted);
  font-size: 0.78rem;
  transition: color 160ms ease;
}

.docs-actions a:hover,
.docs-actions a:focus-visible {
  color: var(--text);
}

.docs-menu-button {
  display: none;
  min-height: 38px;
  margin-left: auto;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.docs-layout {
  display: grid;
  grid-template-columns: var(--docs-sidebar) minmax(0, 760px) var(--docs-toc);
  width: min(100%, 1380px);
  min-height: calc(100dvh - var(--docs-header));
  margin: 0 auto;
  justify-content: center;
}

.docs-sidebar {
  position: sticky;
  top: var(--docs-header);
  align-self: start;
  height: calc(100dvh - var(--docs-header));
  overflow-y: auto;
  padding: 28px 28px 38px 20px;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: #292932 transparent;
}

.docs-search-block label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.7rem;
}

.docs-search-block input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
}

.docs-search-block input::placeholder {
  color: #6f6f79;
}

.docs-search-block input:focus {
  border-color: rgba(165, 170, 216, 0.65);
  box-shadow: 0 0 0 3px rgba(165, 170, 216, 0.08);
}

.docs-tree {
  display: grid;
  margin-top: 24px;
  gap: 3px;
}

.tree-link,
.tree-group summary {
  min-height: 36px;
  border-radius: 9px;
  color: #9898a3;
  font-size: 0.79rem;
  line-height: 1.35;
}

.tree-link {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  text-decoration: none;
  transition: color 140ms ease, background 140ms ease;
}

.tree-link:hover,
.tree-link:focus-visible,
.tree-link.active {
  background: rgba(165, 170, 216, 0.075);
  color: var(--text);
  outline: none;
}

.tree-link.active {
  color: var(--accent);
}

.tree-group summary {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
}

.tree-group summary::-webkit-details-marker {
  display: none;
}

.tree-group summary::after {
  content: "+";
  margin-left: auto;
  color: var(--faint);
  font-size: 0.9rem;
  font-weight: 400;
}

.tree-group[open] > summary::after {
  content: "−";
}

.tree-children {
  display: grid;
  margin-left: 10px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
  gap: 2px;
}

.tree-group.nested > summary {
  font-weight: 500;
}

.docs-empty {
  margin: 18px 10px;
  color: var(--faint);
  font-size: 0.78rem;
}

.docs-main {
  min-width: 0;
  padding: 64px 58px 100px;
}

.docs-article {
  width: 100%;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--faint);
  font-size: 0.71rem;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.docs-article-header {
  padding: 46px 0 50px;
}

.docs-placeholder-label {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
}

.docs-article h1 {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.docs-article-header > p:last-child {
  max-width: 590px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.docs-note {
  padding: 17px 19px;
  border: 1px solid rgba(165, 170, 216, 0.2);
  border-radius: var(--radius);
  background: rgba(165, 170, 216, 0.04);
}

.docs-note strong {
  color: var(--accent);
  font-size: 0.78rem;
}

.docs-note p {
  margin: 6px 0 0;
  color: #9d9da7;
  font-size: 0.82rem;
  line-height: 1.6;
}

.docs-article section {
  padding: 52px 0;
  border-bottom: 1px solid var(--line);
}

.docs-article h2 {
  margin: 0 0 14px;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.docs-article section > p {
  max-width: 630px;
  margin: 0;
  color: #9d9da7;
  font-size: 0.9rem;
  line-height: 1.72;
}

.docs-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 27px;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.docs-fields > div {
  display: grid;
  min-height: 92px;
  padding: 17px;
  align-content: space-between;
  background: #0d0d10;
}

.docs-fields span,
.option-row > span,
.docs-page-nav span {
  color: var(--faint);
  font-size: 0.68rem;
}

.docs-fields strong {
  color: #c9c9d0;
  font-size: 0.78rem;
  font-weight: 550;
  line-height: 1.35;
}

.docs-steps {
  display: grid;
  margin: 28px 0 0;
  padding: 0;
  counter-reset: docs-step;
  list-style: none;
  gap: 23px;
}

.docs-steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 3px 13px;
  counter-increment: docs-step;
}

.docs-steps li::before {
  grid-row: span 2;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  content: counter(docs-step);
  font-size: 0.68rem;
}

.docs-steps strong {
  font-size: 0.84rem;
  font-weight: 600;
}

.docs-steps span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.option-list,
.function-list {
  margin-top: 27px;
  border-top: 1px solid var(--line);
}

.option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 25px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.option-row code {
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
}

.option-row p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.5;
}

.function-list details,
.troubleshooting-item {
  border-bottom: 1px solid var(--line);
}

.function-list summary,
.troubleshooting-item summary {
  cursor: pointer;
  list-style: none;
}

.function-list summary::-webkit-details-marker,
.troubleshooting-item summary::-webkit-details-marker {
  display: none;
}

.function-list summary {
  display: flex;
  min-height: 60px;
  align-items: center;
  gap: 10px;
}

.function-list summary::after,
.troubleshooting-item summary::after {
  margin-left: auto;
  color: var(--accent);
  content: "+";
}

.function-list details[open] summary::after,
.troubleshooting-item[open] summary::after {
  content: "−";
}

.function-list summary span {
  font-size: 0.85rem;
  font-weight: 600;
}

.function-list summary small {
  color: var(--faint);
  font-size: 0.68rem;
}

.function-content {
  padding: 0 0 24px;
}

.function-content p,
.troubleshooting-item p {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.function-content a {
  display: inline-block;
  margin-top: 13px;
  color: var(--accent);
  font-size: 0.75rem;
  text-underline-offset: 3px;
}

.related-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 26px;
  gap: 10px;
}

.related-links a {
  display: grid;
  min-height: 112px;
  padding: 18px;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease;
}

.related-links a:hover {
  border-color: rgba(165, 170, 216, 0.38);
  background: rgba(165, 170, 216, 0.04);
}

.related-links strong {
  font-size: 0.82rem;
  font-weight: 600;
}

.related-links span {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.troubleshooting-item summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
}

.troubleshooting-item p {
  padding: 0 0 22px;
}

.docs-page-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 42px;
  gap: 10px;
}

.docs-page-nav a {
  display: grid;
  min-height: 76px;
  padding: 15px 17px;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}

.docs-page-nav a:last-child {
  text-align: right;
}

.docs-page-nav a:hover {
  border-color: rgba(165, 170, 216, 0.38);
}

.docs-page-nav strong {
  font-size: 0.78rem;
  font-weight: 600;
}

.docs-toc {
  position: sticky;
  top: var(--docs-header);
  align-self: start;
  height: calc(100dvh - var(--docs-header));
  padding: 64px 18px 30px 24px;
}

.docs-toc > p {
  margin: 0 0 13px;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
}

.docs-toc nav {
  display: grid;
  gap: 10px;
}

.docs-toc a {
  color: var(--faint);
  font-size: 0.7rem;
  text-decoration: none;
  transition: color 140ms ease;
}

.docs-toc a:hover,
.docs-toc a.active {
  color: var(--accent);
}

.docs-footer {
  position: relative;
  z-index: 1;
  padding: 28px 24px 34px;
  border-top: 1px solid var(--line);
}

.docs-footer nav {
  display: flex;
  max-width: 760px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px 18px;
}

.docs-footer a {
  color: var(--faint);
  font-size: 0.68rem;
  text-decoration: none;
}

.docs-footer a[aria-current="page"] {
  color: var(--accent);
}

.docs-footer a:hover {
  color: var(--muted);
}

@media (max-width: 1100px) {
  .docs-layout {
    grid-template-columns: var(--docs-sidebar) minmax(0, 760px);
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 767px) {
  :root {
    --docs-header: 62px;
  }

  .docs-topbar-inner {
    width: calc(100% - 32px);
  }

  .docs-actions {
    display: none;
  }

  .docs-menu-button {
    display: inline-flex;
    align-items: center;
  }

  .docs-layout {
    display: block;
    width: 100%;
  }

  .docs-sidebar {
    position: fixed;
    top: var(--docs-header);
    bottom: 0;
    left: 0;
    z-index: 6;
    width: min(88vw, 330px);
    height: auto;
    padding: 22px 18px 34px;
    border-right: 1px solid var(--line);
    background: #0d0d10;
    transform: translateX(-102%);
    transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .docs-sidebar.open {
    transform: translateX(0);
  }

  .docs-overlay {
    position: fixed;
    inset: var(--docs-header) 0 0;
    z-index: 5;
    background: rgba(4, 4, 6, 0.7);
  }

  .docs-main {
    width: 100%;
    padding: 38px 16px 72px;
  }

  .docs-article-header {
    padding: 38px 0 42px;
  }

  .docs-article h1 {
    font-size: clamp(2.9rem, 16vw, 4rem);
  }

  .docs-article section {
    padding: 42px 0;
  }

  .docs-fields,
  .related-links,
  .docs-page-nav {
    grid-template-columns: 1fr;
  }

  .docs-page-nav a:last-child {
    text-align: left;
  }

  .option-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .docs-footer nav {
    max-width: 320px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .docs-sidebar {
    transition: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .docs-topbar {
    background: var(--background);
    backdrop-filter: none;
  }
}
