/*
 * Help center (/help and its locale routes), Figma "03 Docs (Help center)"
 * (node 5846:3456). Generated by scripts/generate-help-pages.tsx; shared blocks
 * come from /v3.css. Layout: grey text hero, then a two-column body with a
 * sticky "On this page" rail (contents + support box) beside numbered chapters.
 */

.helpSkip {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 18px;
  border-radius: 100px;
  background: var(--k-ink);
  color: #fff;
  font: 500 14px/1.2 var(--k-font-text);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--k-dur-ui) var(--k-ease);
}

.helpSkip:focus {
  transform: none;
}

#help-main:focus {
  outline: none;
}

.helpPage [id] {
  scroll-margin-top: calc(var(--k-header-h) + 24px);
}

/* ---------- hero ---------- */
.helpHero.v3-band {
  padding-top: 160px;
  padding-bottom: 80px;
}

.helpHeroInner {
  gap: 20px;
}

.helpTitle {
  max-width: 720px;
  font-size: clamp(36px, 4.4vw, 54px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

/* The server adds a Home / Help breadcrumb before <main>; seat it in the grey hero. */
.helpPage .knBreadcrumb {
  position: absolute;
  z-index: 1;
  top: calc(var(--k-header-h) + 36px);
  right: 0;
  left: 0;
  max-width: calc(var(--k-content) + 2 * var(--k-pad));
  padding: 0 var(--k-pad);
  color: var(--k-ink-3);
  font: 500 12px/1.4 var(--k-font-text);
  letter-spacing: 0.04em;
}

.helpMeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 4px 0 0;
  color: var(--k-ink-3);
  font-size: 15px;
}

.helpMeta .v3-link {
  color: var(--k-green-text);
}

.helpMeta .v3-link {
  font-size: 15px;
}

/* ---------- body ---------- */
.helpBody.v3-band {
  padding-top: 64px;
  padding-bottom: 112px;
}

.helpLayout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: 64px;
}

.helpSidebar {
  position: sticky;
  top: calc(var(--k-header-h) + 24px);
  display: grid;
  gap: 16px;
  max-height: calc(100dvh - var(--k-header-h) - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.helpSidebar::-webkit-scrollbar {
  display: none;
}

/* ---------- contents ---------- */
.helpContents summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--k-ink-3);
  font: 600 13px/1.3 var(--k-font-text);
  letter-spacing: 0.04em;
  list-style: none;
  pointer-events: none;
}

.helpContents summary::-webkit-details-marker {
  display: none;
}

.helpContentsIcon {
  display: none;
}

.helpToc ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.helpToc a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--k-ink-2);
  font-size: 15px;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color var(--k-dur-ui) var(--k-ease), color var(--k-dur-ui) var(--k-ease);
}

.helpTocNum {
  flex: none;
  color: var(--k-ink-3);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color var(--k-dur-ui) var(--k-ease);
}

.helpToc a[aria-current] {
  background: var(--k-green-soft);
  color: var(--k-ink);
  font-weight: 600;
}

.helpToc a[aria-current] .helpTocNum {
  color: var(--k-green);
}

.helpToc a:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .helpToc a:not([aria-current]):hover {
    background: var(--k-bg-2);
    color: var(--k-ink);
  }
}

/* ---------- support ---------- */
.helpSupport {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 24px;
  border-radius: 20px;
  background: var(--k-bg-2);
}

.helpSupport h2 {
  margin: 0;
  color: var(--k-ink);
  font: 600 20px/1.3 var(--k-font-display);
}

.helpSupport p {
  margin: 0;
  color: var(--k-ink-body);
  font-size: 15px;
  line-height: 1.5;
}

.helpSupport .v3-btn {
  min-height: 52px;
  padding: 0 24px;
}

.helpSupport .v3-btn.is-secondary {
  background: var(--k-chip);
}

/* ---------- article ---------- */
.helpArticle {
  display: grid;
  gap: 0;
  min-width: 0;
}

.helpNote {
  margin: 0 0 40px;
  color: var(--k-ink-3);
  font-size: 14px;
  line-height: 1.5;
}

.helpChapter {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.helpChapter + .helpChapter {
  margin-top: 56px;
  padding-top: 56px;
  border-top: 1px solid var(--k-line);
}

.helpChapterHeading {
  display: grid;
  gap: 28px;
}

.helpChapterNum {
  color: var(--k-num);
  font: 700 40px/1 var(--k-font-text);
  font-variant-numeric: tabular-nums;
}

.helpChapterHeading h2 {
  max-width: 760px;
  margin: 0;
  color: var(--k-ink);
  font: 600 clamp(28px, 3vw, 36px)/1.15 var(--k-font-display);
  text-wrap: balance;
}

.helpChapter :is(p, li) {
  color: var(--k-ink-2);
  font-size: 17px;
  line-height: 1.6;
}

.helpChapter > p,
.helpChapter > ul,
.helpChapter > ol {
  margin: 0;
}

.helpChapter strong {
  color: var(--k-ink);
  font-weight: 600;
}

.helpChapter em {
  color: var(--k-ink);
}

.helpSubhead {
  margin: 12px 0 0;
  color: var(--k-ink);
  font: 600 24px/1.25 var(--k-font-display);
}

.helpMinorhead {
  margin: 4px 0 0;
  color: var(--k-ink);
  font: 600 19px/1.3 var(--k-font-text);
}

/* Numbered steps: green-soft number discs, as in the Figma chapter. */
.helpChapter ol {
  display: grid;
  gap: 16px;
  padding: 0;
  list-style: none;
  counter-reset: help-step;
}

.helpChapter ol > li {
  position: relative;
  min-height: 28px;
  padding-left: 44px;
  counter-increment: help-step;
}

.helpChapter ol > li::before {
  content: counter(help-step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 100px;
  background: var(--k-green-soft);
  color: var(--k-green);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.helpChapter ul {
  display: grid;
  gap: 10px;
  padding-left: 22px;
}

.helpChapter ul > li::marker {
  color: var(--k-green);
}

/* Callouts ("Ready to share:") */
.helpChapter .helpCallout {
  position: relative;
  padding: 24px 24px 24px 44px;
  border-radius: 20px;
  background: var(--k-green-soft);
  color: var(--k-green-ink);
}

.helpCallout::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 24px;
  width: 4px;
  border-radius: 2px;
  background: var(--k-green);
}

/* ---------- figures ---------- */
.helpFigures {
  display: grid;
  grid-template-columns: repeat(var(--figure-cols, 1), minmax(0, 1fr));
  gap: 16px;
}

.helpFigures[data-count="2"] {
  --figure-cols: 2;
}

.helpFigures:is([data-count="3"], [data-count="4"], [data-count="5"], [data-count="6"]) {
  --figure-cols: 3;
}

.helpFigure {
  display: grid;
  gap: 12px;
  margin: 0;
  min-width: 0;
}

.helpFigurePanel {
  display: grid;
  place-items: center;
  padding: 40px 24px;
  border-radius: var(--k-radius);
  background: var(--k-bg-2);
}

.helpFigures[data-count="1"] .helpFigurePanel {
  height: 640px;
  padding: 20px;
}

.helpFigurePanel img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 600px;
  aspect-ratio: 1320 / 2868;
  border: 1px solid rgb(0 0 0 / 6%);
  border-radius: var(--k-radius);
  background: var(--k-bg);
  box-shadow: 0 8px 32px rgb(0 0 0 / 8%);
  transition: transform var(--k-dur-ui) var(--k-ease), box-shadow var(--k-dur-ui) var(--k-ease);
}

.helpFigures:not([data-count="1"]) .helpFigurePanel img {
  width: min(100%, 220px);
  border-radius: 18px;
}

.helpFigure figcaption {
  color: var(--k-ink-3);
  font-size: 14px;
  line-height: 1.45;
}

.helpFigurePanel:active img {
  transform: scale(0.99);
}

@media (hover: hover) and (pointer: fine) {
  .helpFigurePanel:hover img {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgb(0 0 0 / 12%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .helpToc a,
  .helpTocNum,
  .helpFigurePanel img {
    transition: none;
  }

  .helpFigurePanel:hover img,
  .helpFigurePanel:active img,
  .helpToc a:active {
    transform: none;
  }
}

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  .helpLayout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 40px;
  }

  .helpFigures:is([data-count="3"], [data-count="4"], [data-count="5"], [data-count="6"]) {
    --figure-cols: 2;
  }
}

/* ---------- mobile: contents collapse above the article, support moves below ---------- */
@media (max-width: 860px) {
  .helpHero.v3-band {
    padding-top: calc(var(--k-header-h) + 72px);
    padding-bottom: 48px;
  }

  .helpPage .knBreadcrumb {
    top: calc(var(--k-header-h) + 28px);
  }

  .helpBody.v3-band {
    padding-top: 24px;
    padding-bottom: 80px;
  }

  .helpLayout {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .helpSidebar {
    display: contents;
  }

  .helpContents {
    order: 0;
    position: sticky;
    z-index: 5;
    top: calc(var(--k-header-h) + 8px);
    padding: 4px 6px;
    border: 1px solid var(--k-line);
    border-radius: 20px;
    background: var(--k-glass);
    box-shadow: var(--k-shadow-soft);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  .helpContents summary {
    min-height: 44px;
    margin: 0;
    padding: 0 12px;
    color: var(--k-ink);
    font-size: 15px;
    letter-spacing: 0;
    cursor: pointer;
    pointer-events: auto;
  }

  .helpContentsIcon {
    display: block;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--k-ink-3);
    border-bottom: 2px solid var(--k-ink-3);
    transform: translateY(-2px) rotate(45deg);
    transition: transform var(--k-dur-ui) var(--k-ease);
  }

  .helpContents[open] {
    background: rgb(255 255 255 / 94%);
  }

  .helpContents[open] .helpContentsIcon {
    transform: translateY(2px) rotate(-135deg);
  }

  .helpContents .helpToc {
    max-height: min(60dvh, 520px);
    padding-bottom: 6px;
    overflow-y: auto;
  }

  .helpArticle {
    order: 1;
  }

  .helpSupport {
    order: 2;
  }

  .helpChapter + .helpChapter {
    margin-top: 40px;
    padding-top: 40px;
  }

  .helpChapterNum {
    font-size: 32px;
  }

  .helpFigures[data-count="1"] .helpFigurePanel {
    height: auto;
    padding: 24px;
  }

  .helpFigures[data-count="1"] .helpFigurePanel img {
    width: min(100%, 260px);
  }

  /* Several screenshots scroll sideways instead of shrinking to thumbnails. */
  .helpFigures:not([data-count="1"]) {
    display: flex;
    gap: 12px;
    margin-inline: calc(-1 * var(--k-pad));
    padding-inline: var(--k-pad);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--k-pad);
    scrollbar-width: none;
  }

  .helpFigures:not([data-count="1"])::-webkit-scrollbar {
    display: none;
  }

  .helpFigures:not([data-count="1"]) .helpFigure {
    flex: 0 0 min(72%, 260px);
    scroll-snap-align: start;
  }

  .helpFigures:not([data-count="1"]) .helpFigurePanel {
    padding: 20px;
  }
}

/* Source walkthroughs retain their native aspect ratios. */
.helpVideo { display: block; margin: 28px 0; }
.helpVideo video { display: block; width: 100%; height: auto; max-height: 80vh; background: #111; border-radius: 16px; }
.helpVideoCaption { display: block; margin-top: 10px; font-size: 14px; }
