/* =========================================================================
   views/help — Magnet's help centre (src/features/help: helpRender's pages), on its own pages (Help.html: helpApp) and
   in the app's help sheet (shared/lib/helpSheet). Framer's help centre is the model (owner, 5 Nov 2026): a quiet bar
   with Search, a home page of categories in one bordered grid, a category's articles as one bordered list, an article
   in one reading column with On this page and Related articles beside it. One border level, no shadows at rest.
   Prefix: help-. Linked into Help.html and every app shell (after the shells' own view sheets, before responsive.css).
   ========================================================================= */
.help-body { margin: 0; background: var(--surface); color: var(--text); font-family: var(--font-sans); }

/* ---- the bar: Magnet Help, and Search on the right ---- */
.help-top { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); height: 56px; padding: 0 var(--space-6); border-bottom: 1px solid var(--border-faint); background: var(--surface); }
.help-brand { display: inline-flex; flex: none; align-items: center; gap: var(--space-2); white-space: nowrap; color: var(--text-strong); font-size: var(--text-sm); font-weight: var(--fw-semibold); text-decoration: none; }
.help-brand img { display: block; }
.help-search-box { position: relative; flex: 0 1 240px; min-width: 0; margin: 0; }
.help-search-ico { position: absolute; left: var(--space-2-5); top: 50%; display: flex; color: var(--text-soft); transform: translateY(-50%); pointer-events: none; }
.help-search-ico svg { width: 14px; height: 14px; }
.help-search-input { box-sizing: border-box; width: 100%; height: var(--control-sm); padding: 0 var(--space-2-5) 0 calc(var(--space-2-5) + 14px + var(--space-2)); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); font: inherit; font-size: var(--text-sm); outline: none; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.help-search-input::placeholder { color: var(--text-placeholder); }
.help-search-input:focus-visible { border-color: var(--border-strong); box-shadow: var(--ring-primary); }
.help-search-input::-webkit-search-cancel-button { cursor: pointer; }

/* ---- the page: one width for every page; the reading column and its rail inside it ---- */
.help-main { box-sizing: border-box; max-width: 1040px; margin: 0 auto; padding: var(--space-10) var(--space-6) var(--space-12); container-type: inline-size; container-name: help; }
.help-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1-5); margin: 0 0 var(--space-8); padding: 0; list-style: none; font-size: var(--text-sm); color: var(--text-soft); }
.help-crumbs li { display: inline-flex; align-items: center; gap: var(--space-1-5); min-width: 0; }
.help-crumbs li + li::before { content: "›"; color: var(--text-placeholder); }
.help-crumbs a { color: var(--text-muted); text-decoration: none; }
.help-crumbs [aria-current] { overflow: hidden; color: var(--text-soft); text-overflow: ellipsis; white-space: nowrap; }

/* a page's title, and (a category, a search) the line under it, as large and in a quieter ink */
.help-h1 { margin: 0 0 var(--space-8); font-size: var(--text-3xl); font-weight: var(--fw-semibold); line-height: var(--leading-tight); letter-spacing: -0.02em; color: var(--text-strong); }
.help-h1-sub { display: block; margin-top: var(--space-1); color: var(--text-soft); font-weight: var(--fw-medium); }

/* ---- the home page: the categories, one bordered grid (each cell its icon, name, line and how many articles) ---- */
.help-cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; overflow: hidden; list-style: none; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.help-cats > li { display: flex; min-width: 0; box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border); }
.help-cat { display: flex; flex: 1; flex-direction: column; min-width: 0; padding: var(--space-6); color: inherit; text-decoration: none; transition: background var(--dur-fast) var(--ease); }
.help-cat-ico { display: flex; margin-bottom: var(--space-4); color: var(--text-strong); }
.help-cat-ico svg { width: 18px; height: 18px; }
.help-cat b { font-size: var(--text-md); font-weight: var(--fw-semibold); color: var(--text-strong); }
.help-cat-desc { margin-top: var(--space-0-5); overflow: hidden; font-size: var(--text-md); color: var(--text-soft); text-overflow: ellipsis; white-space: nowrap; }
.help-cat-n { margin-top: var(--space-5); font-size: var(--text-xs); color: var(--text-soft); }
@container help (max-width: 820px) { .help-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container help (max-width: 480px) { .help-cats { grid-template-columns: minmax(0, 1fr); } .help-cat { padding: var(--space-4) var(--space-5); } .help-cat-ico { margin-bottom: var(--space-2-5); } .help-cat-n { margin-top: var(--space-2-5); } }

/* ---- a category, a search, related lists: one bordered list, each row a title and its line ---- */
.help-rows { margin: 0; padding: 0; overflow: hidden; list-style: none; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.help-rows > li + li { border-top: 1px solid var(--border-faint); }
.help-row { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); color: inherit; text-decoration: none; transition: background var(--dur-fast) var(--ease); }
.help-row-text { display: flex; flex: 1; flex-direction: column; gap: var(--space-0-5); min-width: 0; }
.help-row-text b { font-size: var(--text-md); font-weight: var(--fw-medium); color: var(--text-strong); }
.help-row-text span { overflow: hidden; font-size: var(--text-sm); color: var(--text-soft); text-overflow: ellipsis; white-space: nowrap; }
.help-row-go { display: flex; flex: none; color: var(--text-placeholder); }
.help-row-go svg { width: 16px; height: 16px; }
.help-search-home a { color: var(--text-strong); font-size: var(--text-md); }

/* ---- an article: the reading column, and beside it (wide enough) On this page and Related articles ---- */
.help-doc { display: block; }
@container help (min-width: 900px) { .help-doc.has-rail { display: grid; grid-template-columns: minmax(0, 1fr) 220px; column-gap: var(--space-12); align-items: start; } }
.help-article { max-width: 680px; min-width: 0; }
.help-article h1 { margin: 0 0 var(--space-3); font-size: var(--text-3xl); font-weight: var(--fw-semibold); line-height: var(--leading-tight); letter-spacing: -0.02em; color: var(--text-strong); }
.help-article .help-sub { margin: 0 0 var(--space-8); font-size: var(--text-lg); line-height: var(--leading-snug); color: var(--text-soft); }
.help-article h2 { margin: var(--space-10) 0 var(--space-3); scroll-margin-top: var(--space-6); font-size: var(--text-lg); font-weight: var(--fw-semibold); line-height: var(--leading-snug); color: var(--text-strong); }
.help-article h3 { margin: var(--space-6) 0 var(--space-2); font-size: var(--text-md); font-weight: var(--fw-semibold); line-height: var(--leading-snug); color: var(--text-strong); }
.help-article p, .help-article li { font-size: var(--text-md); line-height: var(--leading-relaxed); color: var(--text); }
.help-article p { margin: 0 0 var(--space-4); }
.help-article strong { font-weight: var(--fw-semibold); color: var(--text-strong); }
.help-article a { color: var(--text-strong); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
.help-article code { padding: 1px 5px; border-radius: var(--radius-xs); background: var(--surface-sunk); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86em; color: var(--text-strong); }

/* numbered steps: the number in a small round marker */
.help-steps { counter-reset: step; margin: 0 0 var(--space-4); padding: 0; list-style: none; }
.help-steps > li { counter-increment: step; position: relative; padding: 0 0 var(--space-3) 36px; }
.help-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 2px; display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: var(--radius-full); background: var(--surface-sunk); font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-strong);
}
.help-list { margin: 0 0 var(--space-4); padding-left: var(--space-5); list-style: disc; }
.help-list > li::marker { color: var(--text-soft); }
.help-list > li { padding-bottom: var(--space-1-5); }
.help-note { padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: var(--surface-sunk); }

/* a table: in one bordered box, its head row quiet */
.help-table-wrap { margin: 0 0 var(--space-5); overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.help-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.help-table th, .help-table td { padding: var(--space-3) var(--space-4); text-align: left; vertical-align: top; line-height: var(--leading-normal); }
.help-table tr + tr th, .help-table tr + tr td, .help-table tbody tr:first-child th, .help-table tbody tr:first-child td { border-top: 1px solid var(--border-faint); }
.help-table thead th { font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--text-soft); background: var(--surface-sunk); }
.help-table tbody th { width: 34%; font-weight: var(--fw-medium); color: var(--text-strong); white-space: nowrap; }
.help-table td { color: var(--text); }

/* the FAQ: its small label, then each question and its answer */
.help-faq { margin-top: var(--space-12); }
.help-faq > h2 { margin: 0 0 var(--space-2); font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text-soft); }
.help-faq > h3:first-of-type { margin-top: var(--space-3); }
.help-article .help-meta { margin: var(--space-10) 0 0; font-size: var(--text-sm); color: var(--text-soft); }

/* the rail: On this page (the article's headings) and Related articles, held in view as the article scrolls */
.help-rail { margin-top: var(--space-10); }
@container help (min-width: 900px) { .help-doc.has-rail .help-rail { position: sticky; top: var(--space-6); margin-top: 0; } }
.help-rail-label { margin: 0 0 var(--space-2); font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text-strong); }
.help-toc { margin: 0 0 var(--space-8); padding: 0; list-style: none; }
.help-toc a { display: block; padding: var(--space-1) 0; font-size: var(--text-sm); line-height: var(--leading-snug); color: var(--text-soft); text-decoration: none; }
.help-related { display: flex; flex-direction: column; gap: var(--space-1-5); margin: 0; padding: 0; list-style: none; }
.help-related a { display: block; overflow: hidden; padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--text-strong); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; transition: background var(--dur-fast) var(--ease); }

.help-brand:focus-visible, .help-crumbs a:focus-visible, .help-cat:focus-visible, .help-row:focus-visible, .help-toc a:focus-visible, .help-related a:focus-visible, .help-article a:focus-visible, .help-search-home a:focus-visible { outline: none; border-radius: var(--radius-sm); box-shadow: var(--ring-primary); }
.help-cat:focus-visible, .help-row:focus-visible { border-radius: 0; box-shadow: inset 0 0 0 2px var(--focus-color); }
@media (hover: hover) and (pointer: fine) {
  .help-crumbs a:hover, .help-toc a:hover { color: var(--text-strong); }
  .help-cat:hover, .help-row:hover, .help-related a:hover { background: var(--surface-hover); }
  .help-article a:hover { text-decoration-color: currentColor; }
}
@media (max-width: 640px) {
  .help-top { padding: 0 var(--space-4); }
  .help-main { padding: var(--space-6) var(--space-4) var(--space-12); }
  .help-h1, .help-article h1 { font-size: var(--text-2xl); }
  .help-table tbody th { white-space: normal; }
}

/* ---- the app's help sheet (shared/lib/helpSheet): the help centre over the page it was opened on, slid in from the
   right across that page's column, a back arrow at its top left and Search on its right; the page underneath stays
   put. It's last in the column, so it covers the column's own bars and menus; a dialog or a toast still shows over it ---- */
.help-sheet { position: absolute; inset: 0; z-index: var(--z-popover); display: flex; flex-direction: column; min-height: 0; background: var(--surface); color: var(--text); font-family: var(--font-sans); transform: translateX(100%); visibility: hidden; transition: transform var(--dur-slow) var(--ease-exit), box-shadow var(--dur-slow) var(--ease-exit), visibility 0s linear var(--dur-slow); }
.help-sheet.is-window { position: fixed; z-index: var(--z-overlay); }
.help-sheet.is-in { transform: none; visibility: visible; box-shadow: var(--shadow-lg); transition: transform var(--dur-slow) var(--ease-enter), box-shadow var(--dur-slow) var(--ease-enter), visibility 0s; }
.help-sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex: none; height: 56px; padding: 0 var(--space-4); border-bottom: 1px solid var(--border-faint); }
.help-sheet-back:focus-visible { outline: var(--focus-outline); outline-offset: var(--focus-offset); }
.help-sheet-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.help-sheet .help-main { padding-top: var(--space-8); }
@media (prefers-reduced-motion: reduce) { .help-sheet, .help-sheet.is-in { transition: none; } .help-cat, .help-row, .help-related a { transition: none; } }
