:root {
  --bg: #0f1419;
  --surface: #161b22;
  --surface2: #1a2030;
  --border: #2a313c;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --slate: #7aa2f7;
  --sage: #9ece6a;
  --amber: #e0af68;
  --rose: #f7768e;
  --lavender: #bb9af7;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --nav-height: 56px;
  --sidebar-width: 240px;
  --content-max: 760px;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
}

.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 10;
}
.topnav a.brand {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.5px;
}
.topnav .launch {
  margin-left: auto;
  padding: 6px 14px;
  background: var(--slate);
  color: var(--bg);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.topnav .menu {
  display: none;
  margin-right: 12px;
  font-size: 20px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
}

.sidebar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 0;
  z-index: 5;
}
.sidebar h4 {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 20px 6px;
  font-weight: 700;
}
.sidebar a {
  display: block;
  padding: 6px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  border-left: 2px solid transparent;
}
.sidebar a:hover {
  color: var(--text);
  background: var(--surface2);
}
.sidebar a.active {
  color: var(--slate);
  border-left-color: var(--slate);
  background: var(--surface2);
}

main {
  margin-top: var(--nav-height);
  margin-left: var(--sidebar-width);
  padding: 40px 48px 80px;
  max-width: calc(var(--content-max) + 96px);
}

article h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}
article h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 10px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
article h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 8px;
}
article p, article li { margin-bottom: 12px; }
article a { color: var(--slate); }
article code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface2);
  padding: 1px 6px;
  border-radius: 3px;
}
article pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  overflow-x: auto;
  margin-bottom: 16px;
}
article ol, article ul { padding-left: 24px; }

.callout {
  background: var(--surface2);
  border-left: 3px solid var(--amber);
  padding: 14px 18px;
  margin: 18px 0;
  border-radius: 4px;
}
.callout.risk { border-left-color: var(--rose); }
.callout.info { border-left-color: var(--slate); }
.callout.safety { border-left-color: var(--sage); }
.callout h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.callout.risk h4 { color: var(--rose); }
.callout.info h4 { color: var(--slate); }
.callout.safety h4 { color: var(--sage); }

.figure {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  margin: 24px 0;
}
.figure svg, .figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
.figure figcaption {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
  margin-top: 18px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 8px 0 8px 40px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 6px;
  width: 26px;
  height: 26px;
  background: var(--surface2);
  color: var(--slate);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  margin-bottom: 18px;
}
th, td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  color: var(--text);
  font-weight: 600;
  background: var(--surface);
}
td { color: var(--text-muted); }

.breadcrumb {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--text); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 18px;
  text-decoration: none;
  display: block;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--slate); }
.card h4 {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.card p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

.muted { color: var(--text-muted); }

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .sidebar.open { transform: translateX(0); }
  main { margin-left: 0; padding: 24px 20px 60px; }
  .topnav .menu { display: inline-flex; }
}
