:root {
  --help-shell-max-width: 1380px;
  --help-sidebar-width: 18rem;
  --help-toc-width: 15rem;
  --help-header-offset: var(--rask-global-header-height, 5.75rem);
  --help-surface: var(--rask-surface, #ffffff);
  --help-surface-soft: var(--rask-surface-soft, #f7f1e2);
  --help-canvas: var(--rask-bg, #fffaf0);
  --help-border: var(--rask-border-soft, rgba(226, 217, 198, 0.58));
  --help-border-strong: var(--rask-border-strong, rgba(82, 80, 245, 0.12));
  --help-shadow-soft: var(
    --rask-public-shadow-sm,
    0 1px 2px 0 rgb(0 0 0 / 0.05)
  );
  --help-shadow: var(--rask-public-shadow-md, 0 14px 40px rgb(26 26 26 / 0.1));
  --help-shadow-strong: var(
    --rask-public-shadow-lg,
    0 24px 60px rgb(26 26 26 / 0.13)
  );
  --help-radius-card: var(--rask-public-radius-card, 18px);
  --help-radius-shell: var(--rask-public-radius-panel, 26px);
  --help-radius-hero: var(--rask-public-radius-hero, 30px);
  --help-radius-control: var(--radius, 8px);
  --help-text: var(--rask-text, #2a2929);
  --help-muted: var(--rask-muted, #5f5f5f);
  --help-heading: var(--rask-heading, #1a1a1a);
  --help-accent: var(--rask-blue, #5250f5);
}

html {
  scroll-behavior: smooth;
}

html,
body,
body * {
  -webkit-user-select: none;
  user-select: none;
}

input,
textarea,
[contenteditable="true"],
[contenteditable="true"] * {
  -webkit-user-select: text;
  user-select: text;
}

body.help-page {
  margin: 0;
  background: var(--help-canvas);
  color: var(--help-text);
  font-family: var(
    --font-body,
    "Source Sans 3",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif
  );
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.help-main {
  padding-top: calc(var(--help-header-offset) + 1.75rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.help-shell {
  --rask-public-container-width: var(--help-shell-max-width);
  display: grid;
  grid-template-columns:
    minmax(0, var(--help-sidebar-width)) minmax(0, 1fr)
    minmax(0, var(--help-toc-width));
  gap: 1.5rem;
  align-items: start;
}

body.help-page--no-toc .help-shell {
  grid-template-columns: minmax(0, var(--help-sidebar-width)) minmax(0, 1fr);
}

body.help-page--no-toc .help-shell__pagination {
  grid-column: 2 / 3;
}

.help-shell__sidebar,
.help-shell__toc {
  position: sticky;
  top: calc(var(--help-header-offset) + 1.25rem);
}

.help-shell__content {
  min-width: 0;
  min-height: 60vh;
}

.help-shell__pagination {
  grid-column: 2 / 4;
}

.help-sidebar__card,
.help-toc__card,
.help-card,
.help-pagination__link {
  background: var(--help-surface);
  border: 1px solid var(--help-border);
  border-radius: var(--help-radius-card);
  box-shadow: var(--help-shadow-soft);
}

.help-article {
  background: var(--help-surface);
  border: 1px solid var(--help-border);
  border-radius: var(--help-radius-shell);
  box-shadow: var(--help-shadow-soft);
}

.help-sidebar__card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.1rem;
  max-height: calc(100vh - var(--help-header-offset) - 2.5rem);
  overflow: hidden;
}

.help-sidebar__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--help-muted) 35%, transparent)
    transparent;
}

.help-sidebar__scroll::-webkit-scrollbar {
  width: 8px;
}

.help-sidebar__scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--help-muted) 28%, transparent);
  border-radius: 999px;
}

.help-toc__card {
  padding: 1.1rem;
}

.help-sidebar__eyebrow,
.help-toc__eyebrow,
.help-kicker,
.help-footer__eyebrow,
.help-home-hero__eyebrow {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--help-muted);
}

.help-search {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.help-search__label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1rem;
  min-height: 2.6rem;
  border: 1px solid var(--help-border);
  border-radius: var(--rask-public-radius-field, 9999px);
  background: var(--help-canvas);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.help-search__label:hover {
  border-color: color-mix(in srgb, var(--help-accent) 30%, var(--help-border));
}

.help-search__label:focus-within {
  border-color: var(--help-accent);
  background: var(--help-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--help-accent) 18%, transparent);
}

.help-search__icon {
  display: inline-flex;
  color: var(--help-muted);
  flex-shrink: 0;
}

.help-search__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  font-size: 0.95rem;
  color: var(--help-text);
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
}

.help-search__input::-webkit-search-decoration,
.help-search__input::-webkit-search-cancel-button,
.help-search__input::-webkit-search-results-button,
.help-search__input::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

.help-search__input::placeholder {
  color: var(--help-muted);
}

.help-search__status {
  margin: 0;
  font-size: 0.85rem;
  color: var(--help-muted);
}

.help-search__results {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 22rem;
  overflow-y: auto;
}

.help-search__hit {
  display: grid;
  gap: 0.15rem;
  padding: 0.6rem 0.7rem;
  border-radius: var(--help-radius-control);
  text-decoration: none;
  color: var(--help-text);
  background: var(--help-canvas);
  border: 1px solid transparent;
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}

.help-search__hit:hover,
.help-search__hit:focus-visible,
.help-search__hit.is-active {
  background: color-mix(in srgb, var(--help-accent) 8%, var(--help-canvas));
  border-color: color-mix(in srgb, var(--help-accent) 32%, transparent);
}

.help-search__hit-section {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--help-muted);
}

.help-search__hit-title {
  font-weight: 700;
  color: var(--help-heading);
}

.help-search__hit-copy {
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--help-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.help-sidebar__group + .help-sidebar__group {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid color-mix(in srgb, var(--help-border) 80%, transparent);
}

.help-sidebar__group--static + .help-sidebar__group {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
}

.help-sidebar__heading,
.help-sidebar__summary-label {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--help-heading);
}

.help-sidebar__heading {
  margin-bottom: 0.5rem;
}

.help-sidebar__details {
  border-radius: var(--help-radius-control);
}

.help-sidebar__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.55rem;
  border-radius: var(--help-radius-control);
  color: var(--help-heading);
  user-select: none;
}

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

.help-sidebar__summary:hover,
.help-sidebar__summary:focus-visible {
  background: color-mix(in srgb, var(--help-accent) 6%, var(--help-canvas));
  outline: none;
}

.help-sidebar__summary-icon {
  display: inline-flex;
  color: var(--help-muted);
  transition: transform 160ms ease;
}

.help-sidebar__details[open]
  > .help-sidebar__summary
  .help-sidebar__summary-icon {
  transform: rotate(180deg);
}

.help-sidebar__list,
.help-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.help-sidebar__details[open] > .help-sidebar__list {
  margin-top: 0.2rem;
}

.help-sidebar__link,
.help-toc__link {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: var(--help-radius-control);
  text-decoration: none;
  color: var(--help-muted);
  font-size: 0.95rem;
  line-height: 1.4;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.help-sidebar__link:hover,
.help-toc__link:hover,
.help-sidebar__link:focus-visible,
.help-toc__link:focus-visible {
  background: color-mix(in srgb, var(--help-accent) 8%, var(--help-canvas));
  color: var(--help-accent);
  outline: none;
}

.help-sidebar__link.is-active {
  background: color-mix(in srgb, var(--help-accent) 14%, var(--help-surface));
  color: var(--help-accent);
  font-weight: 700;
}

.help-toc__link.is-subheading {
  padding-left: 1.4rem;
  font-size: 0.9rem;
}

.help-toc__eyebrow {
  margin-bottom: 0.6rem;
}

.help-article {
  padding: clamp(1.4rem, 3vw, 2rem);
}

.help-article > :first-child {
  margin-top: 0;
}

.help-article > :last-child {
  margin-bottom: 0;
}

.help-article h1,
.help-article h2,
.help-article h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--help-heading);
}

.help-article h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  line-height: 1;
  max-width: 22ch;
}

.help-article h2 {
  margin: 2.4rem 0 0.9rem;
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  line-height: 1.08;
  max-width: 28ch;
}

.help-article h3 {
  margin: 1.75rem 0 0.65rem;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.15;
  max-width: 32ch;
}

.help-article > p:first-of-type {
  font-size: clamp(1.08rem, 2vw, 1.22rem);
  line-height: 1.6;
  color: var(--help-muted);
  max-width: 62ch;
}

.help-article p,
.help-article li,
.help-article blockquote,
.help-article td,
.help-article th {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--help-text);
}

.help-article p,
.help-article ul,
.help-article ol {
  max-width: 70ch;
}

.help-article p,
.help-article ul,
.help-article ol,
.help-article table,
.help-article blockquote {
  margin: 0 0 1.1rem;
}

.help-article ul,
.help-article ol {
  padding-left: 1.3rem;
}

.help-article li + li {
  margin-top: 0.45rem;
}

.help-article a:not([class]) {
  color: var(--help-accent);
  font-weight: 600;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
}

.help-article a:not([class]):hover,
.help-article a:not([class]):focus-visible {
  color: color-mix(in srgb, var(--help-accent) 75%, var(--help-heading));
}

/* When the article only frames the home hero (which has its own panel),
   drop the outer card so we don't get a panel-within-a-panel. */
.help-article:has(> .help-home-hero:first-child) {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}

.help-article strong {
  color: var(--help-heading);
}

.help-article hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--help-border);
}

.help-article blockquote {
  padding: 1rem 1.1rem;
  border-left: 4px solid color-mix(in srgb, var(--help-accent) 32%, transparent);
  border-radius: var(--help-radius-card);
  background: color-mix(in srgb, var(--help-accent) 5%, var(--help-surface));
}

.help-article code {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.92em;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm, 4px);
  background: color-mix(in srgb, var(--help-border) 60%, var(--help-surface));
}

.help-article pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: var(--help-radius-card);
  background: var(--surface-card-contrast, #1a1a1a);
  color: var(--rask-white, #ffffff);
}

.help-article pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.help-article table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--help-radius-card);
  border: 1px solid var(--help-border);
}

.help-article th,
.help-article td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--help-border);
}

.help-article th {
  background: color-mix(in srgb, var(--help-border) 30%, var(--help-surface));
  color: var(--help-heading);
}

.help-article img {
  max-width: 100%;
  height: auto;
  border-radius: var(--help-radius-card);
}

.help-home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
  padding: clamp(1.6rem, 3.5vw, 2.5rem);
  margin-bottom: 2rem;
  background:
    radial-gradient(
      circle at 82% 12%,
      color-mix(in srgb, var(--rask-accent-purple, #c3aaf5) 22%, transparent) 0%,
      transparent 38%
    ),
    radial-gradient(
      circle at 8% 92%,
      color-mix(in srgb, var(--rask-light-blue, #b4cfeb) 28%, transparent) 0%,
      transparent 42%
    ),
    var(--help-surface);
  border: 1px solid var(--help-border);
  border-radius: var(--help-radius-hero);
  box-shadow: var(--help-shadow);
  overflow: hidden;
}

.help-home-hero__eyebrow {
  margin-bottom: 0.85rem;
}

.help-home-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
  color: var(--help-heading);
  max-width: 14ch;
}

.help-home-hero__copy {
  margin: 1.1rem 0 0;
  font-size: clamp(1.08rem, 2.1vw, 1.3rem);
  line-height: 1.6;
  color: var(--help-muted);
  max-width: 42ch;
}

.help-home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.help-home-hero__visual {
  display: flex;
  justify-content: center;
}

.help-home-hero__visual img {
  width: min(100%, 24rem);
  height: auto;
}

.help-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
  gap: 1rem;
  margin-top: 1.4rem;
}

.help-card {
  padding: 1.2rem;
  height: 100%;
}

.help-card__title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  font-size: 1.4rem;
  line-height: 1.1;
  color: var(--help-heading);
}

.help-card__copy > :first-child {
  margin-top: 0;
}

.help-card__copy > :last-child {
  margin-bottom: 0;
}

.help-pagination {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.help-pagination__link,
.help-pagination__spacer {
  min-height: 6rem;
}

.help-pagination__link {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  padding: 1rem 1.15rem;
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.help-pagination__link:hover,
.help-pagination__link:focus-visible {
  transform: translateY(-1px);
  border-color: var(--help-border-strong);
  box-shadow: var(--help-shadow);
}

.help-pagination__link--next {
  text-align: right;
}

.help-pagination__eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--help-muted);
}

.help-pagination__title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  line-height: 1.1;
  color: var(--help-heading);
}

.help-footer {
  margin-top: 0;
}

.help-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto;
  gap: 1.5rem;
  align-items: center;
}

.help-footer__title {
  margin: 0;
}

.help-footer__copy {
  max-width: 42rem;
  margin-top: 0.9rem;
}

.help-footer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: flex-end;
}

@media (max-width: 80rem) {
  .help-shell {
    grid-template-columns: minmax(0, 16.5rem) minmax(0, 1fr);
  }

  .help-shell__toc {
    display: none;
  }

  .help-shell__pagination {
    grid-column: 2 / 3;
  }
}

@media (max-width: 62rem) {
  .help-shell {
    grid-template-columns: 1fr;
  }

  .help-shell__content {
    order: 1;
  }

  .help-shell__sidebar,
  .help-shell__toc {
    position: static;
  }

  .help-sidebar__card {
    max-height: none;
    overflow: visible;
  }

  .help-sidebar__scroll {
    overflow: visible;
  }

  .help-shell__pagination {
    grid-column: auto;
    order: 2;
  }

  .help-shell__sidebar {
    order: 3;
  }

  .help-shell__toc {
    order: 4;
  }

  .help-home-hero,
  .help-footer__inner {
    grid-template-columns: 1fr;
  }

  .help-footer__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 42rem) {
  .help-main {
    padding-top: calc(var(--help-header-offset) + 1rem);
  }

  .help-article {
    padding: 1.15rem;
    border-radius: var(--help-radius-card);
  }

  .help-home-hero {
    padding: 1.4rem;
    border-radius: var(--help-radius-shell);
  }

  .help-pagination {
    grid-template-columns: 1fr;
  }

  .help-pagination__spacer {
    display: none;
  }
}
