:root {
  --bg: #0a0e1a;
  --bg-card: #111827;
  --bg-card-hover: #1a2235;
  --border: #1e293b;
  --text: #cbd5e1;
  --text-muted: #64748b;
  --text-heading: #f1f5f9;
  --accent: #3b82f6;
  --accent-green: #22c55e;
  --accent-yellow: #eab308;
  --accent-red: #ef4444;
  --accent-purple: #a855f7;
  --accent-orange: #f97316;
  --radius: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  background: linear-gradient(135deg, #111827 0%, #1e1b4b 100%);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header h1 { color: var(--text-heading); font-size: 1.5rem; }
.site-header h1 span { color: var(--accent); }
.site-header .subtitle { color: var(--text-muted); font-size: 0.85rem; }

/* Navigation */
.toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 32px 0;
}

.toc h2 { color: var(--text-heading); font-size: 1.1rem; margin-bottom: 12px; }

.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}

.toc a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 4px;
  display: block;
  transition: background 0.15s;
}

.toc a:hover { background: var(--bg-card-hover); }
.toc a .num { color: var(--text-muted); margin-right: 4px; }

/* Sections */
.section {
  margin: 48px 0;
  scroll-margin-top: 80px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-num {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.section-header h2 { color: var(--text-heading); font-size: 1.4rem; }

.section-desc {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

/* Content blocks */
.block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.block h3 {
  color: var(--text-heading);
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.block h4 {
  color: var(--accent);
  font-size: 0.95rem;
  margin: 16px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.block p, .block li { margin-bottom: 8px; }
.block ul { padding-left: 20px; }

/* Screenshots */
.screenshots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

.screenshot-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.screenshot-wrapper img {
  width: 100%;
  display: block;
  cursor: pointer;
  transition: opacity 0.15s;
}

.screenshot-wrapper img:hover { opacity: 0.9; }

.screenshot-caption {
  background: var(--bg-card-hover);
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.screenshots-grid { grid-template-columns: 1fr 1fr; }

/* Detail tables */
.detail-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.9rem;
}

.detail-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  color: var(--text-heading);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-table td {
  padding: 8px 12px;
  border: 1px solid var(--border);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-green { background: rgba(34, 197, 94, 0.2); color: var(--accent-green); }
.badge-yellow { background: rgba(234, 179, 8, 0.2); color: var(--accent-yellow); }
.badge-red { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); }
.badge-blue { background: rgba(59, 130, 246, 0.2); color: var(--accent); }
.badge-purple { background: rgba(168, 85, 247, 0.2); color: var(--accent-purple); }
.badge-gray { background: rgba(100, 116, 139, 0.2); color: var(--text-muted); }
.badge-orange { background: rgba(249, 115, 22, 0.2); color: var(--accent-orange); }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-card .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
}

.stat-card .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

/* Checklist */
.checklist { list-style: none; padding: 0; }
.checklist li {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.checklist li:last-child { border-bottom: none; }
.check-icon { flex-shrink: 0; margin-top: 2px; }

/* Alert boxes */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 16px 0;
  border-left: 4px solid;
}
.alert-info { background: rgba(59, 130, 246, 0.08); border-color: var(--accent); }
.alert-warning { background: rgba(234, 179, 8, 0.08); border-color: var(--accent-yellow); }
.alert-danger { background: rgba(239, 68, 68, 0.08); border-color: var(--accent-red); }
.alert-success { background: rgba(34, 197, 94, 0.08); border-color: var(--accent-green); }

/* Sidebar visual */
.sidebar-group {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sidebar-group h4 {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.sidebar-group ul {
  list-style: none;
  padding: 0;
}

.sidebar-group li {
  padding: 4px 0;
  font-size: 0.9rem;
  color: var(--text);
}

.sidebar-group li .badge {
  margin-left: 6px;
  font-size: 0.65rem;
}

/* Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 64px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 95%; max-height: 95%; object-fit: contain; }

/* Route status list */
.route-status-list { list-style: none; padding: 0; }
.route-status-list li {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}
.route-status-list li:last-child { border-bottom: none; }
.route-path { font-family: monospace; color: var(--accent); font-size: 0.85rem; }

@media (max-width: 768px) {
  .screenshots-grid { grid-template-columns: 1fr; }
  .toc-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
