/* Help centre (pages/help.js) – home (#/help) and topic pages (#/help/<topic>) + the "?" button in page headers (js/ui.js pageHead).
   Colours only via tokens (css/theme.css); flat surfaces, no ALL-CAPS labels, no thick coloured bars. Screenshots sit in a small window frame. */

/* ---- "?" button in every page header ---- */
.page-head .actions .ph-help { color: var(--text-3); }
.page-head .actions .ph-help:hover { color: var(--text); }

/* ---- shared ---- */
.hc { --hc-gap: 16px; }
.hc-h { font-size: var(--fs-lg); margin: 28px 0 12px; }
.hc-ic { width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center; border-radius: var(--radius); background: var(--accent-50); color: var(--accent-ink, var(--accent)); }
.hc-ic .ico { width: 19px; height: 19px; }
.hc-ic-lg { width: 44px; height: 44px; margin-right: 12px; vertical-align: middle; }
.hc-ic-lg .ico { width: 22px; height: 22px; }
.hc .page-head h1 { display: flex; align-items: center; }
.hc mark { background: var(--coral-50); color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: inset 0 -2px 0 var(--coral); }
[data-mode="dark"] .hc mark { background: rgba(252, 93, 3, .22); }

/* ---- hero with search ---- */
.hc-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 32px; border-radius: var(--radius-lg);
  background: var(--hero-from); color: var(--accent-contrast); overflow: hidden; }
[data-mode="dark"] .hc-hero { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.hc-hero h2 { color: inherit; font-size: var(--fs-xl); margin-bottom: 14px; }
.hc-search { max-width: 640px; }
.hc-search input { height: 50px; font-size: var(--fs-md); border-color: transparent; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.hc-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.hc-chips > span { opacity: .8; margin-right: 4px; }
.hc-chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, currentColor 30%, transparent); background: color-mix(in srgb, currentColor 8%, transparent); color: inherit; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.hc-chip:hover { background: color-mix(in srgb, currentColor 18%, transparent); }
.hc-chip:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 2px; }
/* CSS graphic: a help page with lines and a question mark (no stock images) */
.hc-hero-art { position: relative; width: 200px; height: 150px; margin-right: 8px; }
.hc-doc { position: absolute; left: 18px; top: 10px; width: 120px; height: 140px; border-radius: 12px; background: color-mix(in srgb, currentColor 10%, transparent); border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  display: flex; flex-direction: column; gap: 10px; padding: 22px 16px; transform: rotate(-5deg); }
.hc-doc i { display: block; height: 7px; border-radius: 4px; background: color-mix(in srgb, currentColor 35%, transparent); }
.hc-doc i:nth-child(2) { width: 80%; } .hc-doc i:nth-child(3) { width: 60%; }
.hc-doc i.s { width: 34px; height: 7px; margin-top: auto; background: var(--brand-orange); }
.hc-qm { position: absolute; right: 8px; top: 34px; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--brand-navy);
  font-size: 40px; font-weight: 800; box-shadow: var(--shadow-lg); border: 4px solid var(--brand-orange); }
[data-mode="dark"] .hc-qm { color: var(--text); }

/* ---- topic cards + categories ---- */
.hc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--hc-gap); }
.hc-grid-sm { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.hc-card { display: flex; align-items: flex-start; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text);
  transition: border-color .15s, box-shadow .15s; min-width: 0; }
.hc-card:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-50); }
.hc-card:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.hc-card-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.hc-card-t b { font-size: var(--fs-md); }
.hc-go { color: var(--text-3); flex: none; margin-top: 10px; transition: transform .15s; }
.hc-card:hover .hc-go { transform: translateX(3px); color: var(--accent-ink, var(--accent)); }
.hc-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--hc-gap); align-items: start; }
.hc-cat { padding: 18px 18px 10px; }
.hc-cat-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.hc-cat-head h3 { font-size: var(--fs-md); }
.hc-cat-head p { margin: 2px 0 0; }
.hc-cat-list { list-style: none; margin: 0; padding: 0; }
.hc-cat-list a { display: flex; align-items: center; gap: 10px; padding: 9px 8px; margin: 0 -8px; border-radius: var(--radius-sm); color: var(--text); }
.hc-cat-list a:hover { background: var(--surface-2); text-decoration: none; }
.hc-li-ic { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.hc-lower { margin-top: 28px; }
.hc-direct a { word-break: break-word; }

/* ---- search results ---- */
.hc-res-head { margin: 24px 0 4px; }
.hc-res-head .hc-h { margin: 0; }
.hc-res { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hc-res a { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text); }
.hc-res a:hover { text-decoration: none; border-color: var(--accent); }
.hc-res-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hc-res-t .small { color: var(--text-2); }
.hc-none { margin-top: 12px; }
.hc-none p { margin: 6px 0 12px; }

/* ---- topic page ---- */
.hc-body { display: grid; grid-template-columns: minmax(0, var(--read-w)) 280px; gap: 40px; align-items: start; }
.hc-aside { grid-column: 2; grid-row: 1; position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
.hc-main { grid-column: 1; grid-row: 1; min-width: 0; max-width: var(--read-w); }
.hc-toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 6px 0; }
.hc-toc summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 16px; font-weight: 600; font-size: var(--fs-sm); }
.hc-toc summary::-webkit-details-marker { display: none; }
.hc-toc summary .ico { margin-left: auto; color: var(--text-3); transition: transform .15s; }
.hc-toc[open] summary .ico { transform: rotate(180deg); }
.hc-toc ol { list-style: none; margin: 0; padding: 0 8px 6px; counter-reset: toc; }
.hc-toc li a { display: block; padding: 6px 8px; border-radius: var(--radius-sm); color: var(--text-2); font-size: var(--fs-sm); line-height: 1.35; }
.hc-toc li a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.hc-side-help { padding: 16px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border); }
.hc-side-help p { margin: 4px 0 10px; }

.hc-intro { font-size: 1.05rem; line-height: 1.65; color: var(--text-2); margin: 0 0 8px; }
.hc-sec { padding: 22px 0 6px; border-top: 1px solid var(--border); margin-top: 18px; scroll-margin-top: 80px; }
.hc-sec:first-of-type { border-top: 0; margin-top: 0; }
.hc-sec h2, .hc-tips h2, .hc-faqsec h2, .hc-related h2 { font-size: var(--fs-lg); display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.hc-n { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: var(--fs-sm); font-weight: 700; color: var(--brand-orange-ink); letter-spacing: 0; }
[data-mode="dark"] .hc-n { color: var(--brand-orange); }
.hc-main p, .hc-main li { line-height: 1.65; }
.hc-main p { margin: 0 0 12px; }
.hc-main code { font-size: .88em; background: var(--surface-3); padding: 1px 6px; border-radius: 5px; word-break: break-word; }
.hc-steps { list-style: none; counter-reset: step; margin: 6px 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hc-steps li { counter-increment: step; position: relative; padding-left: 40px; min-height: 28px; }
.hc-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: var(--fs-sm); font-weight: 700; background: var(--accent-50); color: var(--accent-ink, var(--accent)); border: 1px solid var(--accent-100); }
.hc-list { margin: 6px 0 14px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.hc-list li::marker { color: var(--brand-orange); }
.hc-note { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--info-bg); color: var(--text); font-size: var(--fs-sm); line-height: 1.55; }
.hc-note > .ico { color: var(--info); flex: none; margin-top: 2px; }
.hc-table { margin: 4px 0 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.hc-table .tbl { margin: 0; }

/* screenshot in a small window frame (click → larger) */
.hc-fig { margin: 14px 0 10px; }
.hc-frame { display: block; width: 100%; padding: 0; border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); cursor: zoom-in; text-align: left; }
.hc-frame:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
.hc-bar { display: flex; gap: 6px; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.hc-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.hc-bar i:first-child { background: var(--brand-orange); }
.hc-frame img { display: block; width: 100%; height: auto; }
.hc-fig figcaption { font-size: var(--fs-sm); color: var(--text-3); margin-top: 8px; }
.hc-zoom.modal { width: min(1280px, 96vw); max-width: none; }
.hc-zoomimg { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }

.hc-tips { margin-top: 26px; padding: 18px 20px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border); scroll-margin-top: 80px; }
.hc-tips h2 { align-items: center; margin-bottom: 6px; }
.hc-tips h2 .ico { color: var(--brand-orange); }
.hc-tips ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.hc-faqsec { margin-top: 28px; scroll-margin-top: 80px; }
.hc-faqsec details { scroll-margin-top: 80px; }
.hc-related { margin-top: 28px; }
.hc-back { margin-top: 26px; }
.hc-back a { display: inline-flex; align-items: center; gap: 6px; }
.hc-flash { animation: hc-flash 1.6s ease-out; }
@keyframes hc-flash { 0% { background: var(--accent-50); } 100% { background: transparent; } }

/* ---- responsive ---- */
@media (max-width: 1100px) { .hc-body { grid-template-columns: minmax(0, 1fr) 240px; gap: 24px; } }
@media (max-width: 959px) {
  .hc-body { grid-template-columns: minmax(0, 1fr); }
  .hc-aside { grid-column: 1; grid-row: 1; position: static; }
  .hc-main { grid-column: 1; grid-row: 2; max-width: none; }
  .hc-side-help { display: none; }
  .hc-hero { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; }
  .hc-hero-art { display: none; }
}
@media (max-width: 600px) {
  .hc-hero h2 { font-size: var(--fs-lg); }
  .hc-grid, .hc-grid-sm, .hc-cats { grid-template-columns: minmax(0, 1fr); }
  .hc-hide-sm { display: none; }
  .hc-ic-lg { width: 36px; height: 36px; margin-right: 10px; }
  .hc-steps li { padding-left: 36px; }
}
@media (prefers-reduced-motion: reduce) { .hc-flash { animation: none; } .hc-card, .hc-go { transition: none; } }
