:root {
  --bg: #1e1f22;
  --panel: #2b2d31;
  --panel-2: #313338;
  --text: #dbdee1;
  --muted: #949ba4;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --border: #3f4147;
  --code: #1e1f22;
  --danger: #f23f43;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { scroll-padding-top: 72px; }  /* #heading links land below the sticky top bar, not under it */
body {
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: #00a8fc; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 20px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { color: #fff; font-weight: 700; font-size: 18px; }
.brand span { color: var(--muted); font-weight: 400; margin-left: 4px; }
.brand:hover { text-decoration: none; }
.user { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.user img { border-radius: 50%; }

.btn {
  display: inline-block; padding: 10px 18px; border-radius: 6px;
  background: var(--accent); color: #fff; font-weight: 600;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn.small { padding: 5px 10px; font-size: 13px; background: var(--panel-2); border: 1px solid var(--border); }
.btn.small:hover { background: var(--border); }
.btn.discord::before { content: ""; display: inline-block; width: 18px; height: 18px; margin: 0 8px -3px 0;
  background: currentColor; -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 127.14 96.36'><path d='M107.7 8.07A105.15 105.15 0 0 0 81.47 0a72.06 72.06 0 0 0-3.36 6.83 97.68 97.68 0 0 0-29.11 0A72.37 72.37 0 0 0 45.64 0a105.89 105.89 0 0 0-26.25 8.09C2.79 32.65-1.71 56.6.54 80.21a105.73 105.73 0 0 0 32.17 16.15 77.7 77.7 0 0 0 6.89-11.11 68.42 68.42 0 0 1-10.85-5.18c.91-.66 1.8-1.34 2.66-2a75.57 75.57 0 0 0 64.32 0c.87.71 1.76 1.39 2.66 2a68.68 68.68 0 0 1-10.87 5.19 77 77 0 0 0 6.89 11.1 105.25 105.25 0 0 0 32.19-16.14c2.64-27.38-4.51-51.11-18.9-72.15ZM42.45 65.69C36.18 65.69 31 60 31 53s5-12.74 11.43-12.74S54 46 53.89 53s-5.05 12.69-11.44 12.69Zm42.24 0C78.41 65.69 73.25 60 73.25 53s5-12.74 11.44-12.74S96.23 46 96.12 53s-5.04 12.69-11.43 12.69Z'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 127.14 96.36'><path d='M107.7 8.07A105.15 105.15 0 0 0 81.47 0a72.06 72.06 0 0 0-3.36 6.83 97.68 97.68 0 0 0-29.11 0A72.37 72.37 0 0 0 45.64 0a105.89 105.89 0 0 0-26.25 8.09C2.79 32.65-1.71 56.6.54 80.21a105.73 105.73 0 0 0 32.17 16.15 77.7 77.7 0 0 0 6.89-11.11 68.42 68.42 0 0 1-10.85-5.18c.91-.66 1.8-1.34 2.66-2a75.57 75.57 0 0 0 64.32 0c.87.71 1.76 1.39 2.66 2a68.68 68.68 0 0 1-10.87 5.19 77 77 0 0 0 6.89 11.1 105.25 105.25 0 0 0 32.19-16.14c2.64-27.38-4.51-51.11-18.9-72.15ZM42.45 65.69C36.18 65.69 31 60 31 53s5-12.74 11.43-12.74S54 46 53.89 53s-5.05 12.69-11.44 12.69Zm42.24 0C78.41 65.69 73.25 60 73.25 53s5-12.74 11.44-12.74S96.23 46 96.12 53s-5.04 12.69-11.43 12.69Z'/></svg>") center/contain no-repeat; }

.center { display: flex; justify-content: center; padding: 60px 20px; }
.card {
  max-width: 480px; width: 100%; padding: 32px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; text-align: center;
}
.card h1 { margin-top: 0; }
.card .btn { margin: 12px 0; }
.fine { color: var(--muted); font-size: 13px; margin-bottom: 0; }
.error { color: var(--danger); }

.layout { display: flex; min-height: calc(100% - 56px); }
.sidebar {
  width: 240px; flex-shrink: 0; padding: 20px 12px;
  background: var(--panel); border-right: 1px solid var(--border);
  /* Pinned below the top bar; scrolls on its own if the page list outgrows the window */
  position: sticky; top: 56px; align-self: flex-start;
  height: calc(100vh - 56px); overflow-y: auto;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a {
  display: block; padding: 8px 12px; border-radius: 6px; color: var(--muted);
}
.sidebar a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.sidebar a.active { background: var(--panel-2); color: #fff; font-weight: 600; }

.content { flex: 1; min-width: 0; padding: 32px 48px 80px; }
.doc { max-width: 780px; }
.doc h1 { margin-top: 0; font-size: 32px; }
.doc h2 { margin-top: 40px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.doc h3 { margin-top: 28px; }
.doc code {
  background: var(--code); padding: 2px 6px; border-radius: 4px;
  font: 14px ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}
.doc pre {
  background: var(--code); padding: 14px 16px; border-radius: 8px; overflow-x: auto;
  border: 1px solid var(--border);
}
.doc pre code { padding: 0; background: none; }
.doc table { border-collapse: collapse; width: 100%; margin: 16px 0; }
.doc th, .doc td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.doc th { background: var(--panel); }
.doc blockquote {
  margin: 16px 0; padding: 10px 16px; border-left: 4px solid var(--accent);
  background: var(--panel); color: var(--text); border-radius: 0 6px 6px 0;
}
.doc blockquote p { margin: 4px 0; }
.doc img { max-width: 100%; }

@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar { width: auto; border-right: 0; border-bottom: 1px solid var(--border); position: static; height: auto; }
  .content { padding: 20px; }
}
