/* Help Centre additions. Loaded after styles.css on the help pages only,
   so the shared stylesheet (cached as immutable) stays untouched. Colours
   come from the tokens styles.css defines on :root, except three fixed
   ones: the skip link's dark text (#1a1200) and the blue and red note
   borders (#7aa2f7, #f87171, with matching rgba backgrounds). */

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  background: var(--accent);
  color: #1a1200;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
}

.skip-link:focus { top: 12px; color: #1a1200; }

a:focus-visible,
button:focus-visible,
.table-wrap:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

nav a[aria-current="page"] { color: var(--text); }

/* On narrow screens, or when zoomed in, the two-row header would take up a
   large share of the screen if it stayed pinned, so let it scroll away. */
@media (max-width: 640px), (max-height: 520px) {
  header { position: static; }
}

.help-page h2[id],
.help-page h3[id],
.help-page section[id] { scroll-margin-top: 96px; }

/* styles.css styles every <nav> as the header's link row; undo that for
   the breadcrumb and the page contents list inside <main>. */
.help-page nav { display: block; }
.help-page nav a {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  color: var(--accent);
}
.help-page nav a:hover { color: var(--accent-2); }

.breadcrumb ol {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  font-size: 14px;
}

.breadcrumb li { margin: 0; color: var(--text-muted); }
.breadcrumb li + li::before { content: "\203A"; margin: 0 8px; color: var(--text-muted); }

/* Who a getting-started guide is for, in brackets after its name: on its
   own line, smaller and lighter, so a long heading still reads well on a
   phone. Used in the guide's <h1> and on the Help Centre's guide cards. */
.guide-for {
  display: block;
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.4;
  color: var(--text-muted);
  margin-top: 8px;
}

.help-grid .guide-for { font-size: 0.875em; font-weight: 500; margin-top: 4px; }

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 8px 0 8px;
}

.toc-title {
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 8px;
}

.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 4px; }

.help-page ul, .help-page ol { overflow-wrap: anywhere; }
.help-page li > ul, .help-page li > ol { margin-top: 6px; }
.help-page strong { color: var(--text); }
.help-page code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.92em;
  color: var(--text);
}

.note {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 18px 0;
}

.note p, .note li { color: var(--text); }
.note p:last-child, .note ul:last-child { margin-bottom: 0; }

.note.kid {
  background: rgba(122, 162, 247, 0.12);
  border-left-color: #7aa2f7;
}

.note.warn {
  background: rgba(248, 113, 113, 0.10);
  border-left-color: #f87171;
}

.note-label { font-weight: 700; color: var(--text); }

.steps { padding-left: 24px; }
.steps > li { margin-bottom: 10px; padding-left: 4px; }

.table-wrap {
  overflow-x: auto;
  margin: 18px 0 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.help-page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}

.help-page caption {
  text-align: left;
  font-weight: 700;
  color: var(--text);
  padding: 12px 14px 4px;
}

.help-page th,
.help-page td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

.help-page thead th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}

.help-page tbody th { color: var(--text); font-weight: 600; }
.help-page td { color: var(--text-muted); }

@media (min-width: 641px) {
  .glossary th[scope="row"] { min-width: 150px; }
}

.help-grid { margin: 20px 0 8px; }
.help-grid .card { margin-bottom: 0; }
.help-grid .card h3 a { color: var(--text); text-decoration: none; }
.help-grid .card h3 a:hover { color: var(--accent-2); text-decoration: underline; }
.help-grid .card p { margin-bottom: 0; }

.help-more {
  border-top: 1px solid var(--border);
  margin-top: 56px;
  padding-top: 8px;
}

.help-more ul { columns: 2; column-gap: 32px; }
.help-more li { break-inside: avoid; }

@media (max-width: 640px) {
  .help-more ul { columns: 1; }
  .help-page table { font-size: 14px; }
  .help-page th, .help-page td { padding: 9px 8px; hyphens: auto; -webkit-hyphens: auto; }
  .toc { padding: 16px 18px; }
  .table-wrap.compact table { font-size: 13px; }
  .table-wrap.compact th, .table-wrap.compact td { padding: 8px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grid .card:hover { transform: none; }
}
