/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; width: 100%; overflow-x: hidden; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: #0e1424;
  color: #d4d4d4;
  line-height: 1.65;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.docs-wrap {
  padding-top: 58px;
}

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.docs-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: rgba(14,20,36,0.95);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #1e2840;
  height: 58px;
  display: flex;
  align-items: center;
}
.docs-nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: -0.01em;
}
.nav-brand .gold { color: #f59e0b; }
.nav-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: #6b7280;
  background: #1a2238;
  border: 1px solid #252525;
  border-radius: 5px;
  padding: 0.15rem 0.5rem;
  letter-spacing: 0.03em;
}
.nav-right { display: flex; align-items: center; gap: 1.25rem; }
.nav-link { font-size: 0.85rem; color: #6b7280; transition: color 0.15s; }
.nav-link:hover { color: #d4d4d4; }
@media (max-width: 640px) {
  .nav-right .nav-link { display: none; }
  .nav-right .btn-gold { display: none; }
}
.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f59e0b;
  color: #000;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.42rem 1rem;
  border-radius: 7px;
  transition: background 0.15s;
}
.btn-gold:hover { background: #fbbf24; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.docs-sidebar {
  position: fixed;
  top: 58px;
  left: 0;
  width: 256px;
  height: calc(100vh - 58px);
  overflow-y: auto;
  background: #0c1220;
  border-right: 1px solid #1e2840;
  padding: 1.75rem 0.85rem;
  z-index: 200;
  scrollbar-width: thin;
  scrollbar-color: #1e2840 transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: #1e2840; border-radius: 99px; }

.sb-group {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8090a8;
  padding: 0 0.75rem;
  margin: 1.4rem 0 0.45rem;
}
.sb-group:first-child { margin-top: 0.25rem; }
.sb-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.46rem 0.75rem;
  border-radius: 7px;
  font-size: 0.84rem;
  color: #888;
  transition: all 0.13s;
  cursor: pointer;
}
.sb-link i { font-size: 0.72rem; width: 14px; text-align: center; opacity: 0.7; flex-shrink: 0; }
.sb-link:hover { background: #1a2238; color: #c8c8c8; }
.sb-link:hover i { opacity: 1; }
.sb-link.active { background: rgba(245,158,11,0.1); color: #f59e0b; font-weight: 600; }
.sb-link.active i { opacity: 1; }

/* ── Main ─────────────────────────────────────────────────────────────────── */
.docs-main {
  margin-left: 256px;
  padding: 2.5rem 3rem 5rem 2.75rem;
  max-width: 960px;
}

/* ── Section ──────────────────────────────────────────────────────────────── */
section {
  margin-bottom: 4rem;
  scroll-margin-top: 78px;
}
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f59e0b;
  margin-bottom: 0.7rem;
}
.section-label i { font-size: 0.6rem; }
h2 {
  font-size: 1.55rem;
  font-weight: 800;
  color: #f5f5f5;
  letter-spacing: -0.025em;
  margin-bottom: 0.6rem;
}
h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e0e0e0;
  margin: 1.75rem 0 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
h3 .lang-pill {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  letter-spacing: 0.04em;
}
.pill-curl    { background: rgba(245,158,11,0.1); color: #f59e0b; }
.pill-php     { background: rgba(139,92,246,0.1); color: #a78bfa; }
.pill-python  { background: rgba(52,211,153,0.1); color: #34d399; }
.pill-js      { background: rgba(251,191,36,0.1);  color: #fbbf24; }
.pill-json    { background: rgba(96,165,250,0.1);  color: #60a5fa; }

p {
  font-size: 0.915rem;
  color: #808080;
  line-height: 1.75;
  margin-bottom: 0.85rem;
}
p strong { color: #c0c0c0; font-weight: 600; }

/* ── Divider ──────────────────────────────────────────────────────────────── */
.section-divider {
  border: none;
  border-top: 1px solid #1e2840;
  margin: 0 0 4rem;
}

/* ── Info cards ───────────────────────────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin: 1.25rem 0;
}
.info-card {
  background: #0c1220;
  border: 1px solid #1e2840;
  border-radius: 10px;
  padding: 1.1rem 1.15rem;
}
.info-card-label {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #3d3d3d;
  margin-bottom: 0.45rem;
}
.info-card-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: #d4d4d4;
}

/* ── Alert box ────────────────────────────────────────────────────────────── */
.alert {
  border-radius: 10px;
  padding: 1rem 1.15rem;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 1.1rem 0;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.alert i { margin-top: 0.15rem; flex-shrink: 0; font-size: 0.85rem; }
.alert-gold { background: rgba(245,158,11,0.07); border: 1px solid rgba(245,158,11,0.18); color: #a16207; }
.alert-gold i, .alert-gold a { color: #f59e0b; }
.alert-blue { background: rgba(96,165,250,0.06); border: 1px solid rgba(96,165,250,0.15); color: #4b7db5; }
.alert-blue i { color: #60a5fa; }

/* ── Method badge ─────────────────────────────────────────────────────────── */
.method-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #0c1220;
  border: 1px solid #1e2840;
  border-radius: 10px;
  padding: 0.9rem 1.15rem;
  margin: 1rem 0 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
}
.badge-post {
  background: rgba(52,211,153,0.1);
  color: #34d399;
  border: 1px solid rgba(52,211,153,0.2);
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.endpoint-path { color: #f5f5f5; }
.endpoint-base { color: #4b5563; }

/* ── Code block ───────────────────────────────────────────────────────────── */
.code-wrap {
  position: relative;
  margin: 0.5rem 0 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #1e2840;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0c1220;
  border-bottom: 1px solid #1e2840;
  padding: 0.55rem 1.1rem;
}
.code-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.code-dots { display: flex; gap: 5px; }
.code-dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red    { background: #3d1515; }
.dot-yellow { background: #3d3115; }
.dot-green  { background: #153d1f; }
.code-filename {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #4b5563;
}
.copy-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #4b5563;
  background: none;
  border: 1px solid #1e2840;
  border-radius: 5px;
  padding: 0.25rem 0.65rem;
  cursor: pointer;
  transition: all 0.13s;
  font-family: 'Inter', sans-serif;
}
.copy-btn:hover { background: #1a2238; color: #9ca3af; border-color: #1e2840; }
.copy-btn.copied { color: #34d399; border-color: rgba(52,211,153,0.3); }

pre {
  background: #0e1424;
  padding: 1.35rem 1.4rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.75;
  color: #d4d4d4;
  margin: 0;
  tab-size: 2;
  scrollbar-width: thin;
  scrollbar-color: #1e2840 transparent;
}
pre::-webkit-scrollbar { height: 4px; }
pre::-webkit-scrollbar-thumb { background: #1e2840; border-radius: 99px; }

/* Syntax tokens */
.tk-key    { color: #60a5fa; }          /* JSON key — blue */
.tk-str    { color: #86efac; }          /* string value — green */
.tk-num    { color: #fb923c; }          /* number — orange */
.tk-bool   { color: #c084fc; }          /* true/false — purple */
.tk-null   { color: #6b7280; }          /* null — gray */
.tk-punc   { color: #374151; }          /* brackets — dim */
.tk-cmd    { color: #f59e0b; }          /* shell command — gold */
.tk-flag   { color: #60a5fa; }          /* -H, -X flags — blue */
.tk-url    { color: #a5b4fc; }          /* URLs */
.tk-cmt    { color: #374151; font-style: italic; } /* comments */
.tk-meth   { color: #34d399; font-weight: 600; }  /* POST GET */
.tk-var    { color: #f0abfc; }          /* variables — pink */
.tk-ret    { color: #fb7185; }          /* retrograde badge */
.tk-comb   { color: #f97316; }          /* combust badge */

/* ── Param table ──────────────────────────────────────────────────────────── */
.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  margin: 0.75rem 0 1.5rem;
}
.param-table thead th {
  background: #0c1220;
  padding: 0.65rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #3d3d3d;
  border-bottom: 1px solid #1e2840;
}
.param-table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #1e2840;
  vertical-align: top;
  color: #808080;
  line-height: 1.55;
}
.param-table tbody tr:last-child td { border-bottom: none; }
.param-table tbody tr:hover td { background: rgba(255,255,255,0.012); }
.param-table code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #60a5fa;
  background: rgba(96,165,250,0.07);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.param-table td:first-child code { color: #a5b4fc; }
.tag-req {
  display: inline-block;
  background: rgba(239,68,68,0.09);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.15);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.tag-opt {
  display: inline-block;
  background: #111827;
  color: #4b5563;
  border: 1px solid #1e2840;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ── Error table ──────────────────────────────────────────────────────────── */
.error-table { width:100%; border-collapse:collapse; font-size:0.84rem; }
.error-table th { background:#0c1220; padding:0.6rem 0.9rem; text-align:left; font-size:0.68rem; font-weight:700; text-transform:uppercase; letter-spacing:0.07em; color:#3d3d3d; border-bottom:1px solid #1e2840; }
.error-table td { padding:0.7rem 0.9rem; border-bottom:1px solid #1e2840; color:#6b7280; font-size:0.83rem; vertical-align:middle; }
.error-table tr:last-child td { border-bottom:none; }
.http-badge { font-family:'JetBrains Mono',monospace; font-size:0.78rem; font-weight:600; padding:0.15rem 0.45rem; border-radius:4px; }
.http-4 { background:rgba(239,68,68,0.08); color:#f87171; }
.http-5 { background:rgba(249,115,22,0.08); color:#fb923c; }

/* ── Plan table ───────────────────────────────────────────────────────────── */
.plan-table { width:100%; border-collapse:collapse; font-size:0.84rem; }
.plan-table th { background:#0c1220; padding:0.6rem 1rem; text-align:left; font-size:0.68rem; font-weight:700; text-transform:uppercase; letter-spacing:0.07em; color:#3d3d3d; border-bottom:1px solid #1e2840; }
.plan-table td { padding:0.75rem 1rem; border-bottom:1px solid #1e2840; color:#808080; }
.plan-table tr:last-child td { border-bottom:none; }
.plan-name { font-weight:700; color:#d4d4d4; }
.plan-price { font-family:'JetBrains Mono',monospace; font-size:0.82rem; }

/* ── Table scroll wrapper (prevents mobile horizontal overflow) ─────────────── */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #1e2840 transparent;
  border-radius: 10px;
}
.table-scroll::-webkit-scrollbar { height: 4px; }
.table-scroll::-webkit-scrollbar-thumb { background: #1e2840; border-radius: 99px; }
.table-scroll .param-table,
.table-scroll .error-table,
.table-scroll .plan-table { min-width: 540px; }

/* ── Mobile ───────────────────────────────────────────────────────────────── */
#mob-menu { display: none; }

@media (max-width: 900px) {
  .docs-sidebar { display: none; }
  .docs-main { margin-left: 0; padding: 1.75rem 1.15rem 4rem; max-width: 100%; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  #mob-menu { display: flex; }
  pre { font-size: 0.78rem; }
}
@media (max-width: 560px) {
  .info-grid { grid-template-columns: 1fr; }
  h2 { font-size: 1.28rem; }
  p { font-size: 0.9rem; }
  .docs-main { padding: 1.5rem 1rem 4rem; }
  .method-row { font-size: 0.78rem; padding: 0.75rem 0.9rem; flex-wrap: wrap; gap: 0.5rem; }
  .alert { font-size: 0.84rem; }
}

/* Mobile sidebar overlay */
.mob-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.75); z-index:200; backdrop-filter:blur(2px); }
.mob-overlay.open { display:block; }
.mob-sidebar {
  position:fixed; top:0; left:0; width:270px; height:100vh;
  background:#0c1220; border-right:1px solid #1e2840;
  z-index:201; padding:1.25rem 0.85rem 2rem; overflow-y:auto;
  transform:translateX(-100%); transition:transform 0.22s cubic-bezier(0.4,0,0.2,1);
}
.mob-sidebar.open { transform:translateX(0); }
.mob-sidebar-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:0 0.75rem; margin-bottom:1.25rem; border-bottom:1px solid #1e2840; padding-bottom:1rem;
}
.mob-sidebar-close {
  background:none; border:none; color:#666; cursor:pointer; padding:4px; line-height:1;
}
.mob-sidebar-close:hover { color:#aaa; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.docs-footer {
  margin-left: 256px;
  border-top: 1px solid #1e2840;
  background: #0c1220;
  padding: 1.25rem 1.5rem;
  font-size: 0.78rem;
  color: #8090a8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.docs-footer-love { color: #8090a8; }
.docs-footer-love span { color: #e53e3e; }
.docs-footer-copy { color: #8090a8; }
@media (max-width: 900px) {
  .docs-footer { margin-left: 0; justify-content: center; text-align: center; flex-direction: column; gap: 0.3rem; }
}

/* ── Divisional charts section (added 2026-11-20) ─────────────────────────── */
.sub-h { margin-top: 1.75rem; margin-bottom: 0.65rem; font-size: 1rem; color: #e5e7eb; }
.group-row td { background: rgba(165,180,252,0.06); color: #a5b4fc; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.tag-new { display: inline-block; margin-left: 0.35rem; padding: 0.05rem 0.4rem; border-radius: 4px; background: rgba(52,211,153,0.12); color: #34d399; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em; vertical-align: middle; }
.note-list { margin-top: 1.25rem; padding-left: 1.25rem; color: #9ca3af; font-size: 0.88rem; line-height: 1.8; }
.note-list strong { color: #e2e8f0; }
.note-list a, .doc-link { color: #60a5fa; }
.callout { margin-top: 1.25rem; padding: 0.9rem 1rem; border-left: 3px solid #60a5fa; border-radius: 6px; background: rgba(96,165,250,0.06); color: #c7d2fe; font-size: 0.88rem; line-height: 1.7; }
.callout i { margin-right: 0.4rem; color: #60a5fa; }
.code-wrap-gap { margin-top: 1rem; }
.cell-muted { color: #4b5563; }
.table-note { margin-top: 0.5rem; font-size: 0.78rem; color: #6b7280; }

/* Chart Styles gallery */
.theme-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.theme-card { margin: 0; border: 1px solid #1e2840; border-radius: 12px; overflow: hidden; background: #0f1626; }
.theme-card img { display: block; width: 100%; height: auto; }
.theme-card figcaption { padding: 0.8rem 0.95rem; font-size: 0.85rem; color: #cbd5e1; }
.theme-card figcaption span { display: block; margin-top: 0.3rem; color: #94a3b8; font-size: 0.8rem; }
.theme-card code { font-size: 0.75rem; }
