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

:root {
  --brand:       #5654D4;
  --brand-dark:  #4340B8;
  --brand-light: #EEF0FF;
  --sidebar-w:   272px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  --gray-50:  #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --red:   #DC2626;
  --green: #059669;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--gray-900);
  background: #fff;
  line-height: 1.65;
}

/* ─── Layout ──────────────────────────────────────────── */
.wrapper { display: flex; min-height: 100vh; }

/* ─── Sidebar ─────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--gray-50);
  border-right: 1px solid var(--gray-200);
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--gray-200);
  text-decoration: none;
  flex-shrink: 0;
}

.sidebar-logo img { height: 26px; width: auto; }

.sidebar-nav { padding: 14px 0 32px; }

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

.nav-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gray-400);
  padding: 10px 20px 3px;
}

.nav-link {
  display: block;
  font-size: 13.5px;
  color: var(--gray-700);
  text-decoration: none;
  padding: 5.5px 20px;
  border-left: 2px solid transparent;
  transition: color .12s, background .12s;
}

.nav-link:hover {
  color: var(--brand);
  background: var(--brand-light);
}

.nav-link.active {
  color: var(--brand);
  background: var(--brand-light);
  border-left-color: var(--brand);
  font-weight: 600;
}

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

/* ─── Topbar ──────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  height: 56px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 48px;
  z-index: 50;
}

.breadcrumb {
  font-size: 13px;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb a { color: var(--gray-500); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { color: var(--gray-300); }
.breadcrumb .current { color: var(--gray-900); font-weight: 500; }

/* ─── Content ─────────────────────────────────────────── */
.content {
  max-width: 780px;
  padding: 52px 48px 96px;
}

/* ─── Typography ──────────────────────────────────────── */
.content h1 {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--gray-900);
  margin-bottom: 10px;
}

.subtitle {
  font-size: 1.0625rem;
  color: var(--gray-500);
  margin-bottom: 44px;
  line-height: 1.6;
}

.content h2 {
  font-size: 1.1875rem;
  font-weight: 700;
  margin-top: 52px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-900);
  letter-spacing: -.01em;
}

.content h3 {
  font-size: .9375rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 10px;
  color: var(--gray-900);
}

.content p { margin-bottom: 14px; color: var(--gray-700); }

.content ul, .content ol {
  margin: 0 0 16px 22px;
  color: var(--gray-700);
}

.content li { margin-bottom: 5px; }

.content a { color: var(--brand); text-decoration: none; }
.content a:hover { text-decoration: underline; }

/* inline code */
.content code {
  font-family: var(--mono);
  font-size: .8125em;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ─── Code blocks ─────────────────────────────────────── */
.code-block {
  position: relative;
  margin: 20px 0;
}

.code-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 6px;
}

pre {
  background: #1e1e2e !important;
  border-radius: 10px;
  padding: 20px 22px;
  overflow-x: auto;
  margin: 0;
}

pre code {
  font-family: var(--mono) !important;
  font-size: .8375rem !important;
  line-height: 1.65;
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.5);
  border-radius: 5px;
  padding: 3px 9px;
  font-size: 11px;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s, color .15s;
}

.copy-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.copy-btn.copied { color: #86efac; }

/* ─── Endpoint block ──────────────────────────────────── */
.endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 11px 15px;
  margin: 14px 0 20px;
  font-family: var(--mono);
  font-size: .875rem;
}

.method {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .06em;
  flex-shrink: 0;
}

.method.post   { background: #dbeafe; color: #1d4ed8; }
.method.get    { background: #dcfce7; color: #15803d; }
.method.put    { background: #fef3c7; color: #b45309; }
.method.patch  { background: #ede9fe; color: #7c3aed; }
.method.delete { background: #fee2e2; color: #b91c1c; }

.ep-path { color: var(--gray-900); font-weight: 500; }

/* ─── Callouts ────────────────────────────────────────── */
.callout {
  display: flex;
  gap: 11px;
  border-radius: 8px;
  padding: 13px 15px;
  margin: 20px 0;
  font-size: .875rem;
  line-height: 1.55;
}

.callout-icon { font-style: normal; flex-shrink: 0; line-height: 1.4; }

.callout.info    { background: #EEF0FF; border: 1px solid #c7c5f5; color: #3730a3; }
.callout.warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.callout.tip     { background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; }
.callout.danger  { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ─── Tables ──────────────────────────────────────────── */
.param-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 24px;
  font-size: .875rem;
}

.param-table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gray-500);
  padding: 8px 12px;
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
}

.param-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
  color: var(--gray-700);
}

.param-table tr:last-child td { border-bottom: none; }

.pname { font-family: var(--mono); font-size: .8125rem; color: var(--gray-900); font-weight: 500; }
.ptype { font-family: var(--mono); font-size: .75rem;   color: var(--brand); }
.req   { font-size: .6875rem; font-weight: 600; color: var(--red);       background: #fee2e2; border-radius: 3px; padding: 1px 5px; }
.opt   { font-size: .6875rem; font-weight: 600; color: var(--gray-500);  background: var(--gray-100); border-radius: 3px; padding: 1px 5px; }

/* ─── Event catalog ───────────────────────────────────── */
.event-card {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
  margin: 24px 0;
}

.event-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.event-name {
  font-family: var(--mono);
  font-size: .875rem;
  font-weight: 600;
  color: var(--brand);
}

.event-desc { font-size: .875rem; color: var(--gray-500); }

.event-card pre { border-radius: 0; margin: 0; }

/* ─── Cards (home page) ───────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 28px 0;
}

.card {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}

.card:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
  text-decoration: none;
}

.card-icon  { font-size: 1.375rem; margin-bottom: 10px; }
.card-title { font-size: .9375rem; font-weight: 600; color: var(--gray-900); margin-bottom: 4px; }
.card-desc  { font-size: .8125rem; color: var(--gray-500); line-height: 1.5; }

/* ─── Steps (quickstart) ──────────────────────────────── */
.steps { counter-reset: step; margin: 20px 0; }

.step {
  display: flex;
  gap: 16px;
  margin-bottom: 36px;
}

.step-num {
  counter-increment: step;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: .8125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.step-num::before { content: counter(step); }

.step-body { flex: 1; min-width: 0; }
.step-body h3 { margin-top: 2px; margin-bottom: 8px; }

/* ─── Base URL bar ────────────────────────────────────── */
.base-url {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 7px;
  padding: 9px 14px;
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: .875rem;
  color: var(--gray-700);
}

.base-url strong { color: var(--gray-400); font-weight: 500; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }

/* ─── Divider ─────────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--gray-200); margin: 44px 0; }

/* ─── Mobile ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 32px 22px 64px; }
  .topbar { padding: 0 22px; }
  .menu-btn { display: flex; }
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  margin-right: 12px;
  color: var(--gray-500);
}
