/*
 * Help Center (/help and /help/<topic>), on top of theme.css. The pages are generated by
 * scripts/buildHelpPages.ts, so their shared layout lives here instead of in each page.
 */

/* ── Search ── */
.help-search { position: relative; display: flex; align-items: center; gap: .6rem; width: 100%; background: var(--bg-elevated); border: 1.5px solid var(--border-default); border-radius: .75rem; color: var(--text-muted); transition: border-color .15s, box-shadow .15s; }
.help-search:focus-within { border-color: var(--accent-teal); box-shadow: 0 0 0 3px var(--bg-accent); }
.help-search-icon { flex: none; width: 1.15rem; height: 1.15rem; }
.help-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--text-primary); font: inherit; }
.help-search input::placeholder { color: var(--text-muted); }
.help-search input::-webkit-search-cancel-button { cursor: pointer; }
.help-search-key { flex: none; font: 500 .72rem/1 'Inter', system-ui, sans-serif; border: 1px solid var(--border-default); border-radius: .3rem; padding: .25rem .4rem; color: var(--text-muted); }
.help-search:focus-within .help-search-key { display: none; }
.help-search-lg { max-width: 40rem; padding: .9rem 1.1rem; font-size: 1.0625rem; box-shadow: var(--shadow-md); }
.help-search-sm { max-width: 22rem; padding: .45rem .75rem; font-size: .9rem; }

.help-search-results {
  position: absolute; z-index: 40; top: calc(100% + .4rem); left: 0; right: 0;
  max-height: min(28rem, 70vh); overflow-y: auto; text-align: left;
  background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: .75rem; box-shadow: var(--shadow-lg);
  padding: .35rem;
}
.help-search-sm .help-search-results { left: auto; width: min(30rem, calc(100vw - 2rem)); }
.help-result { display: flex; flex-direction: column; gap: .15rem; padding: .6rem .75rem; border-radius: .5rem; text-decoration: none; color: var(--text-primary); }
.help-result[aria-selected="true"], .help-result:hover { background: var(--bg-accent); }
.help-result-top { display: flex; align-items: baseline; gap: .75rem; }
.help-result-title { flex: 1; min-width: 0; font-weight: 600; font-size: .9375rem; line-height: 1.35; }
.help-result-page { flex: none; font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
.help-result-snippet { font-size: .82rem; line-height: 1.45; color: var(--text-secondary); }
.help-result mark { background: color-mix(in srgb, var(--accent-teal) 30%, transparent); color: inherit; border-radius: .15rem; padding: 0 .05rem; }
.help-noresult { padding: .85rem .85rem; font-size: .875rem; line-height: 1.55; color: var(--text-secondary); }
.help-noresult a { color: var(--text-accent); }

/* ── Hub ── */
.help-hero { background: var(--bg-muted); border-bottom: 1px solid var(--border-default); }
.help-hero-inner { max-width: 72rem; margin: 0 auto; padding: 4rem 1.5rem 3.5rem; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1rem; }
.help-hero h1 { margin: 0; font-size: clamp(2.1rem, 5vw, 3rem); line-height: 1.1; }
.help-hero-desc { margin: 0 0 .75rem; max-width: 36rem; font-size: 1.0625rem; color: var(--text-secondary); }

.help-hub-body { max-width: 72rem; margin: 0 auto; padding: 3rem 1.5rem 6rem; display: flex; flex-direction: column; gap: 3rem; }
.help-group { display: flex; flex-direction: column; gap: 1rem; }
.help-group-title { margin: 0; font: 600 .8rem/1.2 'Inter', system-ui, sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }

.help-start { border: 1px solid var(--border-default); background: var(--bg-elevated); border-radius: 1rem; padding: 1.5rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1.5rem 2.5rem; align-items: center; box-shadow: var(--shadow-sm); }
.help-start-head { display: flex; gap: 1rem; align-items: flex-start; }
.help-start-head h2 { margin: 0 0 .25rem; font-size: 1.5rem; }
.help-start-head h2 a { color: inherit; text-decoration: none; }
.help-start-head h2 a:hover { color: var(--text-accent); }
.help-start-head p { margin: 0; color: var(--text-secondary); font-size: .9375rem; }
.help-start-steps { list-style: none; margin: 0; padding: 0; counter-reset: start; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.help-start-steps li { counter-increment: start; }
.help-start-steps a { display: flex; flex-direction: column; gap: .5rem; height: 100%; padding: .9rem 1rem; border-radius: .75rem; background: var(--bg-muted); border: 1px solid var(--border-default); text-decoration: none; color: var(--text-primary); font-weight: 500; font-size: .9375rem; line-height: 1.35; transition: border-color .15s; }
.help-start-steps a::before { content: counter(start); width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent-teal); color: var(--accent-teal-text); font-weight: 700; font-size: .8rem; display: grid; place-items: center; }
.help-start-steps a:hover { border-color: var(--accent-teal); }

.help-cards { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.help-cards-providers, .help-cards-help { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.help-card { display: flex; flex-direction: column; gap: .35rem; padding: 1.25rem; border: 1px solid var(--border-default); border-radius: 1rem; background: var(--bg-elevated); text-decoration: none; color: var(--text-primary); transition: border-color .15s, box-shadow .15s, transform .15s; }
.help-card:hover { border-color: color-mix(in srgb, var(--accent-teal) 45%, transparent); box-shadow: var(--shadow-md); }
.help-card-title { font-weight: 600; font-size: 1.0625rem; }
.help-card-desc { font-size: .875rem; line-height: 1.5; color: var(--text-secondary); }
.help-card-icon { width: 2.5rem; height: 2.5rem; padding: .5rem; margin-bottom: .4rem; border-radius: .65rem; background: var(--bg-accent); color: var(--text-accent); flex: none; }
.help-card-logo { width: 2.5rem; height: 2.5rem; margin-bottom: .4rem; object-fit: contain; border-radius: .5rem; flex: none; }

.help-questions { border: 1px solid var(--border-default); border-radius: 1rem; background: var(--bg-elevated); }
.help-question { border-top: 1px solid var(--border-default); scroll-margin-top: 1rem; }
.help-question:first-child { border-top: 0; }
.help-question summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; font-size: 1.0625rem; }
.help-question summary::-webkit-details-marker { display: none; }
.help-question summary::marker { content: ''; }
.help-question summary span { flex: 1; }
.help-question summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; border-radius: 1rem; }
.help-chevron { flex: none; width: 1.1rem; height: 1.1rem; color: var(--text-muted); transition: transform .18s ease; }
.help-question[open] .help-chevron { transform: rotate(180deg); }
.help-question .help-prose { padding: 0 1.25rem 1.25rem; max-width: 46rem; }

/* ── Topic pages ── */
.help-bar { border-bottom: 1px solid var(--border-default); background: var(--bg-secondary); }
.help-bar-inner { max-width: 72rem; margin: 0 auto; padding: .75rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.help-crumbs { display: flex; align-items: center; gap: .5rem; min-width: 0; font-size: .875rem; color: var(--text-muted); }
.help-crumbs a { color: var(--text-secondary); text-decoration: none; }
.help-crumbs a:hover { color: var(--text-accent); }
.help-crumbs [aria-current] { color: var(--text-primary); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.help-page { max-width: 72rem; margin: 0 auto; padding: 3rem 1.5rem 6rem; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 3.5rem; align-items: start; }
.help-toc { position: sticky; top: 5.5rem; }
.help-toc h2 { margin: 0 0 .6rem; font: 600 .75rem/1.2 'Inter', system-ui, sans-serif; letter-spacing: .05em; text-transform: uppercase; color: var(--text-accent); }
.help-toc ul { display: flex; flex-direction: column; border-left: 2px solid var(--border-default); }
.help-toc a { display: block; margin-left: -2px; padding: .35rem .75rem; border-left: 2px solid transparent; font-size: .875rem; line-height: 1.4; color: var(--text-secondary); text-decoration: none; }
.help-toc a:hover { color: var(--text-accent); }
.help-toc a[aria-current="true"] { color: var(--text-accent); border-left-color: var(--accent-teal); font-weight: 500; }

.help-content { max-width: 46rem; min-width: 0; }
.help-content > h1 { margin: 0 0 .5rem; font-size: clamp(1.9rem, 4vw, 2.4rem); line-height: 1.15; }
.help-summary { margin: 0 0 1.5rem; font-size: 1.125rem; line-height: 1.6; color: var(--text-secondary); }
.help-intro { margin-bottom: 1rem; }

.help-article { padding-top: 2.25rem; margin-top: 2.25rem; border-top: 1px solid var(--border-default); scroll-margin-top: 1rem; }
.help-content > .help-article:first-of-type { border-top: 0; margin-top: .5rem; padding-top: 0; }
.help-article h2 { margin: 0 0 .75rem; font-size: 1.5rem; line-height: 1.25; display: flex; align-items: baseline; gap: .5rem; }
.help-anchor { font: 400 .9rem/1 'Inter', system-ui, sans-serif; color: var(--text-muted); text-decoration: none; opacity: 0; transition: opacity .15s; }
.help-article h2:hover .help-anchor, .help-anchor:focus-visible { opacity: 1; }
@keyframes help-arrive { from { background: var(--bg-accent); } to { background: transparent; } }
.help-article:target { animation: help-arrive 2.2s ease-out; border-radius: .5rem; }
@media (prefers-reduced-motion: reduce) { .help-article:target { animation: none; } }

.help-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.25rem 0 1rem; }
.help-tag { font-size: .75rem; font-weight: 600; line-height: 1; padding: .3rem .55rem; border-radius: 999px; border: 1px solid var(--border-default); color: var(--text-secondary); background: var(--bg-muted); cursor: help; }
.help-tag-advanced { color: var(--text-accent); background: var(--bg-accent); border-color: color-mix(in srgb, var(--accent-teal) 35%, transparent); }
.help-tag-inline { display: inline-block; vertical-align: .1em; margin: 0 .15rem; white-space: nowrap; }

/* ── Article text ── */
.help-prose { font-size: 1rem; line-height: 1.7; color: var(--text-secondary); }
.help-prose > * + * { margin-top: .9rem; }
.help-prose p { margin-bottom: 0; }
.help-prose strong { color: var(--text-primary); font-weight: 600; }
.help-prose a { color: var(--text-accent); text-decoration: underline; text-underline-offset: 2px; }
.help-prose h3 { margin: 1.75rem 0 .5rem; font-size: 1.125rem; color: var(--text-primary); }
.help-prose ul { list-style: disc; padding-left: 1.3rem; }
.help-prose li + li { margin-top: .35rem; }
.help-prose li > ul { margin-top: .35rem; }
.help-prose code { background: var(--bg-muted); border: 1px solid var(--border-default); border-radius: .25rem; padding: .1em .4em; font-size: .85em; font-family: 'SF Mono', 'Cascadia Mono', Consolas, monospace; color: var(--text-primary); }

/* Numbered lists are steps. */
.help-prose ol { list-style: none; padding-left: 0; counter-reset: help-step; }
.help-prose ol > li { counter-increment: help-step; position: relative; padding-left: 2.25rem; min-height: 1.6rem; }
.help-prose ol > li + li { margin-top: .6rem; }
.help-prose ol > li::before { content: counter(help-step); position: absolute; left: 0; top: .1rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--accent-teal); color: var(--accent-teal-text); font-size: .75rem; font-weight: 700; display: grid; place-items: center; }

.help-callout { padding: .85rem 1.1rem; border-left: 3px solid var(--accent-teal); border-radius: 0 .6rem .6rem 0; background: var(--bg-accent); color: var(--text-primary); font-size: .9375rem; }
.help-callout p { margin: 0; }
.help-callout strong { color: var(--text-accent); }

.help-table { overflow-x: auto; border: 1px solid var(--border-default); border-radius: .75rem; }
.help-table table { width: 100%; border-collapse: collapse; font-size: .9rem; line-height: 1.5; }
.help-table th, .help-table td { padding: .65rem .85rem; text-align: left; vertical-align: top; border-top: 1px solid var(--border-default); }
.help-table thead th { border-top: 0; background: var(--bg-muted); color: var(--text-primary); font-weight: 600; font-size: .8125rem; }
.help-table td:first-child { color: var(--text-primary); }

.help-media { margin: 1.25rem 0 0; }
/* No display here: theme.css's .theme-light-only/.theme-dark-only decide which screenshot shows. */
.help-media img, .help-media video { vertical-align: top; width: 100%; height: auto; border-radius: .75rem; border: 1px solid var(--border-default); background: var(--bg-muted); box-shadow: var(--shadow-sm); }
.help-media video { display: block; }
.help-media figcaption { margin-top: .5rem; font-size: .85rem; color: var(--text-muted); }

/* ── Screenshot enlarge: the same button and lightbox as the home page's screenshots ── */
.help-zoom { display: block; position: relative; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: .75rem; color: inherit; }
.help-zoom:focus-visible { outline: 2px solid var(--text-accent); outline-offset: 3px; }
.help-zoom img { transition: filter .15s; }
.help-zoom:hover img, .help-zoom:focus-visible img { filter: brightness(1.05); }
.help-zoom-hint {
  position: absolute; top: .75rem; right: .75rem; display: flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: 50%; background: rgba(15, 23, 42, .55); color: #fff;
  opacity: 0; transition: opacity .15s;
}
.help-zoom:hover .help-zoom-hint, .help-zoom:focus-visible .help-zoom-hint { opacity: 1; }
/* Touch screens have no hover, so the hint stays up to say the picture opens. */
@media (hover: none) { .help-zoom-hint { opacity: 1; } }

/* The dialog takes the picture's own size, scaled down to fit the window, so there are no bands beside it. */
.help-lightbox {
  border: none; border-radius: 1rem; padding: 0; margin: auto;
  width: fit-content; max-width: none; max-height: none;
  background: var(--bg-elevated); box-shadow: var(--shadow-lg); overflow: hidden;
}
.help-lightbox::backdrop { background: rgba(8, 11, 15, .8); }
.help-lightbox img { display: block; width: auto; height: auto; max-width: min(1400px, 94vw); max-height: 90vh; }
.help-lightbox-close {
  position: absolute; top: .75rem; right: .75rem; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; background: rgba(15, 23, 42, .6); color: #fff; transition: background .15s;
}
.help-lightbox-close:hover { background: rgba(15, 23, 42, .85); }
.help-lightbox-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ── Shared bottom blocks ── */
.help-contact { margin-top: 3.5rem; padding: 1.5rem; border-radius: 1rem; border: 1px solid var(--border-default); background: var(--bg-muted); }
.help-contact h2 { margin: 0 0 .4rem; font-size: 1.25rem; }
.help-contact p { margin: 0; color: var(--text-secondary); line-height: 1.65; }
.help-contact a { color: var(--text-accent); }

.help-pager { margin-top: 1.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.help-pager a { display: flex; flex-direction: column; gap: .2rem; padding: .9rem 1.1rem; border: 1px solid var(--border-default); border-radius: .75rem; text-decoration: none; color: var(--text-primary); font-weight: 600; }
.help-pager a span { font-size: .75rem; font-weight: 500; color: var(--text-muted); }
.help-pager a:hover { border-color: var(--accent-teal); }
.help-pager-next { text-align: right; }

@media (max-width: 900px) {
  .help-start { grid-template-columns: 1fr; }
  .help-cards-providers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .help-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .help-page { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 1.5rem; }
  .help-toc { position: static; padding: 1rem 1.1rem; border: 1px solid var(--border-default); border-radius: .75rem; background: var(--bg-secondary); }
  .help-toc-spacer { display: none; }
  .help-bar-inner { flex-direction: column; align-items: stretch; }
  .help-search-sm { max-width: none; }
  .help-search-sm .help-search-results { left: 0; width: auto; }
  .help-search-key { display: none; }
}
@media (max-width: 560px) {
  .help-hero-inner { padding: 2.5rem 1rem 2.25rem; }
  .help-hub-body { padding: 2rem 1rem 4rem; gap: 2.25rem; }
  .help-page { padding-left: 1rem; padding-right: 1rem; }
  .help-start-steps { grid-template-columns: 1fr; }
  .help-cards, .help-cards-providers { grid-template-columns: 1fr; }
  .help-pager { grid-template-columns: 1fr; }
}
