/* ─── Docs Page: complete override of docs-specific layout ──────────── */
/* docs-page variables — scoped to light/dark themes */
:root, [data-theme="light"] {
  --bg:       #F6FAFA;
  --surface:  #ffffff;
  --surface2: #EEF8F7;
  --border:   #D8ECEB;
  --accent:   #01BEB2;
  --accent2:  #6058F8;
  --accent3:  #4372C3;
  --green:    #52B044;
  --yellow:   #F0BC2E;
  --red:      #dc2626;
  --sky:      #38B8C8;
  --navy:     #2B4B8A;
  --text:     #0D1E2C;
  --muted:    #3A5672;
  --code-bg:  #0D1E2C;
  --code-text:#C6F3F1;
  --inline-code-bg:  #E6F7F6;   /* light teal tint for inline code in light mode */
  --inline-code-fg:  #007A72;   /* darker teal — readable on light bg */
  --radius:   12px;
  --radius-sm:8px;
  --shadow:   0 1px 3px rgba(0,0,0,0.07), 0 4px 12px rgba(0,0,0,0.05);
  --callout-info-bg:   #E5FAF8; --callout-info-bd:   #A8E9E5;
  --callout-tip-bg:    #EDFAEB; --callout-tip-bd:    #A8DFAA;
  --callout-warn-bg:   #FFFAEC; --callout-warn-bd:   #F0DC8A;
  --callout-danger-bg: #fef2f2; --callout-danger-bd: #fecaca;
}
[data-theme="dark"] {
  --bg:       #0D1424;
  --surface:  #1B2335;
  --surface2: #1e2a3b;
  --border:   rgba(255,255,255,0.1);
  --text:     #e2f0ef;
  --muted:    rgba(226,240,239,0.6);
  --code-bg:  #0a1220;
  --shadow:   0 1px 3px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2);
  --inline-code-bg:  rgba(1,190,178,0.15);   /* subtle teal tint on dark */
  --inline-code-fg:  #01BEB2;
  --callout-info-bg:   rgba(1,190,178,0.1);  --callout-info-bd:   rgba(1,190,178,0.3);
  --callout-tip-bg:    rgba(82,176,68,0.1);  --callout-tip-bd:    rgba(82,176,68,0.3);
  --callout-warn-bg:   rgba(240,188,46,0.1); --callout-warn-bd:   rgba(240,188,46,0.3);
  --callout-danger-bg: rgba(239,68,68,0.1);  --callout-danger-bd: rgba(239,68,68,0.3);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  padding-top: 76px;
}

.badge.green  { border-color: rgba(82,176,68,0.6);   color: #A8DFAA; }
.badge.blue   { border-color: rgba(67,114,195,0.6);  color: #C6F3F1; }
.badge.purple { border-color: rgba(107,99,254,0.6);  color: #C5C2FF; }

/* ─── LAYOUT ─────────────────────────────────────────────────────────── */
/* Narrow content only for doc sections — siblings of hero that come after it.
   This deliberately excludes .header .container and .doc-nav .container
   so the header logo aligns identically to other pages. */
.docs-hero ~ .container { max-width: 1080px; margin: 0 auto; padding: 0 2rem; }
.section { padding: 1.1rem 0; }
.section.alt { background: var(--surface2); }
.section + .section { border-top: 1px solid var(--border); }

/* ─── TYPOGRAPHY ─────────────────────────────────────────────────────── */
h2 {
  font-size: 1.65rem; font-weight: 800; margin-bottom: 0.6rem;
  color: var(--text);
}
h3 { font-size: 1.05rem; font-weight: 700; margin: 1.1rem 0 0.5rem; color: var(--accent2); }
h4 { font-size: 0.95rem; font-weight: 700; margin: 1rem 0 0.45rem; color: var(--muted); }
p { margin-bottom: 0.9rem; color: var(--text); }
a { color: var(--accent3); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.5rem; margin-bottom: 0.9rem; }
li { margin-bottom: 0.3rem; }
strong { font-weight: 700; }

/* ─── CODE ───────────────────────────────────────────────────────────── */
pre {
  background: var(--code-bg); color: var(--code-text);
  border-radius: var(--radius-sm); padding: 1.15rem 1.4rem;
  overflow-x: auto; margin: 1rem 0; font-size: 13px;
  font-family: 'JetBrains Mono', monospace; line-height: 1.65;
  box-shadow: var(--shadow);
}
code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.875em;
  background: var(--inline-code-bg); color: var(--inline-code-fg);
  padding: 2px 6px; border-radius: 4px;
}
pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

/* ─── SYNTAX ─────────────────────────────────────────────────────────── */
.kw  { color: #c084fc; }
.fn  { color: #7dd3fc; }
.str { color: #86efac; }
.cm  { color: #64748b; font-style: italic; }
.num { color: #fdba74; }
.cls { color: #fde68a; }
.dec { color: #67e8f9; }

/* ─── CARDS ──────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.85rem 1rem; margin-bottom: 0.5rem;
}
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.5rem; margin: 0.75rem 0;
}
.card-grid .card { margin: 0; }
.card h3 { margin-top: 0; }
.card-icon { display: none; }

/* ─── CALLOUTS ───────────────────────────────────────────────────────── */
.callout {
  border-radius: var(--radius-sm); padding: 0.9rem 1.15rem;
  margin: 1rem 0; display: flex; gap: 0.7rem; align-items: flex-start;
}
.callout.info   { background: var(--callout-info-bg);   border: 1px solid var(--callout-info-bd); }
.callout.tip    { background: var(--callout-tip-bg);    border: 1px solid var(--callout-tip-bd); }
.callout.warn   { background: var(--callout-warn-bg);   border: 1px solid var(--callout-warn-bd); }
.callout.danger { background: var(--callout-danger-bg); border: 1px solid var(--callout-danger-bd); }
.callout-icon { font-size: 1.05rem; flex-shrink: 0; margin-top: 2px; }
.callout-body { flex: 1; }
.callout-body p { color: inherit; margin-bottom: 0; }

/* ─── TABLE ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 1rem 0; border-radius: var(--radius-sm); box-shadow: var(--shadow); overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
th {
  background: var(--surface2); text-align: left;
  padding: 9px 13px; font-weight: 700; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
td { padding: 9px 13px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

/* ─── STEPS ──────────────────────────────────────────────────────────── */
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  counter-increment: step;
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1rem 0; border-bottom: 1px solid var(--border);
}
.steps li:last-child { border-bottom: none; }
.step-num {
  flex-shrink: 0; width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: white;
}
.step-content h4 { margin-top: 3px; color: var(--text); }

/* ─── DETAILS ────────────────────────────────────────────────────────── */
details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin: 0.75rem 0;
  overflow: hidden; box-shadow: var(--shadow);
}
summary {
  padding: 0.8rem 1.2rem; cursor: pointer;
  font-weight: 700; list-style: none;
  display: flex; align-items: center; gap: 0.5rem;
  user-select: none; color: var(--text);
}
summary::-webkit-details-marker { display: none; }
summary::before { content: '▶'; font-size: 0.6rem; transition: transform 0.2s; color: var(--accent); }
details[open] summary::before { transform: rotate(90deg); }
.details-body { padding: 0 1.2rem 1.2rem; border-top: 1px solid var(--border); padding-top: 1rem; }

/* ─── TABS ───────────────────────────────────────────────────────────── */
.tabs { margin: 1.5rem 0; }
.tab-headers {
  display: flex; gap: 0; border-bottom: 2px solid var(--border);
  background: var(--surface2); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-headers::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0;
  background: none; border: none; color: var(--muted);
  padding: 0.6rem 1.1rem; font-size: 13px; font-weight: 700;
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.2s; font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--accent); background: rgba(1,190,178,0.06); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--surface); }
/* Scroll container: panels sit side-by-side; JS scrolls to the active one */
.tab-panels-scroll {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tab-panels-scroll::-webkit-scrollbar { display: none; }
.tab-panel {
  flex: 0 0 100%; min-width: 0; scroll-snap-align: start;
  padding-top: 1rem;
}

/* ─── PILLS ──────────────────────────────────────────────────────────── */
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 100px;
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
}
.pill.avail   { background: rgba(82,176,68,0.15);  color: #52B044; }
.pill.soon    { background: rgba(240,188,46,0.15); color: #C89A10; }
.pill.beta    { background: rgba(107,99,254,0.15); color: #9187FF; }
.pill.partial { background: rgba(56,184,200,0.15); color: #38B8C8; }
.pill.new     { background: rgba(82,176,68,0.15);  color: #52B044; }

/* ─── SVG WRAP ───────────────────────────────────────────────────────── */
.svg-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  margin: 1.5rem 0; box-shadow: var(--shadow);
}
.svg-wrap svg { display: block; width: 100%; }
/* The SVG itself carries its own background rect — transparent wrapper avoids double-bg */
[data-theme="dark"] .svg-wrap { background: transparent; }


/* ─── ACCENT BAR ─────────────────────────────────────────────────────── */
.accent-bar { display: none; }

/* ─── RESPONSIVE ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  body { padding-top: 68px; }
  html { scroll-padding-top: 72px; }
}
@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
}
/* Screen-reader only utility */
.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;
}

/* ── BREADCRUMB ────────────────────────────────────────────────── */
.docs-breadcrumb {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 2rem 0;
  font-size: 13px;
  color: var(--muted);
}
.docs-breadcrumb a { color: var(--accent); text-decoration: none; }
.docs-breadcrumb a:hover { text-decoration: underline; }
.docs-breadcrumb .sep { margin: 0 0.4rem; color: var(--border); }

/* ── PREV / NEXT PAGER ────────────────────────────────────────── */
.docs-pager {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  padding: 2rem 2rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  font-size: 14px;
  font-weight: 600;
}
.docs-pager a { color: var(--accent); text-decoration: none; }
.docs-pager a:hover { text-decoration: underline; }
.docs-pager .pager-spacer { flex: 1; }
