/* ==========================================================================
   help — the Help Center's shared article and index layout (DA275.1; ui-guideline.md §3 / Q47).

   One structure for every surface that shows Help: Ops desktop, BM Portal, Staff Portal, Guest
   Portal and the public site. Each family reads different tokens, so this is a shared partial: it may
   use only Tier 0 (brand-kit.css) and its own `--help-*` interface properties (design_lint Rule 9).
   Each family's own Tier-3 file (ops/help.css, mobile/help.css, public/css/help.css) maps the
   interface from that family's Tier-1 tokens on the `.help--<surface>` modifier.

   MARKUP CONTRACT
     <div class="help help--<surface>">
       <header class="help__header"> .help__title  .help__lede  .help__badges  .help__who  .help__updated
       <div class="help__top"> <form class="help__search-form"> …the family's search atom + clear button + All questions… </form> + the chapter <nav class="help__tabs"> (the family's tab atom)
       <div id="help-results"> .help__group > .help__group-title + .help__list > .help__item > .help__item-link
       <article class="help-article"> .help__crumbs  .help__section--<kind> > .help__section-title + .help__prose
       .help__related  .help__chips  .help__empty
       Contents ("All questions"): .help__jump-bar > .help__chips  .help__chapters > details.help__chapter > summary.help__chapter-summary
       + .help__chapter-body > .help__toc-title  .help__toc > .help__toc-item > .help__toc-link;  .help__search-row  .help__all-link  .help__text-btn
     Screenshots: .help-shot__img, or .help-shot--missing (a DEBUG-only placeholder).

   INTERFACE (every property is optional; the value after the comma is the fallback)
     --help-font  --help-ink  --help-ink-muted  --help-surface  --help-surface-alt  --help-border
     --help-accent  --help-accent-soft  --help-radius  --help-ring
     --help-space-1 … --help-space-5   --help-fs-small  --help-fs-body  --help-fs-lede
     --help-fs-h2  --help-fs-title   --help-fw-medium  --help-fw-bold   --help-lh  --help-touch
     --help-icon-size   the row chevron and the public search icon (the SVG itself carries fill/stroke)
   ========================================================================== */

.help {
  color: var(--help-ink, inherit);
  font-family: var(--help-font, inherit);
  font-size: var(--help-fs-body, 1rem);
  line-height: var(--help-lh, 1.6);
  display: flex;
  flex-direction: column;
  gap: var(--help-space-5, 1.5rem);
  min-width: 0;
}

.help__header { display: flex; flex-direction: column; gap: var(--help-space-2, 0.5rem); }
.help__title {
  margin: 0;
  font-size: var(--help-fs-title, 1.5rem);
  font-weight: var(--help-fw-bold, 700);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.help__lede { margin: 0; font-size: var(--help-fs-lede, 1rem); color: var(--help-ink-muted, inherit); }
.help__badges { display: flex; flex-wrap: wrap; gap: var(--help-space-2, 0.5rem); }
.help__who,
.help__updated { margin: 0; font-size: var(--help-fs-small, 0.875rem); color: var(--help-ink-muted, inherit); }
.help__who strong { color: var(--help-ink, inherit); font-weight: var(--help-fw-medium, 600); }

/* ---- search ---- */
.help__search-form { display: flex; flex-direction: column; gap: var(--help-space-2, 0.5rem); }
.help__search {
  display: flex;
  align-items: center;
  gap: var(--help-space-2, 0.5rem);
  min-height: var(--help-touch, 2.5rem);
  padding: 0 var(--help-space-3, 0.75rem);
  background: var(--help-surface, transparent);
  border: 1px solid var(--help-border, currentColor);
  border-radius: var(--help-radius, 0.5rem);
}
.help__search:focus-within { border-color: var(--help-accent, currentColor); box-shadow: var(--help-ring, none); }
.help__search-icon,
.help__guide-card-label svg,
.help__chevron {
  flex: none;
  width: var(--help-icon-size, 1rem);
  height: var(--help-icon-size, 1rem);
  color: var(--help-ink-muted, inherit);
}
.help__search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
}
.help__loading { display: none; font-size: var(--help-fs-small, 0.875rem); color: var(--help-ink-muted, inherit); }
.help__loading.htmx-request { display: inline-flex; }

/* ---- index ---- */
.help__count { margin: 0; font-size: var(--help-fs-small, 0.875rem); color: var(--help-ink-muted, inherit); }
.help__group { display: flex; flex-direction: column; gap: var(--help-space-2, 0.5rem); }
.help__group + .help__group { margin-top: var(--help-space-2, 0.5rem); }
.help__group-title {
  margin: 0;
  font-size: var(--help-fs-small, 0.875rem);
  font-weight: var(--help-fw-bold, 700);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--help-ink-muted, inherit);
}
.help__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--help-space-2, 0.5rem); }
.help__item-link {
  display: flex;
  align-items: center;
  gap: var(--help-space-3, 0.75rem);
  min-height: var(--help-touch, 2.5rem);
  padding: var(--help-space-3, 0.75rem) var(--help-space-4, 1rem);
  background: var(--help-surface, transparent);
  border: 1px solid var(--help-border, currentColor);
  border-radius: var(--help-radius, 0.5rem);
  color: inherit;
  text-decoration: none;
}
.help__item-link:hover { border-color: var(--help-accent, currentColor); background: var(--help-accent-soft, transparent); }
.help__item-link:active, .help__card:active { background: var(--help-accent-soft, transparent); border-color: var(--help-accent, currentColor); }
.help__item-link:focus-visible { outline: none; border-color: var(--help-accent, currentColor); box-shadow: var(--help-ring, none); }
.help__item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.help__item-title { font-weight: var(--help-fw-medium, 600); overflow-wrap: anywhere; }
.help__item-summary { font-size: var(--help-fs-small, 0.875rem); color: var(--help-ink-muted, inherit); }
.help__empty {
  padding: var(--help-space-5, 1.5rem) var(--help-space-4, 1rem);
  text-align: center;
  color: var(--help-ink-muted, inherit);
  background: var(--help-surface-alt, transparent);
  border-radius: var(--help-radius, 0.5rem);
}
.help__empty a { color: var(--help-accent, inherit); }

/* ---- article ---- */
.help__crumbs { font-size: var(--help-fs-small, 0.875rem); color: var(--help-ink-muted, inherit); display: flex; flex-wrap: wrap; gap: var(--help-space-2, 0.5rem); }
.help__crumbs a { color: var(--help-accent, inherit); }
.help__section {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-2, 0.5rem);
  padding: var(--help-space-4, 1rem);
  background: var(--help-surface, transparent);
  border: 1px solid var(--help-border, currentColor);
  border-radius: var(--help-radius, 0.5rem);
}
.help__section--steps { border-color: var(--help-accent, currentColor); }
.help__section-title { margin: 0; font-size: var(--help-fs-h2, 1.125rem); font-weight: var(--help-fw-bold, 700); }

.help__prose { min-width: 0; overflow-wrap: anywhere; }
.help__prose > :first-child { margin-top: 0; }
.help__prose > :last-child { margin-bottom: 0; }
.help__prose p { margin: 0 0 var(--help-space-3, 0.75rem); }
.help__prose h3 { margin: var(--help-space-4, 1rem) 0 var(--help-space-2, 0.5rem); font-size: var(--help-fs-body, 1rem); font-weight: var(--help-fw-bold, 700); }
.help__prose ul,
.help__prose ol { margin: 0 0 var(--help-space-3, 0.75rem); padding-left: 1.25rem; }
.help__prose li { margin-bottom: var(--help-space-2, 0.5rem); }
.help__prose li > ul,
.help__prose li > ol { margin-top: var(--help-space-2, 0.5rem); margin-bottom: 0; }
.help__prose a { color: var(--help-accent, inherit); }
.help__prose code,
.help__prose kbd {
  padding: 0.05rem 0.3rem;
  background: var(--help-surface-alt, transparent);
  border-radius: 0.25rem;
  font-size: 0.9em;
}
.help__prose blockquote {
  margin: 0 0 var(--help-space-3, 0.75rem);
  padding: var(--help-space-2, 0.5rem) var(--help-space-3, 0.75rem);
  background: var(--help-accent-soft, transparent);
  border-left: 3px solid var(--help-accent, currentColor);
  border-radius: 0 var(--help-radius, 0.5rem) var(--help-radius, 0.5rem) 0;
}

/* Numbered steps: a counter badge per step, the screenshot (if any) under the text. */
.help__section--steps .help__prose ol { list-style: none; padding-left: 0; }
.help__section--steps .help__prose ol > li {
  position: relative;
  padding-left: 2.25rem;
  margin-bottom: var(--help-space-4, 1rem);
}
.help__section--steps .help__prose ol > li::before {
  content: counter(list-item); /* the native list counter, so the renderer's <ol start> carries the numbering across sub-headings */
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--help-accent, currentColor);
  color: var(--help-surface, inherit);
  font-size: var(--help-fs-small, 0.875rem);
  font-weight: var(--help-fw-bold, 700);
}
.help__section--steps .help__prose ol ol,
.help__section--steps .help__prose li > ul { margin-top: var(--help-space-2, 0.5rem); }

.help-shot__img { display: block; max-width: 100%; height: auto; margin-top: var(--help-space-2, 0.5rem); border: 1px solid var(--help-border, currentColor); border-radius: var(--help-radius, 0.5rem); }
.help-shot--missing {
  display: block;
  margin-top: var(--help-space-2, 0.5rem);
  padding: var(--help-space-4, 1rem);
  text-align: center;
  font-size: var(--help-fs-small, 0.875rem);
  color: var(--help-ink-muted, inherit);
  background: var(--help-surface-alt, transparent);
  border: 1px dashed var(--help-border, currentColor);
  border-radius: var(--help-radius, 0.5rem);
}

.help__aside { display: flex; flex-direction: column; gap: var(--help-space-2, 0.5rem); }
.help__aside-title { margin: 0; font-size: var(--help-fs-small, 0.875rem); font-weight: var(--help-fw-bold, 700); text-transform: uppercase; letter-spacing: 0.04em; color: var(--help-ink-muted, inherit); }
.help__chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--help-space-2, 0.5rem); }
.help__chip {
  display: inline-flex;
  align-items: center;
  min-height: var(--help-touch, 2.5rem);
  padding: 0 var(--help-space-3, 0.75rem);
  border: 1px solid var(--help-border, currentColor);
  border-radius: 999px;
  color: var(--help-accent, inherit);
  text-decoration: none;
}
.help__chip:hover { background: var(--help-accent-soft, transparent); }
.help__chip:focus-visible { outline: none; box-shadow: var(--help-ring, none); }

/* ---- home, module cards, guides, A-Z (DA275.3) ---- */
.help__block { display: flex; flex-direction: column; gap: var(--help-space-2, 0.5rem); }
.help__block + .help__block, .help__block + .help__links { margin-top: var(--help-space-4, 1.25rem); }
.help__cards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--help-space-2, 0.5rem); grid-template-columns: repeat(auto-fill, minmax(var(--help-card-min, 15rem), 1fr)); }
.help__card-item { display: flex; min-width: 0; }
.help__card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--help-space-1, 0.25rem);
  padding: var(--help-space-3, 0.75rem) var(--help-space-4, 1rem);
  background: var(--help-surface, transparent);
  border: 1px solid var(--help-border, currentColor);
  border-radius: var(--help-radius, 0.5rem);
  color: inherit;
  text-decoration: none;
}
.help__card:hover { border-color: var(--help-accent, currentColor); background: var(--help-accent-soft, transparent); }
.help__card:focus-visible { outline: none; border-color: var(--help-accent, currentColor); box-shadow: var(--help-ring, none); }
.help__card-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--help-space-2, 0.5rem); }
.help__card-title { font-weight: var(--help-fw-medium, 600); overflow-wrap: anywhere; }
.help__card-count { flex: none; font-size: var(--help-fs-small, 0.875rem); color: var(--help-ink-muted, inherit); }
.help__card-text { font-size: var(--help-fs-small, 0.875rem); color: var(--help-ink-muted, inherit); }
.help__links { margin: 0; display: flex; flex-wrap: wrap; gap: var(--help-space-2, 0.5rem); font-size: var(--help-fs-small, 0.875rem); }
.help__links a { color: var(--help-accent, inherit); }
.help__empty { display: flex; flex-direction: column; gap: var(--help-space-1, 0.25rem); }
.help__empty strong { color: var(--help-ink, inherit); }
.help mark { background: var(--help-accent-soft, transparent); color: inherit; border-radius: 0.125rem; padding: 0 0.125rem; }
.help__readonly {
  margin: 0;
  padding: var(--help-space-2, 0.5rem) var(--help-space-3, 0.75rem);
  font-size: var(--help-fs-small, 0.875rem);
  background: var(--help-surface-alt, transparent);
  border-radius: var(--help-radius, 0.5rem);
  color: var(--help-ink-muted, inherit);
}

.help__guide-nav { display: flex; flex-direction: column; gap: var(--help-space-2, 0.5rem); }
.help__guide-line { margin: 0; font-size: var(--help-fs-small, 0.875rem); color: var(--help-ink-muted, inherit); }
.help__guide-cards { display: grid; gap: var(--help-space-2, 0.5rem); grid-template-columns: repeat(auto-fit, minmax(var(--help-card-min, 15rem), 1fr)); }
.help__guide-card {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-1, 0.25rem);
  min-height: var(--help-touch, 2.5rem);
  padding: var(--help-space-3, 0.75rem) var(--help-space-4, 1rem);
  background: var(--help-surface, transparent);
  border: 1px solid var(--help-border, currentColor);
  border-radius: var(--help-radius, 0.5rem);
  color: inherit;
  text-decoration: none;
}
.help__guide-card--next { text-align: right; align-items: flex-end; }
.help__guide-card:hover { border-color: var(--help-accent, currentColor); background: var(--help-accent-soft, transparent); }
.help__guide-card:focus-visible { outline: none; border-color: var(--help-accent, currentColor); box-shadow: var(--help-ring, none); }
.help__guide-card-label { display: inline-flex; align-items: center; gap: var(--help-space-1, 0.25rem); font-size: var(--help-fs-small, 0.875rem); color: var(--help-ink-muted, inherit); }
.help__guide-card-title { font-weight: var(--help-fw-medium, 600); overflow-wrap: anywhere; }

.help__jump { display: flex; flex-wrap: wrap; gap: var(--help-space-1, 0.25rem); }
.help__jump-link {
  min-width: var(--help-touch, 2.5rem);
  min-height: var(--help-touch, 2.5rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--help-border, currentColor);
  border-radius: var(--help-radius, 0.5rem);
  color: var(--help-accent, inherit);
  text-decoration: none;
  font-weight: var(--help-fw-medium, 600);
}
.help__jump-link:hover { background: var(--help-accent-soft, transparent); }
.help__jump-link:focus-visible { outline: none; box-shadow: var(--help-ring, none); }

/* ---- Contents page, "All questions" (DA275.4) ---- */
.help__search-row { display: flex; align-items: center; gap: var(--help-space-3, 0.75rem); }
.help__search-row > :first-child { flex: 1 1 auto; min-width: 0; }
.help__text-btn {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: var(--help-touch, 2.5rem);
  color: var(--help-accent, inherit);
  font: inherit;
  font-size: var(--help-fs-small, 0.875rem);
  font-weight: var(--help-fw-medium, 600);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.help__text-btn {
  padding: 0 var(--help-space-3, 0.75rem);
  background: var(--help-surface, transparent);
  border: 1px solid var(--help-border, currentColor);
  border-radius: var(--help-radius, 0.5rem);
}
.help__text-btn:hover { background: var(--help-accent-soft, transparent); }
.help__text-btn:focus-visible { outline: none; box-shadow: var(--help-ring, none); border-radius: var(--help-radius, 0.5rem); }
.help__toolbar { display: flex; flex-wrap: wrap; gap: var(--help-space-2, 0.5rem); }

.help__chapters { display: flex; flex-direction: column; gap: var(--help-space-3, 0.75rem); }
@media (min-width: 56rem) {
  .help--contents .help__chapters { display: block; column-count: 2; column-gap: var(--help-space-5, 1.5rem); }
  .help--contents .help__chapter { break-inside: avoid; margin-bottom: var(--help-space-3, 0.75rem); }
}
.help__chapter {
  background: var(--help-surface, transparent);
  border: 1px solid var(--help-border, currentColor);
  border-radius: var(--help-radius, 0.5rem);
}
.help__chapter-summary {
  display: flex;
  align-items: center;
  gap: var(--help-space-2, 0.5rem);
  min-height: var(--help-touch, 2.5rem);
  padding: var(--help-space-2, 0.5rem) var(--help-space-4, 1rem);
  cursor: pointer;
  list-style: none;
}
.help__chapter-summary::-webkit-details-marker { display: none; }
.help__chapter-summary:focus-visible { outline: none; box-shadow: var(--help-ring, none); border-radius: var(--help-radius, 0.5rem); }
.help__chapter-name { flex: 1; min-width: 0; font-weight: var(--help-fw-bold, 700); overflow-wrap: anywhere; }
.help__chapter-count { flex: none; font-size: var(--help-fs-small, 0.875rem); color: var(--help-ink-muted, inherit); }
.help__chapter[open] > .help__chapter-summary .help__chapter-chevron { transform: rotate(90deg); }
.help__chapter-body { display: flex; flex-direction: column; gap: var(--help-space-1, 0.25rem); padding: 0 var(--help-space-4, 1rem) var(--help-space-4, 1rem); }
.help__chapter-text { margin: 0 0 var(--help-space-2, 0.5rem); font-size: var(--help-fs-small, 0.875rem); color: var(--help-ink-muted, inherit); }
.help__toc-title {
  margin: var(--help-space-3, 0.75rem) 0 0;
  font-size: var(--help-fs-small, 0.875rem);
  font-weight: var(--help-fw-bold, 700);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--help-ink-muted, inherit);
}
.help__toc-subtitle { margin: var(--help-space-2, 0.5rem) 0 0; font-size: var(--help-fs-small, 0.875rem); font-weight: var(--help-fw-medium, 600); color: var(--help-ink-muted, inherit); }
.help__toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.help__toc-link {
  display: flex;
  align-items: center;
  min-height: var(--help-touch, 2.5rem);
  padding: 0 var(--help-space-2, 0.5rem);
  color: var(--help-accent, inherit);
  text-decoration: none;
  border-radius: var(--help-radius, 0.5rem);
  overflow-wrap: anywhere;
}
.help__toc-link:hover { background: var(--help-accent-soft, transparent); text-decoration: underline; }
.help__toc-link:focus-visible { outline: none; box-shadow: var(--help-ring, none); }

/* ---- The shared Help header (DA275.6): search + All questions, then the chapter tab strip. Colours and shapes come from each family's atoms
   (atom-search / mob-searchbar / help__search, atom-tabstrip / mob-chip / btn--outline, the secondary buttons); this is layout glue only. ---- */
.help__top { display: flex; flex-direction: column; gap: var(--help-space-3, 0.75rem); min-width: 0; }
.help__searchbox { flex: 1 1 auto; min-width: 0; min-height: 2.75rem; }
.help__all-link { flex: none; white-space: nowrap; text-decoration: none; }
.help__search-clear {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem; padding: 0; border: 0; border-radius: var(--help-radius, 0.5rem);
  background: transparent; color: var(--help-ink-muted, inherit); cursor: pointer;
}
.help__search-clear:hover { background: var(--help-accent-soft, transparent); color: var(--help-ink, inherit); }
.help__search-clear:focus-visible { outline: none; box-shadow: var(--help-ring, none); }
.help__search-clear[hidden] { display: none; }
.help__tabs-scroller { min-width: 0; }
.help__tabs-track { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.help__tabs-track::-webkit-scrollbar { display: none; }
.help__tabs { flex: none; }
.help__tabs a { white-space: nowrap; text-decoration: none; }
.help__tabs-row { display: flex; flex-wrap: nowrap; gap: var(--help-space-2, 0.5rem); }
.help__tabs-row > a { flex: none; text-decoration: none; }
/* A label never ends half cut at an edge: the track fades out toward the side that still has more (set by help_header.js). */
.help__tabs-track[data-fade="end"] { -webkit-mask-image: linear-gradient(to right, black calc(100% - 1.5rem), transparent); mask-image: linear-gradient(to right, black calc(100% - 1.5rem), transparent); } /* lint-ignore */
.help__tabs-track[data-fade="start"] { -webkit-mask-image: linear-gradient(to left, black calc(100% - 1.5rem), transparent); mask-image: linear-gradient(to left, black calc(100% - 1.5rem), transparent); } /* lint-ignore */
.help__tabs-track[data-fade="both"] { -webkit-mask-image: linear-gradient(to right, transparent, black 1.5rem, black calc(100% - 1.5rem), transparent); mask-image: linear-gradient(to right, transparent, black 1.5rem, black calc(100% - 1.5rem), transparent); } /* lint-ignore */
.help__count { margin: 0; font-size: var(--help-fs-small, 0.875rem); color: var(--help-ink-muted, inherit); }
/* Reading width: the article column stays about 70 characters wide; the header above it spans the page. */
.help-article > :not(.help__top) { max-width: 46rem; }
@media (max-width: 30rem) {
  /* A narrow row: the module badge drops under the text instead of squeezing the title into a sliver. */
  .help__item-link { flex-wrap: wrap; }
  .help__item-main { flex: 1 1 calc(100% - 2.75rem); }
  .help__item-link > [class*="badge"] { order: 3; }
}
