:root {
  --api-bg: #f4f7fb;
  --api-surface: #ffffff;
  --api-sidebar-bg: #0f172a;
  --api-sidebar-border: rgba(148, 163, 184, 0.2);
  --api-text: #0f172a;
  --api-muted: #475569;
  --api-accent: #0ea5a4;
  --api-accent-strong: #0f766e;
  --api-border: #d8e1ec;
  --api-code-bg: #0b1120;
  --api-code-fg: #dbeafe;
  --api-radius: 14px;
  --api-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

.api-docs-body {
  margin: 0;
  min-height: 100vh;
  color: var(--api-text);
  background:
    radial-gradient(circle at 100% 0%, rgba(14, 165, 164, 0.16) 0%, rgba(14, 165, 164, 0) 42%),
    radial-gradient(circle at 0% 25%, rgba(2, 132, 199, 0.14) 0%, rgba(2, 132, 199, 0) 35%),
    var(--api-bg);
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
}

.api-docs-shell {
  position: relative;
  min-height: 100vh;
}

.api-docs-nav-toggle {
  position: fixed;
  top: -1000px;
  left: -1000px;
}

.api-docs-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  width: min(84vw, 300px);
  height: 100vh;
  padding: 1.5rem 1.2rem;
  color: #dbe7ff;
  background: linear-gradient(180deg, #0f172a 0%, #101d38 100%);
  border-right: 1px solid var(--api-sidebar-border);
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  overflow-y: auto;
}

.api-docs-brand {
  color: #f8fbff;
  text-decoration: none;
  font-size: 1.03rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.api-docs-sidebar-head p {
  margin: 0.65rem 0 0;
  color: #94a3b8;
  font-size: 0.8rem;
  line-height: 1.4;
}

.api-docs-sidebar-head code {
  color: #bfdbfe;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 0.35rem;
  padding: 0.08rem 0.3rem;
  font-size: 0.72rem;
}

.api-docs-nav {
  display: grid;
  gap: 0.35rem;
}

.api-docs-nav-link {
  display: block;
  border-radius: 0.6rem;
  padding: 0.6rem 0.72rem;
  color: #c9d7f7;
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.api-docs-nav-link:hover,
.api-docs-nav-link:focus-visible {
  color: #f8fbff;
  background: rgba(30, 41, 59, 0.85);
}

.api-docs-nav-link.is-active {
  color: #ecfeff;
  background: linear-gradient(90deg, rgba(13, 148, 136, 0.48), rgba(8, 47, 73, 0.2));
  border: 1px solid rgba(45, 212, 191, 0.32);
}

.api-docs-schema-link {
  margin-top: auto;
  display: block;
  padding: 0.75rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(147, 197, 253, 0.24);
  background: rgba(15, 23, 42, 0.42);
  color: #c7d2fe;
  font-size: 0.82rem;
  line-height: 1.5;
  text-decoration: none;
}

.api-docs-schema-link code {
  color: #bfdbfe;
}

.api-docs-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  background: rgba(15, 23, 42, 0.56);
}

.api-docs-main {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  margin-left: 0;
}

.api-docs-mobile-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.8rem;
  backdrop-filter: blur(8px);
  background: rgba(244, 247, 251, 0.88);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.api-docs-mobile-brand {
  color: #0f172a;
  font-weight: 800;
  text-decoration: none;
}

.api-docs-menu-button {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 0.34rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  background: #ffffff;
  cursor: pointer;
}

.api-docs-content {
  width: min(980px, calc(100% - 2rem));
  margin: 1.2rem auto 2.6rem;
  padding: 1.7rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--api-radius);
  background: var(--api-surface);
  box-shadow: var(--api-shadow);
}

.api-docs-content > :first-child {
  margin-top: 0;
}

.api-docs-content h1,
.api-docs-content h2,
.api-docs-content h3,
.api-docs-content h4 {
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 1.7rem 0 0.8rem;
  line-height: 1.2;
}

.api-docs-content h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.35rem);
  margin-top: 0;
}

.api-docs-content h2 {
  border-top: 1px solid var(--api-border);
  padding-top: 1.35rem;
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
}

.api-docs-content h3 {
  font-size: 1.16rem;
}

.api-docs-content p,
.api-docs-content li {
  margin: 0.7rem 0;
  color: #1f2937;
  font-size: 1rem;
  line-height: 1.73;
}

.api-docs-content a {
  color: var(--api-accent-strong);
  text-decoration: underline;
  text-decoration-color: rgba(15, 118, 110, 0.3);
  text-underline-offset: 0.18rem;
}

.api-docs-content ul,
.api-docs-content ol {
  margin: 0.8rem 0 1.2rem 1.2rem;
  padding: 0;
}

.api-docs-content ul {
  list-style: disc;
}

.api-docs-content ol {
  list-style: decimal;
}

.api-docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.25rem;
  font-size: 0.95rem;
}

.api-docs-content th,
.api-docs-content td {
  text-align: left;
  padding: 0.6rem 0.7rem;
  border: 1px solid #d9e2ef;
  vertical-align: top;
}

.api-docs-content th {
  background: #f0f5fb;
  color: #0f172a;
  font-weight: 700;
}

.api-docs-content pre {
  margin: 0.92rem 0 1.25rem;
  padding: 1rem;
  background: var(--api-code-bg);
  color: var(--api-code-fg);
  border-radius: 0.72rem;
  border: 1px solid rgba(59, 130, 246, 0.24);
  overflow-x: auto;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.api-docs-content code,
.api-docs-content pre code {
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, monospace;
  font-size: 0.86rem;
}

.api-docs-content :not(pre) > code {
  color: #0f172a;
  background: #eef4fb;
  border: 1px solid #dbe5f1;
  border-radius: 0.4rem;
  padding: 0.09rem 0.32rem;
}

.api-docs-content .hljs {
  background: transparent;
  color: var(--api-code-fg);
}

.api-docs-content blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid #0ea5a4;
  background: #effcf9;
  color: #134e4a;
}

.api-docs-content hr {
  margin: 1.5rem 0;
  border: 0;
  border-top: 1px solid #dce5f2;
}

.api-docs-nav-toggle:checked ~ .api-docs-sidebar {
  transform: translateX(0);
}

.api-docs-nav-toggle:checked ~ .api-docs-backdrop {
  display: block;
}

@media (min-width: 980px) {
  .api-docs-sidebar {
    transform: none;
    width: 290px;
    padding: 1.8rem 1.3rem;
  }

  .api-docs-backdrop,
  .api-docs-mobile-header {
    display: none;
  }

  .api-docs-main {
    margin-left: 290px;
  }

  .api-docs-content {
    width: min(1040px, calc(100% - 3rem));
    margin: 2rem auto;
    padding: 2.2rem;
  }
}
