:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --body-text: #c9d1d9;
  --muted: #8b949e;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --sidebar-width: 272px;
  --nav-height: 58px;
  --radius: 8px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 20px);
}

body {
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

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

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 500;
  padding: 8px 12px;
  transform: translateY(-150%);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.15s;
}

.skip-link:focus {
  transform: translateY(0);
}

code,
pre {
  font-family: Consolas, "Courier New", monospace;
}

:not(pre) > code {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: #79c0ff;
  font-size: 12.5px;
}

.topnav {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--nav-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 17, 23, 0.93);
  backdrop-filter: blur(10px);
}

.nav-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.nav-title:hover {
  text-decoration: none;
}

.nav-version {
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
}

.nav-spacer {
  flex: 1;
}

.nav-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--text);
  text-decoration: none;
}

.hamburger {
  display: none;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}

.layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--nav-height);
}

.sidebar {
  position: fixed;
  top: var(--nav-height);
  bottom: 0;
  width: var(--sidebar-width);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px 12px 40px;
  border-right: 1px solid var(--border);
  background: var(--bg);
}

.docs-search {
  position: relative;
  z-index: 3;
  margin-bottom: 18px;
  padding: 0 4px;
}

.docs-search label {
  display: block;
  margin: 0 0 6px 4px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.docs-search__control {
  position: relative;
}

.docs-search input {
  width: 100%;
  padding: 9px 34px 9px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.docs-search input::placeholder {
  color: #6e7681;
}

.docs-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.docs-search kbd {
  position: absolute;
  top: 50%;
  right: 8px;
  min-width: 20px;
  padding: 0 5px;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

.docs-search__status {
  min-height: 17px;
  margin: 4px 4px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.docs-search__results {
  position: absolute;
  top: calc(100% - 15px);
  right: 4px;
  left: 4px;
  max-height: min(420px, 55vh);
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #161b22;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.docs-search__results a {
  display: block;
  padding: 8px 9px;
  border-radius: 6px;
}

.docs-search__results a:hover,
.docs-search__results a:focus {
  outline: none;
  background: var(--surface-2);
  text-decoration: none;
}

.docs-search__results strong,
.docs-search__results span {
  display: block;
}

.docs-search__results strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-search__results span {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-search__empty {
  padding: 10px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.sidebar::-webkit-scrollbar {
  width: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: var(--border);
}

.nav-group {
  margin-bottom: 22px;
}

.nav-group__title {
  margin-bottom: 5px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-group ul {
  list-style: none;
}

.nav-group a {
  display: block;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.4;
  transition: color 0.12s, background 0.12s;
}

.nav-group a:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.nav-group a.is-active {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-hover);
  font-weight: 600;
}

.content {
  flex: 1;
  min-width: 0;
  max-width: calc(var(--sidebar-width) + 880px);
  margin-left: var(--sidebar-width);
  padding: 0 56px 100px;
}

.hero {
  margin-bottom: 56px;
  padding: 60px 0 56px;
  border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  padding: 3px 12px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.08);
  color: #93c5fd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1 {
  margin-bottom: 20px;
  background: linear-gradient(135deg, #e6edf3 0%, #93c5fd 55%, #c4b5fd 100%);
  background-clip: text;
  color: transparent;
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  max-width: 60ch;
  margin-bottom: 36px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.6;
}

.hero-install {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: #79c0ff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
}

.hero-install .prompt {
  color: var(--muted);
  user-select: none;
}

.hero-copy-button,
.copy-button {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  transition: color 0.12s, border-color 0.12s;
}

.hero-copy-button:hover,
.copy-button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.hero-copy-button.is-copied,
.copy-button.is-copied {
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.pill-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill,
.chip {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 600;
}

.pill-green {
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.pill-purple {
  border-color: rgba(139, 92, 246, 0.25);
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
}

.pill-amber {
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}

.hero-paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 680px;
  margin-top: 28px;
}

.hero-paths a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(22, 27, 34, 0.72);
  color: var(--body-text);
  font-size: 12px;
  font-weight: 600;
}

.hero-paths a:hover {
  border-color: rgba(59, 130, 246, 0.55);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.hero-paths span {
  color: var(--accent-hover);
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
}

section,
header[id] {
  scroll-margin-top: calc(var(--nav-height) + 20px);
}

.doc-section {
  margin-top: 64px;
}

.doc-section:first-of-type {
  margin-top: 0;
}

.section-rule {
  display: none;
}

.doc-section h2 {
  margin-bottom: 32px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.doc-section h3 {
  margin-top: 44px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}

.doc-section h4 {
  margin-top: 28px;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.doc-section p {
  max-width: 80ch;
  margin-bottom: 14px;
  color: var(--body-text);
}

.doc-section ul,
.doc-section ol {
  margin-bottom: 14px;
  padding-left: 22px;
  color: var(--body-text);
}

.doc-section li {
  margin-bottom: 5px;
}

.flow-list {
  counter-reset: persistence-step;
  list-style: none;
  padding-left: 0 !important;
}

.flow-list li {
  position: relative;
  min-height: 34px;
  padding: 5px 0 10px 42px;
  counter-increment: persistence-step;
}

.flow-list li::before {
  position: absolute;
  top: 2px;
  left: 0;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-hover);
  content: counter(persistence-step);
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
}

.check-list {
  list-style: none;
  padding-left: 0 !important;
}

.check-list li {
  position: relative;
  padding-left: 25px;
}

.check-list li::before {
  position: absolute;
  left: 2px;
  color: #86efac;
  content: "\2713";
  font-weight: 800;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 22px;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 24px;
}

.path-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(33, 38, 45, 0.72), rgba(22, 27, 34, 0.88));
}

.path-card__label {
  color: var(--accent-hover);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.path-card h3 {
  margin: 8px 0 5px;
  font-size: 17px;
}

.path-card p {
  margin-bottom: 12px;
  font-size: 13px;
}

.path-card > a {
  font-size: 12px;
  font-weight: 600;
}

.info-card,
.footer-note {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.info-card h4 {
  margin-top: 0;
}

.callout {
  margin: 14px 0 22px;
  padding: 14px 18px;
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(59, 130, 246, 0.07);
  color: var(--body-text);
}

.callout--success {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.07);
}

.callout--warn {
  border-color: #eab308;
  background: rgba(234, 179, 8, 0.07);
}

.callout--danger {
  border-color: #f85149;
  background: rgba(248, 81, 73, 0.07);
}

.callout strong {
  color: var(--text);
}

.code-block {
  position: relative;
  margin: 14px 0 22px;
}

.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #1c2128;
}

.code-block__header span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.code-block pre {
  overflow-x: auto;
  margin: 0;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #0d1117;
  font-size: 13px;
  line-height: 1.6;
}

.code-block pre code,
.code-block pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 16px;
  border: 0;
  border-radius: 0 0 8px 8px;
  background: #0d1117;
  color: var(--body-text);
  font-size: inherit;
}

.table-wrap {
  overflow-x: auto;
  margin: 14px 0 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.doc-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 13.5px;
}

.doc-table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.doc-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--body-text);
  vertical-align: top;
}

.doc-table tr:last-child td {
  border-bottom: 0;
}

.doc-table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.doc-table td:first-child {
  color: var(--text);
}

.doc-table td code {
  font-size: 11.5px;
}

.signature {
  color: #79c0ff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
}

.subtle {
  color: var(--muted) !important;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--accent);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}

.overlay {
  display: none;
}

@media (max-width: 1060px) {
  .content {
    padding: 0 32px 80px;
  }
}

@media (max-width: 768px) {
  .nav-link {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .sidebar {
    z-index: 150;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    transition: transform 0.28s;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .overlay {
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(0, 0, 0, 0.5);
  }

  .overlay.is-visible {
    display: block;
  }

  .content {
    max-width: none;
    margin-left: 0;
    padding: 0 18px 64px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero-sub {
    font-size: 16px;
  }

  .hero-install {
    max-width: 100%;
    flex-wrap: wrap;
  }

  .doc-section h2 {
    font-size: 23px;
  }

  .mini-grid {
    grid-template-columns: 1fr;
  }

  .path-grid,
  .hero-paths {
    grid-template-columns: 1fr;
  }
}
