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

:root {
  --bg: #ffffff;
  --text: #1a1a2e;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #5865F2;
  --accent-hover: #4752c4;
  --code-bg: #f3f4f6;
  --sidebar-bg: #f9fafb;
  --sidebar-w: 280px;
  --content-max: 800px;
  --step-num: #5865F2;
  --callout-bg: #eef0ff;
  --callout-border: #5865F2;
  --warning-bg: #fff8e6;
  --warning-border: #f59e0b;
  --radius: 6px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────── */

#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 32px 0 32px;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  text-decoration: none;
  color: var(--text);
}

.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-logo .logo-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.sidebar-logo .logo-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}

.nav-section {
  padding: 0 12px 4px;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 12px 8px 4px;
}

.nav-section a {
  display: block;
  padding: 5px 8px;
  font-size: 14px;
  color: #374151;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-section a:hover { background: #e9ebf0; color: var(--accent); }
.nav-section a.active { background: var(--callout-bg); color: var(--accent); font-weight: 600; }

.nav-section a.sub {
  padding-left: 20px;
  font-size: 13px;
  color: var(--muted);
}
.nav-section a.sub:hover { color: var(--accent); }

/* ── Main ────────────────────────────────────────── */

#main {
  flex: 1;
  min-width: 0;
  padding: 48px 48px 80px;
}

.content {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* ── Typography ──────────────────────────────────── */

h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 12px;
}

h1 .subtitle {
  display: block;
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 6px;
}

h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 10px;
}

h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 24px 0 8px;
}

p { margin-bottom: 12px; }

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

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

/* ── Code ────────────────────────────────────────── */

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: #d63384;
}

pre {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: var(--radius);
  padding: 16px 20px;
  overflow-x: auto;
  margin: 16px 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

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

/* ── Callouts ────────────────────────────────────── */

.callout {
  border-left: 4px solid var(--callout-border);
  background: var(--callout-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 0.95rem;
}

.callout.warning {
  border-left-color: var(--warning-border);
  background: var(--warning-bg);
}

.callout strong { display: block; margin-bottom: 4px; }

/* ── Command cards ───────────────────────────────── */

.cmd-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 16px 0;
  overflow: hidden;
}

.cmd-header {
  background: var(--code-bg);
  padding: 10px 16px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.cmd-name {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.cmd-desc {
  font-size: 0.875rem;
  color: var(--muted);
}

.cmd-body {
  padding: 12px 16px;
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-top: 8px;
}

.param-table th {
  text-align: left;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.param-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

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

.param-table .param-name {
  font-family: monospace;
  font-size: 0.85rem;
  color: #d63384;
  white-space: nowrap;
}

.param-table .param-name a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted #d63384;
}
.param-table .param-name a:hover {
  border-bottom-style: solid;
  text-decoration: none;
}

.param-table .optional {
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--code-bg);
  border-radius: 3px;
  padding: 1px 5px;
}

.param-table .ac {
  font-size: 0.75rem;
  color: #7c6ef5;
  background: #f0eeff;
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
}

.param-table .ac-pick {
  font-size: 0.75rem;
  color: #0369a1;
  background: #e0f2fe;
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
}

/* ── Workflow steps ──────────────────────────────── */

.steps { margin: 20px 0; }

.step {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  position: relative;
}

.step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 40px;
  bottom: -16px;
  width: 2px;
  background: var(--border);
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.step-body { flex: 1; min-width: 0; }
.step-body h4 { margin-top: 6px; color: var(--text); text-transform: none; letter-spacing: 0; font-size: 1rem; }
.step-body p { font-size: 0.95rem; }

/* ── Screenshots ─────────────────────────────────── */

.screenshot {
  margin: 16px 0 24px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #d1d5db;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

.screenshot-caption {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  padding: 6px 12px;
  background: var(--sidebar-bg);
  border-top: 1px solid var(--border);
}

/* ── Button badges ───────────────────────────────── */

.btn {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  white-space: nowrap;
}
.btn-primary   { background: #5865F2; color: #fff; }
.btn-secondary { background: #4E5058; color: #fff; }
.btn-success   { background: #248046; color: #fff; }
.btn-danger    { background: #DA373C; color: #fff; }

/* ── Page header ─────────────────────────────────── */

.page-header {
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 40px;
}

.page-header .badge {
  display: inline-block;
  background: var(--callout-bg);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Responsive ──────────────────────────────────── */

@media (max-width: 768px) {
  body { flex-direction: column; }

  #sidebar {
    width: 100%;
    min-width: 0;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
  }

  #main { padding: 24px 20px 60px; }
}
