:root {
  --sidebar-bg: #162444;
  --sidebar-border: rgba(255,255,255,0.07);
  --sidebar-width: 260px;
  --accent: #2E75B6;
  --accent-hover: #245E96;
  --accent-subtle: #dbeafe;
  --bg: #eef2f7;
  --card-bg: #ffffff;
  --text: #162444;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --code-bg: #0d1a30;
  --code-text: #e2e8f0;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Segoe UI Variable', Roboto, sans-serif;
  --font-mono: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(22,36,68,0.08), 0 4px 16px rgba(22,36,68,0.05);
}

html { overflow-x: hidden; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 15px;
  overflow-x: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-brand {
  background: var(--sidebar-bg);
  padding: 16px 18px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand-logo-wrap {
  display: block;
  margin-bottom: 10px;
  padding: 0;
  background: transparent;
}

.brand-logo {
  width: 100%;
  height: auto;
  display: block;
}

.sidebar-brand h1 {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-top: 10px;
}

.sidebar-brand .brand-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}

.sidebar nav {
  padding: 16px 0;
  flex: 1;
}

.nav-label {
  padding: 12px 22px 5px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.25);
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 22px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 14.5px;
  transition: all 0.12s;
  border-left: 3px solid transparent;
}

.sidebar a .nav-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar a:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.9);
}

.sidebar a.active {
  background: rgba(46,117,182,0.2);
  border-left-color: var(--accent);
  color: #ffffff;
  padding-left: 19px;
}

.sidebar-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--sidebar-border);
  font-size: 11px;
  color: rgba(255,255,255,0.2);
  line-height: 1.6;
}

/* ── Main content ── */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 44px 48px;
  max-width: calc(var(--sidebar-width) + 860px);
  min-width: 0;
}

/* ── Page header ── */
.page-header {
  margin-bottom: 36px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  margin-bottom: 10px;
}

.page-header h1 {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-header .lead {
  margin-top: 12px;
  font-size: 16px;
  color: var(--text-muted);
  max-width: 620px;
  line-height: 1.65;
}

/* ── Cards ── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 26px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

.card-title .card-icon { font-size: 20px; }

.card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card h3:first-of-type { margin-top: 0; }

.card p {
  font-size: 14px;
  line-height: 1.75;
  color: #374151;
  margin-bottom: 12px;
}

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

.card ul { padding-left: 18px; }

.card ul li {
  font-size: 14px;
  line-height: 1.75;
  color: #374151;
  margin-bottom: 4px;
}

/* ── Grid ── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

/* ── Code blocks ── */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 20px 22px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  margin: 14px 0;
  border: 1px solid rgba(255,255,255,0.05);
  max-width: 100%;
  box-sizing: border-box;
}

code { font-family: var(--font-mono); font-size: 12.5px; }

p code, li code, td code {
  background: #eef2f7;
  color: #1a4070;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 12px;
  border: 1px solid #d0dae8;
}

/* Tree colour classes */
.tree .dir   { color: #7dd3fc; font-weight: 600; }
.tree .file  { color: #86efac; }
.tree .cm    { color: #64748b; }
.tree .hl    { color: #fbbf24; font-weight: 600; }
.tree .ep    { color: #f87171; }
.tree .sk    { color: #c084fc; }

/* Code highlight */
.code-key   { color: #7dd3fc; }
.code-val   { color: #86efac; }
.code-str   { color: #fbbf24; }
.code-cmt   { color: #64748b; font-style: italic; }
.code-acc   { color: #f472b6; }

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 12px 0;
}

thead th {
  background: #f4f7fb;
  text-align: left;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--border);
}

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.55;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f4f7fb; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-grey   { background: #f3f4f6; color: #374151; }

/* ── Alerts ── */
.alert {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  margin: 16px 0;
  line-height: 1.6;
  align-items: flex-start;
}

.alert .alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-info    { background: #eef4fc; border-left: 4px solid var(--accent); }
.alert-warning { background: #fffbeb; border-left: 4px solid #f59e0b; }
.alert-danger  { background: #fef2f2; border-left: 4px solid #ef4444; }
.alert-success { background: #f0fdf4; border-left: 4px solid #22c55e; }

/* ── Command triggers ── */
.trigger-card {
  background: var(--code-bg);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 10px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border: 1px solid rgba(255,255,255,0.05);
}

.trigger-card .trigger-phrase {
  font-family: var(--font-mono);
  color: #7dd3fc;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  min-width: 220px;
  padding-top: 1px;
}

.trigger-card .trigger-desc {
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  line-height: 1.55;
}

/* ── Principle cards ── */
.principle {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px 22px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.principle .principle-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}

.principle h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 7px;
  color: var(--text);
}

.principle p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}

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

/* ── Section spacing ── */
.section-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin: 32px 0 14px;
}

.section-label:first-child { margin-top: 0; }
