/* ---------- Documentation center ---------- */

.docs-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 5vw, 64px) 0 clamp(38px, 4vw, 52px);
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 88% 8%, rgba(124, 92, 255, 0.14), transparent 26rem),
    radial-gradient(circle at 4% 100%, rgba(45, 212, 191, 0.1), transparent 24rem),
    linear-gradient(180deg, #f3f6ff 0%, #ffffff 100%);
}

.docs-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #667085;
  font-size: 12.5px;
}

.docs-breadcrumb a {
  color: #667085;
}

.docs-breadcrumb a:hover {
  color: #3446d9;
}

.docs-hero__grid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(32px, 5vw, 72px);
  margin-top: 28px;
}

.docs-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #3446d9;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.docs-eyebrow::before {
  content: '';
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.docs-hero__title {
  margin: 14px 0 0;
  color: var(--text);
  font-size: clamp(2.4rem, 4.4vw, 3.8rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.docs-hero__subtitle {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.3vw, 1.08rem);
  line-height: 1.85;
}

.docs-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  color: #667085;
  font-size: 12.5px;
}

.docs-search {
  position: relative;
  width: min(420px, 100%);
  flex: none;
  display: flex;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(74, 93, 255, 0.18);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(30, 48, 120, 0.1);
}

.docs-search__icon {
  position: absolute;
  left: 22px;
  display: grid;
  place-items: center;
  color: #667085;
  pointer-events: none;
}

.docs-search__icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.docs-search__input {
  width: 100%;
  min-height: 44px;
  padding: 0 116px 0 48px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 14px;
}

.docs-search__input::placeholder {
  color: #8b95a8;
}

.docs-search__button {
  position: absolute;
  top: 6px;
  right: 6px;
  bottom: 6px;
  min-width: 92px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 24px rgba(74, 93, 255, 0.28);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.docs-search__button:hover {
  filter: brightness(1.05);
}

.docs-body {
  padding: clamp(36px, 5vw, 56px) 0 clamp(72px, 8vw, 104px);
  background: #ffffff;
}

.docs-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  align-items: start;
  gap: clamp(24px, 3vw, 40px);
}

/* Sidebar */

.docs-sidebar {
  position: sticky;
  top: 98px;
  max-height: calc(100vh - 122px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(20, 32, 90, 0.05);
  scrollbar-width: thin;
}

.docs-sidebar__block + .docs-sidebar__block {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid #eef1f8;
}

.docs-sidebar__title {
  margin: 0 0 12px;
  color: #667085;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.docs-sidebar__category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  color: #4b556d;
  font-size: 13.5px;
  font-weight: 500;
}

.docs-sidebar__category:hover {
  color: #3446d9;
  background: #f5f7ff;
}

.docs-sidebar__category.is-active {
  color: #3446d9;
  background: #eef1ff;
  font-weight: 700;
}

.docs-sidebar__category span {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  color: #5f6a83;
  background: #f0f2f9;
  font-size: 11px;
  text-align: center;
}

.docs-sidebar__category.is-active span {
  color: #3446d9;
  background: #dfe5ff;
}

.docs-sidebar__group + .docs-sidebar__group {
  margin-top: 16px;
}

.docs-sidebar__group-name {
  margin: 0 0 7px;
  padding: 0 10px;
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.docs-sidebar__doc {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  color: #59637a;
  font-size: 13px;
  line-height: 1.55;
}

.docs-sidebar__doc:hover {
  color: #3446d9;
  background: #f7f8fd;
}

.docs-sidebar__doc.is-active {
  color: #3446d9;
  background: #f2f5ff;
  font-weight: 600;
}

.docs-sidebar__dot {
  width: 5px;
  height: 5px;
  flex: none;
  margin-top: 7px;
  border-radius: 50%;
  background: #c8cfdf;
}

.docs-sidebar__doc.is-active .docs-sidebar__dot {
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(74, 93, 255, 0.12);
}

/* Index cards */

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

.docs-result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding: 13px 16px;
  border: 1px solid #e8ecfa;
  border-radius: 12px;
  background: #f7f9ff;
  color: #64708a;
  font-size: 13px;
}

.docs-result-bar p {
  margin: 0;
}

.docs-result-bar strong {
  color: var(--text);
}

.docs-result-bar a {
  flex: none;
  color: #3446d9;
  font-weight: 600;
}

.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.docs-card {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(25, 40, 100, 0.04);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.docs-card:hover {
  border-color: rgba(74, 93, 255, 0.24);
  box-shadow: 0 24px 52px rgba(25, 40, 100, 0.1);
  transform: translateY(-4px);
}

.docs-card__category {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  color: #3446d9;
  background: #eef1ff;
  font-size: 11.5px;
  font-weight: 700;
}

.docs-card__title {
  margin: 14px 0 8px;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.015em;
}

.docs-card__summary {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.docs-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  color: #667085;
  font-size: 12px;
}

.docs-card__more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #3446d9;
  font-weight: 600;
}

.docs-card__more svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.docs-card:hover .docs-card__more svg {
  transform: translateX(3px);
}

.docs-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 24px;
  border: 1px dashed #dbe1f0;
  border-radius: 20px;
  background: #fafbff;
  text-align: center;
}

.docs-empty__icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #3446d9;
  background: #eef1ff;
}

.docs-empty__icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.docs-empty h2 {
  margin: 18px 0 0;
  font-size: 20px;
}

.docs-empty p {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 14px;
}

/* Detail */

.docs-hero--detail {
  padding-bottom: clamp(32px, 4vw, 44px);
}

.docs-detail-hero {
  max-width: 860px;
  margin-top: 26px;
}

.docs-detail-hero__category {
  display: inline-flex;
  padding: 5px 11px;
  border-radius: 999px;
  color: #3446d9;
  background: #eef1ff;
  font-size: 11.5px;
  font-weight: 700;
}

.docs-detail-hero__title {
  margin: 14px 0 0;
  color: var(--text);
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.docs-detail-hero__summary {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.docs-detail-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  color: #667085;
  font-size: 12.5px;
}

.docs-detail-layout {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr) 188px;
  align-items: start;
  gap: clamp(22px, 3vw, 34px);
}

.docs-detail-layout--no-toc {
  grid-template-columns: 228px minmax(0, 1fr);
}

.docs-article {
  min-width: 0;
  padding: clamp(26px, 4vw, 46px);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(20, 32, 90, 0.06);
}

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

.docs-toc__sticky {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 124px);
  overflow-y: auto;
  padding: 4px 0 12px 14px;
  border-left: 1px solid #e7eaf3;
  scrollbar-width: thin;
}

.docs-toc__title {
  margin: 0 0 10px;
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.docs-toc__nav {
  display: grid;
  gap: 2px;
}

.docs-toc__link {
  padding: 5px 0;
  color: #5f6a83;
  font-size: 12.5px;
  line-height: 1.5;
}

.docs-toc__link:hover {
  color: #3446d9;
}

.docs-toc__link--3 {
  padding-left: 12px;
  font-size: 12px;
}

.docs-toc__link--4 {
  padding-left: 24px;
  font-size: 11.5px;
}

.docs-toc-mobile {
  display: none;
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f9faff;
}

.docs-toc-mobile summary {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.docs-toc-mobile nav {
  display: grid;
  gap: 3px;
  margin-top: 12px;
}

.docs-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 42px;
  padding-top: 26px;
  border-top: 1px solid #edf0f7;
}

.docs-pager__item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.docs-pager__item:hover {
  border-color: rgba(74, 93, 255, 0.28);
  background: #f8faff;
}

.docs-pager__item span {
  color: #667085;
  font-size: 11.5px;
}

.docs-pager__item strong {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
}

.docs-pager__item--next {
  text-align: right;
}

.docs-pager__placeholder {
  display: block;
}

/* ---------- Markdown article ---------- */

.markdown-body {
  color: #34405c;
  font-size: 15.5px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  color: var(--text);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.025em;
  scroll-margin-top: 96px;
}

.markdown-body h1 {
  margin: 0 0 0.7em;
  font-size: 1.9rem;
}

.markdown-body h2 {
  margin: 2.1em 0 0.8em;
  padding-bottom: 0.45em;
  border-bottom: 1px solid #edf0f7;
  font-size: 1.5rem;
}

.markdown-body h3 {
  margin: 1.8em 0 0.6em;
  font-size: 1.22rem;
}

.markdown-body h4 {
  margin: 1.6em 0 0.5em;
  font-size: 1.05rem;
}

.markdown-body p {
  margin: 0.9em 0;
}

.markdown-body a {
  color: #3446d9;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.markdown-body strong {
  color: #1d2740;
  font-weight: 700;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0.9em 0;
  padding-left: 1.5em;
}

.markdown-body li {
  margin: 0.35em 0;
}

.markdown-body li > ul,
.markdown-body li > ol {
  margin: 0.3em 0;
}

.markdown-body blockquote {
  margin: 1.4em 0;
  padding: 14px 20px;
  border-left: 3px solid var(--brand);
  border-radius: 0 10px 10px 0;
  color: #4d5b78;
  background: #f5f7ff;
}

.markdown-body blockquote p {
  margin: 0;
}

.markdown-body hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid #edf0f7;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.4em auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.markdown-body code {
  padding: 0.16em 0.42em;
  border-radius: 5px;
  color: #c0265b;
  background: #f4f6fb;
  font-family: var(--mono);
  font-size: 0.88em;
}

.markdown-body pre {
  margin: 1.35em 0;
  padding: 18px 20px;
  overflow-x: auto;
  border-radius: 12px;
  color: #e6edf3;
  background: #0d1117;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
}

.markdown-body pre code {
  padding: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
}

.markdown-body pre.hljs {
  background: #0d1117;
}

.markdown-body table {
  width: 100%;
  margin: 1.5em 0;
  border-collapse: collapse;
  font-size: 13.5px;
}

.markdown-body th,
.markdown-body td {
  padding: 10px 12px;
  border: 1px solid #e8ecf5;
  text-align: left;
}

.markdown-body th {
  color: #263147;
  background: #f6f8fd;
  font-weight: 700;
}

.markdown-body tr:nth-child(even) td {
  background: #fafbff;
}

.markdown-body kbd {
  padding: 2px 6px;
  border: 1px solid #dbe0ec;
  border-bottom-width: 2px;
  border-radius: 5px;
  color: #39445c;
  background: #f8f9fc;
  font-family: var(--mono);
  font-size: 0.82em;
}

/* Highlight.js (GitHub dark-ish) */

.markdown-body .hljs {
  color: #e6edf3;
  background: #0d1117;
}

.markdown-body .hljs-keyword,
.markdown-body .hljs-selector-tag,
.markdown-body .hljs-literal,
.markdown-body .hljs-doctag,
.markdown-body .hljs-template-tag {
  color: #ff7b72;
}

.markdown-body .hljs-string,
.markdown-body .hljs-regexp,
.markdown-body .hljs-attribute,
.markdown-body .hljs-meta .hljs-string {
  color: #a5d6ff;
}

.markdown-body .hljs-title,
.markdown-body .hljs-section,
.markdown-body .hljs-name,
.markdown-body .hljs-title.class_,
.markdown-body .hljs-title.function_ {
  color: #d2a8ff;
}

.markdown-body .hljs-number,
.markdown-body .hljs-symbol,
.markdown-body .hljs-bullet,
.markdown-body .hljs-variable,
.markdown-body .hljs-template-variable {
  color: #79c0ff;
}

.markdown-body .hljs-built_in,
.markdown-body .hljs-type,
.markdown-body .hljs-class .hljs-title {
  color: #ffa657;
}

.markdown-body .hljs-attr,
.markdown-body .hljs-property,
.markdown-body .hljs-params {
  color: #7ee787;
}

.markdown-body .hljs-comment,
.markdown-body .hljs-quote {
  color: #8b949e;
  font-style: italic;
}

.markdown-body .hljs-meta,
.markdown-body .hljs-selector-id,
.markdown-body .hljs-selector-class {
  color: #ff7b72;
}

.markdown-body .hljs-emphasis {
  font-style: italic;
}

.markdown-body .hljs-strong {
  font-weight: 700;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .docs-detail-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .docs-toc {
    display: none;
  }

  .docs-toc-mobile {
    display: block;
  }
}

@media (max-width: 900px) {
  .docs-hero__grid {
    align-items: flex-start;
    flex-direction: column;
    gap: 26px;
  }

  .docs-search {
    width: 100%;
  }

  .docs-layout,
  .docs-detail-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 16px;
  }

  .docs-sidebar__block + .docs-sidebar__block {
    display: none;
  }

  .docs-sidebar__block:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .docs-sidebar__title {
    width: 100%;
    margin-bottom: 2px;
  }

  .docs-sidebar__category {
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12.5px;
  }

  .docs-sidebar__category.is-active {
    border-color: rgba(74, 93, 255, 0.3);
  }
}

@media (max-width: 680px) {
  .docs-hero {
    padding-top: 32px;
  }

  .docs-hero__title {
    font-size: clamp(2.2rem, 10vw, 2.8rem);
  }

  .docs-card-grid {
    grid-template-columns: 1fr;
  }

  .docs-card {
    min-height: 0;
    padding: 20px;
  }

  .docs-article {
    padding: 22px 18px;
    border-radius: 18px;
  }

  .docs-detail-hero__title {
    font-size: clamp(1.85rem, 8vw, 2.4rem);
  }

  .docs-pager {
    grid-template-columns: 1fr;
  }

  .docs-pager__item--next {
    text-align: left;
  }

  .docs-pager__placeholder {
    display: none;
  }

  .markdown-body {
    font-size: 15px;
  }

  .markdown-body h1 {
    font-size: 1.65rem;
  }

  .markdown-body h2 {
    font-size: 1.32rem;
  }

  .markdown-body h3 {
    font-size: 1.12rem;
  }

  .markdown-body pre {
    padding: 15px;
    font-size: 12px;
  }

  .docs-result-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}
