.help-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.help-main {
  flex: 1;
}

/* Header */

.help-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 249, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--lp-border-subtle);
}

.help-header__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  padding-block: 0.75rem;
}

.help-header__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.help-header__brand .logo {
  height: 1.5rem;
  width: auto;
}

.help-header__title {
  padding-left: 0.75rem;
  border-left: 1px solid var(--lp-color-border);
  font-family: var(--lp-font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--lp-color-on-surface);
  text-decoration: none;
  white-space: nowrap;
}

.help-header__actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 767px) {
  .help-header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .help-header .help-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .help-header__title {
    display: none;
  }
}

/* Search */

.help-search {
  position: relative;
  width: 100%;
}

.help-search--compact {
  max-width: 32rem;
  justify-self: center;
}

.help-search--hero {
  max-width: 40rem;
  margin-inline: auto;
}

.help-search__field {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding-inline: 0.875rem;
  background: var(--lp-color-surface-lowest);
  border: 1px solid var(--lp-color-border);
  border-radius: 999px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.help-search--hero .help-search__field {
  padding-inline: 1.25rem;
  box-shadow: var(--lp-shadow-frame);
}

.help-search__field:focus-within {
  border-color: var(--lp-color-primary);
  box-shadow: 0 0 0 3px rgba(44, 94, 126, 0.15);
}

.help-search__field input,
.help-search__field input:focus {
  flex: 1;
  min-width: 0;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding-block: 0.5rem;
  padding-inline: 0;
  font-size: 0.9375rem;
  color: var(--lp-color-on-surface);
  outline: none;
}

.help-search--hero .help-search__field input {
  padding-block: 0.875rem;
  font-size: 1.0625rem;
}

.help-search__field input::-webkit-search-cancel-button {
  cursor: pointer;
}

.help-search__icon {
  display: inline-flex;
  color: var(--lp-color-outline);
}

.help-search.htmx-request .help-search__icon {
  animation: help-search-pulse 0.8s ease-in-out infinite;
}

@keyframes help-search-pulse {
  50% { opacity: 0.3; }
}

.help-search__kbd {
  padding: 0.0625rem 0.375rem;
  border: 1px solid var(--lp-color-border);
  border-radius: 0.25rem;
  font-family: var(--lp-font-body);
  font-size: 0.6875rem;
  color: var(--lp-color-outline);
}

.help-search__field:focus-within .help-search__kbd {
  display: none;
}

@media (max-width: 767px) {
  .help-search__kbd {
    display: none;
  }
}

.help-search__results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: min(24rem, 60vh);
  overflow-y: auto;
  padding: 0.375rem;
  background: var(--lp-color-surface-lowest);
  border: var(--lp-border-tinted);
  border-radius: var(--lp-radius-card);
  box-shadow: 0 1rem 2rem -1rem rgba(44, 94, 126, 0.35);
}

.help-results {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.help-results__item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--lp-radius-btn);
  text-decoration: none;
  text-align: left;
}

.help-results__item:hover,
.help-results__item:focus-visible {
  background: var(--lp-color-primary-container);
  outline: none;
}

.help-results__category {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lp-color-primary);
}

.help-results__title {
  font-weight: 600;
  color: var(--lp-color-on-surface);
}

.help-results__summary {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--lp-color-on-surface-muted);
}

.help-results__empty,
.help-empty {
  padding: 0.875rem;
  font-size: 0.875rem;
  color: var(--lp-color-on-surface-muted);
  margin: 0;
}

.help-results-page .help-results__item {
  padding-block: 1rem;
  border-bottom: var(--lp-border-subtle);
  border-radius: 0;
}

/* Index */

.help-hero {
  padding-block: clamp(3rem, 7vw, 5rem) clamp(2.5rem, 5vw, 3.5rem);
  background:
    radial-gradient(45rem 30rem at 75% 5%, rgba(104, 84, 142, 0.18), transparent 62%),
    linear-gradient(180deg, var(--lp-color-primary-container), var(--lp-color-background) 85%);
  text-align: center;
}

.help-hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.help-hero__title {
  font-family: var(--lp-font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--lp-color-on-surface);
  margin: 0;
}

.help-hero__lede {
  max-width: 36rem;
  margin: 0 0 1.25rem;
  color: var(--lp-color-on-surface-muted);
  line-height: 1.6;
}

.help-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
  padding-block: 2.5rem 4rem;
}

.help-category-card {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1.5rem;
  background: var(--lp-color-surface-lowest);
  border: 1px solid var(--lp-color-border);
  border-radius: var(--lp-radius-card);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.help-category-card:hover {
  border-color: var(--lp-color-primary);
  transform: translateY(-2px);
  box-shadow: 0 1rem 2rem -1.25rem rgba(44, 94, 126, 0.4);
}

.help-category-card__icon {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  border-radius: 0.75rem;
  background: var(--lp-color-primary-tonal);
  color: var(--lp-color-primary);
}

.help-category-card__name {
  font-family: var(--lp-font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--lp-color-on-surface);
}

.help-category-card__description {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--lp-color-on-surface-muted);
}

.help-category-card__count {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--lp-color-primary);
}

/* Shell */

.help-layout {
  padding-block: 1.5rem 4rem;
}

.help-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 1.5rem;
  font-size: 0.8125rem;
  color: var(--lp-color-on-surface-muted);
}

.help-breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.help-breadcrumbs a:hover {
  color: var(--lp-color-primary);
}

.help-breadcrumbs [aria-current] {
  color: var(--lp-color-on-surface);
  font-weight: 500;
}

.help-layout__grid {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr) 13rem;
  gap: 3rem;
  align-items: start;
}

.help-layout__content {
  max-width: 46rem;
  min-width: 0;
}

.help-nav,
.help-layout__aside {
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
}

@media (max-width: 1279px) {
  .help-layout__grid {
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 2.5rem;
  }

  .help-layout__aside {
    display: none;
  }
}

@media (max-width: 767px) {
  .help-layout__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  .help-nav {
    position: static;
    max-height: none;
    order: 2;
    padding-top: 1.5rem;
    border-top: 1px solid var(--lp-color-border);
  }

  .help-nav__title {
    display: block;
  }
}

/* Side nav */

.help-nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding-right: 0.5rem;
}

.help-nav__title {
  display: none;
  margin: 0 0 0.5rem;
  padding-inline: 0.625rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lp-color-outline);
}

.help-nav__summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--lp-radius-btn);
  font-family: var(--lp-font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--lp-color-on-surface);
  cursor: pointer;
  list-style: none;
}

.help-nav__summary::-webkit-details-marker {
  display: none;
}

.help-nav__summary:hover {
  background: var(--lp-color-surface-low);
}

.help-nav__summary svg:first-child {
  color: var(--lp-color-outline);
}

.help-nav__chevron {
  margin-left: auto;
  color: var(--lp-color-outline);
  transition: transform 0.15s ease;
}

.help-nav__group[open] .help-nav__chevron {
  transform: rotate(90deg);
}

.help-nav__list {
  list-style: none;
  margin: 0.125rem 0 0.5rem;
  padding: 0 0 0 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
}

.help-nav__link {
  display: block;
  padding: 0.375rem 0.625rem;
  border-left: 2px solid var(--lp-color-border);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--lp-color-on-surface-muted);
  text-decoration: none;
}

.help-nav__link:hover {
  color: var(--lp-color-primary);
  border-color: var(--lp-color-primary-container);
}

.help-nav__link.is-active {
  color: var(--lp-color-primary);
  border-color: var(--lp-color-primary);
  font-weight: 600;
}

.help-nav__empty {
  padding: 0.375rem 0.625rem;
  border-left: 2px solid var(--lp-color-border);
  font-size: 0.75rem;
  color: var(--lp-color-outline);
}

/* Table of contents */

.help-toc {
  padding-left: 1rem;
  border-left: 1px solid var(--lp-color-border);
}

.help-toc__title {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lp-color-outline);
}

.help-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.help-toc a {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--lp-color-on-surface-muted);
  text-decoration: none;
}

.help-toc a:hover {
  color: var(--lp-color-primary);
}

/* Article */

.help-article__header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--lp-color-border);
}

.help-article__title {
  font-family: var(--lp-font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--lp-color-on-surface);
  margin: 0;
}

.help-article__summary {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--lp-color-on-surface-muted);
}

.help-prose {
  color: var(--lp-color-on-surface);
  line-height: 1.7;
  font-size: 1rem;
}

.help-prose > * + * {
  margin-top: 1rem;
}

.help-prose h2 {
  margin-top: 2.5rem;
  scroll-margin-top: 5rem;
  font-family: var(--lp-font-display);
  font-size: 1.375rem;
  font-weight: 700;
}

.help-prose h3 {
  margin-top: 1.75rem;
  scroll-margin-top: 5rem;
  font-family: var(--lp-font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--lp-color-primary);
}

.help-prose a.anchor {
  margin-left: 0.5rem;
  color: var(--lp-color-outline);
  text-decoration: none;
}

.help-prose a.anchor::after {
  content: "#";
  opacity: 0;
  transition: opacity 0.15s ease;
}

.help-prose h2:hover a.anchor::after {
  opacity: 1;
}

.help-prose a:not(.anchor) {
  color: var(--lp-color-primary);
  text-decoration: underline;
  text-decoration-color: rgba(44, 94, 126, 0.35);
  text-underline-offset: 2px;
}

.help-prose ul,
.help-prose ol {
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.help-prose ul {
  list-style: disc;
}

.help-prose ol {
  list-style: decimal;
}

.help-prose ol li::marker {
  font-weight: 600;
  color: var(--lp-color-primary);
}

.help-prose strong {
  font-weight: 600;
}

.help-prose code {
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  background: var(--lp-color-surface-low);
  font-size: 0.875em;
}

.help-prose img {
  max-width: 100%;
  border: 1px solid var(--lp-color-border);
  border-radius: var(--lp-radius-media);
}

.help-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.help-prose th,
.help-prose td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--lp-color-border);
  text-align: left;
  vertical-align: top;
}

.help-prose th {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lp-color-on-surface-muted);
}

.help-prose blockquote {
  display: block;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--lp-color-tertiary);
  border-radius: 0 var(--lp-radius-btn) var(--lp-radius-btn) 0;
  background: var(--lp-color-accent-tonal);
  font-size: 0.9375rem;
}

.help-prose blockquote > * {
  margin: 0;
}

@media (max-width: 767px) {
  .help-prose table {
    display: block;
    overflow-x: auto;
  }
}

/* Article list (category page) */

.help-article-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.help-article-list__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--lp-color-surface-lowest);
  border: 1px solid var(--lp-color-border);
  border-radius: var(--lp-radius-card);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.help-article-list__item:hover {
  border-color: var(--lp-color-primary);
}

.help-article-list__title {
  font-weight: 600;
  color: var(--lp-color-on-surface);
}

.help-article-list__summary {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--lp-color-on-surface-muted);
}

.help-article-list__chevron {
  grid-row: 1 / -1;
  align-self: center;
  color: var(--lp-color-outline);
}

/* Related and pager */

.help-related {
  margin-top: 3rem;
  padding: 1.25rem 1.5rem;
  background: var(--lp-color-surface-low);
  border-radius: var(--lp-radius-card);
}

.help-related h2 {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lp-color-on-surface-muted);
}

.help-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.help-related a {
  color: var(--lp-color-primary);
  font-weight: 500;
  text-decoration: none;
}

.help-related a:hover {
  text-decoration: underline;
}

.help-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--lp-color-border);
}

.help-pager__link {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--lp-color-border);
  border-radius: var(--lp-radius-card);
  text-decoration: none;
}

.help-pager__link:hover {
  border-color: var(--lp-color-primary);
}

.help-pager__link--previous {
  grid-column: 1;
}

.help-pager__link--next {
  grid-column: 2;
  text-align: right;
}

.help-pager__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lp-color-on-surface-muted);
}

.help-pager__title {
  font-weight: 600;
  color: var(--lp-color-primary);
}

@media (max-width: 480px) {
  .help-pager {
    grid-template-columns: minmax(0, 1fr);
  }

  .help-pager__link--previous,
  .help-pager__link--next {
    grid-column: 1;
    text-align: left;
  }
}

/* Support strip */

.help-support {
  background: var(--lp-color-surface-lowest);
  border-top: var(--lp-border-subtle);
}

.help-support__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 2rem;
}

.help-support__title {
  margin: 0 0 0.25rem;
  font-family: var(--lp-font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--lp-color-on-surface);
}

.help-support__blurb {
  margin: 0;
  font-size: 0.875rem;
  color: var(--lp-color-on-surface-muted);
}
