/* The help (Shared/Help, Help/*.html): the "?" buttons, the help panel, the Help centre and the topics' own classes.
   Colours only from the kit's tokens, so dark and light both work; print shows the topic alone. */

/* ---------- the "?" buttons ---------- */
.help-btn { color: var(--lb-muted); vertical-align: middle; }
.help-btn:hover, .help-btn:focus-visible { color: var(--lb-accent-text); }
.help-title { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- the panel ---------- */
.help-panel .lb-dialog__subhead { padding-top: 0; }
.help-search { width: 100%; }
.help-empty { color: var(--lb-text-2); }
.help-hits { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.help-hit {
  display: grid; gap: 2px; width: 100%; text-align: left; padding: 10px 12px; border-radius: var(--lb-radius-md);
  background: var(--lb-surface-2); border: 1px solid var(--lb-border); color: var(--lb-text); text-decoration: none; cursor: pointer;
}
.help-hit:hover, .help-hit:focus-visible { border-color: var(--lb-accent); }
.help-hit__section { font-size: var(--lb-text-xs); color: var(--lb-muted); text-transform: uppercase; letter-spacing: .04em; }
.help-hit__snippet { font-size: var(--lb-text-sm); color: var(--lb-text-2); }

/* ---------- a topic ---------- */
.help-article { container-type: inline-size; color: var(--lb-text); line-height: 1.6; font-size: var(--lb-text-md); }
.help-summary { font-size: var(--lb-text-lg); color: var(--lb-text); margin: 0 0 8px; }
.help-who { display: flex; gap: 8px; align-items: baseline; color: var(--lb-text-2); font-size: var(--lb-text-sm); margin: 0 0 12px; }
.help-open { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 14px; font-size: var(--lb-text-sm); }
.help-open__link { color: var(--lb-accent-text); text-decoration: none; }
.help-open__link:hover { text-decoration: underline; }
.help-toc {
  margin: 0 0 18px; padding: 10px 14px; border-radius: var(--lb-radius-md); background: var(--lb-surface-2); border: 1px solid var(--lb-border);
}
.help-toc__title { display: block; font-size: var(--lb-text-xs); color: var(--lb-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.help-toc ul { margin: 0; padding-left: 18px; columns: 2 220px; column-gap: 24px; }
.help-toc a, .help-body a, .help-related a { color: var(--lb-accent-text); }

.help-body h2 {
  font-family: var(--lb-font-head); font-size: var(--lb-text-xl); margin: 28px 0 10px; padding-top: 14px;
  border-top: 1px solid var(--lb-border); scroll-margin-top: 12px;
}
.help-body h2:first-child { margin-top: 4px; border-top: 0; padding-top: 0; }
.help-body h3 { font-family: var(--lb-font-head); font-size: var(--lb-text-lg); margin: 20px 0 8px; scroll-margin-top: 12px; }
.help-body h4 { font-size: var(--lb-text-md); margin: 16px 0 6px; }
.help-body p { margin: 0 0 10px; }
.help-body ul, .help-body ol { margin: 0 0 12px; padding-left: 22px; }
.help-body li { margin: 3px 0; }
.help-body kbd { padding: 1px 6px; border-radius: var(--lb-radius-xs); border: 1px solid var(--lb-border-2); background: var(--lb-surface-2); font-size: .85em; }
.help-flash { animation: help-flash 1.8s var(--lb-ease); border-radius: var(--lb-radius-sm); }
@keyframes help-flash { 0%, 40% { background: var(--lb-accent-soft); } 100% { background: transparent; } }

/* A button, field, column or status as the screen names it */
.help-body .ui {
  display: inline-block; padding: 0 6px; border-radius: var(--lb-radius-xs); background: var(--lb-surface-3); border: 1px solid var(--lb-border);
  font-size: .92em; font-weight: 600; white-space: nowrap; line-height: 1.5;
}

/* Numbered steps */
.help-body ol.help-steps { list-style: none; counter-reset: help-step; padding-left: 0; }
.help-body ol.help-steps > li { counter-increment: help-step; position: relative; padding: 2px 0 6px 40px; min-height: 30px; }
.help-body ol.help-steps > li::before {
  content: counter(help-step); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: var(--lb-text-sm); background: var(--lb-accent); color: var(--lb-accent-ink);
}

/* Notes: help-note (good to know), help-tip (a quicker way), help-warn (careful: money, stock or Xero) */
.help-note, .help-tip, .help-warn {
  margin: 12px 0; padding: 10px 14px 10px 40px; border-radius: var(--lb-radius-md); position: relative; border: 1px solid var(--lb-border);
}
.help-note::before, .help-tip::before, .help-warn::before { font-family: "bootstrap-icons"; position: absolute; left: 14px; top: 10px; }
.help-note { background: var(--lb-info-soft); }
.help-note::before { content: "\F430"; color: var(--lb-info); }
.help-tip { background: var(--lb-success-soft); }
.help-tip::before { content: "\F468"; color: var(--lb-success); }
.help-warn { background: var(--lb-warning-soft); }
.help-warn::before { content: "\F33A"; color: var(--lb-warning); }
.help-note > :last-child, .help-tip > :last-child, .help-warn > :last-child { margin-bottom: 0; }

/* Process flows: an ordered list of stages, top to bottom in the panel, left to right when there is room */
.help-body ol.help-flow { list-style: none; padding: 0; margin: 14px 0 16px; display: flex; flex-direction: column; gap: 22px; counter-reset: help-flow; }
.help-body ol.help-flow > li {
  position: relative; margin: 0; padding: 10px 12px; border-radius: var(--lb-radius-md); background: var(--lb-surface-2);
  border: 1px solid var(--lb-border-2); border-left: 4px solid var(--lb-accent);
}
.help-body ol.help-flow > li > b, .help-body ol.help-flow > li > strong { display: block; }
.help-body ol.help-flow > li > span { display: block; font-size: var(--lb-text-sm); color: var(--lb-text-2); }
.help-body ol.help-flow > li:not(:last-child)::after {
  content: "\F128"; font-family: "bootstrap-icons"; position: absolute; left: 50%; bottom: -21px; transform: translateX(-50%); color: var(--lb-muted);
}
.help-body ol.help-flow > li.help-flow-end { border-left-color: var(--lb-success); }
.help-body ol.help-flow > li.help-flow-stop { border-left-color: var(--lb-danger); }
.help-body ol.help-flow > li.help-flow-xero { border-left-color: var(--lb-info); }
.help-body .help-flow-alt { margin: -6px 0 16px; font-size: var(--lb-text-sm); color: var(--lb-text-2); }
@container (min-width: 760px) {
  .help-body ol.help-flow { flex-direction: row; flex-wrap: wrap; gap: 14px 34px; }
  .help-body ol.help-flow > li { flex: 1 1 150px; max-width: 240px; }
  .help-body ol.help-flow > li:not(:last-child)::after { content: "\F138"; left: auto; right: -25px; top: 50%; bottom: auto; transform: translateY(-50%); }
}

/* Fields: dl.help-fields (term = the field as the screen names it) */
.help-body dl.help-fields { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 6px 16px; margin: 8px 0 14px; }
.help-body dl.help-fields dt { font-weight: 600; }
.help-body dl.help-fields dd { margin: 0; color: var(--lb-text-2); }
@container (max-width: 420px) {
  .help-body dl.help-fields { grid-template-columns: 1fr; }
  .help-body dl.help-fields dd { margin-bottom: 6px; }
}

/* Tables: statuses, columns, who may do what */
.help-body .help-table-wrap { overflow-x: auto; margin: 8px 0 14px; }
.help-body table.help-table { width: 100%; border-collapse: collapse; font-size: var(--lb-text-sm); }
.help-body table.help-table th, .help-body table.help-table td { text-align: left; vertical-align: top; padding: 6px 10px; border-bottom: 1px solid var(--lb-border); }
.help-body table.help-table th { color: var(--lb-muted); font-weight: 600; background: var(--lb-surface-2); }

.help-related { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--lb-border); }
.help-related h2 { font-family: var(--lb-font-head); font-size: var(--lb-text-lg); margin: 0 0 8px; }
.help-related ul { margin: 0; padding-left: 18px; }
.help-related li span { color: var(--lb-text-2); font-size: var(--lb-text-sm); }
.help-related li span::before { content: " · "; }

/* ---------- the Help centre ---------- */
.help-centre { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; align-items: start; }
.help-centre__nav {
  position: sticky; top: 12px; max-height: calc(100vh - 100px); overflow: auto; padding: 12px; border-radius: var(--lb-radius-lg);
  background: var(--lb-surface); border: 1px solid var(--lb-border);
}
.help-centre__section { margin-top: 10px; }
.help-centre__section summary { cursor: pointer; font-weight: 600; color: var(--lb-text); padding: 4px 0; }
.help-centre__section summary span { color: var(--lb-muted); font-weight: 400; font-size: var(--lb-text-xs); margin-left: 4px; }
.help-centre__section ul { list-style: none; margin: 2px 0 0; padding: 0 0 0 8px; }
.help-centre__section a { display: block; padding: 3px 8px; border-radius: var(--lb-radius-sm); color: var(--lb-text-2); text-decoration: none; font-size: var(--lb-text-sm); }
.help-centre__section a:hover { background: var(--lb-surface-2); color: var(--lb-text); }
.help-centre__section a.is-current { background: var(--lb-accent-soft); color: var(--lb-accent-text); font-weight: 600; }
.help-centre__main {
  min-width: 0; padding: 22px 26px; border-radius: var(--lb-radius-lg); background: var(--lb-surface); border: 1px solid var(--lb-border);
}
.help-centre__title { font-family: var(--lb-font-head); font-size: var(--lb-text-2xl); margin: 0 0 8px; }
.help-centre__crumb { margin: 0 0 4px; font-size: var(--lb-text-sm); color: var(--lb-muted); }
.help-centre__crumb a { color: var(--lb-accent-text); text-decoration: none; }
.help-centre__sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 18px; }
.help-centre__card { padding: 14px 16px; border-radius: var(--lb-radius-md); background: var(--lb-surface-2); border: 1px solid var(--lb-border); }
.help-centre__card h2 { font-family: var(--lb-font-head); font-size: var(--lb-text-lg); margin: 0 0 8px; }
.help-centre__card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.help-centre__card a { color: var(--lb-accent-text); font-weight: 600; text-decoration: none; }
.help-centre__card span { display: block; font-size: var(--lb-text-sm); color: var(--lb-text-2); }
@media (max-width: 900px) {
  .help-centre { grid-template-columns: 1fr; }
  .help-centre__nav { position: static; max-height: none; }
  .help-centre__main { padding: 16px; }
}

@media print {
  .help-centre { display: block; }
  .help-centre__nav { display: none; }
  .help-centre__main { border: 0; padding: 0; }
  .help-body h2 { break-after: avoid; }
}
