:root {
  --bg: #f4f5f1;
  --surface: #ffffff;
  --surface-soft: #fafbf9;
  --text: #1f2933;
  --muted: #637083;
  --line: rgba(31, 41, 51, 0.1);
  --accent: #087d72;
  --accent-dark: #05655d;
  --accent-soft: rgba(8, 125, 114, 0.08);
  --warm: #c2692f;
  --warm-soft: rgba(194, 105, 47, 0.08);
  --content: 760px;
  --radius: 16px;
  --shadow: 0 2px 8px rgba(31, 41, 51, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.7;
}

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

/* ── Page wrapper ── */

.page {
  width: min(calc(100% - 32px), 1120px);
  margin: 0 auto;
  padding: 22px 0 56px;
}

/* ── Breadcrumbs ── */

.breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: var(--muted);
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { opacity: 0.5; }

/* ── Mobile anchor bar ── */

.mobile-nav {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0;
  margin-bottom: 12px;
}
.mobile-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.mobile-nav a:hover { color: var(--accent); border-color: var(--accent); }

/* ── Hero ── */

.hero {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.hero--centered {
  text-align: center;
}
.hero__copy--centered {
  margin-left: auto;
  margin-right: auto;
}
.hero__copy {
  max-width: var(--content);
}
.eyebrow {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
h1, h2, h3, p { margin: 0; }
h1 {
  max-width: var(--content);
  margin-top: 16px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.15;
}
h2 {
  margin-top: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.2;
}
h3 { font-size: 1rem; line-height: 1.3; }
.lead {
  max-width: var(--content);
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ── Button ── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 22px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.button:hover { background: var(--accent-dark); }

/* ── Two-column layout ── */

.kb-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

/* ── Sidebar ── */

.kb-sidebar {
  position: sticky;
  top: 18px;
}
.sidebar-header a {
  display: block;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.sidebar-menu {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}
.menu-link {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.15s;
}
.menu-link:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.menu-link--active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

/* ── Content ── */

.kb-content {
  display: grid;
  gap: 24px;
  min-width: 0;
  max-width: var(--content);
}

/* ── Section card ── */

.section {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  scroll-margin-top: 100px;
}
.section-body {
  margin-top: 16px;
  color: var(--text);
  line-height: 1.7;
}

/* ── When list ── */

.when-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.when-list li {
  padding-left: 24px;
  position: relative;
  color: var(--text);
  line-height: 1.65;
}
.when-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ── Path chips ── */

.path-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.path-chip {
  display: inline-block;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 0.95rem;
  font-weight: 600;
}
.path-arrow { color: var(--muted); font-weight: 600; }

/* ── Steps ── */

.steps {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  list-style: none;
  padding: 0;
}
.step {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.step:not(:has(.step__num)) {
  grid-template-columns: minmax(0, 1fr);
}
.step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  flex-shrink: 0;
}
.step__text {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
}
.step-image {
  margin: 14px 0 0;
  padding: 0;
}
.step-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.step-image figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ── Video ── */

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.video-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.video-frame {
  aspect-ratio: 16 / 9;
  background: #111;
}
.video-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.video-body { padding: 14px; }
.video-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}
.video-title {
  margin-top: 6px;
  font-weight: 700;
  line-height: 1.3;
}

/* ── Tree ── */

.instruction-tree {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}
.tree-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.tree-section h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
}
.tree-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* ── Card link ── */

.card-link {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: all 0.15s;
}
.card-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.card-link strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}
.card-link span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* ── FAQ (details/summary) ── */

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.faq-question button {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  text-align: left;
  color: var(--text);
  transition: all 0.15s;
}
.faq-question button:hover {
  background: var(--accent-soft);
}
.faq-answer {
  padding: 0 16px 14px;
  color: var(--muted);
  line-height: 1.7;
  border-top: 1px solid var(--line);
  margin-top: 0;
}
.faq-answer p { margin: 0; }

/* ── Related grid ── */

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

/* ── Callout ── */

.callout {
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--text);
  line-height: 1.6;
}
.callout--warm {
  border-left-color: var(--warm);
  background: var(--warm-soft);
}
.callout p { margin: 8px 0 0; }
.callout p:first-child { margin-top: 0; }

/* ── Footer ── */

.footer {
  margin-top: 28px;
  padding: 22px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  line-height: 1.6;
}
.footer strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 700;
}
.footer p { margin: 0; }

/* ── Responsive ── */

@media (max-width: 980px) {
  .kb-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .kb-sidebar {
    display: none;
  }
  .mobile-nav {
    display: flex;
  }
  .video-grid,
  .tree-links,
  .related-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  body {
    font-size: 17px;
    line-height: 1.65;
  }
  .page {
    width: min(calc(100% - 20px), 1120px);
    padding-top: 10px;
  }
  .hero {
    padding: 22px;
    border-radius: 16px;
    margin-bottom: 20px;
  }
  h1 {
    margin-top: 12px;
    font-size: clamp(1.6rem, 8vw, 2.5rem);
  }
  h2 {
    font-size: clamp(1.25rem, 5vw, 1.6rem);
  }
  .section {
    padding: 20px;
    border-radius: 14px;
  }
  .step {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }
  .step__num {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
  .actions {
    flex-direction: column;
  }
  .button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .page {
    width: min(calc(100% - 16px), 1120px);
  }
  .hero,
  .section,
  .footer {
    padding: 16px;
    border-radius: 12px;
  }
  h1 {
    font-size: clamp(1.4rem, 7vw, 2rem);
  }
  h2 {
    font-size: clamp(1.1rem, 4vw, 1.4rem);
  }
  .eyebrow {
    font-size: 0.7rem;
  }
}
