.spro-help {
  padding: 2rem 0 3rem;
  background: linear-gradient(180deg, var(--bg-section-soft), var(--bg-section));
  flex: 1;
}

.spro-help__inner {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: start;
}

.spro-help__nav-toggle,
.spro-help__nav-backdrop,
.spro-help__nav-close {
  display: none;
}

.spro-help__sidebar-head {
  display: contents;
}

.spro-help__sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  max-height: calc(100vh - var(--header-h) - 2rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  box-shadow: var(--shadow-soft);
  scrollbar-gutter: stable;
}

@media (max-width: 900px) {
  .spro-help__inner {
    grid-template-columns: 1fr;
  }

  .spro-help__nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    left: 0.85rem;
    top: calc(var(--header-h) + 0.75rem);
    z-index: 120;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--btn-primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(31, 75, 122, 0.28);
    cursor: pointer;
  }

  .spro-help__nav-toggle:hover,
  .spro-help__nav-toggle:focus-visible {
    background: var(--btn-primary-hover);
  }

  .spro-help__nav-toggle-bars,
  .spro-help__nav-toggle-bars::before,
  .spro-help__nav-toggle-bars::after {
    display: block;
    width: 1.1rem;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
  }

  .spro-help__nav-toggle-bars {
    position: relative;
  }

  .spro-help__nav-toggle-bars::before,
  .spro-help__nav-toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
  }

  .spro-help__nav-toggle-bars::before {
    top: -6px;
  }

  .spro-help__nav-toggle-bars::after {
    top: 6px;
  }

  .spro-help.is-nav-open .spro-help__nav-toggle {
    z-index: 150;
  }

  .spro-help.is-nav-open .spro-help__nav-toggle-bars {
    background: transparent;
  }

  .spro-help.is-nav-open .spro-help__nav-toggle-bars::before {
    top: 0;
    transform: rotate(45deg);
  }

  .spro-help.is-nav-open .spro-help__nav-toggle-bars::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .spro-help__nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 130;
    background: rgba(20, 40, 60, 0.45);
    border: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .spro-help.is-nav-open .spro-help__nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .spro-help__sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .spro-help__sidebar-title {
    margin: 0;
  }

  .spro-help__nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
  }

  .spro-help__sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 140;
    width: min(20rem, 88vw);
    max-height: none;
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-top: 0;
    border-bottom: 0;
    padding: 1.25rem 1.25rem 2rem;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    scrollbar-gutter: auto;
  }

  .spro-help.is-nav-open .spro-help__sidebar {
    transform: translateX(0);
  }

  body.help-nav-lock {
    overflow: hidden;
  }
}

.spro-help__sidebar-title {
  margin: 0 0 0.75rem;
  font-weight: 500;
}

.spro-help__sidebar > ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.spro-help__sidebar > ul > li > a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.spro-help__sidebar > ul > li > a::before {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  background: currentColor;
}

.spro-help__sidebar li {
  margin: 0.35rem 0;
}

/* Only the current page link — not nested children */
.spro-help__sidebar li.is-active > a {
  color: var(--text-muted);
  font-weight: 500;
}

.spro-help__sidebar-sub {
  list-style: none;
  margin: 0.3rem 0 0.4rem;
  padding: 0 0 0 0.75rem;
  border-left: 2px solid var(--border);
}

.spro-help__sidebar-sub li {
  margin: 0.25rem 0;
  font-size: 0.85rem;
}

.spro-help__content {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem 2rem;
  min-width: 0;
  box-shadow: var(--shadow-soft);
}

.spro-help__title {
  margin: 0 0 1rem;
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--text-primary);
}

.spro-help__lead {
  color: var(--text-muted);
  margin: -0.5rem 0 1.25rem;
}

.spro-help__back {
  margin: 0 0 0.5rem;
}

.spro-help__back .back-link {
  margin-bottom: 0;
}

.spro-help__crumbs {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
}

.spro-help__body h1:first-child {
  display: none;
}

.spro-help__body .release-notes__dl {
  font-size: 0.65em;
  font-weight: 400;
  margin-left: 0.2em;
  vertical-align: baseline;
}

.spro-help__body :is(h2, h3, h4, h5, h6, [id]) {
  scroll-margin-top: calc(var(--header-h) + 3.5rem);
}

.spro-help__body figure {
  margin: 1.5rem 0;
  text-align: center;
}

.spro-help__body figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

.spro-help__body figure img {
  margin: 0 auto;
}

.spro-help__body .help-media-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  align-items: flex-start;
  justify-content: flex-start;
  margin: 1.25rem 0 1.5rem;
}

.spro-help__body .help-media-row figure {
  flex: 1 1 200px;
  margin: 0;
  min-width: 0;
  max-width: calc(50% - 0.625rem);
}

.spro-help__body .help-media-row img {
  margin: 0;
  max-height: 280px;
  width: 100%;
}

@media (max-width: 640px) {
  .spro-help__body .help-media-row figure {
    max-width: 100%;
    flex-basis: 100%;
  }
}

.spro-help__body img {
  display: block;
  max-width: 100%;
  max-height: 300px;
  height: auto;
  width: auto;
  margin: 1.5rem auto;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: zoom-in;
  transition: max-height 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.spro-help__body img:hover {
  max-height: min(70vh, 720px);
  box-shadow: var(--shadow-soft);
}

.spro-help__body img.is-zoomed {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 1001;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  margin: 0;
  background: var(--bg-page);
  box-shadow: 0 16px 48px rgba(20, 50, 79, 0.28);
  transform: translate(-50%, -50%);
  cursor: zoom-out;
}

.image-zoom-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 50, 79, 0.42);
}

.spro-help__body blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--accent);
  background: var(--bg-section, #f5f5f5);
  box-shadow: inset 0 0 18px rgba(0, 217, 255, 0.08);
}

/* Commands / code — visible blocks across help */
.spro-help__body :not(pre) > code,
.spro-help__body p code,
.spro-help__body li code {
  font-family: "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
  font-size: 0.9em;
  font-weight: 500;
  padding: 0.12em 0.4em;
  border-radius: 4px;
  color: #1e1d1e;
  background: #fff4ef;
  border: 1px solid #ffd4c4;
}

.spro-help__body .highlight,
.spro-help__body pre {
  margin: 1rem 0 1.25rem;
  border-radius: 6px;
  border: 1px solid #2a2a2a;
  border-left: 4px solid var(--accent, #f64e0c);
  background: #1e1d1e;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.spro-help__body .highlight pre,
.spro-help__body pre {
  margin: 0 !important;
  padding: 1rem 1.1rem !important;
  overflow-x: auto;
  border: 0 !important;
  border-radius: 0 !important;
  background: #1e1d1e !important;
  box-shadow: none !important;
}

.spro-help__body .highlight pre code,
.spro-help__body pre code {
  font-family: "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace !important;
  font-size: 0.88rem !important;
  font-weight: 400;
  line-height: 1.55;
  color: #f2f2f2;
  background: transparent !important;
  border: 0;
  padding: 0;
  white-space: pre;
}

.code-block {
  position: relative;
  display: flex;
  flex-direction: column;
}

.code-block__bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex: 0 0 auto;
  padding: 6px 8px 0;
  background: transparent;
}

.code-block > pre,
.code-block.highlight > pre {
  padding-right: 1.1rem !important;
}

.code-copy {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.code-block:hover .code-copy,
.code-copy:focus-visible {
  opacity: 1;
}

.code-copy:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.code-copy.is-copied {
  opacity: 1;
  color: #7dffb3;
  border-color: rgba(125, 255, 179, 0.35);
}

.spro-help__toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

.spro-help__toc li {
  margin: 0.4rem 0;
}

.spro-help__pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.spro-help__pager-next {
  margin-left: auto;
  text-align: right;
}
