/* The Help Center (/help), What's new (/whats-new) and the Learn pages' article sheet (round 31): on the shared shell
   (site.css, linked first: header, footer, buttons, tokens). A centred hero with a big rounded search box over the glow,
   topic cards in a grid (r16), then a sticky topic list on the left and the article on the right. help.js filters the
   sections from the search box. Colours come from site.css's --sx-* tokens, so both themes follow the visitor's system. */
:root { --hx-mark: rgba(41,98,255,.22); --hx-link: #6f9bff; --hx-note: rgba(41,98,255,.10); --hx-kbd: #1f1f1f; }
@media (prefers-color-scheme: light) { :root { --hx-mark: rgba(41,98,255,.14); --hx-link: #1e53e5; --hx-note: rgba(41,98,255,.06); --hx-kbd: #f2f3f6; } }
html { scroll-padding-top: 88px; }
body { overflow-x: hidden; }
.dim { color: var(--sx-dim); }

/* hero: big title, sub-line, the search box */
.hx-hero { padding: 88px 16px 48px; }
.hx-hero h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.05; }
.search { position: relative; max-width: 640px; margin: 36px auto 0; text-align: left; }
.search input { width: 100%; height: 56px; padding: 0 20px 0 54px; border: 1px solid var(--sx-line2); border-radius: 40px; background: var(--sx-bg2);
  color: var(--sx-text); font: 16px var(--sx-ui); outline: none; transition: border-color .15s, box-shadow .15s; }
.search input::placeholder { color: var(--sx-dim); }
.search input:focus { border-color: var(--sx-accent); box-shadow: 0 0 0 3px rgba(41,98,255,.25); }
.search svg { position: absolute; left: 20px; top: 18px; width: 20px; height: 20px; color: var(--sx-dim); pointer-events: none; }
.search .none { display: none; margin: 14px 0 0; color: var(--sx-dim); font-size: 14px; text-align: center; }
html.searching .search .none.show { display: block; }

/* topic cards */
.topics { max-width: 1360px; margin: 0 auto; padding: 8px 40px 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.topics a { display: block; padding: 24px 24px 26px; border: 1px solid var(--sx-line); border-radius: 16px;
  background: linear-gradient(180deg, var(--sx-card2), var(--sx-card)); transition: border-color .15s, transform .15s; }
.topics a:hover { border-color: var(--sx-line2); transform: translateY(-2px); }
.topics b { display: block; color: var(--sx-text); font: 600 18px/1.3 var(--sx-display); letter-spacing: -.01em; margin-bottom: 8px; }
.topics span { color: var(--sx-body); font-size: 15px; line-height: 1.5; display: block; }
html.searching .topics { display: none; }

/* the page: a sticky list of sections on the left, the articles on the right */
.help { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 64px; max-width: 1200px; margin: 0 auto; padding: 48px 40px 96px; }
.tabs { position: sticky; top: 88px; align-self: start; }
.tabs b { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--sx-dim); margin: 0 0 12px 14px; font-weight: 600; }
.tabs a { display: block; padding: 8px 14px; border-radius: 8px; color: var(--sx-body); font-size: 15px; }
.tabs a:hover { color: var(--sx-text); background: var(--sx-ghost-hover); }
.tabs a.on { color: var(--sx-text); background: var(--sx-ghost-hover); font-weight: 600; box-shadow: inset 2px 0 0 var(--sx-accent); }
.tabs a[hidden] { display: none; }
.tabs p { margin: 24px 14px 0; font-size: 13px; color: var(--sx-dim); line-height: 1.5; }
.tabs p a { display: inline; padding: 0; color: var(--hx-link); font-size: 13px; background: none; box-shadow: none; }
.tabs p a:hover { background: none; text-decoration: underline; }

/* article typography */
.doc { max-width: 800px; min-width: 0; color: var(--sx-body); }
.doc section { padding-top: 8px; }
.doc section[hidden] { display: none; }
.doc h2 { font: 600 32px/1.2 var(--sx-display); letter-spacing: -.02em; margin: 56px 0 16px; padding-top: 32px; border-top: 1px solid var(--sx-line); }
.doc section:first-child h2 { margin-top: 0; border-top: 0; padding-top: 0; }
.doc h3 { font: 600 20px/1.35 var(--sx-display); letter-spacing: -.01em; margin: 32px 0 8px; }
.doc p, .doc li { margin: 0 0 14px; line-height: 1.7; }
.doc ul, .doc ol { padding-left: 24px; margin: 0 0 16px; }
.doc li { margin-bottom: 8px; }
.doc b, .doc strong { color: var(--sx-text); font-weight: 600; }
.doc a { color: var(--hx-link); }
.doc a:hover { text-decoration: underline; }
.doc .note { background: var(--hx-note); border: 1px solid var(--sx-line); border-radius: 12px; padding: 16px 20px; margin: 20px 0 24px; }
.doc .note p:last-child { margin-bottom: 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 20px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px 12px; border-bottom: 1px solid var(--sx-line); }
.doc th { color: var(--sx-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.doc td:first-child { color: var(--sx-text); }
.doc td:last-child { white-space: nowrap; }
.doc .end { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--sx-line); color: var(--sx-dim); font-size: 14px; }
kbd { display: inline-block; min-width: 24px; padding: 1px 7px; border: 1px solid var(--sx-line2); border-bottom-width: 2px; border-radius: 6px; background: var(--hx-kbd);
  color: var(--sx-text); font: 600 13px/20px ui-monospace, Consolas, Menlo, monospace; text-align: center; }
code { font: 14px ui-monospace, Consolas, Menlo, monospace; color: var(--sx-text); background: var(--sx-card2); border: 1px solid var(--sx-line); border-radius: 6px; padding: 1px 6px; }
.doc pre { background: var(--sx-bg2); border: 1px solid var(--sx-line); border-radius: 12px; padding: 14px 18px; overflow-x: auto; font: 13.5px/1.55 ui-monospace, Consolas, Menlo, monospace; margin: 0 0 16px; }
.doc pre code { background: none; border: 0; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 18px; }
.chips span { padding: 6px 14px; border: 1px solid var(--sx-line); border-radius: 40px; font-size: 14px; color: var(--sx-text); background: var(--sx-card); }
mark { background: var(--hx-mark); color: inherit; border-radius: 3px; padding: 0 2px; }

/* release notes (What's new): a timeline of dated cards */
.rel { position: relative; padding: 0 0 0 36px; margin: 0 0 48px; }
.rel::before { content: ''; position: absolute; left: 7px; top: 14px; bottom: -48px; width: 2px; background: var(--sx-line); }
.rel:last-of-type::before { display: none; }
.rel::after { content: ''; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--sx-accent); box-shadow: 0 0 0 5px var(--sx-bg), 0 0 18px rgba(41,98,255,.6); }
.rel .when { color: var(--sx-dim); font-size: 14px; margin: 0 0 6px; font-weight: 500; }
.doc .rel h2 { margin: 0 0 16px; padding: 0; border: 0; font-size: 28px; line-height: 1.25; }
.tag { display: inline-block; vertical-align: 5px; margin-left: 10px; padding: 2px 10px; border-radius: 40px; font: 600 11px/18px var(--sx-ui); letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--sx-green); }
.tag.fix { background: #e07b00; }
.tag.sec { background: #7c4dff; }

@media (max-width: 860px) {
  .hx-hero { padding: 48px 16px 28px; }
  .search { margin-top: 26px; }
  .topics { padding: 0 16px 8px; grid-template-columns: 1fr; gap: 12px; }
  .topics a { padding: 18px 20px; }
}
@media (max-width: 560px) {
  nav.topics { grid-template-columns: 1fr 1fr; gap: 10px; }
  nav.topics a { padding: 14px 14px 16px; border-radius: 12px; }
  nav.topics b { font-size: 15px; margin: 0; }
  nav.topics span { display: none; }
}
@media (max-width: 860px) {
  .help { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px 16px 64px; }
  .tabs { position: static; display: flex; flex-wrap: wrap; gap: 8px; }
  .tabs b, .tabs p { display: none; }
  .tabs a { padding: 7px 14px; border: 1px solid var(--sx-line); border-radius: 40px; font-size: 14px; }
  .tabs a.on { border-color: var(--sx-text); box-shadow: none; }
  .doc h2 { font-size: 26px; margin-top: 40px; padding-top: 24px; }
  .doc .rel h2 { font-size: 22px; }
  .rel { padding-left: 28px; }
  .doc table, .doc thead, .doc tbody, .doc tr { display: block; } .doc th { display: none; } .doc td { display: block; border: 0; padding: 4px 0; white-space: normal; }
  .doc td:first-child { font-weight: 600; padding-top: 12px; } .doc tr { border-bottom: 1px solid var(--sx-line); padding-bottom: 10px; }
}
/* the shared top bar is ~18px wider than a 390px phone (brand + both buttons); tighten it here until site.css does */
@media (max-width: 420px) { .sx-top { gap: 8px; } .sx-brand { font-size: 17px; gap: 8px; } .sx-brand svg { width: 26px; height: 26px; } .sx-act { gap: 6px; } .sx-act .sx-btn { padding: 0 12px; font-size: 14px; } }
