/**
 * Bengal SSG - Autodoc Component Styles
 * Complete reset and rebuild of autodoc HTML/CSS system
 *
 * Current: ~950 lines (down from 7,044 - 86% reduction)
 * Structure: Single HTML skeleton for Python API, CLI, and OpenAPI
 *
 * @see plan/drafted/rfc-autodoc-html-reset.md
 */

/* ============================================
   AUTODOC TOKENS
   All custom properties in one place
   ============================================ */

[data-autodoc] {
  /* Spacing */
  --autodoc-gap: var(--space-6);
  --autodoc-section-gap: var(--space-8);
  --autodoc-item-gap: var(--space-4);

  /* Colors */
  --autodoc-border: var(--color-border-light);
  --autodoc-bg-code: var(--color-bg-code);
  --autodoc-bg-card: var(--color-bg-elevated);
  --autodoc-bg-hover: var(--color-bg-hover);

  /* Typography */
  --autodoc-font-mono: var(--font-mono);
  --autodoc-code-size: var(--text-sm);

  /* Badges */
  --autodoc-badge-bg: var(--color-bg-tertiary);
  --autodoc-badge-text: var(--color-text-muted);
}

/* Dark mode token overrides */
[data-theme="dark"] [data-autodoc] {
  --autodoc-border: var(--color-border);
  --autodoc-bg-card: var(--color-bg-secondary);
}

/* ============================================
   PROSE OVERRIDES
   Surgical resets to prevent .prose interference
   ============================================ */

/* Exclude autodoc from .prose lead paragraph styling */
article[data-autodoc]>p:first-of-type,
[data-autodoc] .autodoc-description>p:first-of-type {
  font-size: inherit;
  color: inherit;
}

/* Override .prose table styles */
[data-autodoc] table {
  margin: 0;
  font-size: var(--autodoc-code-size);
}

/* Override .prose heading margins */
[data-autodoc] h1,
[data-autodoc] h2,
[data-autodoc] h3,
[data-autodoc] h4 {
  margin-top: 0;
  margin-bottom: 0;
}

/* Override .prose list styles */
[data-autodoc] dl {
  margin: 0;
}

/* ============================================
   BASE CONTAINER
   ============================================ */

/* Autodoc card modifier */
.autodoc-card--deprecated {
  opacity: 0.7;
}

.autodoc-cell-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.autodoc-custom-content {
  margin-top: var(--space-6);
}

.autodoc-examples-panel {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
}

.autodoc-examples-panel-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.autodoc-examples-panel-content {
  margin-top: var(--space-2);
}

.autodoc-members-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.autodoc-param-envvar {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.autodoc-server-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.autodoc-server-item {
  padding: var(--space-2);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
}

.autodoc-server-url {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.autodoc-server-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-0-5);
}

[data-autodoc] {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
}

.autodoc {
  display: flex;
  flex-direction: column;
  gap: var(--autodoc-gap);
}

/* ============================================
   HEADER
   Title, badges, description, stats
   ============================================ */

.autodoc-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.autodoc-title {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

.autodoc-title code {
  font-family: var(--autodoc-font-mono);
  background: none;
  padding: 0;
}

.autodoc-description {
  color: var(--color-text-secondary);
}

.autodoc-description>p:first-child {
  margin-top: 0;
}

.autodoc-description>p:last-child {
  margin-bottom: 0;
}

/* ============================================
   SECTIONS
   Generic section container
   ============================================ */

.autodoc-section {
  display: flex;
  flex-direction: column;
  gap: var(--autodoc-item-gap);
}

/* Summary section (contains autodoc-summary-table) */
.autodoc-summary {
  display: flex;
  flex-direction: column;
  gap: var(--autodoc-item-gap);
}

/* Member summary table (autosummary-style) */
.autodoc-summary-table {
  width: 100%;
  border-collapse: collapse;
}

.autodoc-summary-table th,
.autodoc-summary-table td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--autodoc-border);
}

.autodoc-summary-table th {
  font-weight: 600;
  color: var(--color-text-muted);
}

.autodoc-summary-table td:first-child {
  font-family: var(--autodoc-font-mono);
}

.autodoc-summary-table a {
  color: inherit;
  text-decoration: none;
}

.autodoc-summary-table a:hover {
  text-decoration: underline;
}

.autodoc-section-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}

.autodoc-label {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   CODE: Signatures, inline code, blocks
   ============================================ */

.autodoc-signature {
  background: var(--autodoc-bg-code);
  border: 1px solid var(--autodoc-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  overflow-x: auto;
}

.autodoc-signature pre {
  margin: 0;
}

.autodoc-signature code {
  font-family: var(--autodoc-font-mono);
  font-size: var(--autodoc-code-size);
  background: none;
  padding: 0;
}

.autodoc-usage {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.autodoc-usage pre {
  margin: 0;
  background: var(--autodoc-bg-code);
  border: 1px solid var(--autodoc-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  overflow-x: auto;
}

.autodoc-usage code {
  font-family: var(--autodoc-font-mono);
  font-size: var(--autodoc-code-size);
  background: none;
  padding: 0;
}

/* Inline code */
[data-autodoc] code {
  font-family: var(--autodoc-font-mono);
  font-size: var(--autodoc-code-size);
  background: var(--autodoc-bg-code);
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
}

/* Reset code inside pre blocks */
[data-autodoc] pre code {
  background: none;
  padding: 0;
}

/* ============================================
   BADGES: Status indicators
   ============================================ */

.autodoc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.autodoc-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125em 0.5em;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  background: var(--autodoc-badge-bg);
  color: var(--autodoc-badge-text);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.autodoc-badge[data-badge="deprecated"] {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}

.autodoc-badge[data-badge="async"] {
  background: var(--color-info-bg);
  color: var(--color-info-text);
}

.autodoc-badge[data-badge="abstract"] {
  background: var(--color-example-bg);
  color: var(--color-example-text);
}

.autodoc-badge[data-badge="mixin"] {
  background: var(--color-info-bg);
  color: var(--color-info-text);
}

.autodoc-badge[data-badge="dataclass"] {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.autodoc-badge[data-badge="required"] {
  background: var(--color-error-bg);
  color: var(--color-error-text);
}

/* ============================================
   TABLES: Parameters, attributes
   ============================================ */

.autodoc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.autodoc-table th,
.autodoc-table td {
  padding: var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--autodoc-border);
}

.autodoc-table th {
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  background: var(--color-bg-secondary);
}

.autodoc-table tbody tr:hover {
  background: var(--autodoc-bg-hover);
}

/* Compact table variant for nested contexts */
.autodoc-table--compact {
  font-size: var(--text-xs);
}

.autodoc-table--compact th,
.autodoc-table--compact td {
  padding: var(--space-2);
}

.autodoc-table--compact th {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.autodoc-cell-name {
  font-family: var(--autodoc-font-mono);
  font-weight: var(--weight-medium);
}

.autodoc-cell-type {
  color: var(--color-text-muted);
  font-family: var(--autodoc-font-mono);
}

.autodoc-cell-default {
  color: var(--color-text-muted);
  font-family: var(--autodoc-font-mono);
}

/* Required indicator */
tr[data-required="true"] .autodoc-cell-name::after {
  content: "*";
  color: var(--color-danger);
  margin-left: 0.25em;
}

/* ============================================
   DEFINITION LISTS: Alternative param display
   ============================================ */

.autodoc-params {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
}

.autodoc-param {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
}

.autodoc-param-name {
  font-family: var(--autodoc-font-mono);
  font-weight: var(--weight-medium);
}

.autodoc-param-type {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-family: var(--autodoc-font-mono);
}

.autodoc-param-desc {
  grid-column: 1 / -1;
  margin: 0;
}

.autodoc-param-default {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Required indicator for param list */
.autodoc-param[data-required="true"] .autodoc-param-name::after {
  content: "*";
  color: var(--color-danger);
  margin-left: 0.25em;
}

/* ============================================
   RETURNS / RAISES
   ============================================ */

.autodoc-returns {
  margin-bottom: var(--space-4);
}

.autodoc-returns-type {
  display: inline-block;
  font-family: var(--autodoc-font-mono);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  background: var(--color-bg-code);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}

.autodoc-returns-desc {
  display: block;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.autodoc-raises {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
}

.autodoc-raise {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
}

.autodoc-raise dt {
  font-family: var(--autodoc-font-mono);
  font-weight: var(--weight-medium);
}

.autodoc-raise dd {
  margin: 0;
  color: var(--color-text-secondary);
}

/* ============================================
   EXAMPLES
   ============================================ */

.autodoc-example {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.autodoc-example-title {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
}

.autodoc-example pre {
  margin: 0;
  background: var(--autodoc-bg-code);
  border: 1px solid var(--autodoc-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  overflow-x: auto;
}

/* ============================================
   MEMBERS: Collapsible method/attribute cards
   With status dots, counts, and diffused shadows
   ============================================ */

.autodoc-member {
  border: 1px solid var(--autodoc-border);
  border-radius: var(--radius-lg);
  background: var(--autodoc-bg-card);
  margin-bottom: var(--space-3);
  box-shadow: var(--neumorphic-enhanced-subtle);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.autodoc-member:hover {
  box-shadow: var(--neumorphic-enhanced-hover);
}

.autodoc-member-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-lg);
  transition: background var(--transition-fast);
}

.autodoc-member-header:hover {
  background: var(--autodoc-bg-hover);
}

.autodoc-member-header::-webkit-details-marker {
  display: none;
}

/* Status dot indicator for members */
.autodoc-member-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-text-muted);
  box-shadow: var(--neumorphic-subtle);
  margin-top: 0.375rem;
}

/* Dot colors by member type */
.autodoc-member[data-member="class"] .autodoc-member-dot,
.autodoc-member[data-member="dataclass"] .autodoc-member-dot {
  background: var(--color-warning);
}

.autodoc-member[data-member="function"] .autodoc-member-dot {
  background: var(--color-success);
}

.autodoc-member[data-member="method"] .autodoc-member-dot {
  background: var(--color-text-muted);
}

/* Content wrapper */
.autodoc-member-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* Name row with count and return type */
.autodoc-member-name-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.autodoc-member-name {
  font-family: var(--autodoc-font-mono);
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  background: none;
  padding: 0;
}

/* Count badge */
.autodoc-member-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-full);
  box-shadow: var(--neumorphic-subtle);
}

/* Return type with arrow */
.autodoc-member-return {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.autodoc-member-return::before {
  content: "→";
  color: var(--color-text-muted);
}

.autodoc-member-return code {
  font-family: var(--autodoc-font-mono);
  font-size: var(--text-sm);
  color: var(--color-warning);
  background: none;
  padding: 0;
}

/* Toggle indicator - positioned at far right for modern look */
.autodoc-member-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  order: 1; /* Push to end of flex row */
  margin-left: auto; /* Push to far right edge */
  width: 1.25rem;
  height: 1.25rem;
  padding: 0.25rem;
  flex-shrink: 0;
  color: var(--color-text-muted);
  opacity: 0.5;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.autodoc-member-toggle svg {
  width: 12px;
  height: 12px;
}

/* Show toggle more prominently on hover */
.autodoc-member-header:hover .autodoc-member-toggle {
  opacity: 1;
  color: var(--color-text-secondary);
}

/* Only rotate the toggle that belongs to THIS details, not nested ones */
.autodoc-member[open]>.autodoc-member-header .autodoc-member-toggle {
  transform: rotate(180deg);
}

/* Signature in header */
.autodoc-member-sig {
  display: block;
  color: var(--color-text-muted);
  font-family: var(--autodoc-font-mono);
  font-size: var(--text-xs);
  margin-top: var(--space-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Full signature block in body */
.autodoc-signature {
  margin: 0 0 var(--space-4);
  padding: var(--space-3);
  background: var(--color-bg-code);
  border-radius: var(--radius-md);
  border: 1px solid var(--autodoc-border);
  overflow-x: auto;
}

.autodoc-signature code {
  font-family: var(--autodoc-font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  background: none;
  padding: 0;
}

/* Signature section (in body) */
.autodoc-signature-section {
  margin-bottom: var(--space-4);
}

/* Parameters section */
.autodoc-params-section {
  margin-bottom: var(--space-4);
}

.autodoc-params-title,
.autodoc-returns-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-2);
}

.autodoc-member-badges {
  margin-left: auto;
  display: flex;
  gap: var(--space-2);
}

.autodoc-member-body {
  padding: var(--space-4);
  border-top: 1px solid var(--autodoc-border);
}

.autodoc-member-desc {
  margin-bottom: var(--space-4);
}

.autodoc-member-desc>p:first-child {
  margin-top: 0;
}

.autodoc-member-desc>p:last-child {
  margin-bottom: 0;
}

/* Description preview in header */
.autodoc-member-desc-preview {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

/* Internal methods section */
.autodoc-internal-methods {
  margin-top: var(--space-4);
  border: 1px dashed var(--autodoc-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-secondary);
  box-shadow: var(--neumorphic-subtle);
}

.autodoc-internal-methods-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  list-style: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: background var(--transition-fast);
}

.autodoc-internal-methods-header:hover {
  background: var(--color-bg-hover);
}

.autodoc-internal-methods-header::-webkit-details-marker {
  display: none;
}

.autodoc-internal-methods-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.autodoc-internal-methods-content {
  padding: var(--space-4);
  border-top: 1px dashed var(--autodoc-border);
  background: var(--color-bg-primary);
}

.autodoc-internal-methods[open]>.autodoc-internal-methods-header .autodoc-member-toggle {
  transform: rotate(180deg);
}

/* ============================================
   CARDS: Subcommands, endpoints, classes
   ============================================ */

.autodoc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.autodoc-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--autodoc-bg-card);
  border: 1px solid var(--autodoc-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

/* Ensure link cards don't show underlines anywhere */
a.autodoc-card,
a.autodoc-card:hover,
a.autodoc-card:visited,
a.autodoc-card:active,
a.autodoc-card:focus {
  text-decoration: none;
  color: inherit;
}

a.autodoc-card code,
a.autodoc-card span {
  text-decoration: none;
}

.autodoc-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--elevation-card-hover);
  background: var(--autodoc-bg-hover);
}

.autodoc-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.autodoc-card-name {
  font-family: var(--autodoc-font-mono);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
}

.autodoc-card:hover .autodoc-card-name {
  color: var(--color-primary);
}

.autodoc-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.autodoc-card-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.autodoc-card-body {
  flex: 1;
  min-height: 0;
}

.autodoc-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0;
}

.autodoc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-2);
  border-top: 1px solid var(--autodoc-border);
}

.autodoc-card-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Hub variant cards (larger icons) */
.autodoc-cards--hub {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.autodoc-card--hub {
  padding: var(--space-5);
}

.autodoc-card--hub .autodoc-card-header {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

/* Empty state */
.autodoc-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-8);
  text-align: center;
}

.autodoc-empty-state-icon {
  opacity: 0.5;
}

.autodoc-empty-state-text {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  margin: 0;
}

.autodoc-empty-state-hint {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

/* Badge positioning inside cards */
.autodoc-card .autodoc-badge {
  align-self: flex-start;
  margin-top: var(--space-1);
}

/* HTTP method badges for OpenAPI */
.autodoc-method {
  display: inline-flex;
  padding: 0.125em 0.5em;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  border-radius: var(--radius-sm);
}

.autodoc-method[data-method="get"] {
  background: #61affe;
  color: white;
}

.autodoc-method[data-method="post"] {
  background: #49cc90;
  color: white;
}

.autodoc-method[data-method="put"] {
  background: #fca130;
  color: white;
}

.autodoc-method[data-method="delete"] {
  background: #f93e3e;
  color: white;
}

.autodoc-method[data-method="patch"] {
  background: #50e3c2;
  color: white;
}

.autodoc-method[data-method="options"] {
  background: #0d5aa7;
  color: white;
}

.autodoc-method[data-method="head"] {
  background: #9012fe;
  color: white;
}

/* ============================================
   STATS: Counters in header
   ============================================ */

.autodoc-stats {
  display: flex;
  gap: var(--space-4);
}

.autodoc-stat {
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
  font-size: var(--text-sm);
}

.autodoc-stat-value {
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}

.autodoc-stat-label {
  color: var(--color-text-muted);
}

/* ============================================
   SOURCE LINK
   ============================================ */

.autodoc-source {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-link);
  text-decoration: none;
}

.autodoc-source:hover {
  text-decoration: underline;
}

/* ============================================
   RESPONSIVE: Mobile adaptations
   ============================================ */

@media (max-width: 768px) {

  /* Stack tables on mobile */
  .autodoc-table thead {
    display: none;
  }

  .autodoc-table tbody tr {
    display: block;
    padding: var(--space-3);
    border: 1px solid var(--autodoc-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-2);
  }

  .autodoc-table td {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    border-bottom: none;
  }

  .autodoc-table td::before {
    content: attr(data-label);
    font-weight: var(--weight-medium);
    color: var(--color-text-muted);
  }

  /* Single column cards on mobile */
  .autodoc-cards {
    grid-template-columns: 1fr;
  }

  /* Smaller title on mobile */
  .autodoc-title {
    font-size: var(--text-xl);
  }

  /* Stack param grid on mobile */
  .autodoc-param {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {

  /* Even smaller gaps on small mobile */
  [data-autodoc] {
    --autodoc-gap: var(--space-4);
    --autodoc-section-gap: var(--space-6);
  }

  /* Reduce padding */
  .autodoc-signature,
  .autodoc-usage pre,
  .autodoc-example pre {
    padding: var(--space-3);
  }
}

/* Status code coloring */
[data-status-class="2"] {
  color: var(--color-success);
  font-weight: var(--weight-bold);
}

[data-status-class="4"] {
  color: var(--color-warning);
  font-weight: var(--weight-bold);
}

[data-status-class="5"] {
  color: var(--color-error);
  font-weight: var(--weight-bold);
}

/* ============================================
   MINTLIFY-STYLE API EXPLORER
   Sticky right panel, high-density badges, playground bar
   ============================================ */

/* 1. Global Reset for REST Pages */
body[data-type="autodoc-rest"] #main-content {
  padding: 0;
  max-width: none;
}

/* 2. Main Layout Grid (Base Docs Extension) */
.docs-layout--api-explorer {
  display: grid;
  grid-template-columns: 280px 1fr 28rem;
  grid-template-areas: "sidebar content examples";
  height: calc(100vh - var(--header-height, 64px));
  overflow: hidden;
}

.docs-layout--api-explorer .docs-sidebar {
  grid-area: sidebar;
  border-right: 1px solid var(--autodoc-border);
  background: var(--color-bg-secondary);
  overflow-y: auto;
}

.docs-layout--api-explorer .docs-main {
  grid-area: content;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: var(--space-12) var(--space-10);
  background: var(--color-bg-primary);
}

.docs-layout--api-explorer .docs-examples {
  grid-area: examples;
  background: #0b0c0e; /* Mintlify Dark */
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  overflow-y: auto;
  padding: var(--space-10) var(--space-8);
  position: sticky;
  top: 0;
}

/* 3. Playground Bar */
.api-playground-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  background: var(--color-bg-secondary);
  border: 1px solid var(--autodoc-border);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-8);
}

.api-playground-method {
  font-weight: 800;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 8px;
  text-transform: uppercase;
}

.api-playground-path {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-playground-button {
  background: #3064e3;
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.api-playground-button:hover {
  opacity: 0.9;
}

/* 4. High-Density Parameters */
.api-param-field {
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--autodoc-border);
}

.api-param-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.api-param-name {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-primary);
  font-size: 14px;
}

.api-param-meta {
  display: flex;
  gap: var(--space-2);
}

.api-param-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  background: var(--color-bg-tertiary);
  color: var(--color-text-muted);
  border-radius: 6px;
  text-transform: lowercase;
}

.api-param-badge[data-required="true"] {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.api-param-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* 5. Response Section Styling */
.api-response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--autodoc-border);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-4);
}

.api-response-status {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-muted);
}

/* 6. Code Group Tabs (Right Panel) */
.api-code-group {
  background: #111214;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: var(--space-6);
}

.api-code-header {
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.api-code-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #8892b0;
  letter-spacing: 0.05em;
}

.api-code-body pre {
  margin: 0 !important;
  background: transparent !important;
  padding: var(--space-4) !important;
  font-size: 12px !important;
}

@media (max-width: 1400px) {
  .docs-layout--api-explorer {
    grid-template-columns: 260px 1fr;
    grid-template-areas: "sidebar content";
  }
  .docs-layout--api-explorer .docs-examples {
    display: none;
  }
}

@media (max-width: 800px) {
  .docs-layout--api-explorer {
    grid-template-columns: 1fr;
    grid-template-areas: "content";
  }
  .docs-layout--api-explorer .docs-sidebar {
    display: none;
  }
}

@media (max-width: 1400px) {
  .web-endpoint-block {
    grid-template-columns: 1fr 45%;
  }
}

@media (max-width: 1100px) {
  .web-grid-huge-navs {
    grid-template-columns: 260px 1fr;
  }
  .web-endpoint-block {
    grid-template-columns: 1fr;
  }
  .web-endpoint-example {
    border-left: none;
    border-top: 1px solid #1e2227;
  }
}

@media (max-width: 800px) {
  .web-grid-huge-navs {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
  }
  .web-side-nav {
    display: none;
  }
}

@media (max-width: 1600px) {
  .rest-endpoint {
    grid-template-columns: 1fr 45%;
  }
}

@media (max-width: 1200px) {
  .rest-explorer {
    grid-template-columns: 280px 1fr;
  }

  .rest-endpoint {
    grid-template-columns: 1fr;
  }

  .rest-endpoint__example {
    border-left: none;
    border-top: 1px solid #1e2227;
  }
}

@media (max-width: 850px) {
  .rest-explorer {
    grid-template-columns: 1fr;
    grid-template-areas: "content";
  }

  .rest-explorer__sidebar {
    display: none;
  }
}

/* ============================================
   OPENAPI HOME / LIST / SECTION INDEX
   ============================================ */

.api-home {
  display: flex;
  flex-direction: column;
  gap: var(--autodoc-section-gap);
}

.api-home__title {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-2) 0;
}

.api-home__version {
  margin-bottom: var(--space-4);
}

.api-home__description {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
}

.api-home__server-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.api-home__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.api-home__tag-section {
  margin-bottom: var(--space-8);
}

.api-home__tag-section-header {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.api-home__tag-section-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.api-home__endpoints {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.api-home__schemas {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.api-list {
  display: flex;
  flex-direction: column;
  gap: var(--autodoc-section-gap);
}

.api-list__title {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-2) 0;
}

.api-list__description {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.api-list__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.api-list__endpoints {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.api-list__cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.api-list__row--deprecated {
  opacity: 0.7;
}

.api-section-index {
  display: flex;
  flex-direction: column;
  gap: var(--autodoc-section-gap);
}

.api-section-index__header {
  margin-bottom: var(--space-4);
}

.api-section-index__breadcrumb {
  margin-bottom: var(--space-3);
}

.api-section-index__title {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-2) 0;
}

.api-section-index__description {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.api-section-index__sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.api-section-index__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

.api-section-index__section-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.api-section-index__card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.api-section-index__card-title {
  font-weight: 600;
  color: var(--color-text-primary);
}

.api-section-index__card-description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.api-section-index__pages {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.api-section-index__empty {
  color: var(--color-text-muted);
  font-style: italic;
  padding: var(--space-6);
  text-align: center;
}

.api-schema {
  display: flex;
  flex-direction: column;
  gap: var(--autodoc-section-gap);
}

.api-schema__title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-2) 0;
}

.api-schema__description {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.api-schema__section {
  margin-bottom: var(--space-4);
}

.api-schema__section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.api-schema__enum-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.api-schema__enum-value {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--color-bg-tertiary);
  padding: var(--space-0-5) var(--space-1);
  border-radius: var(--radius-sm);
}

.api-schema__example {
  margin-top: var(--space-2);
}

.api-schema__usage-list {
  margin-top: var(--space-2);
}

/* ============================================
   OPENAPI EXPLORER LAYOUT
   Three-column "Stripe-style" layout
   ============================================ */

.api-explorer {
  display: grid;
  grid-template-columns: 250px 1fr 400px;
  grid-template-areas: "sidebar main code";
  gap: var(--autodoc-gap);
  min-height: calc(100vh - 200px);
}

.api-explorer__header {
  margin-bottom: var(--space-4);
}

.api-explorer__content {
  display: flex;
  flex-direction: column;
  gap: var(--autodoc-gap);
}

.api-explorer__sidebar {
  grid-area: sidebar;
  position: sticky;
  top: var(--space-4);
  height: fit-content;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: var(--space-4);
  border-right: 1px solid var(--autodoc-border);
}

.api-explorer__main {
  grid-area: main;
  min-width: 0;
  padding: 0 var(--space-6);
}

.api-explorer__code-panel {
  grid-area: code;
  background: var(--gray-900);
  color: var(--gray-100);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  position: sticky;
  top: var(--space-4);
  height: fit-content;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

/* Dark theme adjustments for code panel */
[data-theme="dark"] .api-explorer__code-panel {
  background: var(--gray-950);
  border: 1px solid var(--gray-800);
}

/* ============================================
   API REFERENCE LAYOUT (Single Column)
   ============================================ */

.api-reference {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-6);
}

.api-reference__header {
  margin-bottom: var(--autodoc-section-gap);
}

.api-reference__content {
  margin-bottom: var(--autodoc-section-gap);
}

.api-reference__title {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
}

.api-reference__description {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.api-reference__footer {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--autodoc-border);
}

.api-reference__body {
  margin-bottom: var(--autodoc-section-gap);
}

.api-reference__code {
  background: var(--gray-900);
  color: var(--gray-100);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--autodoc-section-gap);
}

/* ============================================
   HTTP METHOD BADGES
   ============================================ */

.api-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  border-radius: var(--radius-sm);
  min-width: 60px;
}

.api-method--get {
  background: var(--color-method-get-bg);
  color: var(--color-method-get);
  border: 1px solid var(--color-method-get-border);
}

.api-method--post {
  background: var(--color-method-post-bg);
  color: var(--color-method-post);
  border: 1px solid var(--color-method-post-border);
}

.api-method--put {
  background: var(--color-method-put-bg);
  color: var(--color-method-put);
  border: 1px solid var(--color-method-put-border);
}

.api-method--patch {
  background: var(--color-method-patch-bg);
  color: var(--color-method-patch);
  border: 1px solid var(--color-method-patch-border);
}

.api-method--delete {
  background: var(--color-method-delete-bg);
  color: var(--color-method-delete);
  border: 1px solid var(--color-method-delete-border);
}

.api-method--head,
.api-method--options {
  background: var(--color-method-head-bg);
  color: var(--color-method-head);
  border: 1px solid var(--color-method-head-border);
}

/* Small method badges */
.api-method--sm {
  padding: var(--space-0-5) var(--space-1-5);
  font-size: 10px;
  min-width: 44px;
}

.api-method--xs {
  padding: 2px var(--space-1);
  font-size: 9px;
  min-width: 36px;
}

/* ============================================
   PLAYGROUND BAR
   Method + Path + Copy button
   ============================================ */

.api-playground-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--autodoc-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

.api-playground-bar__method-path {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.api-playground-bar__path {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  word-break: break-all;
}

.api-playground-bar__path .api-path-param {
  color: var(--color-primary);
  font-weight: 500;
}

.api-playground-bar__copy {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1-5) var(--space-2);
  background: transparent;
  border: 1px solid var(--autodoc-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}

.api-playground-bar__copy:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.api-playground-bar__copy-text {
  font-size: var(--text-xs);
  color: inherit;
}

.api-playground-bar--deprecated {
  opacity: 0.7;
  border-color: var(--color-warning-border);
}

/* Deprecated banner */
.api-deprecated-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-md);
  color: var(--color-warning-text);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

/* ============================================
   ENDPOINT HEADER
   ============================================ */

.api-endpoint-header {
  margin-bottom: var(--autodoc-section-gap);
}

.api-endpoint-header__breadcrumb {
  margin-bottom: var(--space-3);
}

.api-endpoint-header__title {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.api-endpoint-header__operation-id {
  margin-bottom: var(--space-3);
}

.api-endpoint-header__operation-id code {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background: var(--color-bg-tertiary);
  padding: var(--space-0-5) var(--space-1);
  border-radius: var(--radius-sm);
}

.api-endpoint-header__description {
  margin-bottom: var(--space-4);
}

.api-endpoint-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.api-endpoint-header__auth,
.api-endpoint-header__tags,
.api-endpoint__security {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ============================================
   PARAMETER ROW
   ============================================ */

.api-param-row {
  padding: var(--space-3);
  border-bottom: 1px solid var(--autodoc-border);
}

.api-param-row:last-child {
  border-bottom: none;
}

.api-param-row--required {
  background: var(--color-error-bg);
  border-left: 3px solid var(--color-error);
  padding-left: calc(var(--space-3) - 3px);
}

.api-param-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.api-param-row__name {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
}

.api-param-row__type {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-code-type);
}

.api-param-row__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.api-param-row__label {
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
}

.api-param-row__default {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.api-param-row__enum {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.api-param-row__enum-value {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--color-bg-tertiary);
  padding: var(--space-0-5) var(--space-1);
  border-radius: var(--radius-sm);
}

.api-param-row__example {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.api-param-row__description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* ============================================
   REQUEST BODY
   ============================================ */

.api-request-body {
  margin-bottom: var(--space-6);
}

.api-request-body__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.api-request-body__title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.api-request-body__meta {
  display: flex;
  gap: var(--space-2);
}

.api-request-body__description {
  margin-bottom: var(--space-3);
}

.api-request-body__label {
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
}

.api-request-body__schema-ref,
.api-request-body__schema-link {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-primary);
}

.api-request-body__schema-link:hover {
  text-decoration: underline;
}

/* ============================================
   SCHEMA VIEWER
   ============================================ */

.api-schema-viewer {
  border: 1px solid var(--autodoc-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.api-schema-viewer--depth-0 {
  margin-top: var(--space-3);
}

.api-schema-viewer--depth-1,
.api-schema-viewer--depth-2,
.api-schema-viewer--depth-3 {
  margin-left: var(--space-4);
  margin-top: var(--space-2);
  border-left: 2px solid var(--color-border-light);
  border-top: none;
  border-right: none;
  border-bottom: none;
  border-radius: 0;
}

.api-schema-viewer__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-tertiary);
}

.api-schema-viewer__label {
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
}

.api-schema-viewer__type {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.api-schema-viewer__description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
}

.api-schema-viewer__array {
  margin-left: var(--space-4);
  border-left: 2px solid var(--color-border-light);
  padding-left: var(--space-3);
}

.api-schema-viewer__array-items {
  margin-top: var(--space-2);
}

.api-schema-viewer__default {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.api-schema-viewer__name {
  font-family: var(--font-mono);
  font-weight: 600;
}

.api-schema-viewer__properties {
  padding: var(--space-2);
}

.api-schema-viewer__property {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border-light);
}

.api-schema-viewer__property:last-child {
  border-bottom: none;
}

.api-schema-viewer__property--required {
  border-left: 2px solid var(--color-error);
}

.api-schema-viewer__property-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.api-schema-viewer__property-name {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
}

.api-schema-viewer__property-type {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-code-type);
}

.api-schema-viewer__property-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.api-schema-viewer__enum {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
}

.api-schema-viewer__enum-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.api-schema-viewer__enum-value {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--color-bg-tertiary);
  padding: var(--space-0-5) var(--space-1);
  border-radius: var(--radius-sm);
}

.api-schema-viewer__example {
  padding: var(--space-3);
  background: var(--gray-900);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.api-schema-viewer__example-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-bottom: var(--space-2);
}

.api-schema-viewer__example-code {
  font-size: var(--text-xs);
  color: var(--gray-200);
}

/* ============================================
   RESPONSES
   ============================================ */

.api-responses {
  margin-bottom: var(--space-6);
}

.api-responses__header {
  margin-bottom: var(--space-3);
}

.api-responses__title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.api-responses__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--autodoc-border);
  padding-bottom: var(--space-2);
}

.api-responses__tab {
  padding: var(--space-1-5) var(--space-3);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.api-responses__tab:hover {
  background: var(--color-bg-hover);
}

.api-responses__tab--active {
  background: var(--color-bg-tertiary);
}

.api-responses__panel {
  display: none;
}

.api-responses__panel--active {
  display: block;
}

.api-responses__description {
  margin-bottom: var(--space-3);
}

.api-responses__content-type {
  margin-bottom: var(--space-3);
}

.api-responses__panels {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.api-responses__panel-header {
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

.api-responses__status {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
}

.api-responses__label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.api-responses__schema-ref {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-primary);
}

.api-responses__example {
  margin-top: var(--space-2);
}

.api-responses__example-code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--color-bg-code);
  padding: var(--space-2);
  border-radius: var(--radius-md);
}

/* ============================================
   CODE SAMPLES
   ============================================ */

.api-code-samples {
  color: var(--gray-100);
}

.api-code-samples__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--gray-700);
}

.api-code-samples__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-300);
  margin: 0;
}

.api-code-samples__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.api-code-samples__tab {
  padding: var(--space-1) var(--space-2);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--gray-400);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}

.api-code-samples__tab:hover {
  color: var(--gray-200);
  background: var(--gray-800);
}

.api-code-samples__tab--active {
  background: var(--gray-700);
  color: var(--gray-100);
}

.api-code-samples__panel {
  display: none;
}

.api-code-samples__panel--active {
  display: block;
}

.api-code-samples__panels {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.api-code-samples__code {
  position: relative;
}

.api-code-samples__copy {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  padding: var(--space-1);
  background: var(--gray-700);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--gray-400);
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s ease;
}

.api-code-samples__code:hover .api-code-samples__copy {
  opacity: 1;
}

.api-code-samples__copy:hover {
  background: var(--gray-600);
  color: var(--gray-100);
}

.api-code-samples__code pre {
  margin: 0;
  padding: var(--space-3);
  background: var(--gray-800);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: var(--text-xs);
  line-height: 1.6;
}

.api-code-samples__code code {
  font-family: var(--font-mono);
}

.api-code-samples__response {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--gray-700);
}

.api-code-samples__response-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */

.api-sidebar-nav {
  font-size: var(--text-sm);
}

.api-sidebar-nav__header {
  margin-bottom: var(--space-4);
}

.api-sidebar-nav__home {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--color-text-primary);
  text-decoration: none;
}

.api-sidebar-nav__home:hover {
  color: var(--color-primary);
}

.api-sidebar-nav__search {
  margin-bottom: var(--space-4);
}

.api-sidebar-nav__search-input {
  width: 100%;
  padding: var(--space-2);
  background: var(--color-bg-secondary);
  border: 1px solid var(--autodoc-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.api-sidebar-nav__groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.api-sidebar-nav__group {
  border-radius: var(--radius-md);
}

.api-sidebar-nav__group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background 0.15s ease;
}

.api-sidebar-nav__group-header:hover {
  background: var(--color-bg-hover);
}

.api-sidebar-nav__group-name {
  font-weight: 500;
}

.api-sidebar-nav__group-count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-bg-tertiary);
  padding: var(--space-0-5) var(--space-1);
  border-radius: var(--radius-full);
}

.api-sidebar-nav__endpoints {
  list-style: none;
  padding: 0;
  margin: var(--space-1) 0 0 var(--space-3);
}

.api-sidebar-nav__endpoints--flat {
  display: flex;
  flex-direction: column;
  gap: var(--space-0-5);
}

.api-sidebar-nav__endpoint {
  margin-bottom: var(--space-1);
}

.api-sidebar-nav__link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1-5) var(--space-2);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text-secondary);
  transition: all 0.15s ease;
}

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

.api-sidebar-nav__endpoint--active .api-sidebar-nav__link {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.api-sidebar-nav__endpoint--deprecated .api-sidebar-nav__link {
  opacity: 0.6;
}

.api-sidebar-nav__path {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.api-sidebar-nav__deprecated {
  color: var(--color-warning);
}

/* ============================================
   API HOME PAGE
   ============================================ */

.api-home__stats {
  display: flex;
  gap: var(--space-6);
  margin-bottom: var(--autodoc-section-gap);
}

.api-home__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.api-home__stat-value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-primary);
}

.api-home__stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.api-home__servers {
  margin-bottom: var(--autodoc-section-gap);
}

.api-home__section-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.api-home__server-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.api-home__server {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
}

.api-home__server-url {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  flex: 1;
}

.api-home__server-copy {
  padding: var(--space-1);
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.api-home__server-copy:hover {
  color: var(--color-text-primary);
}

.api-home__auth {
  margin-bottom: var(--autodoc-section-gap);
}

.api-home__auth-schemes {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.api-home__auth-scheme {
  padding: var(--space-4);
}

.api-home__auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.api-home__auth-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0;
}

.api-home__auth-description {
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
}

.api-home__auth-example {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--color-bg-tertiary);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
}

.api-home__tag-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.api-home__tag-card {
  display: block;
  padding: var(--space-4);
  text-decoration: none;
  color: inherit;
}

.api-home__tag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.api-home__tag-name {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0;
}

.api-home__tag-description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.api-home__tag-methods {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

/* ============================================
   API ENDPOINT PAGE
   ============================================ */

.api-endpoint__section {
  margin-bottom: var(--autodoc-section-gap);
}

.api-endpoint__section-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.api-endpoint__param-group {
  margin-bottom: var(--space-4);
}

.api-endpoint__param-group-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: 500;
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

.api-endpoint__param-list {
  border: 1px solid var(--autodoc-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 1400px) {
  .api-explorer {
    grid-template-columns: 220px 1fr 350px;
  }
}

@media (max-width: 1200px) {
  .api-explorer {
    grid-template-columns: 200px 1fr;
    grid-template-areas: "sidebar main";
  }

  .api-explorer__code-panel {
    display: none;
  }

  /* Show inline code samples instead */
  .api-endpoint::after {
    content: '';
    display: block;
  }
}

@media (max-width: 900px) {
  .api-explorer {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
  }

  .api-explorer__sidebar {
    display: none;
  }

  .api-home__stats {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .api-playground-bar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }

  .api-playground-bar__method-path {
    flex-direction: column;
    align-items: flex-start;
  }

  .api-home__stats {
    flex-direction: column;
    align-items: center;
  }
}
