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

:root {
  --color-primary: #017737;
  --color-primary-light: #e8f5e9;
  --color-dark: #1a1a2e;
  --color-gray-50: #f8fafc;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-600: #475569;
  --color-gray-800: #1e293b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--color-gray-800);
  line-height: 1.7;
  background: #fff;
}

/* Header */
.header {
  background: #fff;
  border-bottom: 1px solid var(--color-gray-200);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-dark);
}
.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.header-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.header-nav a {
  text-decoration: none;
  color: var(--color-gray-600);
  font-weight: 500;
  font-size: 0.95rem;
}
.header-nav a:hover { color: var(--color-primary); }

/* Layout */
.guide-layout {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  padding: 2rem;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}
.sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-gray-600);
  margin-bottom: 1rem;
  font-weight: 600;
}
.toc { list-style: none; }
.toc-item { margin-bottom: 0.25rem; }
.toc-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: var(--color-gray-600);
  font-size: 0.875rem;
  border-radius: 8px;
  transition: all 0.15s;
}
.toc-link:hover {
  background: var(--color-gray-100);
  color: var(--color-gray-800);
}
.toc-link.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 500;
}
.toc-num {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-gray-300);
  width: 20px;
}
.toc-link:hover .toc-num,
.toc-link.active .toc-num {
  color: var(--color-primary);
}

/* Main */
.main-content { min-width: 0; }

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-gray-600);
  margin-bottom: 1.5rem;
}
.breadcrumbs a {
  color: var(--color-gray-600);
  text-decoration: none;
}
.breadcrumbs a:hover { color: var(--color-primary); }

/* Hero */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 0.375rem 0.875rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: var(--color-dark);
}
.hero-description {
  font-size: 1.1rem;
  color: var(--color-gray-600);
  margin-bottom: 1.5rem;
}

/* TL;DR Box */
.tldr-box {
  background: linear-gradient(135deg, var(--color-gray-50) 0%, var(--color-gray-100) 100%);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
}
.tldr-box strong { color: var(--color-primary); }

/* Content */
.content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--color-dark);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-gray-100);
}
.content h2:first-child { margin-top: 0; }
.content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--color-gray-800);
}
.content p {
  margin-bottom: 1rem;
}
.content ul, .content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}
.content li {
  margin-bottom: 0.5rem;
}
.content a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}
.content a:hover { text-decoration: underline; }

/* Callout boxes */
.callout {
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.callout-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.callout-tip {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.callout-tip .callout-title { color: #166534; }
.callout-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.callout-warning .callout-title { color: #92400e; }
.callout-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}
.callout-info .callout-title { color: #1e40af; }

/* Steps */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.step {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-gray-100);
}
.step:last-child { border-bottom: none; }
.step-num {
  counter-increment: step;
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.step-num::before { content: counter(step); }
.step-content h4 {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.step-content p {
  color: var(--color-gray-600);
  margin: 0;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-gray-200);
}
th {
  background: var(--color-gray-50);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-gray-600);
}

/* Chapter Nav */
.chapter-nav {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-gray-200);
}
.chapter-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.chapter-nav a {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.15s;
}
.chapter-nav a:hover {
  border-color: var(--color-primary);
  background: #fff;
}
.chapter-nav-label {
  display: block;
  font-size: 0.75rem;
  color: var(--color-gray-600);
  margin-bottom: 0.25rem;
}
.chapter-nav-title {
  font-weight: 600;
  color: var(--color-gray-800);
}
.chapter-nav-next { text-align: right; }

/* Footer */
.footer {
  background: var(--color-gray-50);
  border-top: 1px solid var(--color-gray-200);
  padding: 3rem 2rem;
  margin-top: 4rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2rem;
}
.footer-brand p {
  color: var(--color-gray-600);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}
.footer-section h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-gray-600);
  margin-bottom: 0.75rem;
}
.footer-section a {
  display: block;
  color: var(--color-gray-800);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.footer-section a:hover { color: var(--color-primary); }
.footer-bottom {
  grid-column: 1 / -1;
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--color-gray-200);
  color: var(--color-gray-600);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 900px) {
  .guide-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-gray-200);
  }
  .toc {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .toc-link {
    padding: 0.5rem 0.75rem;
    background: var(--color-gray-100);
  }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .chapter-nav-grid { grid-template-columns: 1fr; }
}
