/* ─────────────────────────────────────────────────────────────────────────
   help-page.css — the /help PAGE chrome: two-column shell, search, the
   tool/page tree, article layout (open button, on-this-page), feedback,
   recently-changed, pager, footer, responsive. Article prose lives in
   help.css (shared with the drawer). Tokens: body.help-page in help.css.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Two-column shell ────────────────────────────────────────────────────── */
.help-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 26px 72px;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

/* ── Search ──────────────────────────────────────────────────────────────── */
.help-search {
  position: relative;
  margin: 2px 0 0 10px;
}
.help-search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--faint); pointer-events: none;
}
.help-search input {
  width: 100%;
  padding: 9px 34px 9px 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field, var(--tile-2));
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.help-search input:focus { outline: none; border-color: var(--accent); }
.help-search input::placeholder { color: var(--faint); }
.help-search kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 11px; padding: 1px 6px; color: var(--faint);
}
.help-search-results { margin: 8px 0 0 10px; }
.help-search-none { font-size: 13px; color: var(--faint); margin: 8px 0 0 4px; }
.help-search-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.help-search-list a {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 12px; border-radius: 9px; text-decoration: none;
  color: var(--text); border: 1px solid transparent;
}
.help-search-list a:hover, .help-search-list a:focus-visible { background: var(--tile-2); border-color: var(--line); outline: none; }
.help-search-tool { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.help-search-title { font-size: 14px; font-weight: 600; }
.help-search-hit { font-size: 12.5px; color: var(--muted); }

/* ── Left column: tree + support card ────────────────────────────────────── */
.help-side {
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.help-side-support {
  margin: 4px 0 8px 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--tile);
}
.help-support-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}
.help-support-mail {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}
.help-support-mail:hover { text-decoration: underline; }
.help-support {
  margin: 40px 0 0;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 6%, var(--tile));
}
.help-support p { margin: 0; font-size: 15px; color: var(--muted); }
.help-support .help-support-mail { font-size: 15px; }
.help-tree-fold > .help-tree-summary { display: none; }
.help-tree-fold > .help-tree-summary::-webkit-details-marker { display: none; }

.help-tree-group {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 22px 0 6px 10px;
}
.help-tree-group:first-child { margin-top: 4px; }

.help-tree-tool > summary,
.help-tree-tool.is-pending {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  margin: 0;
  user-select: none;
}
.help-tree-tool > summary::-webkit-details-marker { display: none; }
.help-tree-tool > summary:hover { background: var(--tile-2); }
.help-tree-tool > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.help-tree-tool.is-pending { color: var(--faint); font-weight: 500; cursor: default; }

.help-tree-dot {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--tc, var(--accent)) 16%, transparent);
  color: var(--tc, var(--accent));
  flex: none;
}
.help-tree-dot svg { width: 14px; height: 14px; }
.help-tree-tool.is-pending .help-tree-dot { opacity: .5; }
.help-tree-name { flex: 1; min-width: 0; }
.help-tree-tool .chev { width: 14px; height: 14px; color: var(--faint); transition: transform .15s ease; }
.help-tree-tool[open] > summary .chev { transform: rotate(180deg); }

.help-soon {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: 5px;
  padding: 1px 6px;
}

.help-tree-pages {
  list-style: none;
  margin: 2px 0 6px;
  padding: 0 0 0 22px;
  border-left: 1px solid var(--line-soft);
  margin-left: 21px;
}
.help-tree-pages a {
  display: block;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--muted);
  text-decoration: none;
}
.help-tree-pages a:hover { color: var(--text); background: var(--tile-2); }
.help-tree-pages a.is-active {
  color: var(--text);
  background: var(--tile-2);
  box-shadow: inset 2px 0 0 var(--accent);
}

/* ── Article (right) ─────────────────────────────────────────────────────── */
.help-main { min-width: 0; }
.help-article { max-width: 760px; }

.help-open { margin: 0 0 22px; }
.help-open a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 8px;
  padding: 6px 11px;
}
.help-open a:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.help-open svg { width: 14px; height: 14px; }

.help-toc {
  border: 1px solid var(--line);
  background: var(--tile);
  border-radius: 12px;
  padding: 10px 16px;
  margin: 0 0 26px;
}
.help-toc summary {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  cursor: pointer;
}
.help-toc ol { margin: 10px 0 4px; padding-left: 20px; }
.help-toc li { font-size: 14px; margin: 4px 0; }
.help-toc a { color: var(--muted); text-decoration: none; }
.help-toc a:hover { color: var(--text); }

/* ── Was this page helpful? ──────────────────────────────────────────────── */
.help-feedback { margin: 36px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.help-fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.help-fb-q { font-weight: 600; color: var(--text); margin: 0 0 8px; font-size: 15px; }
.help-fb-btns { display: flex; gap: 8px; }
.help-fb-btns button,
.help-fb-more button {
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 7px 16px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: var(--tile); color: var(--text);
}
.help-fb-btns button:hover, .help-fb-more button:hover { border-color: var(--accent); }
.help-fb-btns button[aria-pressed="true"] { background: var(--accent); color: #1a1509; border-color: var(--accent); }
.help-fb-more { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.help-fb-more[hidden], .help-fb-btns[hidden] { display: none; }
.help-fb-more label { font-size: 14px; color: var(--muted); flex-basis: 100%; }
.help-fb-more input {
  flex: 1; min-width: 200px; font: inherit; font-size: 14px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--field, var(--tile-2)); color: var(--text);
}
.help-fb-more input:focus { outline: none; border-color: var(--accent); }
.help-fb-thanks { font-size: 14px; color: var(--muted); margin: 0; }

/* ── Recently changed (overview pages) ───────────────────────────────────── */
.help-recent {
  margin: 36px 0 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--tile);
}
.help-recent-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 8px;
}
.help-recent ul { list-style: none; margin: 0 0 8px; padding: 0; }
.help-recent li { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.help-recent-v { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-right: 6px; }
.help-recent-all { font-size: 13px; color: var(--accent); text-decoration: none; }

/* ── Prev / next pager ───────────────────────────────────────────────────── */
.help-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.help-pager a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--tile);
  text-decoration: none;
  color: var(--text);
}
.help-pager a:hover { border-color: var(--accent); }
.help-pager-next { text-align: right; }
.help-pager-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.help-pager-title { font-size: 14px; font-weight: 600; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.help-foot { border-top: 1px solid var(--line-soft); }
.help-foot-in {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 26px 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--faint);
}
.help-foot-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.help-foot-links a { color: var(--muted); text-decoration: none; }
.help-foot-links a:hover { color: var(--text); }
.help-foot-cr { margin: 0; }

/* ── Responsive: the tree folds above the article ────────────────────────── */
@media (max-width: 900px) {
  .help-shell { grid-template-columns: 1fr; gap: 18px; padding: 14px 18px 56px; }
  .help-side { position: static; max-height: none; overflow: visible; }
  .help-side-support { margin-left: 0; }
  .help-tree-fold {
    border: 1px solid var(--line);
    background: var(--tile);
    border-radius: 12px;
    padding: 0;
  }
  .help-tree-fold > .help-tree-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    list-style: none;
  }
  .help-tree-fold > .help-tree-summary svg { width: 16px; height: 16px; color: var(--accent); }
  .help-tree-fold > .help-tree-summary .chev { margin-left: auto; color: var(--faint); }
  .help-tree-fold[open] > .help-tree-summary .chev { transform: rotate(180deg); }
  .help-tree { padding: 0 8px 10px; }
  .help-head h1 { font-size: 25px; }
  .help-pager { grid-template-columns: 1fr; }
  .help-pager-next { text-align: left; }
}
