:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --surface: #f1f5f9;
  --line: #e2e8f0;
  --ink: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --sidebar-w: 260px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

code {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.15em 0.35em;
  font-size: 0.88em;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  color: #be185d;
}

pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.65;
  margin: 0.75rem 0;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink);
  font-size: inherit;
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

h3 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 0.75rem;
  max-width: 65ch;
}

ul {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

li {
  margin-bottom: 0.3rem;
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.docs-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 1.5rem 0;
}

.docs-sidebar-header {
  padding: 0 1.2rem 1.2rem;
  border-bottom: 1px solid var(--line);
}

.docs-sidebar-header a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}

.docs-sidebar-header a:hover { text-decoration: none; }

.docs-nav { padding: 1rem 0; }

.docs-nav-group { margin-bottom: 1rem; }

.docs-nav-group-title {
  padding: 0 1.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.docs-nav a {
  display: block;
  padding: 0.38rem 1.4rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}

.docs-nav a:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.03);
  text-decoration: none;
}

.docs-nav a.active {
  color: var(--accent);
  font-weight: 600;
  background: rgba(37, 99, 235, 0.05);
  border-right: 2px solid var(--accent);
}

.docs-main {
  padding: 2.5rem 3rem 4rem;
  max-width: 820px;
}

.docs-breadcrumb {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.docs-breadcrumb a {
  color: var(--muted);
}

.docs-breadcrumb a:hover {
  color: var(--ink);
}

/* Callouts */
.callout {
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  line-height: 1.5;
}

.callout-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.callout-warn {
  background: #fefce8;
  border: 1px solid #fde68a;
  color: #92400e;
}

.callout-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Table */
.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--bg-soft);
}

tr:last-child td {
  border-bottom: none;
}

@media (max-width: 768px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 280px;
    z-index: 50;
    transition: left 250ms ease;
    background: var(--bg);
  }
  .docs-sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
  }
  .docs-mobile-toggle { display: block; }
  .docs-main { padding: 1.5rem 1.2rem 3rem; }
}

@media (min-width: 769px) {
  .docs-mobile-toggle { display: none; }
}

.docs-mobile-toggle {
  display: none;
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  z-index: 60;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  place-items: center;
}