/* The help centre (pages/help.js, app/content/help-markup.js), on the reading layout's look (app/components/reading.css,
   its own <link> before this one). Also loaded by the older help pages (pages/text.js) for the help menu and the back
   link. Colours: tokens only. Class prefix: hc-.

     the first page   the site's page header (left, UX.md rule 6), the search under it, the topics as the site's
                      choice cards (ui.css .u-choice: icon left, words right, the 2px drop; 3 a row, 2 under 900, 1 on
                      phones), Popular guides as rows, "Still stuck?"
     a topic          the help menu on the left (the reading layout's left column), the topic's icon by its title,
                      its guides as rows in their groups
     a guide          the help menu, its words in the reading layout's sizes, numbered steps with a picture of the
                      site under each (drawn on a soft grey backdrop by the capture script, so every picture sits the
                      same), then Related, the guide before and after, "Still stuck?"
   Below 900 the menu goes (as the reading layout's left column does) and a back link names the page above. */

/* while a help page's words glide in from a side (app/components/helpmotion.js), nothing scrolls sideways */
html.hc-moving { overflow-x: clip; }

/* ================================================================ rows: a guide in a list (topics, Popular, Related) */
.hc-rows { margin: 0; padding: 0; list-style: none; max-width: var(--rd-measure, 680px); }
.hc-rows > li + li { border-top: 2px solid var(--color-swan); }
.hc-row {
  display: flex; align-items: center; gap: 16px; min-height: 72px; margin: 0 -12px; padding: 12px;
  border-radius: 12px; color: var(--color-eel); text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--m-fast) var(--m-ease-out);
}
.hc-row__txt { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.hc-row__title { font: 700 17px/24px var(--font); color: var(--color-eel); text-wrap: pretty; }
.hc-row__sum { font: 400 15px/20px var(--font); color: var(--color-label); text-wrap: pretty; }
.hc-row > .u-ic { flex: none; color: var(--color-hare); transition: translate var(--m-fast) var(--m-ease-out), color var(--m-fast) var(--m-ease-out); }
@media (hover: hover) {
  .hc-row:hover { background: var(--color-polar); }
  .hc-row:hover > .u-ic { color: var(--color-eel); translate: 2px 0; }
}
.hc-row:active { background: var(--color-polar); }
.hc-row:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: -2px; }

/* a section's heading on the first page and under a guide ("Popular guides", "Related") */
.hc-h2 { margin: 0 0 8px; color: var(--color-eel); font: 700 24px/30px var(--font); }
/* "Still stuck?": the last line */
.hc-stuck { margin: 48px 0 0; max-width: var(--rd-measure, 680px); color: var(--color-label); font: 400 17px/24px var(--font); }
.hc-stuck a { color: var(--color-link); font-weight: 700; text-decoration: none; }
@media (hover: hover) { .hc-stuck a:hover { text-decoration: underline; text-underline-offset: 3px; } }

/* ================================================================ the first page */
.hc-hero { max-width: 640px; }
.hc-hero__title { margin: 0 0 4px; }
.hc-hero__lead { margin: 0; color: var(--color-label); font: 400 17px/24px var(--font); }

/* the search: the site's field, a size up (it is the page's first thing to do), its answers in the drop box */
.hc-search { position: relative; margin-top: 24px; }
.hc-search__field { height: 56px; border-radius: 16px; }
.hc-search__field > input { padding-top: 0; padding-bottom: 0; font-size: 18px; }
.hc-search__field > svg { margin-left: 18px; }
.hc-res {
  position: absolute; z-index: 60; top: calc(100% + 8px); left: 0; right: 0;
  max-height: min(480px, calc(100vh / var(--zoom, 1) - var(--f-top-h) - 160px)); overflow-y: auto; overscroll-behavior: contain;
  padding: 8px; border: 2px solid var(--u-drop-edge); border-radius: 16px; background: var(--color-snow);
  box-shadow: var(--u-drop-shadow); scrollbar-width: thin;
}
.hc-res[hidden] { display: none; }
.hc-res:not([hidden]) { animation: hc-res-in var(--m-fast) var(--m-ease-out) both; }
.hc-res.is-leaving { animation: hc-res-out var(--m-fast) var(--m-ease-in) both; pointer-events: none; }
@keyframes hc-res-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes hc-res-out { to { opacity: 0; transform: translateY(-4px); } }
.hc-hit { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; color: var(--color-eel); text-decoration: none; scroll-margin: 8px; }
.hc-hit.is-hi { background: var(--color-polar); }
.hc-hit__title { font: 700 17px/24px var(--font); }
.hc-hit__meta { overflow: hidden; color: var(--color-label); font: 400 15px/20px var(--font); white-space: nowrap; text-overflow: ellipsis; }
.hc-hit:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: -2px; }
.hc-res__none { margin: 0; padding: 12px; color: var(--color-wolf); font: 400 17px/24px var(--font); text-wrap: pretty; }
.hc-res__none a { color: var(--color-link); font-weight: 700; text-decoration: none; }

/* the topics: a card each (the owner's reference, 2026-11-06), the site's card (ui.css .u-card: 2px swan, radius 16).
   Its head (picture, name with the count, line) is the link to the topic; its main guides are rows under it (beside it
   on the two wide cards), "See all 11 guides" last when there are more. */
.hc-topics { margin-top: 40px; }
.hc-cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.hc-tc {
  display: flex; flex-direction: column; grid-column: span 2; min-width: 0;
  border: 2px solid var(--color-swan); border-radius: 16px; background: var(--color-snow);
}
.hc-tc--wide { grid-column: span 3; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
/* a wide card alone in its row (Earn and giveaways): across the whole row, its head a third of it (below 1024 every
   wide card is a row of its own already) */
@media (min-width: 1024px) { .hc-tc--full { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
.hc-tc__head {
  display: flex; align-items: center; gap: 18px; padding: 22px 22px 18px; border-radius: 14px 14px 0 0;
  color: var(--color-eel); text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.hc-tc--wide .hc-tc__head { flex-direction: column; align-items: flex-start; gap: 20px; padding: 24px; border-radius: 14px 0 0 14px; }
.hc-tc__words { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hc-tc__name { display: flex; align-items: center; gap: 8px; }
.hc-tc__title { color: var(--color-eel); font: 700 19px/24px var(--font); transition: color var(--m-fast) var(--m-ease-out); }
.hc-tc__n {
  flex: none; min-width: 24px; padding: 2px 7px; border-radius: 8px; background: var(--color-polar); box-sizing: border-box;
  color: var(--color-label); font: 700 13px/16px var(--font); text-align: center; font-variant-numeric: tabular-nums;
}
.hc-tc__lead { color: var(--color-label); font: 400 15px/21px var(--font); text-wrap: pretty; }
@media (hover: hover) {
  .hc-tc__head:hover .hc-tc__title { color: var(--color-link); }
  .hc-tc__head:hover .hc-pic > img { scale: 1.06; }
}
.hc-tc__head:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: -2px; }

/* the guides: rows split by hairlines, under the head (a line between), or beside it on a wide card */
.hc-tc__list { flex: 1; margin: 0; padding: 4px 22px 14px; list-style: none; border-top: 2px solid var(--color-swan); }
.hc-tc--wide .hc-tc__list { display: flex; flex-direction: column; justify-content: center; padding: 12px 24px; border-top: 0; border-left: 2px solid var(--color-swan); }
.hc-tc__list > li + li { border-top: 2px solid var(--color-polar); }
.hc-tc__row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin: 0 -10px; padding: 8px 10px;
  border-radius: 10px; color: var(--color-eel); font: 700 16px/22px var(--font); text-decoration: none; text-wrap: pretty;
  -webkit-tap-highlight-color: transparent; transition: background-color var(--m-fast) var(--m-ease-out);
}
.hc-tc__row > .u-ic { flex: none; color: var(--color-hare); transition: translate var(--m-fast) var(--m-ease-out), color var(--m-fast) var(--m-ease-out); }
.hc-tc__all { color: var(--color-link); }
.hc-tc__all > .u-ic { color: var(--color-link); }
@media (hover: hover) {
  .hc-tc__row:hover { background: var(--color-polar); }
  .hc-tc__row:hover > .u-ic { color: var(--color-eel); translate: 2px 0; }
  .hc-tc__all:hover > .u-ic { color: var(--color-link); }
}
.hc-tc__row:active { background: var(--color-polar); }
.hc-tc__row:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: -2px; }

/* a topic's picture on its tile: a soft tint of the topic's colour, the picture big on it (the item tile's way, pop.css):
   112 on the wide cards, 80 on the others, 64 by a topic's title, 24 in the menu */
.hc-pic {
  --hc-s: 80px;
  position: relative; display: flex; flex: none; align-items: center; justify-content: center;
  width: var(--hc-s); height: var(--hc-s); border-radius: calc(var(--hc-s) * .22);
  background: color-mix(in srgb, var(--hc-tint) 16%, var(--color-snow));
}
.hc-pic--112 { --hc-s: 112px; }
.hc-pic--64 { --hc-s: 64px; }
.hc-pic--24 { --hc-s: 24px; border-radius: 7px; }
.hc-pic > img { display: block; width: 88%; height: 88%; object-fit: contain; transition: scale var(--m-base) var(--m-ease-out); }

/* ================================================================ the help menu (the left column) */
/* "Help centre" (the menu's name, a link to the first page), then every topic with its small picture; the open topic's
   guides under it (the reading layout's page rows, .rd-page, a step smaller), the one being read lit (the link colour
   and the reading layout's 3px bar at the column's edge, gliding from guide to guide: reading.js); an older page's
   sections under it on the reading layout's rail (.rd-subs) */
.hc-tree__home {
  display: block; margin: 0 0 8px; color: var(--color-eel); font: 700 17px/24px var(--font); text-decoration: none;
}
.hc-tree, .hc-tree__guides { margin: 0; padding: 0; list-style: none; }
.hc-tree__topic {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 0;
  color: var(--color-label); font: 700 15px/20px var(--font); text-decoration: none; text-wrap: pretty;
}
.hc-tree__item.is-open > .hc-tree__topic { color: var(--color-eel); }
.hc-tree__topic.is-active { color: var(--color-link); }
.hc-tree__topic.is-active::before,
.hc-tree__guide.is-active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--color-link);
}
.hc-tree__guides { padding: 0 0 8px 34px; }
.rd-page.hc-tree__guide { min-height: 32px; padding: 6px 0; font: 400 14px/20px var(--font); }
.rd-page.hc-tree__guide.is-active { font-weight: 700; }
.rd-page.hc-tree__guide.is-active::before { left: -48px; top: 6px; bottom: 6px; }
@media (hover: hover) {
  .hc-tree__home:hover { color: var(--color-link); }
  .hc-tree__topic:not(.is-active):hover { color: var(--color-eel); }
}
:is(.hc-tree__home, .hc-tree__topic):focus-visible { outline: 2px solid var(--color-macaw); outline-offset: 2px; border-radius: 6px; }

/* the back link above the header ("← Trading"): only where the menu isn't (below 900), as Settings' "← Settings" */
.hc-back { display: none; }

/* ================================================================ a topic */
.hc-head { display: flex; align-items: center; gap: 16px; }
.hc-head__txt { min-width: 0; }
.rd-head.hc-head .rd-title { margin-bottom: 2px; }
.hc-group + .hc-group { margin-top: 40px; }
.hc-group__title { margin: 0 0 4px; color: var(--color-eel); font: 700 19px/28px var(--font); }

/* ================================================================ a guide */
/* a picture under a step's words, or on its own between the words: drawn at twice its size on a soft grey backdrop
   with round corners (spec/help/capture.mjs), shown at its own size up to the words' width */
.hc-fig { margin: 0; max-width: 600px; }   /* every picture of a guide one width, in a step or on its own */
.hc-fig__img { display: block; max-width: 100%; height: auto; border-radius: 16px; background: var(--color-polar); }
.hc-step > .hc-fig { margin-top: 16px; }
.hc-fig--phone { max-width: 360px; }   /* a phone's own screen, at a phone's width */
.rd-step:has(.hc-fig) { padding-bottom: 32px; }
.rd-step:last-child { padding-bottom: 0; }

/* Related, the guide before and after */
.hc-related { margin-top: 56px; }
.hc-guide .hc-h2, .hc-related .hc-h2 { font: 700 19px/28px var(--font); margin-bottom: 4px; }
.hc-pn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: var(--rd-measure, 680px); margin-top: 48px; }
.hc-pn__a {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 14px 18px 16px;
  border: 2px solid var(--color-swan); border-radius: 16px; box-shadow: 0 2px 0 var(--color-swan);
  color: var(--color-eel); text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--m-fast) var(--m-ease-out);
}
.hc-pn__a--next { grid-column: 2; align-items: flex-end; text-align: right; }
.hc-pn__k { display: inline-flex; align-items: center; gap: 6px; color: var(--color-label); font: 700 14px/20px var(--font); }
.hc-pn__t { color: var(--color-link); font: 700 17px/24px var(--font); text-wrap: pretty; }
@media (hover: hover) { .hc-pn__a:hover { background: var(--color-polar); } }
.hc-pn__a:active { translate: 0 2px; box-shadow: none; }
.hc-pn__a:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: 2px; }
.hc-guide .hc-stuck { margin-top: 40px; }

/* ================================================================ narrower */
/* 900 to 1023: two a row (the wide ones a row each) */
@media (max-width: 1023px) {
  .hc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hc-tc { grid-column: span 1; }
  .hc-tc--wide { grid-column: span 2; }
}
/* the phone frame: the menu goes (reading.css), the back link names the page above */
@media (max-width: 899px) {
  .hc-back {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: -10px 0 4px; border-radius: 8px;
    color: var(--color-link); font: 700 15px/20px var(--font); text-decoration: none; -webkit-tap-highlight-color: transparent;
  }
  .hc-back:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: 2px; }
  .rd-toc + .hc-back { margin-top: -14px; }
}
/* phones: a card a row, its picture beside its name (the wide ones too), its guides under it */
@media (max-width: 699px) {
  .hc-cards { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .hc-tc, .hc-tc--wide { grid-column: span 1; display: flex; flex-direction: column; }
  .hc-tc--wide .hc-tc__head { flex-direction: row; align-items: center; gap: 18px; padding: 20px 20px 16px; border-radius: 14px 14px 0 0; }
  .hc-tc__head { padding: 20px 20px 16px; }
  .hc-tc--wide .hc-tc__head > .hc-pic { --hc-s: 80px; }
  .hc-tc__list, .hc-tc--wide .hc-tc__list { padding: 4px 20px 12px; border-left: 0; border-top: 2px solid var(--color-swan); }
}
@media (max-width: 599px) {
  .hc-pn { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .hc-pn__a--next { grid-column: 1; grid-row: 1; }
  .hc-head > .hc-pic { --hc-s: 52px; }
}
