:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --card: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #22d3ee;
  --accent2: #a78bfa;
  --border: #334155;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: linear-gradient(180deg, var(--bg), #020617 70%);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1080px; margin: 0 auto; padding: 24px; }
.nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0;
  background: rgba(2,6,23,.85); backdrop-filter: blur(6px); z-index: 10;
}
.brand { font-weight: 700; letter-spacing: .2px; }
.badge { border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.hero {
  margin-top: 26px;
  background: radial-gradient(circle at 20% 20%, rgba(34,211,238,.2), transparent 40%),
              radial-gradient(circle at 80% 0%, rgba(167,139,250,.18), transparent 35%),
              var(--bg-soft);
  border: 1px solid var(--border); border-radius: 16px; padding: 34px;
}
.hero h1 { margin: 0 0 10px; font-size: 2rem; }
.hero p { color: var(--muted); max-width: 780px; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); gap: 14px; margin-top: 20px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.card h3 { margin: 0 0 8px; font-size: 1rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.cta-row { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-block; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border);
  font-weight: 600;
}
.btn.primary { background: linear-gradient(135deg, #0891b2, #7c3aed); color: white; border: none; }
.note { color: var(--muted); font-size: .92rem; margin-top: 16px; }
.footer { margin: 34px 0 12px; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--border); padding-top: 16px; }

/* Multipage docs layout */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(2,6,23,.92);
  backdrop-filter: blur(6px);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}
.top-links { display: flex; gap: 14px; }
.top-links a { color: var(--muted); font-size: .92rem; }

.layout {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}
.sidebar {
  position: sticky;
  top: 68px;
  height: calc(100vh - 86px);
  overflow: auto;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.86);
  border-radius: 12px;
  padding: 12px;
}
.sidebar-title {
  font-weight: 700;
  margin-bottom: 8px;
  padding: 8px;
}
.toc-search {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 2px 0 10px;
  background: rgba(15,23,42,.9);
  color: #e5e7eb;
}
.toc-search::placeholder { color: #94a3b8; }

.toc-group {
  border: 1px solid rgba(148,163,184,.2);
  border-radius: 8px;
  margin-bottom: 8px;
  background: rgba(15,23,42,.6);
}
.toc-group > summary {
  cursor: pointer;
  padding: 8px 10px;
  font-weight: 600;
  color: #cbd5e1;
  list-style: none;
}
.toc-group > summary::-webkit-details-marker { display: none; }
.toc-group > summary::after {
  content: '▸';
  float: right;
  color: #94a3b8;
}
.toc-group[open] > summary::after { content: '▾'; }

.sidebar ul { margin: 0; padding: 0 6px 8px; list-style: none; }
.sidebar li { margin: 0; }
.sidebar li a {
  display: block;
  color: #cbd5e1;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: .93rem;
  line-height: 1.3;
}
.sidebar li a:hover { background: rgba(148,163,184,.16); }
.sidebar li.active a {
  background: rgba(34,211,238,.18);
  border: 1px solid rgba(34,211,238,.4);
  color: #ecfeff;
}
.main { min-width: 0; }
.pagination {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 22px;
}
.pager {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(30,41,59,.7);
  color: #e2e8f0;
}

/* Guide page styling */
.guide {
  max-width: 980px;
}
.guide .content {
  background: #f8fafc;
  color: #0f172a;
  border-radius: 12px;
  padding: 30px;
}
.guide .content a { color: #0e7490; }

/* Command-type label callouts (blockquotes above code blocks) */
.content blockquote {
  margin: 6px 0 0;
  padding: 5px 12px;
  border-left: 3px solid #64748b;
  border-radius: 4px 4px 0 0;
  background: rgba(30,41,59,.7);
  font-size: .88rem;
  color: #94a3b8;
  font-style: normal;
}
/* Terminal label */
.content blockquote:has(+ pre) {
  border-left-color: #22c55e;
  background: rgba(21,128,61,.15);
  color: #86efac;
}
/* Chat label override - detect via content */
.content blockquote + pre {
  border-radius: 0 0 6px 6px;
  margin-top: 0;
}

/* Multipage article link styling */
.content a {
  color: #22d3ee;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.content a:hover { color: #67e8f9; }
.guide pre {
  background: #0b1020;
  color: #e2e8f0;
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
}
.guide code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.guide h1, .guide h2, .guide h3 { line-height: 1.25; }
.guide table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.guide th, .guide td { border: 1px solid #cbd5e1; padding: 8px; text-align: left; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    max-height: 45vh;
  }
}
