/* API Documentation Styles - ReDoc Customization */
/* Maintains the same color scheme as the original documentation */

.api-docs {
  background-color: #1a202c !important; /* full-page dark background */
  color: #f9fafb !important;
  line-height: 1.5 !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  min-height: 100vh;
}

/* Container */
.api-docs .container {
  max-width: 1280px !important;
  margin: 0 auto !important;
  padding: 2rem 1rem !important;
  width: 100% !important;
}

/* Header gradient */
.api-docs .bg-gradient-to-r {
  background: linear-gradient(to right, #1e3a8a, #4f46e5) !important; /* blue-900 to indigo-600 */
}

/* ReDoc Customization */
.api-docs #redoc-container {
  background-color: #1a202c !important;
  padding: 2rem 0;
}

/* Override ReDoc styles to match our color scheme */
.api-docs .redoc-wrap {
  background-color: #1a202c !important;
}

.api-docs .api-content {
  background-color: #1a202c !important; /* remove white card */
  box-shadow: none !important;
  padding: 1.5rem;
  margin: 1rem 0;
}

/* Method badges - matching original colors */
.api-docs .http-verb {
  background-color: #6b46c1 !important;
  color: white !important;
  font-weight: 600 !important;
  padding: 0.25rem 0.75rem !important;
  border-radius: 0.25rem !important;
  font-size: 0.875rem !important;
}

.api-docs .http-verb.get {
  background-color: #10b981 !important;
}

.api-docs .http-verb.post {
  background-color: #3b82f6 !important;
}

.api-docs .http-verb.put {
  background-color: #f59e0b !important;
}

.api-docs .http-verb.delete {
  background-color: #ef4444 !important;
}

/* Path styling */
.api-docs .endpoint-path {
  color: #2f855a !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  padding: 0.25rem 0.75rem !important;
  background-color: #f3f4f6 !important;
  border-radius: 0.25rem !important;
  font-size: 0.875rem !important;
}

/* Parameter tables */
.api-docs .parameter-table,
.api-docs table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  background-color: #111827;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: none;
}

.api-docs .parameter-table th,
.api-docs table th {
  padding: 0.75rem 1rem;
  border: 1px solid #374151;
  text-align: left;
  background-color: #1f2937;
  font-weight: 600;
  color: #f9fafb;
}

.api-docs .parameter-table td,
.api-docs table td {
  padding: 0.75rem 1rem;
  border: 1px solid #374151;
  text-align: left;
  color: #e5e7eb;
  background-color: #111827;
}

/* Markdown tables inside ReDoc operation descriptions (WebSocket feeds, etc.) */
#redoc-container table,
#redoc-container [class*="redoc-markdown"] table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.25rem;
  background-color: #111827;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  overflow: hidden;
}

#redoc-container table th,
#redoc-container [class*="redoc-markdown"] table th {
  padding: 0.75rem 1rem;
  text-align: left;
  background-color: #1f2937;
  color: #f9fafb;
  font-weight: 600;
  border: 1px solid #374151;
}

#redoc-container table td,
#redoc-container [class*="redoc-markdown"] table td {
  padding: 0.75rem 1rem;
  text-align: left;
  background-color: #111827;
  color: #e5e7eb;
  border: 1px solid #374151;
}

#redoc-container table tbody tr,
#redoc-container [class*="redoc-markdown"] table tbody tr {
  background-color: #111827;
}

/* Code blocks */
.api-docs pre,
.api-docs code {
  background-color: #1a202c !important;
  color: #e2e8f0 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  border-radius: 0.5rem;
}

.api-docs pre {
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5;
}

.api-docs code {
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

/* Response examples */
.api-docs .response-object,
.api-docs .response-example {
  background-color: #1a202c !important;
  color: #e2e8f0 !important;
  padding: 1rem;
  border-radius: 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Sidebar styling */
.api-docs .menu-content {
  background-color: #1f2937 !important; /* gray-800 */
}

.api-docs .menu-item {
  color: #1f2937 !important;
}

.api-docs .menu-item:hover {
  background-color: #374151 !important; /* gray-700 */
  color: #f9fafb !important;
}

.api-docs .menu-item.active {
  background-color: #6b46c1 !important;
  color: white !important;
}

/* Parameter type badges */
.api-docs .parameter-type {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 0.75rem;
  background-color: #f3f4f6;
  color: #4b5563;
  font-size: 0.875rem;
  margin-left: 0.5rem;
}

.api-docs .parameter-required {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 0.75rem;
  background-color: #fee2e2;
  color: #dc2626;
  font-size: 0.875rem;
  margin-left: 0.5rem;
}

.api-docs .parameter-optional {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 0.75rem;
  background-color: #dbeafe;
  color: #2563eb;
  font-size: 0.875rem;
  margin-left: 0.5rem;
}

/* Typography */
.api-docs h1 {
  font-size: 2.25rem !important;
  font-weight: 700 !important;
  color: #f9fafb !important;
  margin-bottom: 2rem !important;
  line-height: 1.2 !important;
}

.api-docs h2 {
  font-size: 1.5rem !important;
  font-weight: 600 !important;
  color: #f9fafb !important;
  margin-bottom: 1rem !important;
  line-height: 1.3 !important;
}

.api-docs h3 {
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  color: #f9fafb !important;
  margin-bottom: 1rem !important;
  line-height: 1.4 !important;
}

.api-docs p {
  margin-bottom: 1rem !important;
  color: #e5e7eb !important;
  line-height: 1.6 !important;
}

/* Responsive styles */
@media (max-width: 768px) {
  .api-docs .container {
    padding: 1rem;
  }
  
  .api-docs h1 {
    font-size: 1.875rem;
  }
  
  .api-docs h2 {
    font-size: 1.25rem;
  }
}

/*
 * ReDoc uses many class names containing "Section" / "Label" (e.g. operation layout, servers chip).
 * Do NOT wildcard-match those: default server blocks keep a light background and forced white text
 * becomes unreadable. Keep this list to panels that stay on the dark right column.
 */
#redoc-container [class*="security"],
#redoc-container [class*="Security"],
#redoc-container [class*="auth"],
#redoc-container [class*="Auth"],
#redoc-container [class*="parameter"],
#redoc-container [class*="Parameter"],
#redoc-container [class*="response"],
#redoc-container [class*="Response"] {
  color: #ffffff !important;
}

/* Hide expand/collapse arrows for AUTHORIZATIONS section */
#redoc-container [class*="security"] svg,
#redoc-container [class*="Security"] svg,
#redoc-container [class*="auth"] svg,
#redoc-container [class*="Auth"] svg,
#redoc-container [class*="security"] [class*="chevron"],
#redoc-container [class*="Security"] [class*="chevron"],
#redoc-container [class*="auth"] [class*="chevron"],
#redoc-container [class*="Auth"] [class*="chevron"],
#redoc-container [class*="security"] [class*="arrow"],
#redoc-container [class*="Security"] [class*="arrow"],
#redoc-container [class*="auth"] [class*="arrow"],
#redoc-container [class*="Auth"] [class*="arrow"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}


/* Make application/json text white - handled by JavaScript */
/* Target response schema content */
#redoc-container [class*="response"] *,
#redoc-container [class*="Response"] *,
#redoc-container [class*="schema"] *,
#redoc-container [class*="Schema"] * {
  color: #ffffff !important;
}

/* Specific targeting for ReDoc's structure */
#redoc-container h3,
#redoc-container h4,
#redoc-container h5,
#redoc-container [class*="redoc-markdown"] h3,
#redoc-container [class*="redoc-markdown"] h4,
#redoc-container [class*="redoc-markdown"] h5 {
  color: #ffffff !important;
}

/* Additional JavaScript-based styling - see docs.html for dynamic text matching */

/* Print styles */
@media print {
  .api-docs {
    background-color: white;
  }
  
  .api-docs .response-object,
  .api-docs .response-example {
    background-color: #f9fafb;
    color: #1f2937;
    border: 1px solid #e5e7eb;
  }
}

.api-docs-shell {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 4rem);
  margin: 0 -1rem;
  background: #0b1120;
  color: #e5e7eb;
}

@media (min-width: 1024px) {
  .api-docs-shell {
    margin: 0 calc(50% - 50vw);
    width: 100vw;
    max-width: 100vw;
  }
}

.api-docs-topbar {
  flex-shrink: 0;
  border-bottom: 1px solid #1f2937;
  background: #111827;
}

.api-docs-topbar-inner {
  max-width: 100%;
  padding: 1rem 1.25rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.api-docs-topbar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.api-docs-topbar-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f9fafb;
}

/* ── Category picker (REST / WebSocket / Flat Files) ── */

.api-docs-categories {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
}

.api-docs-category-card {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-height: 5.5rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #374151;
  background: #0f172a;
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease,
    flex-grow 0.25s ease,
    flex-basis 0.25s ease;
}

.api-docs-category-card:hover {
  border-color: #4b5563;
  background: #111827;
  transform: translateY(-1px);
}

.api-docs-category-card-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e5e7eb;
  background: #1f2937;
}

.api-docs-category-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  color: #f9fafb;
}

.api-docs-category-card-desc {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #9ca3af;
}

.api-docs-category-card.is-active {
  border-color: var(--docs-accent, #6366f1);
  background: linear-gradient(165deg, rgba(99, 102, 241, 0.14) 0%, #0f172a 55%);
  box-shadow: 0 0 0 1px var(--docs-accent, #6366f1), 0 8px 24px rgba(0, 0, 0, 0.25);
}

.api-docs-category-card.is-active .api-docs-category-card-badge {
  background: var(--docs-accent, #6366f1);
  color: #fff;
}

.api-docs-shell--rest {
  --docs-accent: #6366f1;
}

.api-docs-shell--websocket {
  --docs-accent: #10b981;
}

.api-docs-shell--flatfiles {
  --docs-accent: #f59e0b;
}

.api-docs-shell--websocket .api-docs-category-card.is-active {
  background: linear-gradient(165deg, rgba(16, 185, 129, 0.12) 0%, #0f172a 55%);
}

.api-docs-shell--flatfiles .api-docs-category-card.is-active {
  background: linear-gradient(165deg, rgba(245, 158, 11, 0.12) 0%, #0f172a 55%);
}

@media (min-width: 768px) {
  .api-docs-topbar-inner {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (max-width: 720px) {
  .api-docs-categories {
    flex-direction: column;
  }

  .api-docs-category-card {
    flex: 1 1 auto;
    min-height: 0;
  }
}

/* ── Sidebar category + sections ── */

.api-docs-sidebar-category {
  flex-shrink: 0;
  padding: 1rem 1rem 0.875rem;
  border-bottom: 1px solid #1f2937;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
}

.api-docs-shell--websocket .api-docs-sidebar-category {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, transparent 100%);
}

.api-docs-shell--flatfiles .api-docs-sidebar-category {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, transparent 100%);
}

.api-docs-sidebar-category-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
}

.api-docs-sidebar-category-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #f9fafb;
  line-height: 1.25;
}

.api-docs-sidebar-category-desc {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #9ca3af;
}

.api-docs-sidebar-section-label {
  margin: 0.75rem 1rem 0.35rem;
  padding-top: 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
}

.api-docs-sidebar-section-label--reference {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #1f2937;
}

.api-docs-shell--rest .api-docs-nav-item.active {
  border-left-color: #6366f1;
}

.api-docs-shell--websocket .api-docs-nav-item.active {
  border-left-color: #10b981;
}

.api-docs-shell--flatfiles .api-docs-nav-item.active {
  border-left-color: #f59e0b;
}

.api-docs-topbar-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.api-docs-topbar-link {
  font-size: 0.875rem;
  color: #9ca3af;
  text-decoration: none;
}

.api-docs-topbar-link:hover {
  color: #e5e7eb;
}

.api-docs-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.api-docs-sidebar {
  width: 280px;
  flex-shrink: 0;
  min-height: 0;
  border-right: 1px solid #1f2937;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.api-docs-sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 0;
  scrollbar-gutter: stable;
}

.api-docs-sidebar-hint {
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.api-docs-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  padding: 0.55rem 1rem;
  border: none;
  background: transparent;
  color: #d1d5db;
  font-size: 0.875rem;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.api-docs-nav-item:hover {
  background: #1e293b;
  color: #f9fafb;
}

.api-docs-nav-item.active {
  background: #1e293b;
  color: #f9fafb;
}

.api-docs-nav-count {
  font-size: 0.75rem;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

.api-docs-nav-item.active .api-docs-nav-count {
  color: #9ca3af;
}

.api-docs-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #1a202c;
}

/* WebSocket docs: guide panel + ReDoc stacked */
.api-docs-main--stacked {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.api-docs-ws-intro {
  flex-shrink: 0;
  max-height: min(52vh, 28rem);
  overflow-y: auto;
  border-bottom: 1px solid #1f2937;
}

.api-docs-ws-intro .api-docs-static-inner {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.api-docs-redoc--embedded {
  flex: 1;
  min-height: 320px;
  overflow: auto;
  padding: 0;
}

.api-docs-redoc {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/* Plain selectors (no :global — invalid in static CSS and breaks ReDoc overrides). */
.api-docs-redoc .redoc-wrap {
  min-height: 100%;
}

@media (max-width: 900px) {
  .api-docs-body {
    flex-direction: column;
  }

  .api-docs-sidebar {
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid #1f2937;
  }
}

.is-hidden {
  display: none !important;
}

/*
 * Single app sidebar: hide ReDoc's internal menu (search + tag nav).
 * #redoc-container improves specificity over ReDoc's styled-components.
 */
#redoc-container.api-docs-redoc:not(.is-hidden) .menu-content,
.api-docs-redoc:not(.is-hidden) .menu-content {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: none !important;
  position: absolute !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
}

#redoc-container.api-docs-redoc:not(.is-hidden) .redoc-wrap,
.api-docs-redoc:not(.is-hidden) .redoc-wrap {
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
}

#redoc-container.api-docs-redoc:not(.is-hidden) .api-content,
.api-docs-redoc:not(.is-hidden) .api-content {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  padding-left: 1.25rem !important;
  padding-right: 1.25rem !important;
  flex: 1 1 auto !important;
  box-sizing: border-box !important;
}

/* Per-operation ReDoc (OpenAPI default layout); app sidebar stays separate */
.docs-redoc-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: linear-gradient(180deg, #0f172a 0%, #1a202c 28%, #1a202c 100%);
  color: #e5e7eb;
}

.docs-redoc-panel .docs-redoc-stack {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.docs-redoc-panel #redoc-container.api-docs-redoc {
  flex: 1;
  min-height: 0;
}

.docs-redoc-stack {
  position: relative;
  min-height: 0;
}

.docs-redoc-loading {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(4px);
}

.docs-redoc-loading.is-hidden {
  display: none !important;
}

.docs-redoc-loading-text {
  font-size: 0.875rem;
  color: #9ca3af;
}

.docs-redoc-loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #374151;
  border-top-color: #818cf8;
  border-radius: 50%;
  animation: api-docs-spin 0.75s linear infinite;
}

@keyframes api-docs-spin {
  to {
    transform: rotate(360deg);
  }
}

.docs-redoc-panel #redoc-container .api-content h2 {
  margin-top: 1.35rem;
  margin-bottom: 0.65rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #f3f4f6;
}

.api-docs-redoc--framed {
  padding-top: 0.25rem;
}

/* Static guide pages: REST API, Pagination, Quick Authentication */
.api-docs-static-panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0;
  background: linear-gradient(180deg, #0f172a 0%, #1a202c 28%, #1a202c 100%);
  color: #e5e7eb;
}

.api-docs-static-inner {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1.75rem 3.5rem;
}

@media (min-width: 1024px) {
  .api-docs-static-inner {
    padding: 2.5rem 2.25rem 4rem;
  }
}

.api-docs-doc-page {
  margin: 0;
}

.api-docs-page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(55, 65, 81, 0.85);
  position: relative;
}

.api-docs-page-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 4rem;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 2px;
}

.api-docs-page-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #818cf8;
}

.api-docs-page-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 700;
  color: #f9fafb;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.api-docs-doc-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.api-docs-section {
  background: rgba(17, 24, 39, 0.65);
  border: 1px solid #374151;
  border-radius: 0.75rem;
  padding: 1.25rem 1.35rem 1.35rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.api-docs-section--intro {
  background: rgba(30, 27, 75, 0.25);
  border-color: rgba(99, 102, 241, 0.35);
}

.api-docs-section-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

@media (min-width: 640px) {
  .api-docs-section-head {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
  }
}

.api-docs-pill {
  display: inline-block;
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c7d2fe;
  background: rgba(79, 70, 229, 0.35);
  border: 1px solid rgba(129, 140, 248, 0.45);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.api-docs-pill--alt {
  color: #a5f3fc;
  background: rgba(14, 116, 144, 0.35);
  border-color: rgba(34, 211, 238, 0.35);
}

.api-docs-section-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #f3f4f6;
  line-height: 1.35;
}

.api-docs-section-head .api-docs-section-title {
  flex: 1;
  min-width: 0;
}

.api-docs-section-title code {
  font-size: 0.9em;
  font-weight: 500;
}

.api-docs-section-lead {
  margin: 0 0 0.85rem;
  font-size: 0.875rem;
  color: #9ca3af;
  line-height: 1.55;
}

.api-docs-lead {
  font-size: 1rem;
  color: #d1d5db;
  margin: 0 0 0.25rem !important;
  line-height: 1.65;
}

.api-docs-section .api-docs-lead:last-child {
  margin-bottom: 0 !important;
}

.api-docs-kv {
  margin: 0.75rem 0 0;
  display: grid;
  gap: 0.65rem 0;
}

.api-docs-kv dt {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9ca3af;
}

.api-docs-kv dd {
  margin: 0.15rem 0 0.85rem;
  font-size: 0.9375rem;
  color: #e5e7eb;
  line-height: 1.55;
  padding-left: 0;
  border-left: 3px solid #4f46e5;
  padding-left: 0.85rem;
}

.api-docs-kv dd:last-of-type {
  margin-bottom: 0;
}

.api-docs-hint {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  color: #9ca3af;
  line-height: 1.5;
}

.api-docs-hint code {
  font-size: 0.8em;
}

.api-docs-steps {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  counter-reset: docstep;
}

.api-docs-steps li {
  position: relative;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem 0.65rem 2.65rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid #334155;
  border-radius: 0.5rem;
  color: #d1d5db;
  line-height: 1.55;
}

.api-docs-steps li:last-child {
  margin-bottom: 0;
}

.api-docs-steps li::before {
  counter-increment: docstep;
  content: counter(docstep);
  position: absolute;
  left: 0.65rem;
  top: 0.65rem;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #e0e7ff;
  background: linear-gradient(145deg, #4f46e5, #6366f1);
  border-radius: 0.35rem;
  line-height: 1;
}

.api-docs-step-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #a5b4fc;
  margin-bottom: 0.2rem;
}

.api-docs-flow-link {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: #a5b4fc;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.api-docs-flow-link:hover {
  color: #c7d2fe;
}

.api-docs-inline-anchor {
  color: #a5b4fc;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.api-docs-inline-anchor:hover {
  color: #c7d2fe;
}

.api-docs-doc-body code,
.api-docs-section code {
  background: rgba(15, 23, 42, 0.9);
  padding: 0.12rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.84em;
  border: 1px solid #374151;
  color: #e5e7eb;
}

.api-docs-header-token {
  color: #fda4af !important;
  border-color: rgba(251, 113, 133, 0.35) !important;
  background: rgba(136, 19, 55, 0.25) !important;
}

.api-docs-callout {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 0.65rem;
  font-size: 0.875rem;
  line-height: 1.55;
  border: 1px solid;
}

.api-docs-callout--note {
  color: #d1d5db;
  background: rgba(30, 41, 59, 0.6);
  border-color: #475569;
}

.api-docs-callout--tip {
  color: #e0e7ff;
  background: rgba(49, 46, 129, 0.35);
  border-color: rgba(129, 140, 248, 0.4);
}

.api-docs-code-figure {
  margin: 0;
}

.api-docs-code-caption {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
}

.api-docs-code-caption code {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

.api-docs-code-sample {
  margin: 0;
  padding: 1rem 1.1rem;
  background: #0b1120;
  border-radius: 0.65rem;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.5;
  border: 1px solid #1f2937;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.08);
}

.api-docs-code-sample code {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: #e5e7eb;
}

/* Legacy helpers (if used elsewhere) */
.api-docs-static-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #f9fafb;
  margin-bottom: 1rem;
}

.api-docs-static-block p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.api-docs-static-list {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
  list-style: disc;
  color: #d1d5db;
}

.api-docs-static-list li {
  margin-bottom: 0.5rem;
}

.api-docs-note {
  font-size: 0.875rem;
  color: #9ca3af;
  margin-top: 1rem !important;
}

.api-docs-static-h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #f3f4f6;
  margin: 1.25rem 0 0.5rem;
}

.api-docs-sidebar-groups {
  border-top: 1px solid #1f2937;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

.api-docs-nav-group {
  margin-bottom: 0.25rem;
}

.api-docs-nav-group-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
  padding: 0.5rem 1rem 0.25rem;
}

.api-docs-nav-op.api-docs-nav-nested {
  padding-left: 1.75rem;
  font-size: 0.8125rem;
}

.api-docs-details {
  border-bottom: 1px solid #1f2937;
}

.api-docs-details-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 1rem;
  color: #d1d5db;
  font-size: 0.875rem;
  user-select: none;
}

.api-docs-details-summary::-webkit-details-marker {
  display: none;
}

.api-docs-details-summary::after {
  content: "";
  width: 0.35rem;
  height: 0.35rem;
  border-right: 2px solid #6b7280;
  border-bottom: 2px solid #6b7280;
  transform: rotate(-45deg);
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.api-docs-details[open] > .api-docs-details-summary::after {
  transform: rotate(45deg);
}

.api-docs-details-title {
  flex: 1;
  text-align: left;
}

.api-docs-details-ops {
  padding-bottom: 0.35rem;
}

.api-docs-nav-static {
  font-weight: 500;
}
