:root{
  --bg: #000000;
  --bg-panel: #0a0a0a;
  --bg-panel-2: #0e0e0e;
  --sidebar-bg: #050505;
  --border: rgba(255,255,255,0.1);
  --border-soft: rgba(255,255,255,0.07);
  --text: #ffffff;
  --text-2: rgba(255,255,255,0.62);
  --text-3: rgba(255,255,255,0.38);
  --accent: #ffffff;
  --code-bg: #0d0d0d;
  --note-bg: rgba(255,255,255,0.04);
  --warn-border: rgba(240,180,60,0.4);
  --warn-bg: rgba(240,180,60,0.06);
  --font: 'Inter', ui-sans-serif, -apple-system, system-ui, "Segoe UI", Roboto,
      Ubuntu, Cantarell, "Noto Sans", sans-serif, "Helvetica Neue", Arial;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-w: 280px;
  --topbar-h: 60px;
}

*{ box-sizing:border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; }
body{
  background:var(--bg); color:var(--text); font-family:var(--font);
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility; font-synthesis:none; overflow-x:hidden;
}
h1,h2,h3,h4{ font-family:var(--font); text-rendering:optimizeLegibility; }
a{ color:inherit; text-decoration:none; }
img{ display:block; max-width:100%; }
::selection{ background:var(--accent); color:#000; }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:0.001ms !important; transition-duration:0.001ms !important; }
}

/* ---------- TOP BAR ---------- */
.topbar{
  position:fixed; top:0; left:0; right:0; height:var(--topbar-h); z-index:500;
  background:#000000; border-bottom:1px solid var(--border-soft);
  display:flex; align-items:center; gap:16px; padding:0 20px;
}
.topbar .brand{ display:flex; align-items:center; gap:10px; flex-shrink:0; }
.topbar .brand img{ height:18px; width:auto; }
.topbar .brand .docs-tag{
  font-size:11px; font-weight:500; color:var(--text-3);
  border-left:1px solid var(--border-soft); padding-left:10px; letter-spacing:0.02em;
}
.topbar-burger{
  display:none; flex-direction:column; justify-content:center; align-items:center;
  gap:4px; width:36px; height:36px; background:none; border:none; cursor:pointer;
  border-radius:8px; flex-shrink:0;
}
.topbar-burger:hover{ background:rgba(255,255,255,0.06); }
.topbar-burger span{ width:18px; height:2px; background:#fff; border-radius:2px; }

.topbar-search{
  flex:1; max-width:420px; position:relative;
}
.topbar-search input{
  width:100%; background:#0d0d0d; border:1px solid var(--border-soft); border-radius:8px;
  color:var(--text); font-family:var(--font); font-size:13.5px; padding:8px 12px 8px 34px;
  outline:none; transition:border-color .15s ease;
}
.topbar-search input:focus{ border-color:rgba(255,255,255,0.3); }
.topbar-search input::placeholder{ color:var(--text-3); }
.topbar-search svg{
  position:absolute; left:11px; top:50%; transform:translateY(-50%); opacity:0.4; pointer-events:none;
}
.topbar-links{ margin-left:auto; display:flex; align-items:center; gap:22px; flex-shrink:0; }
.topbar-links a{ font-size:13.5px; color:var(--text-2); transition:color .15s ease; }
.topbar-links a:hover{ color:var(--text); }
.topbar-links a.btn{
  color:#000; background:#fff; padding:7px 14px; border-radius:999px; font-weight:500;
}

/* ---------- LAYOUT ---------- */
.docs-shell{
  display:flex; padding-top:var(--topbar-h); min-height:100vh;
}

/* ---------- SIDEBAR ---------- */
.sidebar{
  width:var(--sidebar-w); flex-shrink:0; position:fixed; top:var(--topbar-h); left:0;
  bottom:0; overflow-y:auto; background:var(--sidebar-bg);
  border-right:1px solid var(--border-soft); padding:20px 12px 60px;
  z-index:150;
}
.sidebar-group{ margin-bottom:4px; }
.sidebar-group-title{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  width:100%; background:none; border:none; cursor:pointer; font-family:var(--font);
  color:var(--text); font-size:12.5px; font-weight:600; text-transform:uppercase;
  letter-spacing:0.05em; padding:10px 10px; border-radius:6px; text-align:left;
}
.sidebar-group-title:hover{ background:rgba(255,255,255,0.04); }
.sidebar-group-title .chev{
  font-size:10px; color:var(--text-3); transition:transform .18s ease; flex-shrink:0;
}
.sidebar-group.collapsed .chev{ transform:rotate(-90deg); }
.sidebar-group.collapsed .sidebar-links{ display:none; }
.sidebar-links{ display:flex; flex-direction:column; padding:2px 0 10px; }
.sidebar-links a{
  font-size:13.5px; color:var(--text-2); padding:7px 10px 7px 20px; border-radius:6px;
  border-left:2px solid transparent; margin-left:2px; line-height:1.4;
  transition:background .15s ease, color .15s ease, border-color .15s ease;
}
.sidebar-links a:hover{ background:rgba(255,255,255,0.04); color:var(--text); }
.sidebar-links a.active{
  color:var(--text); border-left-color:#fff; background:rgba(255,255,255,0.05); font-weight:500;
}
.sidebar-hidden{ display:none !important; }

.nav-overlay{
  display:none; position:fixed; inset:var(--topbar-h) 0 0 0; background:rgba(0,0,0,0.6);
  z-index:140;
}
.nav-overlay.show{ display:block; }

/* ---------- MAIN CONTENT ---------- */
.breadcrumb{ font-size:12.5px; color:var(--text-3); margin-bottom:14px; }
.breadcrumb a{ color:var(--text-3); }
.breadcrumb a:hover{ color:var(--text-2); }

.docs-section{ margin-bottom:76px; scroll-margin-top:80px; }
.docs-section:last-child{ margin-bottom:20px; }
.docs-section h1{
  font-size:34px; line-height:1.25; font-weight:600; letter-spacing:-0.02em;
  margin-bottom:10px; scroll-margin-top:80px;
}
.docs-section > .section-lead{ font-size:16px; color:var(--text-2); line-height:1.6; margin-bottom:36px; }
.docs-section h2{
  font-size:21px; line-height:1.3; font-weight:600; letter-spacing:-0.01em; margin:40px 0 14px;
  padding-top:8px; border-top:1px solid var(--border-soft); scroll-margin-top:80px;
}
.docs-section h2:first-of-type{ border-top:none; padding-top:0; }
.docs-section h3{ font-size:16px; line-height:1.3; font-weight:600; margin:26px 0 10px; scroll-margin-top:80px; }
.docs-section p{ font-size:15px; line-height:1.7; color:var(--text-2); margin-bottom:14px; }
.docs-section p strong{ color:var(--text); font-weight:600; }
.docs-section ul, .docs-section ol{ margin:0 0 16px 22px; }
.docs-section li{ font-size:15px; line-height:1.7; color:var(--text-2); margin-bottom:6px; }
.docs-section li strong{ color:var(--text); font-weight:600; }
.docs-section a.inline-link{ color:var(--text); text-decoration:underline; text-underline-offset:2px; text-decoration-color:rgba(255,255,255,0.3); }
.docs-section a.inline-link:hover{ text-decoration-color:#fff; }

code.inline{
  font-family:var(--mono); font-size:0.86em; background:rgba(255,255,255,0.08);
  padding:2px 6px; border-radius:4px; color:#fff;
}

pre{
  background:var(--code-bg); border:1px solid var(--border-soft); border-radius:10px;
  padding:16px 18px; overflow-x:auto; margin:0 0 18px; position:relative;
}
pre code{
  font-family:var(--mono); font-size:13px; line-height:1.6; color:#e8e8e8;
  white-space:pre;
}
.code-copy{
  position:absolute; top:10px; right:10px; background:rgba(255,255,255,0.08);
  border:1px solid var(--border-soft); color:var(--text-2); font-size:11px;
  padding:4px 9px; border-radius:6px; cursor:pointer; font-family:var(--font);
  transition:background .15s ease, color .15s ease;
}
.code-copy:hover{ background:rgba(255,255,255,0.16); color:#fff; }

.callout{
  border-radius:10px; padding:14px 16px; margin:0 0 18px; font-size:14px; line-height:1.65;
  border:1px solid var(--border-soft); background:var(--note-bg); color:var(--text-2);
}
.callout strong.callout-label{
  display:block; color:var(--text); font-size:12px; font-weight:700; text-transform:uppercase;
  letter-spacing:0.04em; margin-bottom:5px;
}
.callout.warn{ border-color:var(--warn-border); background:var(--warn-bg); }
.callout.warn strong.callout-label{ color:#f0b43c; }

table{ width:100%; border-collapse:collapse; margin:0 0 20px; font-size:14px; }
th, td{ text-align:left; padding:9px 12px; border-bottom:1px solid var(--border-soft); color:var(--text-2); }
th{ color:var(--text); font-weight:600; font-size:12.5px; text-transform:uppercase; letter-spacing:0.03em; }

.feature-grid{
  display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:0 0 20px;
}
.feature-grid .fcard{
  border:1px solid var(--border-soft); border-radius:12px; padding:16px 18px; background:var(--bg-panel);
}
.feature-grid .fcard h4{ font-size:14.5px; font-weight:600; margin-bottom:5px; }
.feature-grid .fcard p{ font-size:13.5px; margin:0; color:var(--text-2); }

.docs-pager{
  display:flex; justify-content:space-between; gap:16px; margin-top:60px;
  border-top:1px solid var(--border-soft); padding-top:24px;
}
.docs-pager a{
  flex:1; border:1px solid var(--border-soft); border-radius:12px; padding:14px 16px;
  transition:border-color .15s ease, background .15s ease;
}
.docs-pager a:hover{ border-color:rgba(255,255,255,0.25); background:rgba(255,255,255,0.03); }
.docs-pager .pager-dir{ font-size:11px; color:var(--text-3); text-transform:uppercase; letter-spacing:0.04em; margin-bottom:4px; }
.docs-pager .pager-title{ font-size:14.5px; font-weight:500; color:var(--text); }
.docs-pager .pager-next{ text-align:right; margin-left:auto; }

/* ---------- ON-THIS-PAGE (right rail) ---------- */
.on-this-page{
  width:200px; flex-shrink:0; position:sticky; top:calc(var(--topbar-h) + 64px);
  align-self:flex-start; padding-left:8px; max-height:calc(100vh - var(--topbar-h) - 80px); overflow-y:auto;
}
.on-this-page .otp-label{
  font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:0.05em;
  color:var(--text-3); margin-bottom:10px;
}
.on-this-page a{
  display:block; font-size:13px; color:var(--text-2); padding:5px 0 5px 12px;
  border-left:2px solid var(--border-soft); transition:color .15s ease, border-color .15s ease;
}
.on-this-page a:hover{ color:var(--text); }
.on-this-page a.active{ color:var(--text); border-left-color:#fff; font-weight:500; }

.docs-main-wrap{ display:flex; gap:40px; flex:1; margin-left:var(--sidebar-w); padding:64px 40px 120px; }
.docs-main-wrap .docs-content{ flex:1; max-width:760px; }

/* ---------- RESPONSIVE ---------- */
.docs-main-wrap{ max-width:100%; }
.docs-content{ min-width:0; }
pre{ max-width:100%; }
table{ display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; }

@media (max-width:1180px){
  .on-this-page{ display:none; }
  .docs-main-wrap{ gap:0; }
}
@media (max-width:1024px){
  :root{ --sidebar-w:240px; }
  .docs-main-wrap{ padding:56px 28px 100px; }
}
@media (max-width:900px){
  .topbar-burger{ display:flex; }
  .topbar-search{ display:none; }
  .topbar-links a:not(.btn){ display:none; }
  .sidebar{
    width:280px; transform:translateX(-100%); transition:transform .25s ease; top:var(--topbar-h);
  }
  .sidebar.open{ transform:translateX(0); box-shadow:8px 0 24px rgba(0,0,0,0.5); }
  .docs-main-wrap{ margin-left:0; padding:64px 20px 90px; }
  .docs-content{ max-width:100%; }
}
@media (max-width:640px){
  .docs-main-wrap{ padding:72px 16px 80px; }
  .docs-section{ margin-bottom:56px; }
  .docs-section h1{ font-size:28px; }
  .docs-section h2{ font-size:19px; margin:32px 0 12px; }
  .feature-grid{ grid-template-columns:1fr; gap:12px; }
  .docs-pager{ flex-direction:column; }
  .docs-pager .pager-next{ text-align:left; margin-left:0; }
}
@media (max-width:520px){
  .docs-section h1{ font-size:25px; }
  .topbar .brand .docs-tag{ display:none; }
  .topbar{ padding:0 14px; gap:10px; }
}
@media (max-width:380px){
  .docs-main-wrap{ padding:68px 12px 70px; }
  .callout,pre{ padding:12px 14px; }
}
