:root {
  color-scheme: light;
  --bg: #eef2ff;
  --fg: #16122c;
  --muted: #595275;
  --glass: rgba(255, 255, 255, 0.7);
  --glass-strong: rgba(255, 255, 255, 0.88);
  --border: rgba(109, 74, 255, 0.18);
  --accent: #6d4aff;
  --accent-2: #0891b2;
  --soft: rgba(109, 74, 255, 0.1);
  --code-bg: #111322;
  --code-fg: #ebe8ff;
}
html.dark {
  color-scheme: dark;
  --bg: #070612;
  --fg: #f4f1ff;
  --muted: #a69ec4;
  --glass: rgba(18, 16, 36, 0.65);
  --glass-strong: rgba(24, 21, 48, 0.86);
  --border: rgba(255, 255, 255, 0.12);
  --accent: #9575ff;
  --accent-2: #22d3ee;
  --soft: rgba(149, 117, 255, 0.16);
  --code-bg: rgba(10, 9, 22, 0.92);
  --code-fg: #f1eeff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14.5px/1.6 "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  color: var(--fg);
  background: var(--bg);
}
code, pre { font-family: "JetBrains Mono", ui-monospace, monospace; }
.ambient-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orb { position: absolute; border-radius: 999px; filter: blur(95px); opacity: 0.36; }
.orb-1 { width: 420px; height: 420px; top: -120px; left: -100px; background: radial-gradient(circle, #7c3aed, transparent 70%); }
.orb-2 { width: 420px; height: 420px; bottom: -120px; right: -100px; background: radial-gradient(circle, #06b6d4, transparent 70%); }

.docs-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 20px; background: var(--glass-strong);
  backdrop-filter: blur(20px); border-bottom: 1px solid var(--border);
}
.docs-nav-left, .docs-nav-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand small { display: block; color: var(--muted); font-size: 11px; }
.logo {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
}
.badge-live {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: rgba(52, 211, 153, 0.16); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.35);
}
.nav-btn {
  text-decoration: none; color: var(--fg); background: var(--soft); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer;
  font-family: inherit;
}

.docs-layout {
  position: relative; z-index: 1;
  max-width: 1420px; margin: 0 auto;
  display: grid; grid-template-columns: 230px minmax(0, 1fr) 430px; gap: 24px;
  padding: 24px 20px 60px; align-items: start;
}
.sidebar {
  position: sticky; top: 76px;
  background: var(--glass); backdrop-filter: blur(20px);
  border: 1px solid var(--border); border-radius: 16px; padding: 14px;
  max-height: calc(100vh - 96px); overflow: auto;
}
.side-group { margin-bottom: 16px; }
.side-label { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; color: var(--muted); margin: 0 0 6px 8px; }
.side-link {
  display: flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 9px;
  text-decoration: none; color: var(--muted); font-size: 12.5px; font-weight: 600;
}
.side-link:hover, .side-link.active { color: var(--fg); background: var(--soft); }
.side-link code { font-size: 10.5px; padding: 1px 5px; border-radius: 5px; background: var(--soft); color: var(--accent-2); }

.docs-main, .rail, .rail-box, .docs-main section { min-width: 0; }
.docs-main section {
  background: var(--glass); backdrop-filter: blur(20px);
  border: 1px solid var(--border); border-radius: 18px; padding: 22px; margin-bottom: 18px;
}
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; color: var(--accent-2); }
h1 { font-size: clamp(24px, 3vw, 34px); margin: 6px 0 10px; letter-spacing: -0.03em; }
h2 { font-size: 20px; margin: 4px 0 10px; }
h3 { font-size: 15px; margin: 16px 0 8px; }
.lead { color: var(--muted); margin: 0 0 16px; }
.base-box {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 12px; background: var(--soft); border: 1px solid var(--border); margin-bottom: 14px;
}
.base-box span { font-size: 12px; font-weight: 700; color: var(--muted); }
.base-box code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 700; color: var(--accent-2); }
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

.ep-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.m-post, .m-get {
  font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px; font-family: "JetBrains Mono", monospace;
}
.m-post { background: rgba(149, 117, 255, 0.22); color: var(--accent); }
.m-get { background: rgba(34, 211, 238, 0.2); color: var(--accent-2); }

.table-wrap { overflow-x: auto; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

.tester-card {
  margin-top: 16px; padding: 14px; border-radius: 14px;
  background: var(--glass-strong); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px;
}
.tester-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tester-head small { color: var(--muted); font-size: 11.5px; }
.tester-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tester-card input, .tester-card select {
  padding: 8px 11px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--fg); font: inherit; font-size: 13px; min-width: 0; flex: 1;
}
.btn-primary {
  cursor: pointer; border: none; border-radius: 10px; padding: 9px 15px; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, #7c3aed, #4f46e5); font-family: inherit;
}
.tester-out, pre {
  margin: 0; padding: 12px; border-radius: 12px; background: var(--code-bg); color: var(--code-fg);
  font-size: 12px; overflow: auto; max-height: 360px; white-space: pre-wrap; word-break: break-word;
}
.code-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.code-head {
  display: flex; justify-content: space-between; align-items: center; padding: 8px 12px;
  background: var(--soft); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700;
}
.copy-btn {
  cursor: pointer; border: 1px solid var(--border); background: var(--glass-strong); color: var(--fg);
  border-radius: 8px; padding: 4px 10px; font-size: 11.5px; font-weight: 700; font-family: inherit;
}

.rail { position: sticky; top: 76px; }
.rail-box {
  background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden; box-shadow: 0 22px 54px rgba(2, 1, 14, 0.5);
}
.rail-tabs {
  display: flex; align-items: center; gap: 6px; padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04); border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.rail-tab {
  cursor: pointer; background: transparent; color: #9c95bc; border: 1px solid transparent;
  border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 700; font-family: inherit;
}
.rail-tab.active { background: rgba(149, 117, 255, 0.22); color: #fff; border-color: rgba(149, 117, 255, 0.4); }
.rail-tabs .copy-btn { margin-left: auto; }
.rail-sub { padding: 8px 14px 4px; font-size: 11.5px; font-weight: 700; color: #22d3ee; font-family: "JetBrains Mono", monospace; }
.rail-code { border-radius: 0; background: transparent; padding: 8px 14px 14px; max-height: 250px; }
.rail-resp-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.09); font-size: 11.5px; color: #9c95bc;
}
.ok-dot { padding: 1px 7px; border-radius: 6px; background: rgba(52, 211, 153, 0.18); color: #34d399; font-weight: 700; }

@media (max-width: 1150px) {
  .docs-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .rail { grid-column: 1 / -1; position: static; }
}
@media (max-width: 780px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); padding: 14px 12px 48px; }
  .sidebar { position: static; max-height: none; }
}
