:root {
  --bg: #ffffff;
  --sidebar: #f8fafc;
  --surface: #f4f7fb;
  --border: #e5eaf1;
  --text: #172033;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-soft: #eaf1ff;
  --violet: #7c3aed;
  --code: #111827;
  --green: #16a34a;
  --orange: #d97706;
  --topbar-h: 64px;
  --sidebar-w: 286px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; color: var(--text); background: var(--bg); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.65; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.topbar { position: fixed; z-index: 40; inset: 0 0 auto; height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 700; letter-spacing: .04em; }
.brand strong { color: var(--accent); }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: #fff; background: linear-gradient(145deg, #2563eb, #1d4ed8); box-shadow: 0 8px 20px rgba(37,99,235,.22); }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; box-shadow: 0 0 0 4px #f1f5f9; }
.status-dot.online { background: #22c55e; box-shadow: 0 0 0 4px #dcfce7; }
.status-dot.offline { background: #ef4444; box-shadow: 0 0 0 4px #fee2e2; }
.top-link { font-size: 13px; font-weight: 600; color: #475569; }
.top-link:hover { color: var(--accent); }
.menu-button { display: none; border: 0; background: transparent; font-size: 24px; cursor: pointer; }

.layout { display: flex; padding-top: var(--topbar-h); }
.sidebar { position: fixed; z-index: 30; top: var(--topbar-h); bottom: 0; width: var(--sidebar-w); overflow-y: auto; padding: 24px 18px 36px; border-right: 1px solid var(--border); background: var(--sidebar); }
.eyebrow { display: block; margin-bottom: 8px; color: #94a3b8; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.bot-picker { padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.bot-select { width: 100%; display: grid; grid-template-columns: 34px 1fr 18px; align-items: center; gap: 10px; padding: 10px; margin: 4px 0; border: 1px solid transparent; border-radius: 10px; text-align: left; color: var(--text); background: transparent; cursor: pointer; }
.bot-select:hover { background: #fff; border-color: var(--border); }
.bot-select.active { background: #fff; border-color: #dbe6f5; box-shadow: 0 3px 12px rgba(15,23,42,.04); }
.bot-select strong, .bot-select small { display: block; }
.bot-select strong { font-size: 13px; }
.bot-select small { color: var(--muted); font-size: 10px; margin-top: 1px; }
.bot-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: #fff; font-size: 12px; font-weight: 800; }
.bot-icon.blue { background: var(--accent); }
.bot-icon.violet { background: var(--violet); }
.check { opacity: 0; color: var(--accent); font-size: 13px; }
.bot-select.active .check { opacity: 1; }

.nav { padding-top: 18px; }
.nav-title { display: block; margin: 20px 10px 7px; color: #94a3b8; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.nav a { display: block; padding: 7px 10px; margin: 2px 0; border-radius: 7px; color: #64748b; font-size: 13px; font-weight: 500; }
.nav a:hover { color: var(--text); background: #eef2f7; }
.nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 700; }

.content { width: min(900px, calc(100% - var(--sidebar-w))); margin-left: var(--sidebar-w); padding: 66px 72px 80px; }
.doc-section { padding: 14px 0 64px; border-bottom: 1px solid var(--border); }
.doc-section + .doc-section { padding-top: 64px; }
.hero { padding-top: 22px; }
.pill { display: inline-flex; padding: 5px 10px; margin-bottom: 20px; border: 1px solid #cfe0ff; border-radius: 999px; color: #1d4ed8; background: #eff6ff; font-size: 11px; font-weight: 800; letter-spacing: .06em; }
h1 { margin: 0 0 22px; font-size: clamp(36px, 5vw, 56px); line-height: 1.1; letter-spacing: -.045em; }
h1 span { color: var(--accent); }
h2 { margin: 8px 0 12px; font-size: 30px; line-height: 1.2; letter-spacing: -.025em; }
h3 { margin: 28px 0 10px; font-size: 15px; }
p { margin: 0 0 18px; }
.lead { max-width: 720px; color: #536176; font-size: 18px; line-height: 1.75; }
.muted { color: var(--muted); font-size: 13px; }
.section-label { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.content p code { padding: 2px 5px; border: 1px solid #e2e8f0; border-radius: 5px; color: #334155; background: #f8fafc; font-size: .88em; }

.base-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 18px; margin: 28px 0; border: 1px solid #dbe5f3; border-radius: 12px; background: linear-gradient(135deg, #f8fbff, #f5f7ff); }
.base-card .eyebrow { margin-bottom: 3px; }
.base-card code { color: #1e3a8a; font-size: 13px; word-break: break-all; }
.copy-light { padding: 7px 11px; border: 1px solid #d5dfed; border-radius: 7px; color: #475569; background: #fff; font-size: 11px; font-weight: 700; cursor: pointer; }
.copy-light:hover { color: var(--accent); border-color: #b9cdf1; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 26px; }
.step { display: flex; gap: 11px; padding: 15px; border: 1px solid var(--border); border-radius: 11px; }
.step > span { flex: 0 0 auto; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; color: var(--accent); background: var(--accent-soft); font-size: 11px; font-weight: 800; }
.step strong { display: block; font-size: 12px; }
.step p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.path { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 22px 0; }
.path span { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 12px; font-weight: 650; }
.path b { color: #94a3b8; }

.callout { padding: 16px 18px; margin-top: 22px; border-left: 3px solid; border-radius: 0 9px 9px 0; }
.callout strong { display: block; margin-bottom: 3px; font-size: 13px; }
.callout p { margin: 0; color: #59677a; font-size: 12px; }
.callout.warning { border-color: #f59e0b; background: #fffbeb; }
.callout.success { border-color: #22c55e; background: #f0fdf4; }
.callout.info { border-color: #3b82f6; background: #eff6ff; }

.endpoint-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.endpoint-title > code { color: #334155; font-size: 13px; font-weight: 650; }
.method { display: inline-grid; place-items: center; min-width: 48px; height: 24px; border-radius: 5px; color: #fff; font-size: 10px; font-weight: 900; letter-spacing: .04em; }
.method.get { background: #2563eb; }
.method.post { background: #16a34a; }

.code-card { overflow: hidden; margin: 18px 0 24px; border: 1px solid #1f2937; border-radius: 11px; background: var(--code); box-shadow: 0 10px 30px rgba(15,23,42,.08); }
.code-head { min-height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px; border-bottom: 1px solid #273244; color: #94a3b8; background: #172033; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.copy-code { border: 0; color: #94a3b8; background: transparent; font-size: 10px; text-transform: none; cursor: pointer; }
.copy-code:hover { color: #fff; }
pre { margin: 0; padding: 18px; overflow-x: auto; color: #dbeafe; font-size: 12px; line-height: 1.7; }
.response pre { color: #d1fae5; }

.error-table { margin-top: 24px; overflow: hidden; border: 1px solid var(--border); border-radius: 11px; }
.error-row { display: grid; grid-template-columns: 60px 190px 1fr; gap: 14px; align-items: center; padding: 13px 16px; border-top: 1px solid var(--border); font-size: 12px; }
.error-row:first-child { border-top: 0; }
.error-row.head { color: #94a3b8; background: var(--surface); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.error-row code { color: #334155; font-size: 11px; font-weight: 700; }
.http-code { font-weight: 800; }
.error-row > span:last-child { color: var(--muted); }

footer { display: flex; align-items: center; justify-content: space-between; padding-top: 28px; color: #94a3b8; font-size: 11px; }
footer a:hover { color: var(--accent); }
.overlay { display: none; }

@media (max-width: 900px) {
  .content { width: calc(100% - 240px); margin-left: 240px; padding: 50px 38px 70px; }
  .sidebar { width: 240px; }
  .steps { grid-template-columns: 1fr; }
  .error-row { grid-template-columns: 48px 150px 1fr; }
}

@media (max-width: 700px) {
  .topbar { padding: 0 16px; }
  .status, .top-link { display: none; }
  .menu-button { display: block; }
  .sidebar { width: min(86vw, 300px); transform: translateX(-105%); transition: transform .22s ease; box-shadow: 12px 0 35px rgba(15,23,42,.14); }
  .sidebar.open { transform: translateX(0); }
  .overlay { position: fixed; z-index: 20; inset: var(--topbar-h) 0 0; background: rgba(15,23,42,.35); }
  .overlay.show { display: block; }
  .content { width: 100%; margin-left: 0; padding: 42px 20px 60px; }
  h1 { font-size: 38px; }
  h2 { font-size: 26px; }
  .lead { font-size: 16px; }
  .base-card { align-items: flex-start; flex-direction: column; }
  .error-table { overflow-x: auto; }
  .error-row { min-width: 620px; }
  footer { align-items: flex-start; flex-direction: column; gap: 7px; }
}
