/* ===== Docs layout ===== */
.docs-body {
  background: var(--bg-primary);
  min-height: 100vh;
}

.docs-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  background: rgba(15, 17, 23, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.docs-header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
}

.docs-header__badge {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 3px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
}

.docs-header__actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.docs-layout {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 56px);
}

/* ===== Sidebar ===== */
.docs-sidebar {
  width: 240px;
  flex-shrink: 0;
  padding: 24px 16px;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-nav__group {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 16px 12px 8px;
}

.docs-nav__group:first-child {
  padding-top: 0;
}

.docs-nav__link {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.docs-nav__link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.docs-nav__link--active {
  color: var(--primary);
  background: rgba(79, 140, 255, 0.1);
}

/* ===== Main content ===== */
.docs-main {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px;
  max-width: 820px;
}

.docs-section {
  margin-bottom: 64px;
  scroll-margin-top: 80px;
}

.docs-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  line-height: 1.2;
}

.docs-lead {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.docs-heading {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.docs-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.docs-text a {
  color: var(--primary);
}

.docs-text a:hover {
  text-decoration: underline;
}

.docs-inline-code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.15em 0.45em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--info);
}

.docs-callout {
  padding: 14px 16px;
  background: rgba(79, 140, 255, 0.08);
  border: 1px solid rgba(79, 140, 255, 0.2);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 20px 0;
}

.docs-callout--warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
}

.docs-callout strong {
  color: var(--text-primary);
}

.docs-steps {
  margin: 0 0 24px 20px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.9;
}

.docs-steps a {
  color: var(--primary);
}

.docs-code-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  overflow-x: auto;
}

.docs-code-line code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
}

.docs-copy-inline {
  font-size: 12px;
  color: var(--primary);
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background var(--transition);
}

.docs-copy-inline:hover {
  background: rgba(79, 140, 255, 0.1);
}

/* ===== Endpoints ===== */
.endpoint {
  margin-bottom: 32px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.endpoint__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.endpoint__method {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.endpoint__method--get {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.endpoint__method--post {
  background: rgba(79, 140, 255, 0.15);
  color: var(--primary);
}

.endpoint__method--patch {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.endpoint__method--delete {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.endpoint__path {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-primary);
}

.endpoint__desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.endpoint__subtitle {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 20px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.endpoint__status {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
  border-radius: 4px;
  font-weight: 600;
}

.docs-json {
  padding: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-bottom: 8px;
}

.docs-json code {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  background: none;
  padding: 0;
}

/* ===== Tables ===== */
.docs-table-wrap {
  overflow-x: auto;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.docs-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.docs-table td {
  padding: 10px 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.docs-table tr:last-child td {
  border-bottom: none;
}

.docs-table code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--info);
  background: none;
  padding: 0;
}

/* ===== Code blocks (extend landing) ===== */
.docs-main .code-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.docs-main .code-block__body {
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}

.docs-main .code-block__body .cm { color: var(--text-muted); }
.docs-main .code-block__body .fn { color: var(--primary); }
.docs-main .code-block__body .str { color: var(--success); }
.docs-main .code-block__body .kw { color: #C792EA; }

.docs-footer {
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}

.docs-footer a {
  color: var(--primary);
}

.docs-footer a:hover {
  text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .docs-layout {
    flex-direction: column;
  }

  .docs-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }

  .docs-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .docs-nav__group {
    width: 100%;
    padding: 8px 0 4px;
  }

  .docs-nav__link {
    white-space: nowrap;
    font-size: 12px;
    padding: 6px 10px;
  }

  .docs-main {
    padding: 24px 16px 48px;
  }

  .docs-title {
    font-size: 28px;
  }
}
