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

:root {
  --sidebar-w: 272px;
  --bg: #FAFBFC;
  --sidebar-bg: #F1F5F9;
  --sidebar-border: #E2E8F0;
  --card-bg: #FFFFFF;
  --border: #E2E8F0;
  --text: #0F172A;
  --text-2: #475569;
  --text-3: #94A3B8;
  --accent: #0096B4;
  --accent-h: #007A94;
  --accent-dim: rgba(0, 150, 180, 0.1);
  --green: #059669;
  --green-dim: rgba(5, 150, 105, 0.1);
  --amber: #D97706;
  --amber-dim: rgba(217, 119, 6, 0.1);
  --red: #DC2626;
  --red-dim: rgba(220, 38, 38, 0.1);
  --purple: #7C3AED;
  --code-bg: #0F172A;
  --code-text: #E2E8F0;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

/* ── LAYOUT ── */
.layout { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar__header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  position: sticky;
  top: 0;
  background: var(--sidebar-bg);
  z-index: 1;
}
.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 12px;
}
.sidebar__logo img { width: 80px; height: auto; }
.sidebar__logo-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 4px;
}
.sidebar__version {
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar__version-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.sidebar__nav { padding: 12px 12px 24px; flex: 1; }
.sidebar__group { margin-bottom: 6px; }
.sidebar__group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 8px 4px;
}
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--text-2);
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar__link:hover { background: var(--border); color: var(--text); }
.sidebar__link.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}
.sidebar__link-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar__link-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}
.badge-get { background: var(--green-dim); color: var(--green); }
.badge-post { background: var(--accent-dim); color: var(--accent); }

.sidebar__cta {
  padding: 12px 16px;
  border-top: 1px solid var(--sidebar-border);
}
.btn-cta {
  display: block;
  width: 100%;
  text-align: center;
  background: linear-gradient(135deg, #0096B4, #7C3AED);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-cta:hover { opacity: 0.88; }

/* ── CONTENT ── */
.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

/* ── TOPBAR ── */
.topbar {
  position: sticky;
  top: 0;
  background: rgba(250, 251, 252, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 40;
  padding: 0 40px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar__search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 12px;
  flex: 1;
  max-width: 360px;
  cursor: text;
}
.topbar__search input {
  border: none;
  background: none;
  font-size: 13px;
  color: var(--text);
  outline: none;
  width: 100%;
}
.topbar__search input::placeholder { color: var(--text-3); }
.topbar__search svg { color: var(--text-3); flex-shrink: 0; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.btn-outline {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card-bg);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary {
  padding: 7px 14px;
  border: none;
  border-radius: 7px;
  background: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-h); }

/* ── MAIN ── */
.main { max-width: 860px; margin: 0 auto; padding: 48px 40px 80px; }

/* ── SECTION ── */
.doc-section {
  margin-bottom: 72px;
  scroll-margin-top: 80px;
}
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
h1 { font-size: 32px; font-weight: 800; line-height: 1.2; margin-bottom: 12px; color: var(--text); }
h2 { font-size: 24px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
h4 { font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
p { color: var(--text-2); margin-bottom: 16px; line-height: 1.7; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.lead {
  font-size: 17px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 24px;
}

.divider { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* ── BASE URL CARD ── */
.base-url-card {
  background: linear-gradient(135deg, rgba(0,150,180,0.06), rgba(124,58,237,0.05));
  border: 1px solid rgba(0,150,180,0.2);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}
.base-url-card__label { font-size: 12px; font-weight: 600; color: var(--text-3); margin-bottom: 2px; }
.base-url-card__url { font-family: var(--mono); font-size: 14px; color: var(--accent); font-weight: 600; }

/* ── FEATURE GRID ── */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 32px; }
.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: box-shadow 0.15s;
}
.feature-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.feature-card__icon { font-size: 22px; margin-bottom: 8px; }
.feature-card__title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.feature-card__desc { font-size: 12px; color: var(--text-2); line-height: 1.5; }

/* ── STEPS ── */
.steps { counter-reset: step; margin-bottom: 24px; }
.step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.step__num {
  counter-increment: step;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.step__num::after { content: counter(step); }
.step__body { flex: 1; min-width: 0; }
.step__title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.step__desc { font-size: 13.5px; color: var(--text-2); margin-bottom: 10px; }

/* ── CODE BLOCK ── */
.code-block {
  background: var(--code-bg);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.06);
}
.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.code-block__lang {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #64748B;
}
.code-block__dots { display: flex; gap: 5px; }
.code-block__dots span {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.code-block__copy {
  font-size: 11px;
  font-weight: 600;
  color: #64748B;
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.code-block__copy:hover { color: #94A3B8; border-color: rgba(255,255,255,0.2); }
.code-block__copy.copied { color: #10B981; border-color: rgba(16,185,129,0.4); }
.code-block pre {
  margin: 0;
  padding: 18px 18px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  color: var(--code-text);
  overflow-x: auto;
  white-space: pre;
}
.code-block pre::-webkit-scrollbar { height: 4px; }
.code-block pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* syntax tokens */
.t-kw  { color: #C084FC; }   /* keyword */
.t-str { color: #86EFAC; }   /* string */
.t-num { color: #FDA4AF; }   /* number */
.t-cm  { color: #4B5563; }   /* comment */
.t-fn  { color: #FCD34D; }   /* function/key */
.t-op  { color: #94A3B8; }   /* operator/punctuation */
.t-url { color: #67E8F9; }   /* url/method */
.t-hd  { color: #A5B4FC; }   /* header */
.t-ph  { color: #F97316; }   /* placeholder */

/* ── TABS ── */
.tabs { margin-bottom: 4px; }
.tabs__nav {
  display: flex;
  gap: 2px;
  background: var(--code-bg);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 8px 12px 0;
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom: none;
}
.tabs__btn {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border: none;
  background: none;
  color: #64748B;
  border-radius: 5px 5px 0 0;
  cursor: pointer;
  transition: all 0.15s;
}
.tabs__btn:hover { color: #94A3B8; }
.tabs__btn.active { background: rgba(255,255,255,0.08); color: #E2E8F0; }
.tabs__panel { display: none; }
.tabs__panel.active { display: block; }
.tabs__panel .code-block { border-radius: 0 var(--radius) var(--radius) var(--radius); }

/* ── ENDPOINT CARD ── */
.endpoint-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}
.endpoint-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--sidebar-bg);
}
.method-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
}
.method-get { background: var(--green-dim); color: var(--green); }
.method-post { background: var(--accent-dim); color: var(--accent); }
.endpoint-path {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text);
  font-weight: 600;
}
.endpoint-desc-text { font-size: 12.5px; color: var(--text-3); margin-left: auto; }
.endpoint-card__body { padding: 18px 20px; }

/* ── PARAM TABLE ── */
.param-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 13px; }
.param-table th {
  text-align: left;
  padding: 7px 10px;
  background: var(--sidebar-bg);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.param-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: top;
}
.param-table tr:last-child td { border-bottom: none; }
.param-name { font-family: var(--mono); font-size: 12px; color: var(--text); font-weight: 600; }
.param-type { font-family: var(--mono); font-size: 11px; color: var(--purple); }
.param-req { font-size: 10px; font-weight: 700; color: var(--red); text-transform: uppercase; }
.param-opt { font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; }

/* ── ALERT ── */
.alert {
  display: flex;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13.5px;
  line-height: 1.6;
}
.alert-info { background: var(--accent-dim); border-left: 3px solid var(--accent); color: var(--text); }
.alert-warn { background: var(--amber-dim); border-left: 3px solid var(--amber); color: var(--text); }
.alert-success { background: var(--green-dim); border-left: 3px solid var(--green); color: var(--text); }
.alert__icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ── ERROR TABLE ── */
.error-grid { display: grid; gap: 10px; margin-bottom: 20px; }
.error-row {
  display: grid;
  grid-template-columns: 80px 140px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}
.error-code { font-family: var(--mono); font-weight: 700; color: var(--text); }
.error-name { font-weight: 600; color: var(--text); }
.error-desc { color: var(--text-2); line-height: 1.5; }

/* ── RATE LIMIT TABLE ── */
.rate-card { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.rate-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.rate-item__label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-3); margin-bottom: 6px; }
.rate-item__value { font-size: 22px; font-weight: 800; color: var(--text); }
.rate-item__unit { font-size: 12px; color: var(--text-3); font-weight: 400; }

/* ── INLINE CODE ── */
code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--accent);
}

/* ── MOBILE ── */
.menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-2);
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; }
  .menu-btn { display: block; }
  .topbar { padding: 0 20px; }
  .main { padding: 32px 20px 60px; }
  .rate-card { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
  }
  .overlay.visible { display: block; }
}

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-3);
  margin-left: var(--sidebar-w);
}
.footer a { color: var(--text-3); }
.footer a:hover { color: var(--accent); text-decoration: none; }
@media (max-width: 900px) { .footer { margin-left: 0; padding: 20px; flex-direction: column; gap: 8px; text-align: center; } }
