/* --------------------------------------------------------------------------
   View Transitions API — smooth cross-fade between page navigations
   -------------------------------------------------------------------------- */

@view-transition {
  navigation: auto;
}

/* --------------------------------------------------------------------------
   CSS Custom Properties (Light Theme — Default)
   -------------------------------------------------------------------------- */

html[data-theme="light"] {
  --color-bg: #fafbfd;
  --color-bg-secondary: #f0f2f5;
  --color-bg-sidebar: #f3f4f8;
  --color-bg-code: #f0f1f5;
  --color-bg-code-block: #f6f8fa;
  --color-bg-hover: rgba(0, 0, 0, 0.045);
  --color-bg-active: rgba(74, 140, 63, 0.07);
  --color-bg-inline-code: #eaecf1;
  --color-bg-table-alt: #f3f4f8;
  --color-bg-header: rgba(250, 251, 253, 0.92);
  --color-bg-callout: #f0f2f5;
  --color-bg-endpoint: #ffffff;

  --color-text: #1a1a2e;
  --color-text-secondary: #475569;
  --color-text-tertiary: #6b7a8d;
  --color-text-code: #1a1a2e;
  --color-text-link: #3a8538;
  --color-text-link-hover: #2d6e2b;
  --color-text-heading: #0a0a23;
  --color-text-on-dark: #e0e0e8;
  --color-text-inverse: #ffffff;

  --color-primary: #3a8538;
  --color-primary-hover: #2d6e2b;
  --color-primary-subtle: rgba(58, 133, 56, 0.08);
  --color-accent: #00d4aa;
  --color-accent-subtle: rgba(0, 212, 170, 0.08);

  --color-border: #d5dae3;
  --color-border-light: #e0e5ec;
  --color-border-strong: #bcc3cf;
  --color-border-code: #d5dae3;
  --color-border-sidebar: #dce1ea;
  --color-divider: #d5dae3;

  --color-info: #2563eb;
  --color-info-bg: #eff6ff;
  --color-info-border: #2563eb;
  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #d97706;
  --color-tip: #059669;
  --color-tip-bg: #ecfdf5;
  --color-tip-border: #059669;
  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #dc2626;

  --color-method-get: #059669;
  --color-method-get-bg: #ecfdf5;
  --color-method-post: #2563eb;
  --color-method-post-bg: #eff6ff;
  --color-method-put: #d97706;
  --color-method-put-bg: #fffbeb;
  --color-method-delete: #dc2626;
  --color-method-delete-bg: #fef2f2;
  --color-method-patch: #7c3aed;
  --color-method-patch-bg: #f5f3ff;

  --color-scrollbar: #c5cad4;
  --color-scrollbar-hover: #9ca3af;

  --color-hero-grid: rgba(0, 0, 0, 0.05);
  --color-hero-glow-1: rgba(58, 133, 56, 0.12);
  --color-hero-glow-2: rgba(0, 212, 170, 0.08);
  --color-hero-glow-3: rgba(59, 130, 246, 0.06);
  --color-featured-icon-bg: rgba(58, 133, 56, 0.09);
  --color-featured-icon: #3a8538;
  --color-featured-border-top: linear-gradient(135deg, #3a8538, #00d4aa);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.09);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.11);
  --shadow-header: 0 1px 0 var(--color-border);
  --shadow-sidebar: 1px 0 0 var(--color-border-sidebar);
}

/* --------------------------------------------------------------------------
   Dark Theme Overrides
   -------------------------------------------------------------------------- */

html[data-theme="dark"] {
  --color-bg: #0f0f1a;
  --color-bg-secondary: #161625;
  --color-bg-sidebar: #12121f;
  --color-bg-code: #1a1a2e;
  --color-bg-code-block: #12121f;
  --color-bg-hover: rgba(255, 255, 255, 0.04);
  --color-bg-active: rgba(22, 196, 94, 0.12);
  --color-bg-inline-code: #1e1e32;
  --color-bg-table-alt: #161625;
  --color-bg-header: rgba(15, 15, 26, 0.92);
  --color-bg-callout: #161625;
  --color-bg-endpoint: #161625;

  --color-text: #e0e0e8;
  --color-text-secondary: #9da3b0;
  --color-text-tertiary: #6b7280;
  --color-text-code: #e0e0e8;
  --color-text-link: #16C45E;
  --color-text-link-hover: #3ED47A;
  --color-text-heading: #f0f0f5;
  --color-text-on-dark: #e0e0e8;
  --color-text-inverse: #0f0f1a;

  --color-primary: #16C45E;
  --color-primary-hover: #3ED47A;
  --color-primary-subtle: rgba(22, 196, 94, 0.12);
  --color-accent: #00d4aa;
  --color-accent-subtle: rgba(0, 212, 170, 0.1);

  --color-border: #2a2a3e;
  --color-border-light: #222236;
  --color-border-strong: #3a3a52;
  --color-border-code: #2a2a3e;
  --color-border-sidebar: #1e1e32;
  --color-divider: #2a2a3e;

  --color-info: #60a5fa;
  --color-info-bg: #0f1d3a;
  --color-info-border: #60a5fa;
  --color-warning: #f59e0b;
  --color-warning-bg: #271e05;
  --color-warning-border: #f59e0b;
  --color-tip: #10b981;
  --color-tip-bg: #0a2520;
  --color-tip-border: #10b981;
  --color-danger: #ef4444;
  --color-danger-bg: #2a0f0f;
  --color-danger-border: #ef4444;

  --color-method-get: #10b981;
  --color-method-get-bg: #0a2520;
  --color-method-post: #60a5fa;
  --color-method-post-bg: #0f1d3a;
  --color-method-put: #f59e0b;
  --color-method-put-bg: #271e05;
  --color-method-delete: #ef4444;
  --color-method-delete-bg: #2a0f0f;
  --color-method-patch: #a78bfa;
  --color-method-patch-bg: #1e1535;

  --color-scrollbar: #2a2a3e;
  --color-scrollbar-hover: #3a3a52;

  --color-hero-grid: rgba(255, 255, 255, 0.035);
  --color-hero-glow-1: rgba(22, 196, 94, 0.14);
  --color-hero-glow-2: rgba(0, 212, 170, 0.10);
  --color-hero-glow-3: rgba(59, 130, 246, 0.07);
  --color-featured-icon-bg: rgba(22, 196, 94, 0.1);
  --color-featured-icon: #16C45E;
  --color-featured-border-top: linear-gradient(135deg, #16C45E, #00d4aa);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-header: 0 1px 0 var(--color-border);
  --shadow-sidebar: 1px 0 0 var(--color-border-sidebar);
}

/* --------------------------------------------------------------------------
   Shared Layout Primitives
   -------------------------------------------------------------------------- */

/* Responsive breakpoint — used by card grids, feature grids, comparisons */
:root {
  --bp-mobile: 600px;
}

/* Card — base surface for clickable or informational cards */
.card {
  padding: 20px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  text-decoration: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.card:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Card title — shared heading style */
.card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--color-text-heading);
}

/* Card description — shared secondary text */
.card-desc {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

/* Card icon — small icon container */
.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   Base Reset & Global Styles
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Helvetica, Arial, sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo,
    monospace;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: color 0.2s ease, background-color 0.2s ease;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: var(--color-text-link);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--color-text-link-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

::selection {
  background-color: var(--color-primary-subtle);
  color: var(--color-text);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--color-scrollbar);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-scrollbar-hover);
}

/* --------------------------------------------------------------------------
   Site Header
   -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 64px;
  background: var(--color-bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Static gradient accent line (visible when page hasn't scrolled) */
.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  opacity: 0.35;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-text-heading);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color 0.15s ease;
}

.site-logo:hover {
  color: var(--color-primary);
}

.site-logo:hover .site-logo-icon {
  box-shadow: 0 0 12px var(--color-primary-subtle), 0 0 4px var(--color-primary-subtle);
  transform: scale(1.05);
}

.site-logo-icon {
  height: 26px;
  width: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.site-logo img {
  height: 28px;
  width: auto;
}

/* --- Header Left Group (logo + divider + links) --- */

.header-left {
  display: flex;
  align-items: center;
  gap: 0;
}

.header-divider {
  width: 1px;
  height: 20px;
  background: var(--color-border);
  margin: 0 16px 0 18px;
  flex-shrink: 0;
}

/* --- Scroll Progress Bar --- */

.scroll-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  z-index: 1;
  transition: width 0.1s linear;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-nav a {
  padding: 6px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.header-nav a:hover {
  color: var(--color-text);
  background-color: var(--color-bg-hover);
}

/* --- Header Section Links --- */

.header-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.header-link {
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
  position: relative;
}

.header-link:hover {
  color: var(--color-text);
  background-color: var(--color-bg-hover);
}

.header-link:active {
  color: var(--color-primary);
}

/* --- Dashboard Link (disabled state) --- */

.header-dashboard {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-tertiary);
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  height: 36px;
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  user-select: none;
}

.header-dashboard svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Mobile Navigation Toggle (Hamburger)
   -------------------------------------------------------------------------- */

.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.mobile-nav-toggle:hover {
  background-color: var(--color-bg-hover);
}

.hamburger {
  display: block;
  position: relative;
  width: 20px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 1px;
  transition: background-color 0.2s ease;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 1px;
  transition: transform 0.25s ease, top 0.25s ease, bottom 0.25s ease;
}

.hamburger::before {
  top: -6px;
}

.hamburger::after {
  bottom: -6px;
}

/* Hamburger → X transformation when sidebar is open */
.mobile-nav-toggle[aria-expanded="true"] .hamburger {
  background-color: transparent;
}

.mobile-nav-toggle[aria-expanded="true"] .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.mobile-nav-toggle[aria-expanded="true"] .hamburger::after {
  bottom: 0;
  transform: rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Theme Toggle (Dark Mode)
   -------------------------------------------------------------------------- */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.theme-toggle:hover {
  background-color: var(--color-bg-hover);
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

/* Theme toggle SVG icons */
.theme-icon {
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

/* Light mode: show moon, hide sun */
html[data-theme="light"] .theme-icon-sun {
  display: none;
}

html[data-theme="light"] .theme-icon-moon {
  display: block;
}

/* Dark mode: show sun, hide moon */
html[data-theme="dark"] .theme-icon-sun {
  display: block;
}

html[data-theme="dark"] .theme-icon-moon {
  display: none;
}

/* --------------------------------------------------------------------------
   Site Layout (Sidebar + Content)
   -------------------------------------------------------------------------- */

.site-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 64px; /* account for fixed header */
}

/* --------------------------------------------------------------------------
   Sidebar Navigation
   -------------------------------------------------------------------------- */

.sidebar {
  position: fixed;
  top: 64px;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--color-bg-sidebar);
  box-shadow: var(--shadow-sidebar);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 0;
  z-index: 50;
  transition: background-color 0.2s ease, transform 0.25s ease;
}

.sidebar-nav {
  padding: 0 16px;
}

.nav-section {
  margin-bottom: 28px;
}

.nav-section:last-child {
  margin-bottom: 16px;
}

.nav-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  list-style: none; /* Firefox: hide default marker */
}

.nav-section-icon {
  display: flex;
  align-items: center;
  color: var(--color-text-tertiary);
  opacity: 0.7;
}

.nav-section-icon svg {
  flex-shrink: 0;
}

.nav-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
  line-height: 1.4;
}

/* Chevron indicator */
.nav-section-chevron {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--color-text-tertiary);
  opacity: 0.5;
  transition: transform 0.2s ease, opacity 0.15s ease;
}

.nav-section-header:hover .nav-section-chevron {
  opacity: 0.8;
}

/* Rotate chevron when closed */
.nav-section:not([open]) .nav-section-chevron {
  transform: rotate(-90deg);
}

/* Hide the default disclosure triangle */
.nav-section-header::marker,
.nav-section-header::-webkit-details-marker {
  display: none;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-list li {
  margin: 1px 0;
}

.nav-link {
  display: block;
  padding: 7px 12px;
  font-size: 0.875rem;
  font-weight: 450;
  color: var(--color-text-secondary);
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.12s ease, background-color 0.12s ease;
  line-height: 1.5;
}

.nav-link:hover {
  color: var(--color-text);
  background-color: var(--color-bg-hover);
}

.nav-link.active {
  color: var(--color-primary);
  font-weight: 550;
  background-color: var(--color-primary-subtle);
  border-radius: 6px;
}

/* Single-page section — rendered as a direct link */
.nav-section-solo {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  margin-bottom: 28px;
  font-size: 0.875rem;
  font-weight: 450;
  color: var(--color-text-secondary);
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.12s ease, background-color 0.12s ease;
  line-height: 1.5;
}

.nav-section-solo:hover {
  color: var(--color-text);
  background-color: var(--color-bg-hover);
}

.nav-section-solo.active {
  color: var(--color-primary);
  font-weight: 550;
  background-color: var(--color-primary-subtle);
}

/* Endpoint count badge (API reference sidebar) */
.nav-link-count {
  float: right;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-tertiary);
  background: var(--color-bg-secondary);
  border-radius: 10px;
  padding: 0 6px;
  line-height: 1.6;
  min-width: 20px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Main Content Area
   -------------------------------------------------------------------------- */

.content {
  flex: 1;
  min-width: 0;
  margin-left: 280px;
  padding: 48px 48px 80px;
}

/* --------------------------------------------------------------------------
   Article Wrapper
   -------------------------------------------------------------------------- */

.article {
  max-width: 720px;
  margin: 0 auto;
}

.article-wide {
  max-width: 960px;
}

.article-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--color-text-heading);
  margin-bottom: 12px;
}

.article-description {
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--color-text-secondary);
  margin-bottom: 40px;
  max-width: 600px;
}

/* --------------------------------------------------------------------------
   Article Metadata Bar
   -------------------------------------------------------------------------- */

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border-light);
}

.article-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
  line-height: 1;
}

.article-meta-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.article-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

/* --------------------------------------------------------------------------
   Previous / Next Page Navigation
   -------------------------------------------------------------------------- */

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
}

.page-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
  max-width: 50%;
}

.page-nav-link:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.page-nav-next {
  margin-left: auto;
  text-align: right;
}

.page-nav-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-tertiary);
}

.page-nav-title {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .page-nav {
    flex-direction: column;
  }

  .page-nav-link {
    max-width: 100%;
  }

  .page-nav-next {
    text-align: left;
  }
}

/* --------------------------------------------------------------------------
   Table of Contents (Right Sidebar)
   -------------------------------------------------------------------------- */

.content-with-toc {
  display: flex;
  gap: 48px;
}

.content-with-toc .article {
  flex: 1;
  min-width: 0;
}

.toc {
  flex-shrink: 0;
  width: 220px;
  position: sticky;
  top: 112px; /* 64px header + 48px content padding — matches natural position */
  align-self: flex-start;
  max-height: calc(100vh - 152px);
  overflow-y: auto;
}

.toc-nav {
  border-left: 1px solid var(--color-border-light);
  padding-left: 16px;
}

.toc-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
  margin-bottom: 12px;
  line-height: 1.4;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  margin: 0;
}

.toc-level-3 {
  padding-left: 12px;
}

.toc-link {
  display: block;
  padding: 4px 0;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text-tertiary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.toc-link:hover {
  color: var(--color-text);
}

.toc-link.active {
  color: var(--color-primary);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Typography (Inside .article-body)
   -------------------------------------------------------------------------- */

/* --- Headings --- */

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
  font-family: var(--font-heading);
  color: var(--color-text-heading);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-top: 2em;
  margin-bottom: 0.75em;
  scroll-margin-top: 80px;
}

.article-body h1 {
  font-size: 2rem;
  margin-top: 0;
}

.article-body h2 {
  font-size: 1.5rem;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--color-border-light);
}

.article-body h3 {
  font-size: 1.25rem;
}

.article-body h4 {
  font-size: 1.0625rem;
}

.article-body h5 {
  font-size: 1rem;
}

.article-body h6 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
}

/* Heading anchor links */
.article-body h1 a,
.article-body h2 a,
.article-body h3 a,
.article-body h4 a,
.article-body h5 a,
.article-body h6 a {
  color: inherit;
  text-decoration: none;
}

.article-body h1 a:hover,
.article-body h2 a:hover,
.article-body h3 a:hover,
.article-body h4 a:hover,
.article-body h5 a:hover,
.article-body h6 a:hover {
  color: var(--color-primary);
}

/* Anchor icon on hover */
.article-body h1 a::before,
.article-body h2 a::before,
.article-body h3 a::before,
.article-body h4 a::before,
.article-body h5 a::before,
.article-body h6 a::before {
  content: '#';
  position: absolute;
  margin-left: -1.2em;
  color: var(--color-text-tertiary);
  font-weight: 400;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.article-body h1:hover a::before,
.article-body h2:hover a::before,
.article-body h3:hover a::before,
.article-body h4:hover a::before,
.article-body h5:hover a::before,
.article-body h6:hover a::before {
  opacity: 1;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
  position: relative;
}

/* --- Paragraphs --- */

.article-body p {
  margin-bottom: 1.25em;
}

/* --- Links --- */

.article-body a {
  color: var(--color-text-link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--color-text-link) 30%, transparent);
  text-underline-offset: 2px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.article-body a:hover {
  color: var(--color-text-link-hover);
  text-decoration-color: var(--color-text-link-hover);
}

/* --- Bold & Italic --- */

.article-body strong {
  font-weight: 650;
  color: var(--color-text-heading);
}

.article-body em {
  font-style: italic;
}

/* --- Lists --- */

.article-body ul,
.article-body ol {
  margin-bottom: 1.25em;
  padding-left: 1.75em;
}

.article-body ul {
  list-style-type: disc;
}

.article-body ol {
  list-style-type: decimal;
}

.article-body li {
  margin-bottom: 0.4em;
  line-height: 1.7;
}

.article-body li > ul,
.article-body li > ol {
  margin-top: 0.4em;
  margin-bottom: 0.4em;
}

/* --- Blockquotes --- */

.article-body blockquote {
  margin: 1.5em 0;
  padding: 1em 1.25em;
  border-left: 3px solid var(--color-primary);
  background: var(--color-bg-secondary);
  border-radius: 0 8px 8px 0;
  color: var(--color-text-secondary);
}

.article-body blockquote p {
  margin-bottom: 0.5em;
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

/* --- Inline Code --- */

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.15em 0.4em;
  background: var(--color-bg-inline-code);
  border-radius: 4px;
  color: var(--color-text-code);
  word-break: break-word;
}

/* Reset for code inside code blocks (handled by .code-block) */
.article-body pre code {
  padding: 0;
  background: none;
  border-radius: 0;
  font-size: inherit;
  word-break: normal;
}

/* --- Tables --- */

.article-body .table-wrapper {
  margin: 1.5em 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.4;
}

.article-body thead th {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  text-align: left;
  padding: 8px 14px;
  border-bottom: 2px solid var(--color-border-light);
  background: var(--color-bg);
  white-space: nowrap;
}

.article-body tbody td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: top;
}

.article-body tbody tr:last-child td {
  border-bottom: none;
}

.article-body tbody tr:hover td {
  background: rgba(99, 102, 241, 0.06);
  transition: background 0.15s ease;
}

html[data-theme="dark"] .article-body tbody tr:hover td {
  background: rgba(99, 102, 241, 0.1);
}

/* Bold labels in first column — keep on one line */
.article-body tbody td:first-child strong {
  white-space: nowrap;
}

/* Inline code inside table cells — tighter to avoid visual noise */
.article-body td code {
  font-size: 0.8125em;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

/* --- Horizontal Rules --- */

.article-body hr {
  border: none;
  height: 1px;
  background: var(--color-divider);
  margin: 3em 0;
}

/* --------------------------------------------------------------------------
   Code Blocks
   -------------------------------------------------------------------------- */

.code-block {
  margin: 1.5em 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-border-code);
  background: var(--color-bg-code-block);
  transition: border-color 0.15s ease;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 38px;
}

html[data-theme="light"] .code-block-header {
  background: rgba(0, 0, 0, 0.03);
  border-bottom-color: var(--color-border-light);
}

.code-block-lang {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-tertiary);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  user-select: none;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-tertiary);
  font-size: 0.75rem;
  font-family: inherit;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  user-select: none;
}

html[data-theme="light"] .copy-btn {
  background: rgba(0, 0, 0, 0.04);
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-text-on-dark);
}

html[data-theme="light"] .copy-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--color-text);
}

.copy-btn::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.code-block pre {
  margin: 0;
  padding: 16px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--color-text-code);
  background: transparent;
  -webkit-overflow-scrolling: touch;
}

html[data-theme="light"] .code-block pre {
  color: #383a42;
}

.code-block pre code {
  display: block;
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  border-radius: 0;
  white-space: pre;
}

/* Standalone pre blocks without .code-block wrapper */
.article-body > pre {
  margin: 1.5em 0;
  padding: 16px 20px;
  border-radius: 10px;
  overflow-x: auto;
  background: var(--color-bg-code-block);
  border: 1px solid var(--color-border-code);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--color-text-code);
}

/* --------------------------------------------------------------------------
   Pygments Syntax Highlighting
   --------------------------------------------------------------------------
   Dark theme: One Dark / Catppuccin inspired.
   Light theme: One Light inspired (scoped under html[data-theme="light"]).
   -------------------------------------------------------------------------- */

.highlight {
  background: transparent;
}

/* ==========================================================================
   Dark Theme (default)
   ========================================================================== */

/* Comments */
.highlight .c,
.highlight .c1,
.highlight .cm,
.highlight .cs,
.highlight .ch {
  color: #6a737d;
  font-style: italic;
}

/* Docstrings */
.highlight .sd {
  color: #6a737d;
  font-style: italic;
}

/* Keywords */
.highlight .k,
.highlight .kn,
.highlight .kc,
.highlight .kd,
.highlight .kr,
.highlight .kp {
  color: #c678dd;
  font-weight: 500;
}

/* Keyword type */
.highlight .kt {
  color: #e5c07b;
}

/* Strings */
.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sb,
.highlight .sc,
.highlight .sh,
.highlight .dl {
  color: #98c379;
}

/* String interpolation & escape */
.highlight .si {
  color: #56b6c2;
}

.highlight .se {
  color: #d19a66;
}

/* String regex */
.highlight .sr {
  color: #56b6c2;
}

/* String other, heredoc */
.highlight .sx,
.highlight .ss {
  color: #98c379;
}

/* Numbers */
.highlight .mi,
.highlight .mf,
.highlight .mh,
.highlight .mo,
.highlight .mb,
.highlight .il {
  color: #d19a66;
}

/* Functions / Names */
.highlight .nf,
.highlight .fm,
.highlight .nx {
  color: #61afef;
}

/* Builtins */
.highlight .nb,
.highlight .bp {
  color: #56b6c2;
}

/* Names (general) */
.highlight .n {
  color: #e0e0e8;
}

/* Name class, namespace */
.highlight .nc,
.highlight .nn {
  color: #e5c07b;
}

/* Name constant, attribute */
.highlight .no,
.highlight .na {
  color: #d19a66;
}

/* Name decorator */
.highlight .nd {
  color: #c678dd;
}

/* Name entity, exception, label */
.highlight .ni,
.highlight .ne,
.highlight .nl {
  color: #e06c75;
}

/* Name tag (HTML/XML) */
.highlight .nt {
  color: #e06c75;
}

/* Name variable */
.highlight .nv,
.highlight .vi,
.highlight .vg,
.highlight .vc {
  color: #e06c75;
}

/* Operators */
.highlight .o,
.highlight .ow {
  color: #56b6c2;
}

/* Punctuation */
.highlight .p {
  color: #abb2bf;
}

/* Generic (diffs, errors, etc.) */
.highlight .gd {
  color: #e06c75;
  background: rgba(224, 108, 117, 0.1);
}

.highlight .gi {
  color: #98c379;
  background: rgba(152, 195, 121, 0.1);
}

.highlight .gh,
.highlight .gu {
  color: #61afef;
  font-weight: 600;
}

.highlight .ge {
  font-style: italic;
}

.highlight .gs {
  font-weight: 700;
}

.highlight .gr,
.highlight .gt {
  color: #e06c75;
}

.highlight .go {
  color: #6a737d;
}

.highlight .gp {
  color: #6a737d;
  font-weight: 600;
}

/* Whitespace / Text */
.highlight .w {
  color: #abb2bf;
}

.highlight .err {
  color: #e06c75;
}

/* ==========================================================================
   Light Theme (One Light inspired)
   ========================================================================== */

/* Comments */
html[data-theme="light"] .highlight .c,
html[data-theme="light"] .highlight .c1,
html[data-theme="light"] .highlight .cm,
html[data-theme="light"] .highlight .cs,
html[data-theme="light"] .highlight .ch {
  color: #a0a1a7;
}

/* Docstrings */
html[data-theme="light"] .highlight .sd {
  color: #a0a1a7;
}

/* Keywords */
html[data-theme="light"] .highlight .k,
html[data-theme="light"] .highlight .kn,
html[data-theme="light"] .highlight .kc,
html[data-theme="light"] .highlight .kd,
html[data-theme="light"] .highlight .kr,
html[data-theme="light"] .highlight .kp {
  color: #a626a4;
}

/* Keyword type */
html[data-theme="light"] .highlight .kt {
  color: #c18401;
}

/* Strings */
html[data-theme="light"] .highlight .s,
html[data-theme="light"] .highlight .s1,
html[data-theme="light"] .highlight .s2,
html[data-theme="light"] .highlight .sb,
html[data-theme="light"] .highlight .sc,
html[data-theme="light"] .highlight .sh,
html[data-theme="light"] .highlight .dl {
  color: #50a14f;
}

/* String interpolation & escape */
html[data-theme="light"] .highlight .si {
  color: #0184bc;
}

html[data-theme="light"] .highlight .se {
  color: #986801;
}

/* String regex */
html[data-theme="light"] .highlight .sr {
  color: #0184bc;
}

/* String other, heredoc */
html[data-theme="light"] .highlight .sx,
html[data-theme="light"] .highlight .ss {
  color: #50a14f;
}

/* Numbers */
html[data-theme="light"] .highlight .mi,
html[data-theme="light"] .highlight .mf,
html[data-theme="light"] .highlight .mh,
html[data-theme="light"] .highlight .mo,
html[data-theme="light"] .highlight .mb,
html[data-theme="light"] .highlight .il {
  color: #986801;
}

/* Functions / Names */
html[data-theme="light"] .highlight .nf,
html[data-theme="light"] .highlight .fm,
html[data-theme="light"] .highlight .nx {
  color: #4078f2;
}

/* Builtins */
html[data-theme="light"] .highlight .nb,
html[data-theme="light"] .highlight .bp {
  color: #0184bc;
}

/* Names (general) */
html[data-theme="light"] .highlight .n {
  color: #383a42;
}

/* Name class, namespace */
html[data-theme="light"] .highlight .nc,
html[data-theme="light"] .highlight .nn {
  color: #c18401;
}

/* Name constant, attribute */
html[data-theme="light"] .highlight .no,
html[data-theme="light"] .highlight .na {
  color: #986801;
}

/* Name decorator */
html[data-theme="light"] .highlight .nd {
  color: #a626a4;
}

/* Name entity, exception, label */
html[data-theme="light"] .highlight .ni,
html[data-theme="light"] .highlight .ne,
html[data-theme="light"] .highlight .nl {
  color: #e45649;
}

/* Name tag (HTML/XML) */
html[data-theme="light"] .highlight .nt {
  color: #e45649;
}

/* Name variable */
html[data-theme="light"] .highlight .nv,
html[data-theme="light"] .highlight .vi,
html[data-theme="light"] .highlight .vg,
html[data-theme="light"] .highlight .vc {
  color: #e45649;
}

/* Operators */
html[data-theme="light"] .highlight .o,
html[data-theme="light"] .highlight .ow {
  color: #0184bc;
}

/* Punctuation */
html[data-theme="light"] .highlight .p {
  color: #383a42;
}

/* Generic (diffs, errors, etc.) */
html[data-theme="light"] .highlight .gd {
  color: #e45649;
  background: rgba(228, 86, 73, 0.08);
}

html[data-theme="light"] .highlight .gi {
  color: #50a14f;
  background: rgba(80, 161, 79, 0.08);
}

html[data-theme="light"] .highlight .gh,
html[data-theme="light"] .highlight .gu {
  color: #4078f2;
}

html[data-theme="light"] .highlight .gr,
html[data-theme="light"] .highlight .gt {
  color: #e45649;
}

html[data-theme="light"] .highlight .go {
  color: #a0a1a7;
}

html[data-theme="light"] .highlight .gp {
  color: #a0a1a7;
}

/* Whitespace / Text */
html[data-theme="light"] .highlight .w {
  color: #383a42;
}

html[data-theme="light"] .highlight .err {
  color: #e45649;
}

/* --------------------------------------------------------------------------
   Callout Boxes
   -------------------------------------------------------------------------- */

.callout {
  margin: 1.5em 0;
  padding: 16px 20px;
  border-left: 3px solid var(--color-border);
  border-radius: 0 8px 8px 0;
  background: var(--color-bg-callout);
  font-size: 0.9375rem;
  line-height: 1.65;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.callout p {
  margin-bottom: 0.5em;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 0.8125rem;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.callout-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.callout-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

/* Info */
.callout-info {
  border-left-color: var(--color-info-border);
  background: var(--color-info-bg);
}

.callout-info .callout-title {
  color: var(--color-info);
}

/* Warning */
.callout-warning {
  border-left-color: var(--color-warning-border);
  background: var(--color-warning-bg);
}

.callout-warning .callout-title {
  color: var(--color-warning);
}

/* Tip */
.callout-tip {
  border-left-color: var(--color-tip-border);
  background: var(--color-tip-bg);
}

.callout-tip .callout-title {
  color: var(--color-tip);
}

/* Danger */
.callout-danger {
  border-left-color: var(--color-danger-border);
  background: var(--color-danger-bg);
}

.callout-danger .callout-title {
  color: var(--color-danger);
}

/* Callout code styling */
.callout code {
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: var(--color-bg-inline-code);
}

/* --------------------------------------------------------------------------
   Code Tabs
   -------------------------------------------------------------------------- */

.code-tabs {
  margin: 1.5em 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-border-code);
  background: var(--color-bg-code-block);
}

.code-tabs-header {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 8px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

html[data-theme="light"] .code-tabs-header {
  background: rgba(0, 0, 0, 0.04);
  border-bottom-color: var(--color-border-light);
}

.code-tab-btn {
  position: relative;
  padding: 10px 16px;
  border: none;
  background: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-tertiary);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease;
  user-select: none;
}

.code-tab-btn:hover {
  color: var(--color-text-on-dark);
}

html[data-theme="light"] .code-tab-btn:hover {
  color: var(--color-text);
}

.code-tab-btn.active {
  color: var(--color-text-on-dark);
}

html[data-theme="light"] .code-tab-btn.active {
  color: var(--color-text);
}

.code-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px 1px 0 0;
}

/* Code blocks inside code-tabs: hide all except active */
.code-tabs > .code-block {
  display: none;
  border: none;
  border-radius: 0;
  margin: 0;
}

.code-tabs > .code-block.active {
  display: block;
}

/* Hide the individual code-block headers when inside tabs (the tabs header replaces them) */
.code-tabs > .code-block .code-block-header {
  display: none;
}

/* --------------------------------------------------------------------------
   Endpoint Toolbar (expand/collapse toggle)
   -------------------------------------------------------------------------- */

.endpoint-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
}

.endpoint-expand-btn {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-link);
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s ease;
}

.endpoint-expand-btn:hover {
  color: var(--color-text-link-hover);
}

/* --------------------------------------------------------------------------
   Endpoint Blocks — Collapsible <details> with method-colored accent
   -------------------------------------------------------------------------- */

.endpoint {
  margin: 16px 0;
  border: 1px solid var(--color-border);
  border-radius: 0 10px 10px 0;
  background: var(--color-bg-endpoint);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.endpoint:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}

/* Hide native disclosure markers across browsers */
.endpoint > summary { list-style: none; }
.endpoint > summary::-webkit-details-marker { display: none; }
.endpoint::-webkit-details-marker { display: none; }

/* Method-colored left accent border */
.endpoint-get    { border-left: 3px solid var(--color-method-get); }
.endpoint-post   { border-left: 3px solid var(--color-method-post); }
.endpoint-put    { border-left: 3px solid var(--color-method-put); }
.endpoint-delete { border-left: 3px solid var(--color-method-delete); }
.endpoint-patch  { border-left: 3px solid var(--color-method-patch); }

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
}

.endpoint-header:hover {
  background: var(--color-bg-secondary);
  filter: brightness(0.97);
}

/* When collapsed, remove bottom border since there's no body below */
.endpoint:not([open]) > .endpoint-header {
  border-bottom: none;
}

.endpoint-method {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 5px;
  line-height: 1.5;
  user-select: none;
  flex-shrink: 0;
}

.method-get {
  color: var(--color-method-get);
  background: var(--color-method-get-bg);
}

.method-post {
  color: var(--color-method-post);
  background: var(--color-method-post-bg);
}

.method-put {
  color: var(--color-method-put);
  background: var(--color-method-put-bg);
}

.method-delete {
  color: var(--color-method-delete);
  background: var(--color-method-delete-bg);
}

.method-patch {
  color: var(--color-method-patch);
  background: var(--color-method-patch-bg);
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  word-break: break-all;
}

/* Dot separator between path and summary */
.endpoint-sep {
  flex-shrink: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
  opacity: 0.6;
}

/* One-liner summary text shown next to the path */
.endpoint-summary {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Custom chevron indicator */
.endpoint-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  margin-left: auto;
  transition: color 0.15s ease;
}

.endpoint-header:hover .endpoint-chevron {
  color: var(--color-text-secondary);
}

.endpoint-chevron::before {
  content: '';
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  display: inline-block;
  padding: 3px;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

details.endpoint[open] > .endpoint-header .endpoint-chevron::before {
  transform: rotate(45deg);
}

.endpoint-body {
  padding: 20px 24px;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-text-secondary);
}

.endpoint-body p {
  margin-bottom: 1em;
}

.endpoint-body p:last-child {
  margin-bottom: 0;
}

/* Endpoint params table */
.endpoint-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 16px;
  margin-bottom: 4px;
}

.endpoint-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.endpoint-body thead th {
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-tertiary);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

.endpoint-body thead th:nth-child(4) {
  text-align: center;
}

/* Description column can wrap; all others stay on one line */
.endpoint-body thead th:last-child {
  white-space: normal;
}

.endpoint-body tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: top;
  white-space: nowrap;
}

.endpoint-body tbody td:nth-child(4) {
  text-align: center;
}

.endpoint-body tbody td:last-child {
  white-space: normal;
  min-width: 180px;
}

.endpoint-body tbody tr:last-child td {
  border-bottom: none;
}

.endpoint-body tbody tr:hover {
  background: var(--color-bg-secondary);
}

.endpoint-body code {
  font-size: 0.8125em;
  padding: 0.15em 0.4em;
  background: var(--color-bg-inline-code);
  border-radius: 4px;
}

/* Required / Optional parameter labels */
.param-required {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-method-delete);
  background: var(--color-method-delete-bg);
  padding: 1px 7px;
  border-radius: 4px;
}

.param-optional {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-tertiary);
}

/* Section titles within endpoint body (Example Request, Response, etc.) */
.endpoint-section-title {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  margin: 20px 0 10px;
}

.endpoint-section-title:first-of-type {
  margin-top: 16px;
}

/* Response status badges */
.response-status {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.response-status-success {
  color: var(--color-method-get);
  background: var(--color-method-get-bg);
}

.response-status-error {
  color: var(--color-method-delete);
  background: var(--color-method-delete-bg);
}

/* Curl and response panels */
.endpoint-curl,
.endpoint-response {
  margin-top: 12px;
}

.endpoint-curl .code-block,
.endpoint-response .code-block {
  margin: 8px 0 0;
}

/* Error response items */
.error-response-item {
  margin-top: 12px;
}

.error-response-item .response-status {
  display: block;
  margin-left: 0;
  margin-bottom: 6px;
}

/* --------------------------------------------------------------------------
   Endpoint Tabs (Request / Response / Errors)
   -------------------------------------------------------------------------- */

.endpoint-tabs {
  margin-top: 20px;
  border-top: 1px solid var(--color-border-light);
  padding-top: 4px;
}

.endpoint-tabs-header {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 4px;
  border-bottom: 1px solid var(--color-border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.endpoint-tab-btn {
  position: relative;
  padding: 10px 16px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-tertiary);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease;
  user-select: none;
}

.endpoint-tab-btn:hover {
  color: var(--color-text);
}

.endpoint-tab-btn.active {
  color: var(--color-text);
}

.endpoint-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 8px;
  right: 8px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px 1px 0 0;
}

.endpoint-tab-panel {
  display: none;
  padding-top: 4px;
}

.endpoint-tab-panel.active {
  display: block;
}

/* --------------------------------------------------------------------------
   API Reference Index Page
   -------------------------------------------------------------------------- */

.api-ref-server {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 32px;
  padding: 12px 16px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
}

.api-ref-server-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}

.api-ref-server-url {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.api-ref-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .api-ref-grid {
    grid-template-columns: 1fr;
  }

  .endpoint-sep {
    display: none;
  }

  .endpoint-summary {
    display: none;
  }
}

/* Extends .card — the .card class provides surface, border, radius, hover */
.api-ref-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.api-ref-card-title {
  margin: 0 0 8px;
  font-size: 1.0625rem;
}

.api-ref-card-desc {
  font-size: 0.875rem;
  line-height: 1.55;
  margin: 0 0 12px;
  flex: 1;
}

.api-ref-card-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */

.article-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
  margin-bottom: 12px;
}

.article-breadcrumb a {
  color: var(--color-text-link);
  text-decoration: none;
}

.article-breadcrumb a:hover {
  color: var(--color-text-link-hover);
}

.breadcrumb-sep {
  color: var(--color-text-tertiary);
  user-select: none;
}

/* --------------------------------------------------------------------------
   Site Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-left: 280px;
  border-top: 1px solid var(--color-border-light);
  padding: 0;
  background: var(--color-bg-secondary);
  transition: background-color 0.2s ease;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 32px;
}

/* ── Top section: brand + nav columns ── */

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-border-light);
}

.footer-brand {
  flex-shrink: 0;
  max-width: 240px;
}

.footer-logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--color-text);
  transition: opacity 0.15s ease;
}

.footer-logo-link:hover {
  opacity: 0.8;
}

.footer-logo-icon {
  height: 22px;
  width: 22px;
  border-radius: 50%;
  flex-shrink: 0;
}

.footer-logo-text {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

.footer-tagline {
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
  line-height: 1.5;
}

/* ── Nav columns ── */

.footer-nav {
  display: flex;
  gap: 48px;
}

.footer-nav-group {
  min-width: 120px;
}

.footer-nav-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  margin: 0 0 12px;
}

.footer-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-nav-list a {
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-nav-list a:hover {
  color: var(--color-text);
}

/* ── Bottom bar: copyright + social ── */

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  gap: 16px;
}

.footer-copyright {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  opacity: 0.7;
  margin: 0;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-links a {
  color: var(--color-text-tertiary);
  text-decoration: none;
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
}

.footer-links a:hover {
  color: var(--color-text);
}

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

/* Hide TOC on narrower viewports (sidebar 280 + article 720 + gap + toc 220 ≈ 1320) */
@media (max-width: 1280px) {
  .toc {
    display: none;
  }

  .content-with-toc {
    display: block;
  }
}

/* Tablet adjustments */
@media (max-width: 1024px) {
  .header-links,
  .header-divider {
    display: none;
  }

  .content {
    padding: 40px 32px 64px;
  }

  .site-footer {
    margin-left: 0;
  }

  .footer-inner {
    padding: 40px 32px 24px;
  }

  .footer-nav {
    gap: 32px;
  }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  .mobile-nav-toggle {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
      box-shadow 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg), 100vw 0 0 rgba(0, 0, 0, 0.2);
  }

  .content {
    margin-left: 0;
    padding: 32px 20px 64px;
  }

  .site-footer {
    margin-left: 0;
  }

  .footer-inner {
    padding: 32px 20px 24px;
  }

  .footer-top {
    flex-direction: column;
    gap: 32px;
  }

  .footer-brand {
    max-width: none;
  }

  .footer-nav {
    flex-wrap: wrap;
    gap: 32px 40px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .article-title {
    font-size: 1.75rem;
  }

  .article-description {
    font-size: 1.0625rem;
    margin-bottom: 32px;
  }

  .article-body h2 {
    font-size: 1.3125rem;
  }

  .article-body h3 {
    font-size: 1.125rem;
  }

  /* Endpoint blocks stack better on mobile */
  .endpoint-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
  }

  .endpoint-body {
    padding: 14px 16px;
  }

  /* Code blocks: smaller padding on mobile */
  .code-block pre {
    padding: 14px 16px;
    font-size: 0.78125rem;
  }

  .code-block-header {
    padding: 6px 12px;
  }

  /* Hide header extras on small screens */
  .header-dashboard {
    display: none;
  }

  .header-nav .theme-toggle {
    display: flex;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .header-inner {
    padding: 0 16px;
  }

  .content {
    padding: 24px 16px 48px;
  }

  .article-title {
    font-size: 1.5rem;
  }

  .callout {
    padding: 14px 16px;
  }
}

/* Large screens: center the layout */
@media (min-width: 1440px) {
  .content {
    padding: 48px 64px 80px;
  }
}

/* --------------------------------------------------------------------------
   Search
   -------------------------------------------------------------------------- */

/* --- Search Trigger Button (header) --- */

.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
  transition: background-color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
  height: 36px;
  min-width: 240px;
}

.search-trigger:hover {
  background-color: var(--color-bg-hover);
  border-color: var(--color-text-tertiary);
  box-shadow: var(--shadow-sm);
}

.search-trigger-icon {
  position: relative;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Magnifying glass: circle */
.search-trigger-icon::before {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--color-text-tertiary);
  border-radius: 50%;
}

/* Magnifying glass: handle */
.search-trigger-icon::after {
  content: '';
  position: absolute;
  top: 11px;
  left: 11px;
  width: 5px;
  height: 2px;
  background: var(--color-text-tertiary);
  border-radius: 1px;
  transform: rotate(45deg);
}

.search-trigger-text {
  color: var(--color-text-tertiary);
  font-weight: 450;
  flex: 1;
  text-align: left;
}

.search-trigger-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg-secondary);
  line-height: 1;
}

/* --- Search Modal Overlay --- */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.search-modal[hidden] {
  display: none;
}

.search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .search-modal-backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.search-modal-content {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 70vh;
  margin: 0 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --- Search Input --- */

.search-input-wrapper {
  padding: 16px;
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 1.125rem;
  font-weight: 450;
  color: var(--color-text);
  line-height: 1.5;
}

.search-input::placeholder {
  color: var(--color-text-tertiary);
}

/* --- Search Results --- */

.search-results {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.search-result-item {
  display: block;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border-light);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.1s ease;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item.active {
  background-color: var(--color-bg-hover);
  color: inherit;
}

.search-result-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-primary);
  margin-bottom: 2px;
  line-height: 1.4;
}

.search-result-section {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-tertiary);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: 4px;
  padding: 1px 6px;
  margin-bottom: 4px;
  line-height: 1.5;
}

.search-result-snippet {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-snippet mark {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  border-radius: 2px;
  padding: 0 1px;
}

.search-no-results {
  padding: 32px 16px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-tertiary);
}

/* --- Search Suggestions (empty-state) --- */

.search-suggestions {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.search-suggestions[hidden] {
  display: none;
}

.search-suggestion-group {
  padding: 8px 0;
}

.search-suggestion-group + .search-suggestion-group {
  border-top: 1px solid var(--color-border-light);
}

.search-suggestion-header {
  padding: 4px 16px 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
}

.search-suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.1s ease;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
  background-color: var(--color-bg-hover);
}

.search-suggestion-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  color: var(--color-text-tertiary);
}

.search-suggestion-icon--recent {
  color: var(--color-text-tertiary);
}

.search-suggestion-text {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggestion-item .search-result-section {
  flex-shrink: 0;
  margin-bottom: 0;
}

.search-suggestion-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-text-tertiary);
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.1s ease, background-color 0.1s ease;
}

.search-suggestion-item:hover .search-suggestion-remove {
  opacity: 1;
}

.search-suggestion-remove:hover {
  background-color: var(--color-bg-hover);
  color: var(--color-text-secondary);
}

/* --- Search responsive --- */

@media (max-width: 768px) {
  .search-trigger {
    min-width: auto;
    padding: 6px 8px;
  }

  .search-trigger-text,
  .search-trigger-kbd {
    display: none;
  }

  .search-modal {
    padding-top: 10vh;
  }

  .search-modal-content {
    max-height: 80vh;
  }
}

@media print {
  .search-trigger,
  .search-modal {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   Transitions & Animations
   -------------------------------------------------------------------------- */

/* Smooth theme transition for major layout elements */
.site-header,
.sidebar,
.content,
.site-footer,
.code-block,
.code-tabs,
.callout,
.endpoint {
  transition: background-color 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease, color 0.2s ease;
}

/* --------------------------------------------------------------------------
   Utility & Accessibility
   -------------------------------------------------------------------------- */

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus ring for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Remove focus ring for mouse clicks */
*:focus:not(:focus-visible) {
  outline: none;
}

/* Disable transitions for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   Landing Page
   -------------------------------------------------------------------------- */

.landing {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Hero --- */

.landing-hero {
  position: relative;
  text-align: center;
  padding: 80px 24px 64px;
  overflow: hidden;
  /* Break out of .landing max-width to span full viewport */
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

/* Fine line grid — fades out toward edges */
.landing-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--color-hero-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-hero-grid) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, black 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, black 10%, transparent 70%);
  pointer-events: none;
}

/* Layered glow orbs — diffused light sources at different positions */
.landing-hero::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle 600px at 25% 15%, var(--color-hero-glow-1), transparent 70%),
    radial-gradient(circle 500px at 75% 85%, var(--color-hero-glow-2), transparent 70%),
    radial-gradient(circle 400px at 90% 25%, var(--color-hero-glow-3), transparent 70%);
  pointer-events: none;
}

/* All hero content above the pseudo-element layers */
.landing-hero > * {
  position: relative;
  z-index: 1;
}

/* Badge pill */
.landing-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-primary-subtle);
  border: 1px solid var(--color-primary);
  border-radius: 100px;
  padding: 4px 14px;
  margin-bottom: 20px;
}

.landing-hero-title {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--color-text-heading);
  margin-bottom: 16px;
}

.landing-hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  max-width: 520px;
  margin: 0 auto 32px;
}

/* CTA group */
.landing-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.landing-cta {
  display: inline-block;
  padding: 12px 32px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-inverse);
  background: var(--color-primary);
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.landing-cta:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: var(--color-text-inverse);
}

.landing-cta:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.landing-cta-secondary {
  display: inline-block;
  padding: 12px 32px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  background: transparent;
  border: 1px solid var(--color-primary);
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.landing-cta-secondary:hover {
  background: var(--color-primary-subtle);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: var(--color-primary);
}

.landing-cta-secondary:active {
  transform: translateY(0);
  box-shadow: none;
}

/* --- Featured entry-point cards --- */

.landing-featured {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: -16px;
  margin-bottom: 48px;
}

.landing-featured-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  text-decoration: none;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

/* Gradient top accent */
.landing-featured-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-featured-border-top);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.landing-featured-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.landing-featured-card:hover::before {
  opacity: 1;
}

.landing-featured-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--color-featured-icon-bg);
  color: var(--color-featured-icon);
}

.landing-featured-body {
  flex: 1;
  min-width: 0;
}

.landing-featured-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--color-text-heading);
  margin-bottom: 4px;
}

.landing-featured-desc {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.landing-featured-arrow {
  display: flex;
  align-items: center;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
  margin-top: 12px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.landing-featured-card:hover .landing-featured-arrow {
  color: var(--color-primary);
  transform: translateX(3px);
}

/* --- Goal-based Learning Paths --- */

.landing-paths {
  margin-bottom: 48px;
}

.landing-paths-header {
  text-align: center;
  margin-bottom: 32px;
}

.landing-paths-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-heading);
  margin-bottom: 8px;
}

.landing-paths-subtitle {
  font-size: 1rem;
  color: var(--color-text-secondary);
}

.landing-paths-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.landing-path-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  text-decoration: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.landing-path-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.landing-path-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--color-featured-icon-bg);
  color: var(--color-featured-icon);
  margin-bottom: 16px;
}

.landing-path-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--color-text-heading);
  margin-bottom: 8px;
}

.landing-path-desc {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  flex: 1;
}

.landing-path-trail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.landing-path-step {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-subtle);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.landing-path-chevron {
  display: flex;
  align-items: center;
  color: var(--color-text-tertiary);
}

.landing-path-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}

.landing-path-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
}

/* --- Compact Browse All --- */

.landing-browse {
  padding-bottom: 80px;
}

.landing-browse-title {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  margin-bottom: 16px;
}

.landing-browse-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-browse-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-link);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.landing-browse-link:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-subtle);
}

.landing-browse-icon {
  display: flex;
  align-items: center;
  color: var(--color-primary);
}

.landing-browse-icon svg {
  width: 14px;
  height: 14px;
}

.landing-browse-count {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-tertiary);
  background: var(--color-bg-secondary);
  border-radius: 100px;
  padding: 1px 6px;
}

/* Landing page: full-width footer (no sidebar offset) */
body:has(.landing) .site-footer {
  margin-left: 0;
}

/* --- Responsive --- */

@media (max-width: 1024px) {
  .landing-featured {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Let the third featured card span full width on tablet */
  .landing-featured-card:last-child:nth-child(3) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .landing-featured {
    grid-template-columns: 1fr;
    margin-bottom: 32px;
  }

  .landing-paths-grid {
    grid-template-columns: 1fr;
  }

  .landing-paths-title {
    font-size: 1.25rem;
  }

  .landing-browse-row {
    flex-direction: column;
  }

  .landing-browse-link {
    width: 100%;
  }

  .landing-hero {
    padding: 48px 16px 40px;
  }

  .landing-hero-title {
    font-size: 2rem;
  }

  .landing-hero-subtitle {
    font-size: 1.0625rem;
  }

  .landing-badge {
    font-size: 0.6875rem;
    padding: 3px 12px;
  }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */

@media print {
  .site-header,
  .sidebar,
  .mobile-nav-toggle,
  .theme-toggle,
  .copy-btn,
  .toc {
    display: none !important;
  }

  .content,
  .content-with-toc {
    margin-left: 0;
    padding: 0;
    display: block;
  }

  .site-footer {
    margin-left: 0;
  }

  .article {
    max-width: 100%;
  }

  .code-block {
    border: 1px solid #ccc;
  }

  .code-block pre {
    background: #f5f5f5 !important;
    color: #1a1a1a !important;
  }

  .endpoint-chevron {
    display: none !important;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    color: #666;
  }

  /* Cards */
  .card {
    border-color: #ccc;
    background: #fff;
  }

  /* Comparison card attributes */
  .compare-attr {
    border-color: #e0e0e0;
  }

  /* Connection diagrams */
  .conn-flow {
    break-inside: avoid;
    border-color: #ccc;
    background: #f9f9f9;
  }

  .conn-lifeline {
    border-color: #ccc;
  }

  .conn-step-line {
    background: #333;
  }

  .conn-step--right .conn-step-line::after {
    border-left-color: #333;
  }

  .conn-step--left .conn-step-line::after {
    border-right-color: #333;
  }

  .conn-step-num {
    color: #666;
    background: #fff;
    border-color: #ccc;
  }

  .conn-result-badge {
    background: #333;
  }

  .conn-chip--primary {
    border-color: #333;
  }

  .conn-result {
    background: #f0f0f0;
  }
}

/* --------------------------------------------------------------------------
   Diagrams (D2 / Mermaid — rendered to inline SVG at build time)

   Two SVG variants are embedded per diagram: .diagram-light and .diagram-dark.
   CSS shows the one that matches the active site theme; the other is hidden.
   No JavaScript involved.
   -------------------------------------------------------------------------- */

.diagram-block {
  margin: 1.5em 0;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  overflow-x: auto;
  text-align: center;
}

.diagram-block svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Show the correct theme variant */
html[data-theme="light"] .diagram-dark { display: none; }
html[data-theme="dark"]  .diagram-light { display: none; }

/* --------------------------------------------------------------------------
   Chart preview (static representative example — not live data)
   All colours come from CSS custom properties so the chart adapts to the
   active theme automatically — no JavaScript or duplicate SVGs needed.
   -------------------------------------------------------------------------- */

.chart-preview-block {
  margin: 1.5em 0;
  padding: 0 0 0.75rem;
}

.chart-preview-svg {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  overflow: visible;
}

/* Chart area */
.chart-preview-svg .chart-area-bg { fill: var(--color-bg-secondary); }
.chart-preview-svg .axis-line     { stroke: var(--color-border); stroke-width: 1; }

/* Zone boundary lines (dashed, at score 70 and 40) */
.chart-preview-svg .zone-line {
  stroke: var(--color-border);
  stroke-width: 1;
  stroke-dasharray: 4 3;
}

/* Axis labels */
.chart-preview-svg .axis-label {
  fill: var(--color-text-tertiary);
  font-size: 11px;
  font-family: inherit;
}

/* Zone labels — coloured but muted */
.chart-preview-svg .zone-label {
  font-size: 9px;
  font-weight: 600;
  font-family: inherit;
  opacity: 0.65;
}
.chart-preview-svg .zone-label-good { fill: var(--color-tip); }
.chart-preview-svg .zone-label-mod  { fill: var(--color-warning); }
.chart-preview-svg .zone-label-low  { fill: var(--color-danger); }

/* Data — primary brand green, smooth bezier path */
.chart-preview-svg .data-area {
  fill: var(--color-primary);
  opacity: 0.08;
}

.chart-preview-svg .data-line {
  stroke: var(--color-primary);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-preview-svg .data-point {
  fill: var(--color-primary);
  stroke: var(--color-bg-secondary);
  stroke-width: 1.5;
}

/* Value labels above each data point */
.chart-preview-svg .value-label {
  fill: var(--color-primary);
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
}

.chart-preview-note {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  text-align: center;
  margin: 0.5rem 0 0;
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Card Grid — clickable navigation cards in a responsive 2-column layout
   -------------------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 1.5em 0;
}

/* Hide the raw <ul> before JS transforms it */
.card-grid > ul {
  display: none;
}

/* Card element (created by JS from <li> items) — extends .card */
.card-grid-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.card-grid-body {
  flex: 1;
  min-width: 0;
}

.card-grid-title {
  margin-bottom: 4px;
}

.card-grid-arrow {
  display: flex;
  align-items: center;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
  margin-top: 2px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.card-grid-card:hover .card-grid-arrow {
  color: var(--color-primary);
  transform: translateX(3px);
}

/* Responsive: single column on narrow screens */
@media (max-width: 600px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   404 Not Found Page
   -------------------------------------------------------------------------- */

.not-found {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.not-found-hero {
  position: relative;
  text-align: center;
  padding: 100px 24px 80px;
  overflow: hidden;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

/* Grid background — matches landing hero */
.not-found-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--color-hero-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-hero-grid) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, black 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, black 10%, transparent 70%);
  pointer-events: none;
}

/* Glow orbs — matches landing hero */
.not-found-hero::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle 600px at 25% 15%, var(--color-hero-glow-1), transparent 70%),
    radial-gradient(circle 500px at 75% 85%, var(--color-hero-glow-2), transparent 70%),
    radial-gradient(circle 400px at 90% 25%, var(--color-hero-glow-3), transparent 70%);
  pointer-events: none;
}

.not-found-hero > * {
  position: relative;
  z-index: 1;
}

.not-found-code {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 7rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--color-primary);
  opacity: 0.15;
  margin-bottom: 8px;
}

.not-found-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--color-text-heading);
  margin-bottom: 12px;
}

.not-found-subtitle {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  max-width: 440px;
  margin: 0 auto 32px;
}

.not-found-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.not-found-search-trigger {
  cursor: pointer;
  border: 1px solid var(--color-primary);
  font-family: var(--font-heading);
}

.not-found-browse {
  padding-bottom: 80px;
  max-width: 720px;
  margin: 0 auto;
}

/* Full-width footer (no sidebar offset) */
body:has(.not-found) .site-footer {
  margin-left: 0;
}

@media (max-width: 600px) {
  .not-found-hero {
    padding: 64px 16px 48px;
  }

  .not-found-code {
    font-size: 5rem;
  }

  .not-found-title {
    font-size: 1.75rem;
  }

  .not-found-subtitle {
    font-size: 1rem;
  }
}

/* --------------------------------------------------------------------------
   Inline Badges — colored pill labels for tiers, platforms, and status
   -------------------------------------------------------------------------- */

.badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1;
  padding: 3px 8px;
  border-radius: 100px;
  vertical-align: middle;
  white-space: nowrap;
}

/* --- Tier badges --- */

.badge-pro {
  color: #7c3aed;
  background: #f5f3ff;
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.badge-free {
  color: var(--color-tip);
  background: var(--color-tip-bg);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

/* --- Platform badges --- */

.badge-ios {
  color: var(--color-info);
  background: var(--color-info-bg);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.badge-android {
  color: var(--color-tip);
  background: var(--color-tip-bg);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

/* --- Status badges --- */

.badge-required {
  color: var(--color-danger);
  background: var(--color-danger-bg);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.badge-optional {
  color: var(--color-text-tertiary);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
}

.badge-beta {
  color: var(--color-warning);
  background: var(--color-warning-bg);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.badge-new {
  color: var(--color-primary);
  background: var(--color-primary-subtle);
  border: 1px solid rgba(58, 133, 56, 0.2);
}

.badge-deprecated {
  color: var(--color-text-tertiary);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  text-decoration: line-through;
}

/* --- Dark theme adjustments --- */

html[data-theme="dark"] .badge-pro {
  color: #a78bfa;
  background: #1e1535;
  border-color: rgba(167, 139, 250, 0.25);
}

html[data-theme="dark"] .badge-free {
  border-color: rgba(16, 185, 129, 0.25);
}

html[data-theme="dark"] .badge-ios {
  border-color: rgba(96, 165, 250, 0.25);
}

html[data-theme="dark"] .badge-android {
  border-color: rgba(16, 185, 129, 0.25);
}

html[data-theme="dark"] .badge-required {
  border-color: rgba(239, 68, 68, 0.25);
}

html[data-theme="dark"] .badge-beta {
  border-color: rgba(245, 158, 11, 0.25);
}

html[data-theme="dark"] .badge-new {
  border-color: rgba(22, 196, 94, 0.25);
}

/* --------------------------------------------------------------------------
   Steps — numbered step blocks with vertical timeline connector
   -------------------------------------------------------------------------- */

.steps {
  position: relative;
  counter-reset: step-counter;
  padding-left: 48px;
  margin: 1.5em 0;
}

/* Vertical timeline line */
.steps::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--color-border);
  border-radius: 1px;
}

/* Step headings (h3 inside .steps) */
.steps > h3 {
  position: relative;
  counter-increment: step-counter;
  margin-top: 2em;
  margin-bottom: 0.75em;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--color-text-heading);
}

.steps > h3:first-child {
  margin-top: 0;
}

/* Numbered circle */
.steps > h3::before {
  content: counter(step-counter);
  position: absolute;
  left: -48px;
  top: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-primary);
  background:
    linear-gradient(var(--color-primary-subtle), var(--color-primary-subtle)),
    var(--color-bg);
  border: 2px solid var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--color-bg);
}

/* Hide the '#' anchor indicator — the numbered circle replaces it */
.steps > h3 a::before {
  content: none;
}

/* Content between steps: paragraphs, code blocks, callouts, etc. */
.steps > p,
.steps > ul,
.steps > ol,
.steps > .code-block,
.steps > .code-tabs,
.steps > .callout,
.steps > table,
.steps > blockquote {
  margin-left: 0;
}

/* Responsive: tighter padding on mobile */
@media (max-width: 600px) {
  .steps {
    padding-left: 40px;
  }

  .steps::before {
    left: 11px;
  }

  .steps > h3::before {
    left: -40px;
    width: 24px;
    height: 24px;
    font-size: 0.6875rem;
  }
}

/* --------------------------------------------------------------------------
   Feature Grid — informational cards with icons in a responsive grid layout
   -------------------------------------------------------------------------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 1.5em 0;
}

/* Hide the raw <ul> before JS transforms it */
.feature-grid > ul {
  display: none;
}

/* Card element (created by JS from <li> items) — extends .card */
.feature-grid-card {
  border-top: 2px solid var(--color-primary);
}

/* Override hover lift — feature cards are not clickable */
.feature-grid-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--color-border);
  border-top-color: var(--color-primary);
}

.feature-grid-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.feature-grid-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

/* Responsive: single column on narrow screens */
@media (max-width: 600px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Flow Diagram — animated architecture flow with three phases
   -------------------------------------------------------------------------- */

.flow-diagram {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 1.5em 0;
  padding: 28px 20px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

/* --- Nodes --- */

.flow-node {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  min-width: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.flow-node-primary {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary-subtle), var(--shadow-sm);
}

.flow-node-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}

.flow-node-primary .flow-node-icon {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}

.flow-node-title {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--color-text-heading);
  margin-bottom: 4px;
}

.flow-node-detail {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--color-text-tertiary);
  max-width: 160px;
}

/* --- Connectors --- */

.flow-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 80px;
  flex-shrink: 0;
}

.flow-connector-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.flow-connector-track {
  display: flex;
  align-items: center;
  width: 100%;
}

.flow-connector-line {
  flex: 1;
  height: 2px;
  background-image: linear-gradient(
    90deg,
    var(--color-primary) 6px,
    transparent 6px
  );
  background-size: 12px 2px;
  animation: flow-dash 0.6s linear infinite;
}

.flow-connector-arrow {
  flex-shrink: 0;
  color: var(--color-primary);
  width: 8px;
  height: 12px;
}

@keyframes flow-dash {
  to {
    background-position: 12px 0;
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .flow-connector-line {
    animation: none;
    background-image: none;
    background-color: var(--color-primary);
    opacity: 0.4;
  }
}

/* --- Responsive: vertical stack on narrow screens --- */

@media (max-width: 600px) {
  .flow-diagram {
    flex-direction: column;
    gap: 0;
    padding: 20px 16px;
  }

  .flow-node {
    width: 100%;
    padding: 16px;
  }

  .flow-connector {
    width: auto;
    height: 48px;
    flex-direction: row;
    gap: 8px;
  }

  .flow-connector-track {
    flex-direction: column;
    width: auto;
    height: 100%;
  }

  .flow-connector-line {
    width: 2px;
    height: 100%;
    flex: 1;
    background-image: linear-gradient(
      180deg,
      var(--color-primary) 6px,
      transparent 6px
    );
    background-size: 2px 12px;
    animation: flow-dash-vertical 0.6s linear infinite;
  }

  .flow-connector-arrow {
    transform: rotate(90deg);
  }

  @keyframes flow-dash-vertical {
    to {
      background-position: 0 12px;
    }
  }
}

/* --------------------------------------------------------------------------
   Connection Flow Diagrams — grid-based sequence diagram
   Actor chips across the top, dashed lifelines, horizontal arrows spanning
   between relevant actor columns.
   -------------------------------------------------------------------------- */

/* --- Container (single CSS Grid) --- */

.conn-flow {
  display: grid;
  row-gap: 0;
  column-gap: 0;
  margin: 1.5em 0;
  padding: 24px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.conn-flow--3 {
  grid-template-columns: 32px repeat(3, 1fr);
}

.conn-flow--4 {
  grid-template-columns: 32px repeat(4, 1fr);
}

/* --- Actor header chips (grid row 1) --- */

.conn-actor {
  display: flex;
  justify-content: center;
  padding-bottom: 16px;
  position: relative;
  z-index: 2;
}

/* --- Actor chip (pill) --- */

.conn-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  padding: 6px 14px;
  border-radius: 100px;
  white-space: nowrap;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-heading);
}

.conn-chip svg {
  flex-shrink: 0;
  color: var(--color-text-secondary);
}

.conn-chip--primary {
  border-color: var(--color-primary);
  background:
    linear-gradient(var(--color-primary-subtle), var(--color-primary-subtle)),
    var(--color-bg);
}

.conn-chip--primary svg {
  color: var(--color-primary);
}

.conn-chip-detail {
  font-weight: 400;
  font-size: 0.6875rem;
  color: var(--color-text-tertiary);
  margin-left: 2px;
}

/* --- Lifelines (dashed verticals spanning step rows) --- */

.conn-lifeline {
  justify-self: center;
  width: 0;
  border-left: 1.5px dashed var(--color-border);
  opacity: 0.7;
  z-index: 0;
  pointer-events: none;
}

/* --- Step rows (grid items spanning source→target columns) --- */

.conn-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 28px 0 10px;
  z-index: 1;
  position: relative;
}

/* Badge + label row */
.conn-step-content {
  display: flex;
  align-items: center;
  gap: 6px;
}

.conn-step-num {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: 50%;
  line-height: 1;
  z-index: 1;
}

.conn-step-label {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--color-text-heading);
  white-space: nowrap;
}

.conn-step-note {
  font-size: 0.6875rem;
  color: var(--color-text-tertiary);
  margin-bottom: 6px;
  white-space: nowrap;
}

/* --- Arrow line (stretches center-to-center via calc margins) --- */

.conn-step-line {
  align-self: stretch;
  height: 2px;
  position: relative;
  margin-left: calc(50% / var(--span));
  margin-right: calc(50% / var(--span));
  background: var(--color-primary);
}

/* Source-end dot (::before) */
.conn-step--right .conn-step-line::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}

.conn-step--left .conn-step-line::before {
  content: "";
  position: absolute;
  right: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}

/* Target-end arrowhead (::after) */
.conn-step--right .conn-step-line::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left: 7px solid var(--color-primary);
}

.conn-step--left .conn-step-line::after {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right: 7px solid var(--color-primary);
}

/* --- Result banner (spans all columns) --- */

.conn-result {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
  padding: 12px 16px;
  background: var(--color-primary-subtle);
  border-radius: 10px;
  z-index: 1;
}

.conn-result-badge {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.conn-result-body {
  flex: 1;
  min-width: 0;
}

.conn-result-text {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--color-primary);
}

.conn-result-detail {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: 1px;
}

/* --- Responsive --- */

@media (max-width: 600px) {
  .conn-flow {
    padding: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .conn-flow--3 {
    min-width: 410px;
  }

  .conn-flow--4 {
    min-width: 530px;
  }

  .conn-actor {
    padding-bottom: 12px;
  }

  .conn-chip {
    font-size: 0.75rem;
    padding: 4px 10px;
  }

  .conn-chip svg {
    width: 14px;
    height: 14px;
  }

  .conn-step-num {
    width: 20px;
    height: 20px;
    font-size: 0.625rem;
  }

  .conn-step-label {
    font-size: 0.75rem;
  }

  .conn-step-note {
    font-size: 0.625rem;
  }

  .conn-result-badge {
    width: 22px;
    height: 22px;
  }

  .conn-result-badge svg {
    width: 12px;
    height: 12px;
  }

  .conn-result-text {
    font-size: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   Comparison Cards — side-by-side cards for comparing integration paths
   -------------------------------------------------------------------------- */

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: auto auto 1fr;
  gap: 0 16px;
  margin: 1.5em 0;
}

/* Extends .card */
.compare-card {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
}

/* Override hover lift — comparison cards are not clickable */
.compare-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--color-border);
}

.compare-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.compare-card .compare-title {
  margin: 0;
  line-height: 1;
}

.compare-desc {
  margin: 0;
  padding-bottom: 16px;
}

.compare-attrs {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.compare-attr {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-top: 1px solid var(--color-border-light);
}

.compare-attr-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-tertiary);
}

.compare-attr-value {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text);
}

.compare-attr-value a {
  color: var(--color-text-link);
  text-decoration: none;
}

.compare-attr-value a:hover {
  color: var(--color-text-link-hover);
  text-decoration: underline;
}

/* --- Responsive --- */

@media (max-width: 600px) {
  .compare-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .compare-card {
    grid-row: auto;
    grid-template-rows: auto auto 1fr;
  }
}

/* --------------------------------------------------------------------------
   Device Matrix — tabbed provider × metric table
   -------------------------------------------------------------------------- */

.device-matrix {
  margin: 1.5em 0 2em;
}

/* ── Tab bar ────────────────────────────────────────────────────────────── */

.device-matrix-tabs {
  display: flex;
  gap: 2px;
  padding: 0;
  border-bottom: 1px solid var(--color-border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.device-matrix-tabs::-webkit-scrollbar {
  display: none;
}

.device-matrix-tab {
  position: relative;
  padding: 10px 16px;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease;
  user-select: none;
}

.device-matrix-tab:hover {
  color: var(--color-text);
}

.device-matrix-tab.active {
  color: var(--color-primary);
}

.device-matrix-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 8px;
  right: 8px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px 1px 0 0;
}

.device-matrix-tab-count {
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--color-text-tertiary);
  margin-left: 2px;
}

.device-matrix-tab.active .device-matrix-tab-count {
  color: var(--color-primary);
  opacity: 0.7;
}

/* ── Panels ─────────────────────────────────────────────────────────────── */

.device-matrix-panel {
  display: none;
}

@keyframes device-matrix-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.device-matrix-panel.active {
  display: block;
  animation: device-matrix-fade-in 0.2s ease-out;
}

/* ── Table ──────────────────────────────────────────────────────────────── */

.device-matrix table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.device-matrix thead th {
  position: sticky;
  top: 0;
  background: var(--color-bg);
  padding: 8px 6px;
  font-weight: 600;
  font-size: 0.75rem;
  text-align: center;
  white-space: nowrap;
  border-bottom: 2px solid var(--color-border-light);
  z-index: 1;
}

.device-matrix-provider-col {
  text-align: left !important;
  min-width: 140px;
  position: sticky;
  left: 0;
  background: var(--color-bg) !important;
  z-index: 2 !important;
}

.device-matrix-metric-col {
  min-width: 56px;
  max-width: 80px;
  cursor: default;
}

/* ── Metric ID tooltip (positioned outside table-wrapper to avoid clip) ── */

.device-matrix {
  position: relative;
}

.device-matrix-tooltip {
  position: absolute;
  padding: 3px 8px;
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 0.6875rem;
  font-weight: 500;
  font-family: var(--font-mono);
  white-space: nowrap;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 10;
}

.device-matrix-tooltip.visible {
  opacity: 1;
}

.device-matrix tbody td {
  padding: 6px;
  text-align: center;
  border-bottom: 1px solid var(--color-border-light);
}

.device-matrix tbody td:first-child {
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
  position: sticky;
  left: 0;
  background: var(--color-bg);
  z-index: 1;
}

.device-matrix-provider-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ── Provider count badge ──────────────────────────────────────────────── */

.device-matrix-provider-count {
  font-size: 0.625rem;
  font-weight: 400;
  color: var(--color-text-tertiary);
  opacity: 0.7;
  margin-left: auto;
}

/* ── Column highlight ──────────────────────────────────────────────────── */

.device-matrix td.device-matrix-col-highlight {
  background: var(--color-primary-subtle);
}

/* ── Cells ──────────────────────────────────────────────────────────────── */

.device-matrix-yes {
  color: var(--color-primary);
  font-weight: 600;
}

.device-matrix-no {
  color: var(--color-text-tertiary);
  opacity: 0.4;
}

/* ── Group sub-header rows ──────────────────────────────────────────────── */

.device-matrix-group-row td {
  padding: 0;
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-bg) !important;
  text-align: left !important;
}

.device-matrix-group-label {
  display: block;
  position: sticky;
  left: 0;
  width: fit-content;
  padding: 10px 6px 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
}

/* ── SDK row subtle highlight ───────────────────────────────────────────── */

.device-matrix-sdk-row td {
  background: rgba(99, 102, 241, 0.04);
}

html[data-theme="dark"] .device-matrix-sdk-row td {
  background: rgba(99, 102, 241, 0.06);
}

/* ── Hover ──────────────────────────────────────────────────────────────── */

.device-matrix tbody tr:not(.device-matrix-group-row):hover td {
  background: var(--color-primary-subtle);
}

/* ── Sticky first-column: always opaque so scrolling cells don't bleed ── */

.device-matrix-sdk-row td:first-child,
.device-matrix tbody tr:not(.device-matrix-group-row):hover td:first-child {
  background: var(--color-bg);
}

/* --------------------------------------------------------------------------
   Connectivity Funnel — three-column data flow diagram
   Devices → Connection Paths → Sonar
   -------------------------------------------------------------------------- */

.conn-funnel {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 24px;
  margin: 1.5em 0 2em;
  padding: 24px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: 12px;
}

/* ── Column layout ─────────────────────────────────────────────────────── */

.conn-funnel-col {
  display: flex;
  flex-direction: column;
}

.conn-funnel-col-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  margin-bottom: 12px;
}

/* ── Devices column ────────────────────────────────────────────────────── */

.conn-funnel-col--devices {
  gap: 5px;
}

.conn-funnel-chip {
  display: block;
  width: 100%;
  padding: 6px 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.conn-funnel-chip:hover {
  border-color: var(--color-primary);
}

.conn-funnel-chip.highlighted {
  border-color: var(--color-primary);
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  font-weight: 600;
}

.conn-funnel-chip.dimmed {
  opacity: 0.25;
}

/* ── Paths column ──────────────────────────────────────────────────────── */

.conn-funnel-col--paths {
  gap: 8px;
  justify-content: center;
}

.conn-funnel-path {
  padding: 12px 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  cursor: default;
  transition: all 0.15s ease;
}

.conn-funnel-path:hover {
  border-color: var(--color-primary);
}

.conn-funnel-path.highlighted {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-subtle);
}

.conn-funnel-path.dimmed {
  opacity: 0.25;
}

.conn-funnel-path-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text);
}

.conn-funnel-path-type {
  font-size: 0.6875rem;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* ── Destination column ────────────────────────────────────────────────── */

.conn-funnel-col--destination {
  justify-content: center;
}

.conn-funnel-sonar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 20px;
  background: var(--color-bg);
  border: 2px solid var(--color-primary);
  border-radius: 10px;
  color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-subtle);
  transition: box-shadow 0.15s ease;
}

.conn-funnel-sonar span {
  font-weight: 650;
  font-size: 0.9375rem;
}

.conn-funnel-sonar.highlighted {
  box-shadow: 0 0 0 4px var(--color-primary-subtle);
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .conn-funnel {
    overflow-x: auto;
    min-width: 560px;
  }
}

/* --------------------------------------------------------------------------
   Device Profile — pick a provider, see its full data profile
   -------------------------------------------------------------------------- */

.device-profile {
  margin: 1.5em 0 2em;
}

/* ── Selector ──────────────────────────────────────────────────────────── */

.device-profile-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.device-profile-selector label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
  white-space: nowrap;
}

.device-profile-select {
  flex: 1;
  max-width: 320px;
  padding: 8px 32px 8px 12px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236b7a8d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.device-profile-select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

/* ── Empty state ───────────────────────────────────────────────────────── */

.device-profile-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
  background: var(--color-bg-secondary);
  border: 1px dashed var(--color-border-light);
  border-radius: 8px;
}

/* ── Connection info ───────────────────────────────────────────────────── */

.device-profile-connection {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.device-profile-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.device-profile-badge--sdk {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}

.device-profile-badge--cloud {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.device-profile-also {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.device-profile-also-link {
  color: var(--color-text-link);
  text-decoration: none;
}

.device-profile-also-link:hover {
  text-decoration: underline;
}

/* ── Summary line ──────────────────────────────────────────────────────── */

.device-profile-summary {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-light);
}

/* ── Category groups ───────────────────────────────────────────────────── */

.device-profile-categories {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.device-profile-category-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.device-profile-category-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text-heading);
}

.device-profile-category-count {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}

/* ── Metric chips ──────────────────────────────────────────────────────── */

.device-profile-category-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.device-profile-metric {
  display: inline-flex;
  padding: 4px 10px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.device-profile-metric:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border);
}

/* ── Missing categories (dimmed) ───────────────────────────────────────── */

.device-profile-category--empty {
  opacity: 0.4;
}

.device-profile-category--empty .device-profile-category-count {
  font-style: italic;
}

/* ── Content transition ───────────────────────────────────────────────── */

@keyframes device-profile-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.device-profile-content > * {
  animation: device-profile-fade-in 0.2s ease-out both;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .device-profile-selector {
    flex-direction: column;
    align-items: flex-start;
  }

  .device-profile-select {
    max-width: 100%;
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   FAQ Accordion — Collapsible question/answer pairs
   -------------------------------------------------------------------------- */

.faq-group {
  margin: 1em 0 1.5em;
}

.faq-item {
  border-bottom: 1px solid var(--color-border-light);
  transition: background-color 0.2s ease;
}

.faq-item:last-child {
  border-bottom: none;
}

/* Hide native disclosure markers */
.faq-item > summary { list-style: none; }
.faq-item > summary::-webkit-details-marker { display: none; }

.faq-item > summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 4px;
  cursor: pointer;
  user-select: none;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-heading);
  line-height: 1.5;
}

.faq-item > summary:hover {
  color: var(--color-primary);
}

/* Chevron indicator */
.faq-chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  margin-left: auto;
  position: relative;
  top: 1px;
}

.faq-chevron::before {
  content: '';
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  display: inline-block;
  padding: 3px;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.faq-item[open] > summary .faq-chevron::before {
  transform: rotate(45deg);
}

.faq-item[open] > summary {
  color: var(--color-primary);
}

.faq-body {
  padding: 0 4px 16px;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-text-secondary);
}

.faq-body p {
  margin-bottom: 0.75em;
}

.faq-body p:last-child {
  margin-bottom: 0;
}

.faq-body code {
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: var(--color-bg-inline-code);
}

.faq-body a {
  color: var(--color-text-link);
  text-decoration: none;
}

.faq-body a:hover {
  color: var(--color-text-link-hover);
  text-decoration: underline;
}
