/* crmsix.com/help/ (pages built by client/scripts/build-help.mjs), on top of site.css. */
.help-main {
  padding: 32px 0 72px;
  background: linear-gradient(180deg, var(--bg-soft) 0, var(--bg) 260px);
}
.help-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 210px;
  gap: 40px;
  align-items: start;
}
.help-layout.help-front {
  grid-template-columns: 220px minmax(0, 1fr);
}

/* Left: the articles */
.help-nav {
  position: sticky;
  top: 92px;
  font-size: 0.93rem;
}
.help-home {
  display: block;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}
.help-nav ul,
.help-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.help-nav li a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink-2);
}
.help-nav li a:hover {
  background: var(--brand-soft);
  text-decoration: none;
}
.help-nav a[aria-current='page'] {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 600;
}

/* Right: on this page */
.help-toc {
  position: sticky;
  top: 92px;
  font-size: 0.86rem;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}
.help-toc strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.help-toc a {
  color: var(--ink-2);
  display: block;
  padding: 3px 0;
}

/* The article */
.help-article {
  min-width: 0;
  max-width: 760px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-2);
}
.help-crumbs {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.help-article h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 14px;
  text-wrap: balance;
}
.help-lead {
  font-size: 1.12rem;
  color: var(--ink-2);
  margin: 0 0 28px;
  max-width: 68ch;
}
.help-article h2 {
  font-size: 1.4rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 44px 0 12px;
  padding-top: 8px;
  scroll-margin-top: 88px;
}
.help-article h2:first-of-type {
  margin-top: 8px;
}
.help-article p,
.help-article ul,
.help-article ol,
.help-article dl {
  margin: 0 0 16px;
  max-width: 70ch;
}
.help-article li + li {
  margin-top: 6px;
}
.help-article strong {
  color: var(--ink);
}
.help-article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--ink);
}

/* Numbered steps */
.help-article ol.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
}
.help-article ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  min-height: 30px;
}
.help-article ol.steps > li + li {
  margin-top: 14px;
}
.help-article ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
}

/* The four stages of a deploy */
.help-article ol.flow {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: none;
}
.help-article ol.flow li {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
}
.help-article ol.flow li span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 6px;
}
.help-article ol.flow li strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 2px;
}

/* Key facts */
.help-article ul.facts {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: none;
}
.help-article ul.facts li {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.94rem;
  line-height: 1.55;
}
.help-article ul.facts li strong {
  display: block;
  margin-bottom: 2px;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.5;
}
.help-table th,
.help-table td {
  text-align: left;
  vertical-align: top;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.help-table tr:last-child td {
  border-bottom: 0;
}
.help-table th {
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* Callouts */
.callout {
  border: 1px solid #c7d7fe;
  background: var(--brand-soft);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 18px;
  font-size: 0.95rem;
  max-width: 70ch;
}
.callout.tip {
  border-color: #a7e3c4;
  background: #ecfdf5;
}
.callout.warn {
  border-color: #f3d38a;
  background: #fff8e6;
}

/* Questions and answers */
.faq dt {
  font-weight: 600;
  color: var(--ink);
  margin-top: 14px;
}
.faq dd {
  margin: 4px 0 0;
}

/* Front page cards */
.help-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 0 0 28px;
}
.help-card {
  display: grid;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  color: var(--ink-2);
  font-size: 0.94rem;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.help-card strong {
  color: var(--ink);
  font-size: 1.05rem;
}
.help-card:hover {
  text-decoration: none;
  border-color: var(--brand);
  box-shadow: var(--shadow);
}

/* Previous / next */
.help-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.help-pager a {
  display: grid;
  gap: 2px;
  font-weight: 600;
}
.help-pager a span {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.help-pager .next {
  text-align: right;
}

@media (max-width: 1100px) {
  .help-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .help-toc {
    display: none;
  }
}
@media (max-width: 760px) {
  .help-layout,
  .help-layout.help-front {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .help-nav {
    position: static;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
  }
  .help-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .help-article ol.flow,
  .help-article ul.facts {
    grid-template-columns: 1fr;
  }
}

/* Code examples: scroll inside the block, never the page */
.help-article pre.code {
  margin: 0 0 18px;
  padding: 14px 16px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 100%;
}
.help-article pre.code code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
  white-space: pre;
}
.help-table code {
  white-space: nowrap;
}
