:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --accent: #0b5fff;
  --accent-light: #eef3ff;
  --border: #dbe2ea;
  --sidebar-w: 220px;
  --code-bg: #f1f5f9;
  --success: #15803d;
  --warning: #b45309;
  --danger: #b91c1c;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────── */
nav {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 24px 0 24px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.nav-brand {
  padding: 0 18px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.nav-brand .logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.3px;
}

.nav-brand .version {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

nav a {
  display: block;
  padding: 7px 18px;
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: color 100ms, border-color 100ms, background 100ms;
}

nav a:hover {
  color: var(--text);
  background: var(--accent-light);
}

nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}

.nav-section-label {
  padding: 14px 18px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #94a3b8;
}

/* ── MAIN CONTENT ────────────────────────────── */
main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 40px 48px 80px;
  max-width: 860px;
}

/* ── TYPOGRAPHY ──────────────────────────────── */
h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

h2 {
  font-size: 19px;
  font-weight: 700;
  margin: 48px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  scroll-margin-top: 24px;
}

h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 22px 0 8px;
  color: var(--text);
}

p {
  color: var(--muted);
  margin-bottom: 12px;
}

p:last-child { margin-bottom: 0; }

/* ── INTRO CARD ──────────────────────────────── */
.intro-card {
  background: var(--accent-light);
  border: 1px solid #c7d9ff;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 4px;
}

.intro-card p {
  color: #1e3a8a;
  margin: 0;
}

/* ── STEP LIST ───────────────────────────────── */
.steps {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}

.steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.steps li span {
  color: var(--muted);
  line-height: 1.6;
}

/* ── CALLOUT ─────────────────────────────────── */
.callout {
  border-radius: 10px;
  padding: 13px 16px;
  margin: 16px 0;
  font-size: 13px;
  border-left: 4px solid;
}

.callout.info {
  background: #f0f9ff;
  border-color: #38bdf8;
  color: #075985;
}

.callout.warning {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #78350f;
}

.callout.tip {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #14532d;
}

.callout strong { font-weight: 700; }

/* ── CODE & INLINE CODE ──────────────────────── */
code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: 'Cascadia Code', 'Consolas', monospace;
  font-size: 12.5px;
  color: #be185d;
}

pre.code-block {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0;
  overflow-x: auto;
  font-family: 'Cascadia Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.55;
}

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

/* ── BADGE ───────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  vertical-align: middle;
  margin: 0 2px;
}

.badge.prt  { background: #dbeafe; color: #1e40af; }
.badge.asm  { background: #dcfce7; color: #166534; }
.badge.dwr  { background: #fef3c7; color: #92400e; }
.badge.skip { background: #f1f5f9; color: #475569; }

/* ── TABLE ───────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 9px 12px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text);
}

td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  color: var(--muted);
  vertical-align: top;
}

tr:nth-child(even) td { background: #fafbfc; }

/* ── STAT GRID ───────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.stat-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.stat-item .stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-item .stat-desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

.stat-item.ok   { border-top: 3px solid #22c55e; }
.stat-item.info { border-top: 3px solid var(--accent); }
.stat-item.warn { border-top: 3px solid #f59e0b; }
.stat-item.muted { border-top: 3px solid #94a3b8; }

/* ── SEPARATOR ───────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* ── SECTION ─────────────────────────────────── */
section {
  margin-bottom: 8px;
}
