/* Tokens shared with site/style.css and app/public/style.css (keep in sync). */
:root {
  --bg: #0a0b14;
  --bg-2: #0f1120;
  --surface: #141729;
  --surface-2: #1a1e35;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eceefa;
  --muted: #9aa0c0;
  --accent: #8b6cff;
  --accent-2: #2dd4ef;
  --grad: linear-gradient(120deg, #8b6cff 0%, #5b8cff 50%, #2dd4ef 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: radial-gradient(1000px 500px at 85% -10%, rgba(139, 108, 255, 0.14), transparent 60%), var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.86em; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 0.1em 0.4em; border-radius: 6px; overflow-wrap: anywhere; }
kbd { background: var(--surface-2); border: 1px solid var(--border-strong); border-bottom-width: 2px; padding: 0.05em 0.45em; border-radius: 5px; }

.topbar { position: sticky; top: 0; z-index: 20; background: rgba(10, 11, 20, 0.8); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1320px; margin: 0 auto; padding: 0 16px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.04em; }
.brand:hover { text-decoration: none; }
.brand em { font-style: normal; font-weight: 600; font-size: 0.78rem; color: var(--accent-2); border: 1px solid rgba(45, 212, 239, 0.35); border-radius: 999px; padding: 1px 8px; letter-spacing: 0; }
.logo-mark { width: 28px; height: 28px; }
.top-links { display: flex; align-items: center; gap: 18px; }
.top-links a { color: var(--muted); font-weight: 500; font-size: 0.94rem; }
.top-links a.btn { color: #fff; }
.btn { display: inline-flex; align-items: center; background: var(--grad); color: #fff; border-radius: 10px; padding: 8px 16px; font-weight: 600; }
.btn:hover { text-decoration: none; filter: brightness(1.1); }

.layout { max-width: 1320px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 40px; }
.sidebar { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto; padding: 28px 0; }
.mobile-nav { display: none; }
.nav-section { margin-bottom: 22px; }
.nav-section p { margin: 0 0 6px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.nav-section ul { list-style: none; margin: 0; padding: 0; }
.nav-section a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: 8px; color: #c5c9e4; font-size: 0.93rem; }
.nav-section a:hover { background: var(--surface); text-decoration: none; color: var(--text); }
.nav-section a[aria-current] { background: rgba(139, 108, 255, 0.15); color: var(--text); font-weight: 600; }

.content { padding: 36px 0 64px; min-width: 0; }
.crumb { margin: 0 0 6px; color: var(--accent-2); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.doc h1 { font-size: clamp(1.8rem, 3.6vw, 2.4rem); letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 12px; }
.doc .lead { font-size: 1.1rem; color: #c9cde6; margin-top: 0; }
.doc h2 { font-size: 1.35rem; margin: 2.2em 0 0.6em; padding-top: 0.6em; border-top: 1px solid var(--border); letter-spacing: -0.02em; }
.doc h3 { font-size: 1.08rem; margin: 1.6em 0 0.4em; }
.doc p, .doc li { color: #d6d9ef; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin: 0.3em 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 0.93rem; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.doc pre { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; }
.doc pre code { background: none; border: 0; padding: 0; }
.callout { border: 1px solid; border-radius: 12px; padding: 12px 16px; margin: 1.2em 0; }
.callout p { margin: 0.3em 0; }
.callout.info { background: rgba(96, 165, 250, 0.08); border-color: rgba(96, 165, 250, 0.35); }
.callout.tip { background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.35); }
.callout.warn { background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.35); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 1.4em 0; }
.cards a { display: block; padding: 16px 18px; border: 1px solid var(--border-strong); border-radius: 14px; background: linear-gradient(180deg, var(--surface), var(--bg-2)); color: var(--text); }
.cards a:hover { border-color: var(--accent); text-decoration: none; }
.cards strong { display: block; margin-bottom: 4px; }
.cards span { color: var(--muted); font-size: 0.9rem; }
.steps-list { counter-reset: step; list-style: none; padding-left: 0 !important; }
.steps-list > li { counter-increment: step; position: relative; padding-left: 42px; margin: 0.9em 0; }
.steps-list > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 8px; background: var(--grad); color: #fff; font-weight: 700; font-size: 0.85rem; display: grid; place-items: center; }

.pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 48px; }
.pager a { flex: 1; max-width: 48%; border: 1px solid var(--border-strong); border-radius: 12px; padding: 12px 16px; color: var(--text); font-weight: 600; }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager small { display: block; color: var(--muted); font-weight: 500; font-size: 0.78rem; }
.pager .next { text-align: right; margin-left: auto; }
.doc-footer { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.88rem; }

.toc { position: sticky; top: 64px; align-self: start; padding: 36px 0; font-size: 0.86rem; }
.toc p { margin: 0 0 8px; font-weight: 700; color: var(--muted); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 3px 0 3px 12px; color: var(--muted); }
.toc a:hover { color: var(--text); text-decoration: none; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 230px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sidebar { display: none; }
  .mobile-nav { display: block; border: 1px solid var(--border-strong); border-radius: 12px; padding: 4px 16px; margin-bottom: 22px; background: var(--surface); }
  .mobile-nav summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
  .mobile-nav[open] summary { margin-bottom: 8px; }
  .top-links a:not(.btn) { display: none; }
  .content { padding-top: 24px; }
  .pager { flex-direction: column; }
  .pager a { max-width: none; }
}
