/* ========================================
   PAYUEE DOCS — VANILLA CSS
   ======================================== */

/* ----- CSS VARIABLES ----- */
:root {
  --bg: #ffffff;
  --bg-secondary: #f8f9fb;
  --bg-tertiary: #f1f3f7;
  --surface: #ffffff;
  --border: #e5e8ef;
  --border-hover: #c9cdd8;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --accent: #5b6af8;
  --accent-light: #eef0ff;
  --accent-dark: #4252e0;
  --green: #10b981;
  --green-light: #ecfdf5;
  --red: #ef4444;
  --red-light: #fef2f2;
  --yellow: #f59e0b;
  --yellow-light: #fffbeb;
  --blue: #3b82f6;
  --blue-light: #eff6ff;
  --code-bg: #f6f8fa;
  --code-text: #374151;
  --code-border: #e5e8ef;
  --response-bg: #0d1117;
  --response-text: #e6edf3;
  --sidebar-width: 260px;
  --toc-width: 220px;
  --topnav-height: 60px;
  --radius: 8px;
  --radius-sm: 5px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 12px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.04);
  --shadow-lg: 0 20px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', Menlo, monospace;
  --transition: all .2s ease;
}

[data-theme="dark"] {
  --bg: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --surface: #161b22;
  --border: #30363d;
  --border-hover: #484f58;
  --text-primary: #e6edf3;
  --text-secondary: #8d96a0;
  --text-muted: #6e7681;
  --accent: #7c8ff9;
  --accent-light: #1a1f3a;
  --accent-dark: #6475f7;
  --green: #3fb950;
  --green-light: #0f2a1a;
  --red: #f85149;
  --red-light: #2d1115;
  --yellow: #d29922;
  --yellow-light: #261e00;
  --blue: #58a6ff;
  --blue-light: #0d2137;
  --code-bg: #161b22;
  --code-text: #e6edf3;
  --code-border: #30363d;
  --response-bg: #0d1117;
  --response-text: #e6edf3;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow: 0 4px 12px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.2);
  --shadow-lg: 0 20px 40px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.3);
}

/* ----- RESET ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.7;
  transition: background .25s, color .25s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: var(--mono);
  font-size: .875em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--code-border);
  color: var(--accent);
}
ul { list-style: none; }
img { max-width: 100%; }

/* ----- TOP NAV ----- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topnav-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(var(--bg), .95);
}
[data-theme="dark"] .topnav { background: rgba(13,17,23,.95); }
.topnav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
}
.topnav-brand { flex-shrink: 0; }
.brand-logo { display: flex; align-items: center; gap: 8px; }
.brand-icon {
  width: 30px; height: 30px;
  background: var(--accent);
  color: white;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.brand-name { font-weight: 700; font-size: 17px; color: var(--text-primary); }
.brand-badge {
  font-size: 11px; font-weight: 600;
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 100px;
}
.topnav-links { display: flex; gap: 4px; margin-left: 16px; }
.nav-link {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: var(--transition);
}
.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
  text-decoration: none;
}
.topnav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  cursor: text;
  min-width: 240px;
  transition: var(--transition);
  color: var(--text-muted);
}
.search-bar:hover { border-color: var(--border-hover); }
.search-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.search-bar input {
  border: none; outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-primary);
  font-family: var(--font);
  flex: 1;
  min-width: 0;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar kbd {
  font-size: 11px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font);
  color: var(--text-muted);
  flex-shrink: 0;
}
.theme-toggle {
  width: 34px; height: 34px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}
.theme-toggle:hover { background: var(--bg-secondary); color: var(--text-primary); }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
.btn-primary {
  background: var(--accent);
  color: white;
  padding: 7px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-dark); text-decoration: none; }
.mobile-menu-toggle { display: none; background: transparent; border: none; cursor: pointer; color: var(--text-primary); }

/* ----- SEARCH OVERLAY ----- */
.search-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  padding: 80px 20px 20px;
  backdrop-filter: blur(4px);
}
.search-overlay.visible { display: flex; align-items: flex-start; justify-content: center; }
.search-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 640px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.search-modal-input {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.search-modal-input input {
  flex: 1; border: none; outline: none;
  font-size: 16px; background: transparent;
  color: var(--text-primary); font-family: var(--font);
}
.search-modal-input input::placeholder { color: var(--text-muted); }
.search-close {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
}
.search-results { max-height: 400px; overflow-y: auto; }
.search-result-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-secondary); }
.search-result-section { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-bottom: 2px; }
.search-result-title { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.search-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* ----- LAYOUT ----- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--toc-width);
  min-height: calc(100vh - var(--topnav-height));
  max-width: 1400px;
  margin: 0 auto;
}

/* ----- SIDEBAR ----- */
.sidebar {
  position: sticky;
  top: var(--topnav-height);
  height: calc(100vh - var(--topnav-height));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar-inner { padding: 24px 16px; }
.sidebar-section { margin-bottom: 24px; }
.sidebar-section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted);
  padding: 0 8px 8px;
  display: block;
}
.sidebar-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}
.sidebar-link:hover { color: var(--text-primary); background: var(--bg-secondary); text-decoration: none; }
.sidebar-link.active { color: var(--accent); background: var(--accent-light); font-weight: 500; }
.sidebar-link--method { padding-left: 36px; font-family: var(--mono); font-size: 13px; }
.sidebar-link--method::before {
  content: attr(data-method);
  position: absolute;
  left: 10px;
  font-size: 10px; font-weight: 700;
  font-family: var(--font);
  padding: 1px 4px;
  border-radius: 3px;
}
.sidebar-link.get::before { content: 'GET'; background: var(--green-light); color: var(--green); }
.sidebar-link.post::before { content: 'POST'; background: var(--blue-light); color: var(--blue); }

/* ----- CONTENT ----- */
.content {
  padding: 0;
  min-width: 0;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

/* ----- TOC RAIL ----- */
.toc-rail {
  position: sticky;
  top: var(--topnav-height);
  height: calc(100vh - var(--topnav-height));
  overflow-y: auto;
  padding: 32px 24px;
  border-left: 1px solid var(--border);
  scrollbar-width: thin;
}
.toc-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 12px; }
.toc-list { display: flex; flex-direction: column; gap: 2px; }
.toc-item {
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border-left: 2px solid transparent;
}
.toc-item:hover { color: var(--text-secondary); background: var(--bg-secondary); }
.toc-item.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-light); }

/* ----- SECTIONS ----- */
.doc-section {
  padding: 60px 48px;
  border-bottom: 1px solid var(--border);
}
.doc-section:last-of-type { border-bottom: none; }
.section-label {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 10px;
}
.section-title {
  font-size: 28px; font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -.02em;
}
.section-body { color: var(--text-secondary); margin-bottom: 28px; max-width: 640px; }
.subsection-title {
  font-size: 17px; font-weight: 600;
  color: var(--text-primary);
  margin-top: 36px; margin-bottom: 14px;
  letter-spacing: -.01em;
}
.text-link { color: var(--accent); }
.text-link:hover { text-decoration: underline; }

/* ----- HERO ----- */
.hero-section {
  padding: 80px 48px 64px;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-secondary) 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--accent-light) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green-light);
  color: var(--green);
  font-size: 12px; font-weight: 600;
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 24px;
}
.status-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.hero-title {
  font-size: 48px; font-weight: 800;
  line-height: 1.1; letter-spacing: -.03em;
  color: var(--text-primary);
  margin-bottom: 18px;
  max-width: 600px;
}
.hero-subtitle { font-size: 17px; color: var(--text-secondary); margin-bottom: 32px; max-width: 520px; line-height: 1.65; }
.hero-actions { display: flex; gap: 12px; margin-bottom: 48px; flex-wrap: wrap; }
.btn-primary-lg {
  background: var(--accent);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 15px; font-weight: 600;
  transition: var(--transition);
  display: inline-flex; align-items: center;
}
.btn-primary-lg:hover { background: var(--accent-dark); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost-lg {
  color: var(--text-primary);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 15px; font-weight: 600;
  transition: var(--transition);
  display: inline-flex; align-items: center;
}
.btn-ghost-lg:hover { background: var(--bg-secondary); text-decoration: none; }
.hero-stats { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.stat { }
.stat-value { font-size: 22px; font-weight: 700; color: var(--text-primary); letter-spacing: -.02em; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-divider { width: 1px; height: 36px; background: var(--border); }

/* ----- FEATURE GRID ----- */
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}
.feature-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.feature-icon { font-size: 24px; margin-bottom: 12px; }
.feature-card h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* ----- MERMAID ----- */
.mermaid-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin: 24px 0;
  overflow-x: auto;
}
.mermaid { text-align: center; }
.mermaid svg { max-width: 100%; }

/* ----- FLOW STEPS ----- */
.core-flow { margin-top: 36px; }
.flow-steps { display: flex; flex-direction: column; gap: 0; }
.flow-step {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 16px 0;
  border-left: 2px solid var(--border);
  padding-left: 24px;
  position: relative;
  margin-left: 16px;
}
.flow-step::before {
  content: '';
  position: absolute;
  left: -8px; top: 20px;
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid var(--bg);
}
.flow-step:last-child { border-left-color: transparent; }
.flow-step-num {
  font-size: 12px; font-weight: 700;
  color: var(--accent);
  min-width: 28px; margin-top: 1px;
}
.flow-step-content strong { display: block; font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.flow-step-content span { font-size: 13px; color: var(--text-secondary); }

/* ----- CALLOUTS ----- */
.callout {
  display: flex; gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid;
  margin: 20px 0;
}
.callout-info { background: var(--blue-light); border-color: var(--blue); }
.callout-warning { background: var(--yellow-light); border-color: var(--yellow); }
.callout-error { background: var(--red-light); border-color: var(--red); }
.callout-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.callout-body { font-size: 14px; color: var(--text-primary); line-height: 1.6; }
.callout-body strong { font-weight: 600; }
.callout-body code { font-size: 12px; }

/* ----- CODE BLOCKS ----- */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
}
.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--code-border);
}
.code-lang {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  font-family: var(--font);
}
.copy-btn {
  font-size: 12px; font-weight: 500;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font);
  transition: var(--transition);
}
.copy-btn:hover { background: var(--bg); color: var(--text-primary); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }
.code-block pre {
  padding: 20px;
  overflow-x: auto;
  margin: 0;
}
.code-block code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--code-text);
  white-space: pre;
}

/* ----- TOKEN COLORS ----- */
.token-comment { color: #6b7280; font-style: italic; }
.token-string { color: #059669; }
.token-number { color: #d97706; }
.token-boolean { color: #7c3aed; }
.token-key { color: #0ea5e9; }
.token-keyword { color: #8b5cf6; }
.token-fn { color: #f59e0b; }
.token-interpolation { color: var(--accent); }
.token-decorator { color: #ec4899; }
[data-theme="dark"] .token-comment { color: #6e7681; }
[data-theme="dark"] .token-string { color: #3fb950; }
[data-theme="dark"] .token-number { color: #ffa657; }
[data-theme="dark"] .token-boolean { color: #d2a8ff; }
[data-theme="dark"] .token-key { color: #79c0ff; }
[data-theme="dark"] .token-keyword { color: #d2a8ff; }
[data-theme="dark"] .token-fn { color: #ffa657; }

/* ----- RESPONSE BLOCK ----- */
.response-block {
  background: var(--response-bg);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
  border: 1px solid #30363d;
}
.response-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
}
.response-block pre { padding: 20px; overflow-x: auto; }
.response-block code {
  font-family: var(--mono);
  font-size: 13px; line-height: 1.7;
  background: transparent; border: none; padding: 0;
  color: var(--response-text);
  white-space: pre;
}
.response-status { font-size: 12px; font-weight: 700; font-family: var(--mono); padding: 2px 8px; border-radius: 4px; }
.response-status.success { background: rgba(16,185,129,.15); color: #3fb950; }
.response-status.error { background: rgba(248,81,73,.15); color: #f85149; }

/* ----- TABLES ----- */
.table-container { overflow-x: auto; margin: 16px 0; border-radius: var(--radius); border: 1px solid var(--border); }
.doc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-table thead tr { background: var(--bg-secondary); }
.doc-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.doc-table td {
  padding: 12px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.doc-table td code { font-size: 12px; }
.doc-table tr:last-child td { border-bottom: none; }
.doc-table tbody tr { transition: var(--transition); }
.doc-table tbody tr:hover { background: var(--bg-secondary); }
.required { color: var(--red); font-size: 11px; font-weight: 600; background: var(--red-light); padding: 2px 6px; border-radius: 3px; }

/* ----- BADGES ----- */
.badge {
  font-size: 11px; font-weight: 700;
  font-family: var(--mono);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-yellow { background: var(--yellow-light); color: var(--yellow); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-gray { background: var(--bg-tertiary); color: var(--text-muted); }

/* ----- ENV CARDS ----- */
.env-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.env-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}
.env-card:hover { box-shadow: var(--shadow); }
.env-card--production { border-color: var(--green); }
.env-card--sandbox { border-color: var(--border); }
.env-header { margin-bottom: 12px; }
.env-badge {
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 100px;
  text-transform: uppercase; letter-spacing: .05em;
}
.env-badge--sandbox { background: var(--bg-tertiary); color: var(--text-muted); }
.env-badge--production { background: var(--green-light); color: var(--green); }
.env-url { font-family: var(--mono); font-size: 13px; color: var(--accent); margin-bottom: 16px; word-break: break-all; }
.env-features { display: flex; flex-direction: column; gap: 8px; }
.env-features li {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 18px;
  position: relative;
}
.env-features li::before {
  content: '✓';
  position: absolute; left: 0;
  color: var(--green); font-weight: 700;
  font-size: 12px;
}

/* ----- CONCEPT DIAGRAM ----- */
.concept-diagram { display: flex; align-items: center; gap: 16px; margin: 28px 0; flex-wrap: wrap; }
.concept-box {
  border-radius: var(--radius);
  padding: 20px 28px;
  text-align: center;
  flex: 1; min-width: 160px;
}
.concept-box--blue { background: var(--blue-light); border: 1px solid var(--blue); }
.concept-box--purple { background: var(--accent-light); border: 1px solid var(--accent); }
.concept-box--green { background: var(--green-light); border: 1px solid var(--green); }
.concept-box-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 6px; }
.concept-box-value { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.concept-arrow { font-size: 20px; color: var(--text-muted); flex-shrink: 0; }

/* ----- INFO GRID ----- */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.info-item {
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.info-item h4 { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.info-item p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.info-item code { font-size: 11px; }

/* ----- LIFECYCLE ----- */
.lifecycle-states {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin: 24px 0 12px;
}
.lifecycle-state {
  font-size: 11px; font-weight: 700; font-family: var(--mono);
  padding: 6px 12px; border-radius: 4px;
}
.lifecycle-arrow { color: var(--text-muted); font-size: 18px; }
.state-created { background: var(--bg-tertiary); color: var(--text-muted); }
.state-locked { background: var(--blue-light); color: var(--blue); }
.state-confirmed { background: var(--blue-light); color: var(--blue); }
.state-delivered { background: var(--green-light); color: var(--green); }
.state-released { background: var(--green-light); color: var(--green); }
.state-hold { background: var(--yellow-light); color: var(--yellow); }
.state-failed { background: var(--red-light); color: var(--red); }
.state-refunded { background: var(--red-light); color: var(--red); }
.state-cancelled { background: var(--bg-tertiary); color: var(--text-muted); }
.lifecycle-alt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.alt-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-right: 4px; }

/* ----- SETTLEMENT ----- */
.settlement-example {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 440px;
  margin-top: 24px;
}
.settlement-title {
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-tertiary);
}
.settlement-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.settlement-row--vendor { background: var(--green-light); border-bottom: none; }
.settlement-label { font-size: 14px; color: var(--text-secondary); }
.settlement-value { font-size: 15px; font-weight: 600; font-family: var(--mono); }
.settlement-total { color: var(--text-primary); }
.settlement-fee { color: var(--red); }
.settlement-vendor { color: var(--green); }

/* ----- VERIFICATION ----- */
.verification-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.verify-method {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.verify-icon { font-size: 28px; margin-bottom: 12px; }
.verify-method h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; }
.verify-method p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }
.verify-steps { display: flex; flex-direction: column; gap: 8px; }
.verify-step {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-secondary);
}
.verify-step span {
  width: 22px; height: 22px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}

/* ----- API ENDPOINT ----- */
.api-endpoint { }
.endpoint-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.method-badge {
  font-family: var(--mono);
  font-size: 11px; font-weight: 800;
  padding: 4px 10px;
  border-radius: 5px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.method-get { background: var(--green-light); color: var(--green); }
.method-post { background: var(--blue-light); color: var(--blue); }
.method-put { background: var(--yellow-light); color: var(--yellow); }
.method-delete { background: var(--red-light); color: var(--red); }
.endpoint-path {
  font-family: var(--mono);
  font-size: 18px; font-weight: 600;
  background: transparent; border: none; padding: 0;
  color: var(--text-primary);
}
.base-url {
  font-family: var(--mono);
  font-size: 14px;
  background: var(--code-bg); border: 1px solid var(--code-border);
  padding: 4px 10px; border-radius: var(--radius-sm);
  color: var(--accent);
}

/* ----- TABS ----- */
.tabs { margin-top: 20px; }
.tab-list {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  font-size: 14px; font-weight: 500;
  padding: 8px 16px;
  background: transparent; border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: var(--font);
  transition: var(--transition);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ----- LANG TABS ----- */
.code-tabs { margin-top: 20px; }
.lang-tabs { display: flex; gap: 4px; margin-bottom: 0; background: var(--bg-tertiary); padding: 4px; border-radius: var(--radius) var(--radius) 0 0; border: 1px solid var(--border); border-bottom: none; }
.lang-tab {
  font-size: 13px; font-weight: 500;
  padding: 6px 14px;
  background: transparent; border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 5px;
  font-family: var(--font);
  transition: var(--transition);
}
.lang-tab:hover { color: var(--text-primary); background: var(--bg); }
.lang-tab.active { background: var(--bg); color: var(--accent); font-weight: 600; }
.lang-panel { display: none; }
.lang-panel.active { display: block; }
.lang-panel .code-block { border-radius: 0 0 var(--radius) var(--radius); margin-top: 0; }

/* ----- WEBHOOKS ----- */
.webhook-events { display: flex; flex-direction: column; gap: 24px; margin-top: 20px; }
.webhook-event { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.webhook-event-name { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.webhook-event-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; }

/* ----- SDK GRID ----- */
.sdk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0; }
.sdk-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: var(--transition);
}
.sdk-card:hover { border-color: var(--accent); }
.sdk-icon { font-size: 28px; margin-bottom: 8px; }
.sdk-card h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; }
.sdk-install {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--code-text);
  word-break: break-all;
}

/* ----- SECURITY GRID ----- */
.security-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.security-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.security-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.security-icon { font-size: 22px; }
.security-card h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.security-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.security-list li {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative; line-height: 1.55;
}
.security-list li::before { content: '→'; position: absolute; left: 0; color: var(--accent); font-size: 12px; }
.security-list code { font-size: 11px; }

/* ----- FOOTER ----- */
.doc-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 32px 48px;
}
.footer-inner { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-links { display: flex; gap: 20px; margin-left: auto; }
.footer-links a { font-size: 13px; color: var(--text-muted); transition: var(--transition); }
.footer-links a:hover { color: var(--text-primary); text-decoration: none; }
.footer-copy { font-size: 12px; color: var(--text-muted); width: 100%; margin-top: 8px; }

/* ----- MOBILE SIDEBAR TOGGLE ----- */
.mobile-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 90;
  width: 48px; height: 48px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow);
  align-items: center; justify-content: center;
}

/* ----- RESPONSIVE ----- */
@media (max-width: 1200px) {
  .toc-rail { display: none; }
  .layout { grid-template-columns: var(--sidebar-width) 1fr; }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: var(--topnav-height); left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--topnav-height));
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 80;
    background: var(--bg);
    border-right: 1px solid var(--border);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-sidebar-toggle { display: flex; }
  .doc-section, .hero-section { padding: 40px 24px; }
  .feature-grid, .info-grid, .security-grid, .verification-methods { grid-template-columns: 1fr; }
  .env-cards, .sdk-grid { grid-template-columns: 1fr; }
  .topnav-links { display: none; }
  .search-bar { min-width: 160px; }
  .hero-title { font-size: 34px; }
  .hero-stats { gap: 16px; }
  .stat-divider { display: none; }
  .mobile-sidebar-toggle { display: flex; }
}

@media (max-width: 600px) {
  .search-bar { display: none; }
  .topnav-actions { gap: 6px; }
  .hero-section { padding: 32px 20px; }
  .doc-section { padding: 36px 20px; }
  .mobile-menu-toggle { display: flex; }
}

.settlement-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0 24px 0;
}

.settlement-inputs input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
  background: #fff;
}

.settlement-inputs input:focus {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.settlement-inputs input::placeholder {
  color: #9ca3af;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
  .settlement-inputs {
    grid-template-columns: 1fr;
  }
}

.settlement-example {
  padding: 20px;
  border-radius: 14px;
}

.settlement-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 12px;
}

.scrollable-code {
  max-height: 500px;
  overflow: auto;
  padding: 16px;
  border-radius: 10px;
  font-size: 13px;
}

.calc-container {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: monospace;
}

.calc-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calc-group label {
  font-size: 12px;
  color: #aaa;
}

.calc-group input {
  padding: 10px;
  border-radius: 6px;
  outline: none;
}

.calc-group input:focus {
  border-color: #4ade80;
}

.calc-result {
  margin-top: 10px;
  padding: 14px;
  border-radius: 8px;
  line-height: 1.6;
  font-size: 13px;
}

.scrollable-tabs {
  display: flex;
  gap: 8px;

  overflow-x: auto;
  overflow-y: hidden;

  white-space: nowrap;

  padding-bottom: 8px;

  /* smooth scrolling on mobile */
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* hide ugly scrollbar (optional but clean) */
.scrollable-tabs::-webkit-scrollbar {
  height: 6px;
}

.scrollable-tabs::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.scrollable-tabs::-webkit-scrollbar-track {
  background: transparent;
}

/* keep buttons from shrinking */
.scrollable-tabs .tab-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.scrollable-tabs {
  mask-image: linear-gradient(
    to right,
    transparent,
    black 20px,
    black calc(100% - 20px),
    transparent
  );
}

.callout {
  max-width: 100%;
}

.callout-body {
  min-width: 0; /* 🔥 critical for flex layouts */
}

.callout-body pre {
  background: #2c2a2a;
  padding: 12px;
  border-radius: 8px;
  color: #fff;

  max-width: 100%;
  overflow-x: auto;

  font-size: 13px;
  line-height: 1.4;
}

.callout-body pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.sidebar {
  transition: transform 0.3s ease;
}

.sidebar.active {
  transform: translateX(0);
}

.sort-dropdown {
  margin-top: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
}

.sort-dropdown summary {
  cursor: pointer;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #7dd3fc;
  list-style: none;
  user-select: none;
  transition: background 0.2s ease;
}

.sort-dropdown summary:hover {
  background: rgba(255,255,255,0.04);
}

.sort-dropdown summary::-webkit-details-marker {
  display: none;
}

.sort-dropdown summary::after {
  content: "▾";
  float: right;
  transition: transform 0.2s ease;
}

.sort-dropdown[open] summary::after {
  transform: rotate(180deg);
}

.sort-options {
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sort-option {
  padding: 12px 14px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.sort-option:last-child {
  border-bottom: none;
}

.sort-option code {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}