/* Help view (#/help). Tokens only; no italics; light and dark via tokens.css. */
.help {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 48px;
  max-width: 1180px;
  margin: 0 auto;
}
.help-bar { display: none; }

/* Contents rail */
.help-rail { position: relative; }
.help-rail-inner {
  position: sticky; top: 84px;
  max-height: calc(100vh - 110px); overflow: auto;
  padding-right: 8px;
}
.help-search { margin-bottom: 20px; }
.help-contents .help-group { margin-bottom: 22px; }
.help-contents h2.eyebrow { font-size: 11px; margin: 0 0 8px; }
.help-contents ul { list-style: none; margin: 0; padding: 0; }
.help-contents li a {
  display: block; padding: 6px 10px; margin-left: -10px;
  text-decoration: none; font-size: 14px; line-height: 1.35; color: var(--ink-60);
  border-left: 2px solid transparent; border-radius: 0 var(--radius) var(--radius) 0;
}
.help-contents li a:hover { color: var(--ink); background: var(--accent-soft); }
.help-contents a[aria-current="page"] { color: var(--ink); border-left-color: var(--ink); font-weight: 500; }

.help-hit {
  display: block; text-decoration: none; padding: 10px 0; border-bottom: 1px solid var(--line);
}
.help-hit-title { display: block; font-weight: 500; font-size: 14px; }
.help-hit-snippet { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.help-hit:hover .help-hit-title { text-decoration: underline; }

.help-rail-foot { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.help-ask { font-size: 14px; font-weight: 500; }

/* Reading column */
.help-main { min-width: 0; max-width: 68ch; }
.help-main > .eyebrow { margin-bottom: 10px; }
.help-body { font-size: 16px; line-height: 1.65; }
.help-body h1 { margin-bottom: 0.7em; }
.help-body h2 { margin: 2em 0 0.6em; padding-top: 0.2em; }
.help-body h3 { margin: 1.6em 0 0.4em; font-size: 16px; }
.help-body p, .help-body ul, .help-body ol { margin: 0 0 1em; }
.help-body ul { padding-left: 1.2em; }
.help-body li { margin: 0.25em 0; }
.help-body li::marker { color: var(--muted); }
.help-body strong { font-weight: 600; }
.help-body a { text-decoration: underline; text-decoration-color: var(--accent-line); }
.help-body a:hover { text-decoration-color: currentColor; }
.help-body em, .help-body i { font-style: normal; }

/* Numbered steps */
.help-body ol { list-style: none; counter-reset: step; padding-left: 0; }
.help-body ol > li {
  counter-increment: step; position: relative;
  padding: 2px 0 2px 40px; margin: 0.55em 0;
}
.help-body ol > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 2px;
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font: 500 12px/1 var(--mono);
  color: var(--ink); background: var(--surface-2); border: 1px solid var(--line);
}
.help-body ol > li > ul { margin-top: 0.4em; }

/* Keys, ids and code */
.help-body code {
  font-family: var(--mono); font-size: 0.86em;
  padding: 0.1em 0.4em; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap;
}
.help-body pre {
  font: 400 13px/1.45 var(--mono);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; overflow-x: auto; margin: 0 0 1.2em;
}
.help-body pre code { padding: 0; border: 0; background: none; white-space: pre; font-size: inherit; }
.help-plain { white-space: pre-wrap; font: 400 14px/1.6 var(--mono); }

/* Tables */
.help-table { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--line); border-radius: var(--radius); }
.help-body table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.45; }
.help-body th, .help-body td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.help-body th { font: 500 11px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--surface); }
.help-body tr:last-child td { border-bottom: 0; }

/* Checklists */
.help-body li:has(> input[type="checkbox"]) { list-style: none; margin-left: -1.2em; padding-left: 26px; position: relative; }
.help-body li > input[type="checkbox"] { position: absolute; left: 0; top: 0.35em; width: auto; margin: 0; accent-color: var(--ink); }

/* Footer: ask and pager */
.help-foot { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 24px; }
.help-ask-box {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px;
}
.help-ask-box p { margin: 0; font-weight: 500; }
.help-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.help-pager a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; padding: 12px 0; font-size: 14px; }
.help-pager a:hover span:last-child { text-decoration: underline; }
.help-next { text-align: right; align-items: flex-end; }

/* Phone: single column, contents in a drawer */
.help.is-phone { display: block; }
.help.is-phone .help-bar {
  display: flex;
  background: var(--bg); padding: 4px 0 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
}
.help.is-phone .help-drawer-btn { width: 100%; justify-content: center; }
.help.is-phone .help-rail { display: none; }
.help.is-phone.drawer-open .help-rail { display: block; margin-bottom: 24px; }
.help.is-phone.drawer-open .help-main { display: none; }
.help.is-phone .help-rail-inner { position: static; max-height: none; overflow: visible; padding: 0; }
.help.is-phone .help-contents li a { padding: 11px 10px; font-size: 16px; border-bottom: 1px solid var(--line); border-radius: 0; }
.help.is-phone .help-search { font-size: 16px; } /* 16px stops iOS zooming on focus */
.help.is-phone .help-body { font-size: 17px; }
.help.is-phone .help-body table { font-size: 14px; }
.help.is-phone .help-pager { grid-template-columns: 1fr; }
.help.is-phone .help-next { text-align: left; align-items: flex-start; }
/* Phone index: the contents are the page */
.help.is-phone.index-only .help-bar { display: none; }
.help.is-phone.index-only .help-rail { display: block; }
.help.is-phone.index-only .help-main { display: block; }
.help.is-phone.index-only { display: flex; flex-direction: column; }
.help.is-phone.index-only .help-main { order: -1; }

/* Explainer (public/js/help/explainer.js) */
.xp-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 16px 0 8px; }
.xp-search { flex: 1 1 240px; }
.xp-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 14px; }
.xp-item { display: grid; gap: 8px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: 80px; }
.xp-item.is-focus { border-color: var(--accent-line); background: var(--accent-soft); }
.xp-item:focus { outline: none; }
.xp-title { margin: 0; font-size: 18px; font-weight: 500; }
.xp-n { color: var(--ink-60); font-size: 14px; margin-right: 4px; }
.xp-audio { width: 100%; height: 40px; }
.xp-caption { min-height: 1.5em; margin: 0; font-size: 15px; color: var(--ink); }
.xp-text { margin: 0; line-height: 1.6; }
.xp-media p { margin: 0; }
.xp-stale { color: var(--warn); }

/* Help in the top bar (app.js renderChrome), beside Send a note. The phone has it under More. */
.topbar .who .help-link { color: inherit; text-decoration: none; white-space: nowrap; padding: 6px 2px; opacity: 0.85; }
.topbar .who .help-link:hover, .topbar .who .help-link:focus-visible { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.topbar .who .help-link[aria-current="page"] { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 720px) { .topbar .who .help-link { display: none; } }
