/* ─────────────────────────────────────────────────────────────────
   KetoLens — Help guide / how-to dark-theme overlay
   Loads ON TOP of /style.css. Scoped under body.help so it can't
   leak into the marketing or legal pages.
   ───────────────────────────────────────────────────────────────── */

body.help {
  /* Content-style page: kill the marketing site's flex column layout */
  display: block;
  /* The marketing body paints two off-centre radial glows; on the wide guide
     layout their horizontal edges band in the empty desktop margins. Replace
     with a calm vertical wash that lifts subtly behind the hero, then settles
     to flat ink — uniform across the width, so nothing can seam. */
  background: linear-gradient(180deg, #0A1826 0, var(--ink-0) 600px);
  background-color: var(--ink-0);
}

body.help main {
  display: block;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 32px 80px;
}

body.help header.help-hero {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 32px 32px;
  text-align: center;
  border-bottom: 1px solid var(--ink-3);
  margin-bottom: 32px;
}
body.help header.help-hero h1 {
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 16px;
  color: var(--text-on-dark);
}
body.help header.help-hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--teal), #0EA5E9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
body.help .tagline {
  color: var(--text-on-dark-muted);
  font-size: 1.1rem;
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.55;
}

body.help main p,
body.help main li {
  color: var(--text-on-dark-muted);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 0.7rem;
}
body.help main strong { color: var(--text-on-dark); font-weight: 600; }

body.help main h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-on-dark);
  margin: 36px 0 12px;
}
body.help main h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--text-on-dark);
}

body.help main ul,
body.help main ol { padding-left: 1.5rem; margin-bottom: 1rem; }

body.help main a {
  color: var(--teal);
  text-decoration: none;
}
body.help main a:hover { color: var(--teal-bright); text-decoration: underline; }

/* Breadcrumb */
body.help .breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--text-on-dark-faint);
  margin: 0 0 24px;
  flex-wrap: wrap;
}
body.help .breadcrumb a {
  color: var(--text-on-dark-muted);
  text-decoration: none;
}
body.help .breadcrumb a:hover { color: var(--teal); }
body.help .breadcrumb .sep { color: var(--ink-4); }

/* TOC */
body.help .toc {
  background: rgba(20, 184, 166, 0.04);
  border: 1px solid var(--ink-3);
  border-radius: 12px;
  padding: 18px 24px;
  margin: 24px 0;
}
body.help .toc h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-on-dark-muted);
  margin: 0 0 12px;
}
body.help .toc ul { margin: 0; padding-left: 0; list-style: none; }
body.help .toc li { margin: 0; padding: 6px 0; }
body.help .toc a {
  color: var(--text-on-dark);
  font-weight: 500;
  font-size: 15px;
}
body.help .toc a:hover { color: var(--teal); }

/* Decision box (3-option chooser) */
body.help .decision {
  background: linear-gradient(180deg, rgba(20, 184, 166, 0.06), rgba(20, 184, 166, 0));
  border: 1px solid rgba(20, 184, 166, 0.3);
  border-radius: 16px;
  padding: 28px;
  margin: 32px 0;
}
body.help .decision h2 {
  margin-top: 0;
  font-size: 20px;
  color: var(--text-on-dark);
}
body.help .lede {
  color: var(--text-on-dark-muted);
  font-size: 15px;
  margin: 4px 0 20px;
}
body.help .decision-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
body.help .decision-option {
  background: var(--ink-1);
  border: 1px solid var(--ink-3);
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
body.help .decision-option:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
  text-decoration: none;
}
body.help .decision-option strong {
  color: var(--text-on-dark);
  font-size: 16px;
}
body.help .decision-option span {
  color: var(--text-on-dark-muted);
  font-size: 13px;
  line-height: 1.5;
}
@media (max-width: 720px) {
  body.help .decision-options { grid-template-columns: 1fr; }
}

/* Mode cards (Snap / Manual / Favourites etc.) */
body.help .mode-card {
  background: var(--ink-1);
  border: 1px solid var(--ink-3);
  border-radius: 16px;
  padding: 28px;
  margin: 32px 0;
}
body.help .mode-card > h2 {
  margin-top: 0;
  font-size: 22px;
}
body.help .chip {
  display: inline-block;
  background: var(--teal-soft);
  color: var(--teal);
  border: 1px solid rgba(20, 184, 166, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 4px 0 16px;
}

/* Steps — flat list inside the card (no nested box); teal markers carry it. */
body.help .steps {
  margin: 16px 0;
}
body.help .steps ol { margin: 0; padding-left: 1.4rem; }
body.help .steps li {
  color: var(--text-on-dark);
  margin-bottom: 0.7rem;
}
body.help .steps li::marker {
  color: var(--teal);
  font-weight: 700;
}

/* Figure + screenshot */
body.help figure {
  margin: 24px 0;
  text-align: center;
}
body.help .screenshot {
  max-width: 320px;
  width: 100%;
  height: auto;
  border-radius: 24px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 20px 40px rgba(0, 0, 0, 0.4);
  margin: 0 auto;
}
body.help figcaption {
  color: var(--text-on-dark-muted);
  font-size: 14px;
  font-style: italic;
  margin-top: 12px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* Media row layout — side-by-side text + image */
body.help .media-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  margin: 28px 0;
}
body.help .media-row-reverse .media-col-figure { order: 2; }
body.help .media-row-reverse .media-col-text { order: 1; }
body.help .media-col-figure figure { margin: 0; }
body.help .media-col-figure .screenshot { max-width: 100%; }
body.help .media-col-text p:last-child { margin-bottom: 0; }
@media (max-width: 720px) {
  body.help .media-row { grid-template-columns: 1fr; gap: 16px; }
  body.help .media-row-reverse .media-col-figure,
  body.help .media-row-reverse .media-col-text { order: initial; }
}

/* Callouts */
body.help .callout {
  background: var(--teal-soft);
  border: 1px solid rgba(20, 184, 166, 0.25);
  border-left: 3px solid var(--teal);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 20px 0;
}
body.help .callout p { color: var(--text-on-dark); margin: 0; }
body.help .callout p + p { margin-top: 8px; }
body.help .callout-warn {
  background: var(--warn-soft);
  border-color: var(--warn-border);
  border-left-color: var(--warn);
}
body.help .callout-warn p { color: var(--text-on-dark); }

/* Compare block (div form) — two flat columns split by a single hairline, not a box. */
body.help div.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin: 24px 0;
}
body.help div.compare > div { display: flex; flex-direction: column; gap: 6px; }
body.help div.compare > div:first-child {
  padding-right: 28px;
  border-right: 1px solid var(--ink-3);
}
body.help div.compare .label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-on-dark-faint);
}
@media (max-width: 640px) {
  body.help div.compare { grid-template-columns: 1fr; gap: 20px; }
  body.help div.compare > div:first-child {
    padding-right: 0;
    padding-bottom: 20px;
    border-right: none;
    border-bottom: 1px solid var(--ink-3);
  }
}

/* Comparison table (table form) — bordered rows, subtle header, rounded outer edge. */
body.help table.compare {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 24px 0;
  font-size: 15px;
  border: 1px solid var(--ink-3);
  border-radius: 12px;
  overflow: hidden;
}
body.help table.compare th,
body.help table.compare td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--ink-3);
}
body.help table.compare thead th {
  background: var(--ink-1);
  color: var(--text-on-dark);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
body.help table.compare tbody td { color: var(--text-on-dark-muted); }
body.help table.compare tbody td:first-child {
  color: var(--text-on-dark);
  font-weight: 600;
}
body.help table.compare tbody tr:last-child th,
body.help table.compare tbody tr:last-child td { border-bottom: none; }
@media (max-width: 640px) {
  body.help table.compare { font-size: 14px; }
  body.help table.compare th,
  body.help table.compare td { padding: 10px 12px; }
}

/* Prev/Next nav at the bottom */
body.help .prev-next {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 48px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--ink-3);
}
body.help .prev-next a {
  background: var(--ink-1);
  border: 1px solid var(--ink-3);
  border-radius: 12px;
  padding: 16px 20px;
  text-decoration: none;
  flex: 1;
  max-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease;
}
body.help .prev-next a:hover { border-color: var(--teal); text-decoration: none; }
body.help .prev-next a .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-on-dark-faint);
}
body.help .prev-next a { color: var(--text-on-dark); font-weight: 600; }
body.help .prev-next .next { text-align: right; }
body.help .prev-next .placeholder { flex: 1; max-width: 240px; }
@media (max-width: 640px) {
  body.help .prev-next { flex-direction: column; }
  body.help .prev-next a, body.help .prev-next .placeholder { max-width: none; }
}

/* Help guide TOC (index page) */
body.help .section-group { margin: 40px 0; }
body.help .section-group > h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-on-dark);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink-3);
}
body.help .help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
body.help .help-card {
  display: block;
  background: var(--ink-1);
  border: 1px solid var(--ink-3);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
body.help .help-card:hover {
  border-color: var(--teal);
  transform: translateY(-3px);
  text-decoration: none;
}
body.help .help-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-on-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}
body.help .help-card p {
  color: var(--text-on-dark-muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}
body.help .help-card.coming-soon {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}
body.help .help-card.coming-soon h3 .badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--ink-3);
  color: var(--text-on-dark-muted);
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: auto;
}

/* ─────────────────────────────────────────────────────────────────
   "Next:" handoff bridge — narrates the jump to the following page
   ───────────────────────────────────────────────────────────────── */
body.help .next-hint {
  background: rgba(20, 184, 166, 0.05);
  border: 1px solid var(--ink-3);
  border-left: 3px solid var(--teal);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 40px 0 0;
  font-size: 15px;
  color: var(--text-on-dark-muted);
}
body.help .next-hint strong { color: var(--teal); }
body.help .next-hint a { font-weight: 600; }

/* ─────────────────────────────────────────────────────────────────
   Full-guide sidebar — collapsible panel on mobile, sticky rail on desktop
   ───────────────────────────────────────────────────────────────── */
body.help .guide-shell { display: block; }

/* Mobile-first: a collapsible "Guide contents" panel above the article */
body.help .guide-sidebar { max-width: 880px; margin: 0 auto; padding: 0 32px; }
body.help .guide-nav-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-on-dark);
  background: var(--ink-1);
  border: 1px solid var(--ink-3);
  border-radius: 10px;
  user-select: none;
}
body.help .guide-nav-label::before { content: "☰"; color: var(--teal); }
body.help .sidebar-body {
  display: none;
  margin-top: 8px;
  padding: 14px 16px;
  background: var(--ink-1);
  border: 1px solid var(--ink-3);
  border-radius: 10px;
}
body.help .guide-nav-toggle:checked ~ .sidebar-body { display: block; }

body.help .sidebar-body .sb-group {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-on-dark-faint);
  margin: 16px 0 6px;
}
body.help .sidebar-body .sb-group:first-child { margin-top: 0; }
body.help .sidebar-body ul { list-style: none; margin: 0; padding: 0; }
body.help .sidebar-body li { margin: 0; padding: 0; }
body.help .sidebar-body a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--text-on-dark-muted);
  text-decoration: none;
}
body.help .sidebar-body a:hover {
  background: var(--teal-soft);
  color: var(--teal);
  text-decoration: none;
}
body.help .sidebar-body a.current {
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--teal);
}

/* Desktop: the panel becomes a sticky left rail beside the content */
@media (min-width: 1080px) {
  body.help .guide-shell {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
  }
  body.help .guide-shell > main {
    max-width: none;
    margin: 0;
    padding: 24px 8px 80px;
    flex: 1 1 auto;
    min-width: 0;
  }
  body.help .guide-sidebar {
    flex: 0 0 236px;
    max-width: none;
    margin: 0;
    padding: 0;
    position: sticky;
    /* Clear the sticky "← Back to KetoLens" bar above. */
    top: 72px;
    align-self: flex-start;
  }
  body.help .guide-nav-label { display: none; }
  body.help .sidebar-body {
    display: block;
    margin-top: 24px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
  }
}
