/* ---------------------------------------------------------------------------
   Rundown — Help pages
   Shared by help.html and every help-*.html article.

   Built on the same tokens as the rest of the app (tokens.css), so dark is the
   default and `html.light` flips it with no work here. Never hardcode a
   colour in this file or in a help page: a hardcoded one stays dark in light
   mode and nobody notices until a customer does.

   These pages are public — a signed-out visitor may read them — so nothing
   here may depend on a session.
--------------------------------------------------------------------------- */

html { font-size: 16px; }

body.help {
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.help-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-right, 0px)) 80px max(20px, env(safe-area-inset-left, 0px));
}

/* ── Top bar ─────────────────────────────────────────────────────────────── */

.help-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 18px;
}
.help-brand {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 26px;
  color: var(--accent);
  text-decoration: none;
}
.help-nav a.plain {
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
}
.help-nav a.plain:hover { color: var(--ink); }

/* The trail back to the index, on an article. */
.help-back {
  display: inline-block;
  font: 500 12px/1.4 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-decoration: none;
  margin: 10px 0 4px;
}
.help-back:hover { color: var(--accent); }

/* ── Typography ──────────────────────────────────────────────────────────── */

.help h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: 14px 0 0;
}
.help-lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 62ch;
  margin: 14px 0 30px;
}
.help h2 {
  font-size: 21px;
  font-weight: 600;
  margin: 40px 0 10px;
  scroll-margin-top: 20px;
}
.help h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 26px 0 8px;
}
.help p, .help li {
  font-size: 16px;
  line-height: 1.62;
  color: var(--ink-2);
}
.help p { margin: 0 0 14px; max-width: 68ch; }
.help ul, .help ol { margin: 0 0 16px 22px; max-width: 66ch; }
.help li { margin-bottom: 8px; }
.help strong { color: var(--ink); font-weight: 600; }
.help a.inline { color: var(--accent); }

/* A thing you click or a menu you open, written exactly as the screen says
   it. Deliberately quiet — a page full of shouting is harder to follow.

   No `white-space: nowrap` here, however tempting: a whole menu path such as
   "Library → Plug-in Extras → Sync from Rundown…" is wider than a phone, and
   one unbreakable run of text drags the entire page sideways. It only breaks
   after an arrow, which is where it would break anyway. */
.help .ui {
  font-weight: 600;
  color: var(--ink);
}
.help code, .help .mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2, var(--bg));
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 1px 5px;
  color: var(--ink);
  word-break: break-all;
}

/* ── Numbered steps ──────────────────────────────────────────────────────── */

.help-steps {
  list-style: none;
  counter-reset: helpstep;
  margin: 0 0 20px;
  padding: 0;
  max-width: 68ch;
}
.help-steps > li {
  counter-increment: helpstep;
  position: relative;
  padding: 0 0 2px 44px;
  margin-bottom: 20px;
}
.help-steps > li::before {
  content: counter(helpstep);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--accent-dim);
  color: var(--accent);
  font: 600 13px/26px var(--font-mono);
  text-align: center;
}
.help-steps > li > p:last-child { margin-bottom: 0; }

/* ── Callouts ────────────────────────────────────────────────────────────── */

.help-note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: color-mix(in oklch, var(--accent) 7%, transparent);
  border-radius: var(--r);
  padding: 13px 15px;
  margin: 0 0 20px;
  max-width: 68ch;
}
.help-note p:last-child { margin-bottom: 0; }
.help-note .help-note-title {
  display: block;
  font: 600 11px/1.3 var(--font-mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */

.help-table-scroll { overflow-x: auto; margin: 6px 0 20px; }
/* The scroller keeps a wide table inside its own box rather than letting it
   widen the page; min-width is what makes the columns legible once it does
   scroll, and is deliberately under a small phone's width. */
.help-table-scroll { max-width: 100%; }
.help table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 340px;
}
.help th, .help td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  line-height: 1.5;
}
.help th {
  font: 600 11px/1.3 var(--font-mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ── Index cards ─────────────────────────────────────────────────────────── */

.help-group-label {
  font: 600 11px/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 34px 0 12px;
}
.help-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.help-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--r-md, 10px);
  padding: 16px 17px;
  text-decoration: none;
  background: transparent;
  transition: border-color 0.12s, background 0.12s;
}
.help-card:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.help-card-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 5px;
}
.help-card-sub {
  display: block;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-3);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.help-foot {
  border-top: 1px solid var(--line-soft);
  margin-top: 48px;
  padding-top: 18px;
  font-size: 14px;
  color: var(--ink-3);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.help-foot a { color: var(--ink-2); }

@media (max-width: 600px) {
  .help h1 { font-size: 30px; }
  .help-lede { font-size: 17px; }
  .help-steps > li { padding-left: 38px; }
}
