/* Help Centre (Epic #1152, design #1168). Spec: design-specs/screen-specs/help-centre.md
   Everything is prefixed .sfh- so nothing leaks into the prototype's own screens.
   Colours come from the shell's tokens, with fallbacks. */

/* ── The window: Help replaces the end-user navigation, like Admin Settings ── */
.app-shell.sfh-mode #canonicalNav { display: none; }

/* --sfh-nav is the sidebar's width: Admin Settings' 254, or its 60 wide rail when collapsed. */
#sf-view-help {
  --sfh-nav: 254px;
  display: grid;
  grid-template-columns: var(--sfh-nav) minmax(0, 1fr) 240px;
  grid-template-areas: "nav main toc";
  height: 100vh;
  background: #fff;
  font-family: var(--font, Inter, -apple-system, sans-serif);
}
#sf-view-help.is-nav-collapsed { --sfh-nav: 60px; }
#sf-view-help.has-asst { grid-template-columns: var(--sfh-nav) minmax(0, 1fr) 400px; grid-template-areas: "nav main asst"; }
#sf-view-help.has-asst.asst-wide { grid-template-columns: var(--sfh-nav) minmax(0, 1fr) 560px; }
#sf-view-help.has-asst .sfh-toc { display: none; }
@media (max-width: 1199px) {
  #sf-view-help { grid-template-columns: var(--sfh-nav) minmax(0, 1fr); grid-template-areas: "nav main"; }
  #sf-view-help .sfh-toc { display: none; }
  #sf-view-help.has-asst { grid-template-columns: var(--sfh-nav) minmax(0, 1fr) 360px; }
}

/* ── Left navigation: Admin Settings' sidebar, metric for metric ──────────
   Help is a window like Admin Settings, so its sidebar is drawn the same way
   (admin-dm-prototype.css, #admin-content .left-nav): the tile and a
   collapse button, full-width 40 high rows with a 20 icon, the caret on the
   right, the active marker on the edge, and links in the footer. Only the
   search field, the Assistant button and the tile's soft violet are Help's own. */
.sfh-nav {
  grid-area: nav;
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  background: #f3f4f6;
  border-right: 1px solid var(--c-border, #e5e7eb);
}
.sfh-nav-head {
  height: 52px; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 12px; margin-top: 12px;
}
.sfh-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sfh-nav-logo {
  position: relative; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px;
  background: var(--c-primary-subtle, #ede9fe); color: var(--c-primary, #7c3aed); cursor: default;
  display: flex; align-items: center; justify-content: center;
}
.sfh-nav-logo svg { width: 18px; height: 18px; }
.sfh-expand-hint { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; }
.sfh-expand-hint svg { width: 16px; height: 16px; }
.sfh-nav-title { font-size: 15px; font-weight: 600; color: var(--c-text, #111827); white-space: nowrap; }
.sfh-nav-action {
  flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--c-text-secondary, #4b5563);
}
.sfh-nav-action svg { width: 16px; height: 16px; }
.sfh-nav-action:hover { background: var(--c-border, #e5e7eb); }
.sfh-nav-logo:focus-visible, .sfh-nav-action:focus-visible { outline: 2px solid var(--c-primary, #7c3aed); outline-offset: 1px; }
/* The version the guides describe: the build's, the same number as About Smartflow. */
.sfh-version {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px;
  background: #fff; border: 1px solid var(--c-border, #e5e7eb);
  font-size: 11px; font-weight: 600; color: var(--c-text-secondary, #4b5563);
}
/* Once the running release has a What's new page, the tag opens it: hovered as Learn how is. */
a.sfh-version { text-decoration: none; cursor: pointer; }
a.sfh-version:hover { background: var(--c-primary-subtle, #ede9fe); border-color: var(--c-primary-subtle, #ede9fe); color: var(--c-primary-text, #6d28d9); }
a.sfh-version:focus-visible { outline: 2px solid var(--c-primary, #7c3aed); outline-offset: 1px; }

.sfh-nav-tools { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; flex: none; }
.sfh-search {
  flex: 1; min-width: 0; height: 36px;
  display: flex; align-items: center; gap: 6px;
  padding: 0 8px 0 10px; border-radius: 8px;
  background: #fff; border: 1px solid var(--c-border, #e5e7eb);
}
.sfh-search:focus-within { border-color: var(--c-primary, #7c3aed); box-shadow: 0 0 0 3px var(--c-primary-subtle, #ede9fe); }
.sfh-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: 400 13px var(--font, Inter, sans-serif); color: var(--c-text, #111827);
}
.sfh-search input::placeholder { color: var(--c-text-muted, #9ca3af); }
.sfh-search input::-webkit-search-cancel-button { display: none; }
.sfh-search kbd {
  flex: none; font: 500 11px var(--font, Inter, sans-serif); color: var(--c-text-tertiary, #6b7280);
  padding: 1px 5px; border-radius: 4px; border: 1px solid var(--c-border, #e5e7eb); background: var(--c-surface, #f8fafc);
}
.sfh-ai-btn {
  width: 36px; height: 36px; flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-border, #e5e7eb); background: #fff; color: var(--c-primary, #7c3aed); cursor: pointer;
}
.sfh-ai-btn svg { width: 16px; height: 16px; }
/* Open reads as the app's open toolbar button (Deals' and Hub's Filters):
   lavender fill AND a purple border, so it keeps its edge on the grey
   sidebar (2026-10-21: a lavender border on lavender vanished there, and
   hover looked the same as open). Hover is the border only. */
.sfh-ai-btn:hover { border-color: var(--c-primary, #7c3aed); }
.sfh-ai-btn[aria-expanded="true"] { background: var(--c-primary-subtle, #ede9fe); border-color: var(--c-primary, #7c3aed); color: var(--c-primary-text, #6d28d9); }

/* Rows: full width, square, as in both of the app's sidebars. */
.sfh-nav-list { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 2px; padding: 4px 0 8px; }
.sfh-row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 40px;
  padding: 0 16px 0 20px; border: 0; border-radius: 0; background: transparent; cursor: pointer; text-align: left; text-decoration: none;
  font: 500 14px var(--font, Inter, sans-serif); color: var(--c-text-secondary, #4b5563);
  transition: background .12s, color .12s;
}
.sfh-row:hover { background: rgba(0, 0, 0, .04); color: var(--c-text, #111827); }
.sfh-row > svg { flex: none; width: 20px; height: 20px; }
.sfh-row-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The open guide's row, or the section that holds it: the marker on the edge. */
.sfh-row.is-active { background: var(--c-primary-subtle, #ede9fe); color: var(--c-primary, #7c3aed); }
.sfh-row.is-active::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--c-primary, #7c3aed);
}
.sfh-row:focus-visible { outline: 2px solid var(--c-primary, #7c3aed); outline-offset: -2px; }
.sfh-caret { flex: none; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 4px; color: var(--c-text-tertiary, #6b7280); }
.sfh-caret svg { width: 16px; height: 16px; transition: transform .16s ease; }
.sfh-group.is-collapsed .sfh-caret svg { transform: rotate(-90deg); }
/* A section's guides: the end-user sidebar's sub-rows (Hub, Data Vault), a dot
   and the title, which may take a second line since guide titles are long.
   Admin Settings' sub-rows put an icon first and start the text 40 further in. */
.sfh-sub { display: flex; flex-direction: column; gap: 2px; margin: 4px 12px 8px 32px; padding-left: 4px; }
.sfh-sub[hidden] { display: none; }
.sfh-sub-item {
  display: flex; align-items: flex-start; gap: 8px; min-height: 32px; padding: 7px 12px; border-radius: 6px; line-height: 1.4;
  font-size: 13px; color: var(--c-text-tertiary, #6b7280); text-decoration: none;
  transition: background .12s, color .12s;
}
.sfh-dot { flex: none; font-size: 14px; line-height: 1.3; color: var(--c-text-muted, #9ca3af); }
.sfh-sub-item:hover { background: rgba(0, 0, 0, .04); color: var(--c-text-secondary, #4b5563); }
.sfh-sub-item.is-active { background: var(--c-primary-subtle, #ede9fe); color: var(--c-primary, #7c3aed); font-weight: 600; }
.sfh-sub-item:focus-visible { outline: 2px solid var(--c-primary, #7c3aed); outline-offset: -2px; }
/* "For administrators": Admin Settings' section label. */
.sfh-section-label {
  margin-top: 10px; padding: 8px 18px 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-text-tertiary, #6b7280);
}
.sfh-empty { padding: 6px 20px; font-size: 13px; color: var(--c-text-tertiary, #6b7280); }

/* Footer: Contact support above Back to Deals, both drawn as Back to Deals is. */
.sfh-nav-foot { flex: none; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 16px; border-top: 1px solid var(--c-border, #e5e7eb); }
.sfh-home {
  height: 36px; border-radius: 8px; display: flex; align-items: center; gap: 10px; padding: 0 8px;
  font-size: 14px; font-weight: 500; color: #111827; text-decoration: none; white-space: nowrap;
}
.sfh-home svg { width: 16px; height: 16px; flex: none; }
.sfh-home:hover { background: var(--c-border, #e5e7eb); }
.sfh-home.is-active { background: var(--c-primary-subtle, #ede9fe); color: var(--c-primary, #7c3aed); }
.sfh-home:focus-visible { outline: 2px solid var(--c-primary, #7c3aed); outline-offset: -2px; }

/* Collapsed: Admin Settings' 60 wide rail. Icons only, each named by its tip;
   the tile opens the sidebar again, and so does a section's icon. */
.is-nav-collapsed .sfh-nav-title, .is-nav-collapsed .sfh-version, .is-nav-collapsed .sfh-nav-action,
.is-nav-collapsed .sfh-search, .is-nav-collapsed .sfh-section-label, .is-nav-collapsed .sfh-sub,
.is-nav-collapsed .sfh-caret, .is-nav-collapsed .sfh-row-label, .is-nav-collapsed .sfh-home > span,
.is-nav-collapsed .sfh-empty { display: none; }
.is-nav-collapsed .sfh-nav-head { justify-content: center; padding: 0; }
.is-nav-collapsed .sfh-nav-logo { cursor: pointer; }
.is-nav-collapsed .sfh-nav-logo:hover > svg, .is-nav-collapsed .sfh-nav-logo:focus-visible > svg { opacity: 0; }
.is-nav-collapsed .sfh-nav-logo:hover .sfh-expand-hint, .is-nav-collapsed .sfh-nav-logo:focus-visible .sfh-expand-hint { display: flex; }
.is-nav-collapsed .sfh-nav-tools { justify-content: center; padding: 12px 0 8px; }
.is-nav-collapsed .sfh-row { justify-content: center; padding: 0; }
.is-nav-collapsed .sfh-nav-foot { padding: 12px 0 16px; align-items: center; }
.is-nav-collapsed .sfh-home { width: 36px; justify-content: center; padding: 0; }

/* ── Guide ─────────────────────────────────────────────────────────────── */
.sfh-main { grid-area: main; min-width: 0; overflow-y: auto; }
.sfh-page { max-width: 760px; margin: 0 auto; padding: 40px 40px 96px; }

.sfh-pill {
  display: inline-flex; padding: 3px 10px; border-radius: 999px; margin-bottom: 12px;
  background: var(--c-warn-bg, #fef3c7); color: var(--c-warn, #92400e); font-size: 12px; font-weight: 500;
}
.sfh-article { font-size: 14px; line-height: 1.65; color: var(--c-text, #111827); }
/* Headings: the levels are told apart by size, weight and the space above, not by
   a rule (no one-sided borders). A level 2 section opens with a large gap and a
   24 bold heading; a level 3 heading is 16 semibold and sits close to its own text. */
.sfh-article h1 { font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 14px; }
.sfh-article .sfh-subtitle { margin: -4px 0 20px; font-size: 16.5px; line-height: 1.55; color: var(--c-text-secondary, #4b5563); }
.sfh-article h2 { font-size: 24px; font-weight: 700; line-height: 1.25; letter-spacing: -.015em; margin: 56px 0 16px; scroll-margin-top: 24px; }
.sfh-article h1 + h2, .sfh-article .sfh-subtitle + h2 { margin-top: 32px; }
.sfh-article h3 { font-size: 16px; font-weight: 600; line-height: 1.35; margin: 28px 0 6px; scroll-margin-top: 24px; }
.sfh-article h2 + h3 { margin-top: 20px; }
.sfh-article h4 { font-size: 14px; font-weight: 600; margin: 20px 0 4px; scroll-margin-top: 24px; }
.sfh-article p { margin: 0 0 12px; }
.sfh-article ul, .sfh-article ol { margin: 0 0 14px; padding-left: 22px; }
.sfh-article li { margin: 4px 0; }
.sfh-article li > p { margin: 6px 0; }
.sfh-article a { color: var(--c-primary-text, #6d28d9); }
.sfh-article code { padding: 1px 5px; border-radius: 5px; background: var(--c-surface, #f8fafc); border: 1px solid var(--c-border-light, #f1f3f5); font-size: 12.5px; }
.sfh-article pre { margin: 6px 0 18px; padding: 12px 14px; overflow-x: auto; border-radius: 10px; border: 1px solid var(--c-border, #e5e7eb); background: var(--c-surface, #f8fafc); line-height: 1.6; }
.sfh-article pre code { padding: 0; border: 0; background: none; font-size: 12.5px; white-space: pre; }
.sfh-article table { width: 100%; border-collapse: collapse; margin: 6px 0 18px; font-size: 13px; }
.sfh-article th, .sfh-article td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--c-border, #e5e7eb); }
.sfh-article th { font-weight: 600; color: var(--c-text-secondary, #4b5563); background: var(--c-surface, #f8fafc); }
.sfh-article img { display: block; max-width: 100%; height: auto; margin: 8px 0 20px; border: 1px solid var(--c-border, #e5e7eb); border-radius: 10px; }
.sfh-article blockquote { margin: 0 0 16px; padding: 10px 14px; border-left: 3px solid var(--c-border, #e5e7eb); color: var(--c-text-secondary, #4b5563); }

/* Section links, as on a Confluence page: a link icon after each heading,
   shown while the heading is pointed at, with a "Copy link to heading" tip. */
.sfh-article a.sfh-anchor {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin-left: 6px; vertical-align: middle; border-radius: 6px;
  color: var(--c-text-tertiary, #6b7280); text-decoration: none;
  opacity: 0; transition: opacity .15s, color .15s, background .15s;
}
.sfh-anchor svg { width: 16px; height: 16px; }
.sfh-article h3 .sfh-anchor, .sfh-article h4 .sfh-anchor { width: 22px; height: 22px; }
.sfh-article h3 .sfh-anchor svg, .sfh-article h4 .sfh-anchor svg { width: 14px; height: 14px; }
.sfh-article h1:hover .sfh-anchor, .sfh-article h2:hover .sfh-anchor, .sfh-article h3:hover .sfh-anchor,
.sfh-article h4:hover .sfh-anchor, .sfh-article .sfh-anchor:focus-visible, .sfh-article .sfh-anchor.is-copied { opacity: 1; }
.sfh-article a.sfh-anchor:hover { color: var(--c-primary-text, #6d28d9); background: var(--c-primary-subtle, #ede9fe); }
.sfh-article a.sfh-anchor.is-copied { color: #15803d; background: #dcfce7; }
.sfh-anchor:focus-visible { outline: 2px solid var(--c-primary, #7c3aed); outline-offset: 1px; }
.sfh-anchor::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: 5;
  padding: 6px 10px; border-radius: 6px; background: #1f2937; color: #fff;
  font: 500 12.5px/1.3 var(--font, Inter, -apple-system, sans-serif); letter-spacing: 0; text-transform: none; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity .12s;
}
.sfh-anchor:hover::after, .sfh-anchor:focus-visible::after, .sfh-anchor.is-copied::after { opacity: 1; }
.sfh-anchor.is-tip-below::after { bottom: auto; top: calc(100% + 8px); }
/* Without a pointer to hover with, keep the icon faintly visible. */
@media (hover: none) { .sfh-article a.sfh-anchor { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .sfh-anchor, .sfh-anchor::after { transition: none; } }
.sfh-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.sfh-callout { margin: 0 0 18px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--c-border, #e5e7eb); background: var(--c-surface, #f8fafc); font-size: 13px; }
.sfh-callout-title { font-weight: 600; margin-bottom: 6px; }
.sfh-callout > *:last-child { margin-bottom: 0; }
.sfh-callout--todo { background: #fffbeb; border-color: #fcd34d; }
.sfh-callout--todo .sfh-callout-title { color: #92400e; }
.sfh-callout--tip { background: #f0fdf4; border-color: #bbf7d0; }
.sfh-callout--warning { background: #fef2f2; border-color: #fecaca; }

/* ── On this page: rail, nested level 3, one active heading ─────────────── */
.sfh-toc { grid-area: toc; overflow-y: auto; padding: 40px 24px 40px 8px; }
.sfh-toc.is-empty { visibility: hidden; }
.sfh-toc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; font-weight: 500; color: var(--c-text-secondary, #4b5563); }
.sfh-toc-head svg { width: 14px; height: 14px; color: var(--c-text-tertiary, #6b7280); }
.sfh-toc-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--c-border, #e5e7eb); }
.sfh-toc-link {
  display: block; margin-left: -1px; padding: 5px 0 5px 14px; border-left: 2px solid transparent;
  font-size: 13px; line-height: 1.4; color: var(--c-text-secondary, #4b5563); text-decoration: none;
}
.sfh-toc-l3 { padding-left: 28px; font-size: 12.5px; color: var(--c-text-tertiary, #6b7280); }
.sfh-toc-link:hover { color: var(--c-text, #111827); }
.sfh-toc-link.is-active { color: var(--c-primary-text, #6d28d9); border-left-color: var(--c-primary, #7c3aed); font-weight: 500; }

/* ── Assistant ─────────────────────────────────────────────────────────── */
.sfh-asst {
  grid-area: asst; min-height: 0;
  display: flex; flex-direction: column;
  border-left: 1px solid var(--c-border, #e5e7eb); background: #fff;
}
.sfh-asst[hidden] { display: none; }
.sfh-asst-head { height: 56px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--c-border, #e5e7eb); }
.sfh-asst-mark { width: 16px; height: 16px; color: var(--c-primary, #7c3aed); display: flex; }
.sfh-asst-mark svg { width: 16px; height: 16px; }
.sfh-asst-title { flex: 1; font-size: 15px; font-weight: 600; color: var(--c-text, #111827); }
.sfh-icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent;
  display: flex; align-items: center; justify-content: center; color: var(--c-text-tertiary, #6b7280); cursor: pointer;
}
.sfh-icon-btn svg { width: 15px; height: 15px; }
.sfh-icon-btn:hover { background: var(--c-surface, #f8fafc); color: var(--c-text, #111827); }

.sfh-asst-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px; }
.sfh-asst-note { margin: 0 0 18px; text-align: center; font-size: 12px; line-height: 1.5; color: var(--c-text-tertiary, #6b7280); }
.sfh-asst-suggest-label { margin-bottom: 8px; font-size: 12px; font-weight: 600; color: var(--c-text-secondary, #4b5563); }
.sfh-chip {
  display: block; width: 100%; margin-bottom: 8px; padding: 9px 12px; text-align: left; cursor: pointer;
  border: 1px solid var(--c-border, #e5e7eb); border-radius: 10px; background: #fff;
  font: 400 13px var(--font, Inter, sans-serif); color: var(--c-text, #111827);
}
.sfh-chip:hover { border-color: var(--c-primary, #7c3aed); background: var(--c-primary-subtle, #ede9fe); }

.sfh-msg { margin-bottom: 14px; font-size: 13.5px; line-height: 1.6; color: var(--c-text, #111827); }
.sfh-msg--user { margin-left: 32px; padding: 9px 12px; border-radius: 12px; background: var(--c-surface, #f8fafc); border: 1px solid var(--c-border, #e5e7eb); }
.sfh-msg--bot p { margin: 0 0 8px; }
.sfh-msg--bot ul, .sfh-msg--bot ol { margin: 0 0 8px; padding-left: 20px; }
.sfh-msg--bot a { color: var(--c-primary-text, #6d28d9); }
.sfh-msg-sources { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--c-border, #e5e7eb); }
.sfh-msg-sources-label { margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--c-text-secondary, #4b5563); }
.sfh-msg-sources a { display: block; padding: 3px 0; font-size: 12.5px; text-decoration: none; }
.sfh-msg-sources a:hover { text-decoration: underline; }

.sfh-asst-form {
  flex: none; margin: 12px; display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 8px 8px 12px; border: 1px solid var(--c-border, #e5e7eb); border-radius: 12px;
}
.sfh-asst-form:focus-within { border-color: var(--c-primary, #7c3aed); box-shadow: 0 0 0 3px var(--c-primary-subtle, #ede9fe); }
.sfh-asst-form textarea {
  flex: 1; min-height: 22px; max-height: 140px; border: 0; outline: 0; resize: none; padding: 4px 0;
  font: 400 13.5px/1.5 var(--font, Inter, sans-serif); color: var(--c-text, #111827); background: transparent;
}
.sfh-send {
  width: 30px; height: 30px; flex: none; border: 0; border-radius: 999px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-primary, #7c3aed); color: #fff;
}
.sfh-send svg { width: 15px; height: 15px; }
.sfh-send:disabled { background: var(--c-border, #e5e7eb); color: var(--c-text-muted, #9ca3af); cursor: default; }

/* ── The first page: "How Smartflow works" ─────────────────────────────────
   Readers land here first. The same Markdown, laid out as a hero, the diagram
   and cards (see enhanceLanding in help-center.js). No "On this page": the
   section chips under the hero do that job, and the diagram gets the width. */
#sf-view-help.is-landing:not(.has-asst) { grid-template-columns: var(--sfh-nav) minmax(0, 1fr); grid-template-areas: "nav main"; }
#sf-view-help.is-landing .sfh-toc { display: none; }
.sfh-page.is-landing { max-width: 1080px; padding-top: 28px; }
.sfh-page.is-landing .sfh-article h2 { margin-top: 52px; }

/* Hero */
.sfh-hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: center;
  margin: 0 0 18px; padding: 40px 44px;
  border-radius: 24px; border: 1px solid var(--c-primary-subtle, #ede9fe);
  background:
    radial-gradient(560px 300px at 100% 0%, rgba(124, 58, 237, .14), transparent 62%),
    radial-gradient(420px 260px at 0% 100%, rgba(167, 139, 250, .12), transparent 62%),
    linear-gradient(135deg, #f5f3ff 0%, #fff 72%);
}
.sfh-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(124, 58, 237, .12) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(90deg, transparent 45%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 45%, #000 100%);
}
.sfh-hero-copy { position: relative; z-index: 1; min-width: 0; }
.sfh-hero-eyebrow {
  display: inline-flex; align-items: center; margin-bottom: 14px; padding: 4px 11px; border-radius: 999px;
  background: #fff; border: 1px solid var(--c-primary-subtle, #ede9fe);
  color: var(--c-primary-text, #6d28d9); font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.sfh-article .sfh-hero h1 { font-size: 38px; line-height: 1.1; letter-spacing: -.03em; margin: 0 0 14px; }
.sfh-article .sfh-hero-lead { max-width: 560px; margin: 0 0 24px; font-size: 16.5px; line-height: 1.6; color: var(--c-text-secondary, #4b5563); }
.sfh-hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.sfh-article a.sfh-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px;
  font-size: 14px; font-weight: 500; text-decoration: none;
  border: 1px solid var(--c-border, #e5e7eb); background: #fff; color: var(--c-text, #111827);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.sfh-article a.sfh-btn:hover { border-color: var(--c-primary, #7c3aed); }
.sfh-article a.sfh-btn--primary {
  background: var(--c-primary, #7c3aed); border-color: var(--c-primary, #7c3aed); color: #fff;
  box-shadow: 0 6px 16px rgba(124, 58, 237, .25);
}
.sfh-article a.sfh-btn--primary:hover { background: #6d28d9; border-color: #6d28d9; }
.sfh-btn svg { transition: transform .2s; }
.sfh-btn--primary:hover svg { transform: translateX(3px); }

/* Hero illustration: a document's lines picked out, then an approved record */
.sfh-hero-art { position: relative; z-index: 1; height: 224px; }
.sfh-art-doc {
  position: absolute; left: 0; top: 16px; width: 140px; height: 188px; padding: 32px 16px 0;
  border-radius: 14px; background: #fff; border: 1px solid var(--c-border, #e5e7eb);
  box-shadow: 0 10px 30px rgba(17, 24, 39, .08); transform: rotate(-4deg);
}
.sfh-art-doc-tab { position: absolute; top: 14px; left: 16px; width: 46px; height: 8px; border-radius: 4px; background: #e5e7eb; }
.sfh-art-doc i { position: relative; display: block; height: 7px; margin: 0 0 12px; border-radius: 4px; background: #eef0f3; overflow: hidden; }
.sfh-art-doc i.short { width: 62%; }
.sfh-art-doc i.hl::after {
  content: ""; position: absolute; inset: 0; border-radius: 4px; background: rgba(124, 58, 237, .45);
  transform-origin: left; animation: sfh-hl 6s ease-in-out infinite;
}
.sfh-art-doc i.hl:nth-of-type(4)::after { animation-delay: .2s; }
.sfh-art-doc i.hl:nth-of-type(7)::after { animation-delay: .4s; }
.sfh-art-spark {
  position: absolute; left: 146px; top: 88px; width: 42px; height: 42px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-primary, #7c3aed); color: #fff; box-shadow: 0 8px 20px rgba(124, 58, 237, .35);
  animation: sfh-pulse 6s ease-in-out infinite;
}
.sfh-art-spark svg { width: 20px; height: 20px; }
.sfh-art-rec {
  position: absolute; right: 0; top: 28px; width: 168px; padding: 12px 12px 4px;
  border-radius: 14px; background: #fff; border: 1px solid var(--c-primary-subtle, #ede9fe);
  box-shadow: 0 14px 34px rgba(76, 29, 149, .14); transform: rotate(2deg);
}
.sfh-art-rec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 11px; font-weight: 600; color: var(--c-text, #111827); }
.sfh-art-rec-head b {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px;
  background: #dcfce7; color: #166534; font-size: 10px; font-weight: 600;
  animation: sfh-pop 6s ease-in-out infinite;
}
.sfh-art-row { display: flex; flex-direction: column; gap: 5px; padding: 8px 0; border-top: 1px solid #f1f2f4; }
.sfh-art-row span { font-size: 9.5px; line-height: 1; color: var(--c-text-tertiary, #6b7280); }
.sfh-art-row i { display: block; height: 7px; border-radius: 4px; background: #ddd6fe; transform-origin: left; animation: sfh-fill 6s ease-in-out infinite; }
.sfh-art-row:nth-child(3) i { width: 78%; animation-delay: .2s; }
.sfh-art-row:nth-child(4) i { width: 58%; animation-delay: .4s; }
@keyframes sfh-hl { 0% { transform: scaleX(0); opacity: 1; } 20% { transform: scaleX(1); } 90% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes sfh-pulse { 0%, 22% { transform: scale(1); } 30% { transform: scale(1.14); } 38%, 100% { transform: scale(1); } }
@keyframes sfh-fill { 0%, 36% { transform: scaleX(0); opacity: 1; } 52% { transform: scaleX(1); } 92% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes sfh-pop { 0%, 55% { transform: scale(.6); opacity: 0; } 62% { transform: scale(1.08); opacity: 1; } 68%, 92% { transform: scale(1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }

/* Section chips under the hero */
.sfh-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.sfh-article .sfh-jump a {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--c-border, #e5e7eb); background: #fff; text-decoration: none;
  font-size: 12.5px; font-weight: 500; color: var(--c-text-secondary, #4b5563);
}
.sfh-article .sfh-jump a:hover { border-color: var(--c-primary, #7c3aed); background: var(--c-primary-subtle, #ede9fe); color: var(--c-primary-text, #6d28d9); }

/* The diagram, inline, lighting up with the steps */
.sfh-flow { margin: 6px 0 14px; }
.sfh-flow svg { display: block; width: 100%; height: auto; }
.sfh-article .sfh-flow img { width: 100%; margin: 0; border: 0; border-radius: 20px; }
.sfh-flow .hsw-node { transition: opacity .2s ease; }
.sfh-flow.has-active .hsw-node:not(.is-on) { opacity: .35; }
.sfh-flow .hsw-node.is-on > rect:first-child { stroke: var(--c-primary, #7c3aed); stroke-width: 2.5; }
.sfh-flow .hsw-links line { stroke-dasharray: 5 6; animation: sfh-dash 1.4s linear infinite; }
@keyframes sfh-dash { to { stroke-dashoffset: -11; } }
.sfh-article ol.sfh-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.sfh-article ol.sfh-steps li {
  margin: 0; padding: 14px; border: 1px solid var(--c-border, #e5e7eb); border-radius: 14px; background: #fff;
  font-size: 13px; line-height: 1.55; color: var(--c-text-secondary, #4b5563); outline: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.sfh-steps li strong { color: var(--c-text, #111827); }
.sfh-steps li.is-on, .sfh-steps li:focus-visible { border-color: var(--c-primary, #7c3aed); box-shadow: 0 8px 22px rgba(124, 58, 237, .12); transform: translateY(-2px); }
.sfh-step-num {
  display: flex; width: 24px; height: 24px; margin-bottom: 10px; border-radius: 999px; align-items: center; justify-content: center;
  background: var(--c-primary-subtle, #ede9fe); color: var(--c-primary-text, #6d28d9); font-size: 12px; font-weight: 700;
  transition: background .15s, color .15s;
}
.sfh-steps li.is-on .sfh-step-num { background: var(--c-primary, #7c3aed); color: #fff; }
.sfh-article .sfh-flow-note { margin: 0; font-size: 13px; color: var(--c-text-tertiary, #6b7280); }

/* The five building blocks */
/* Two, then three: the diagram's "set up once" and "every time a document arrives". */
.sfh-blocks { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin: 4px 0 8px; }
.sfh-blocks > .sfh-block { grid-column: span 2; }
.sfh-blocks > .sfh-block:nth-child(-n+2) { grid-column: span 3; }
.sfh-block {
  display: flex; flex-direction: column; padding: 20px; border-radius: 16px;
  border: 1px solid var(--c-border, #e5e7eb); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.sfh-block:hover { border-color: #ddd6fe; box-shadow: 0 10px 28px rgba(76, 29, 149, .08); }
.sfh-block-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sfh-block-icon {
  width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: #f5f3ff; border: 1px solid var(--c-primary-subtle, #ede9fe); color: var(--c-primary, #7c3aed);
}
.sfh-block-num { font-size: 12px; font-weight: 700; color: #c4b5fd; }
.sfh-block-name { font-size: 16px; font-weight: 600; color: var(--c-text, #111827); }
.sfh-block-short { margin: 2px 0 8px; font-size: 12.5px; font-weight: 600; color: var(--c-primary-text, #6d28d9); }
.sfh-article .sfh-block p { flex: 1; margin: 0 0 14px; font-size: 13px; line-height: 1.6; color: var(--c-text-secondary, #4b5563); }
.sfh-article a.sfh-block-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; text-decoration: none; }
.sfh-block-link svg { transition: transform .15s; }
.sfh-block-link:hover svg { transform: translateX(2px); }

/* What happens in an execution */
.sfh-article ol.sfh-journey {
  position: relative; list-style: none; margin: 6px 0 14px; padding: 20px 22px 4px;
  border: 1px solid var(--c-border, #e5e7eb); border-radius: 16px; background: linear-gradient(180deg, #fff, #fcfbff);
}
.sfh-journey::before { content: ""; position: absolute; left: 33px; top: 30px; bottom: 30px; width: 2px; border-radius: 2px; background: #e9e5fb; }
.sfh-article .sfh-journey li.sfh-stage { position: relative; margin: 0; padding: 0 0 18px 34px; }
.sfh-stage-dot { position: absolute; left: 4px; top: 3px; width: 16px; height: 16px; border-radius: 999px; background: #fff; border: 3px solid #d4cbfb; }
.sfh-stage--smartflow .sfh-stage-dot { border-color: var(--c-primary, #7c3aed); background: var(--c-primary-subtle, #ede9fe); }
.sfh-stage-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 2px; }
.sfh-stage-name { font-size: 14px; color: var(--c-text, #111827); }
.sfh-who { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #f3f4f6; color: #4b5563; }
.sfh-who svg { width: 10px; height: 10px; }
.sfh-stage--smartflow .sfh-who { background: var(--c-primary-subtle, #ede9fe); color: var(--c-primary-text, #6d28d9); }
.sfh-stage--reviewer .sfh-who { background: #dbeafe; color: #1e40af; }
.sfh-stage--approver .sfh-who { background: #dcfce7; color: #166534; }
.sfh-article .sfh-stage p { margin: 0; font-size: 13.5px; color: var(--c-text-secondary, #4b5563); }

/* Example workflows: one tab for each example */
.sfh-tabs { margin: 6px 0 14px; }
.sfh-tablist {
  display: flex; flex-wrap: wrap; gap: 4px; width: fit-content; max-width: 100%; margin-bottom: 12px; padding: 4px;
  border-radius: 12px; background: var(--c-surface, #f8fafc); border: 1px solid var(--c-border, #e5e7eb);
}
.sfh-tab {
  height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; cursor: pointer;
  font: 500 13px var(--font, Inter, sans-serif); color: var(--c-text-secondary, #4b5563);
}
.sfh-tab:hover { color: var(--c-text, #111827); }
.sfh-tab[aria-selected="true"] { background: #fff; color: var(--c-primary-text, #6d28d9); box-shadow: 0 0 0 1px var(--c-border, #e5e7eb), 0 1px 2px rgba(17, 24, 39, .06); }
.sfh-tab:focus-visible { outline: 2px solid var(--c-primary, #7c3aed); outline-offset: 1px; }
.sfh-tabpanel:focus-visible { outline: 2px solid var(--c-primary, #7c3aed); outline-offset: 4px; border-radius: 16px; }
.sfh-tabpanel[hidden] { display: none; }
.sfh-article .sfh-tabpanel ol.sfh-journey { margin: 0; }

/* "Learn how" in the topbar of a screen that a guide explains. About Smartflow's
   links into Help (#1129) are drawn the same way. */
#topbarRight .sfh-learn, #admin-content .about-help .sfh-learn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; margin-right: 8px; padding: 0 10px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--c-text-secondary, #4b5563); text-decoration: none;
}
#topbarRight .sfh-learn svg, #admin-content .about-help .sfh-learn svg { color: var(--c-primary, #7c3aed); }
#topbarRight .sfh-learn:hover, #admin-content .about-help .sfh-learn:hover { background: var(--c-primary-subtle, #ede9fe); color: var(--c-primary-text, #6d28d9); }
#topbarRight .sfh-learn:focus-visible, #admin-content .about-help .sfh-learn:focus-visible { outline: 2px solid var(--c-primary, #7c3aed); outline-offset: 1px; }

/* Who does what */
.sfh-roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 4px 0 14px; }
.sfh-role { display: flex; gap: 14px; padding: 18px; border-radius: 16px; border: 1px solid var(--c-border, #e5e7eb); background: #fff; }
.sfh-role-icon {
  flex: none; width: 40px; height: 40px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ede9fe, #f5f3ff); color: var(--c-primary-text, #6d28d9);
}
.sfh-role-body { min-width: 0; }
.sfh-role-name { margin-bottom: 4px; font-size: 15px; font-weight: 600; color: var(--c-text, #111827); }
.sfh-article .sfh-role p { margin: 0 0 10px; font-size: 13px; line-height: 1.55; color: var(--c-text-secondary, #4b5563); }
.sfh-role-place {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 7px;
  background: var(--c-surface, #f8fafc); border: 1px solid var(--c-border, #e5e7eb); font-size: 12px; font-weight: 500; color: var(--c-text, #111827);
}
.sfh-role-place svg { color: var(--c-text-tertiary, #6b7280); }
.sfh-article p.sfh-note {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  background: #f5f3ff; border: 1px solid var(--c-primary-subtle, #ede9fe); font-size: 13px; color: var(--c-text, #111827);
}
.sfh-note > svg { flex: none; margin-top: 2px; color: var(--c-primary, #7c3aed); }

/* Where to find things: the two navigations, drawn like the app's */
.sfh-places { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 4px 0 14px; align-items: start; }
.sfh-place-panel { padding: 14px 10px 10px; border-radius: 16px; background: #f3f4f6; border: 1px solid var(--c-border, #e5e7eb); }
.sfh-place-panel--admin { background: #fff; }
.sfh-place-head { display: flex; align-items: center; gap: 8px; padding: 0 8px 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--c-text-tertiary, #6b7280); }
.sfh-article .sfh-place-intro { margin: 0 8px 8px; font-size: 12.5px; color: var(--c-text-secondary, #4b5563); }
.sfh-article .sfh-places ul { list-style: none; margin: 0; padding: 0; }
.sfh-article .sfh-places li { display: flex; gap: 12px; margin: 0; padding: 9px 8px; border-radius: 10px; }
.sfh-places li:hover { background: rgba(255, 255, 255, .75); }
.sfh-place-panel--admin li:hover { background: var(--c-surface, #f8fafc); }
.sfh-place-icon {
  flex: none; width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--c-border, #e5e7eb); color: #374151;
}
.sfh-place-name { font-size: 13.5px; font-weight: 600; color: var(--c-text, #111827); }
.sfh-place-desc { font-size: 12.5px; line-height: 1.5; color: var(--c-text-secondary, #4b5563); }

/* Where to start */
.sfh-start { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 4px 0 18px; }
.sfh-start-card {
  position: relative; padding: 18px 18px 16px; border-radius: 16px; border: 1px solid var(--c-border, #e5e7eb);
  background: linear-gradient(180deg, #fff, #fcfbff); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.sfh-start-card:hover { border-color: #c4b5fd; box-shadow: 0 10px 28px rgba(76, 29, 149, .10); transform: translateY(-1px); }
.sfh-start-icon {
  width: 34px; height: 34px; margin-bottom: 12px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--c-primary-subtle, #ede9fe); color: var(--c-primary-text, #6d28d9);
}
.sfh-start-label { margin-bottom: 4px; font-size: 12.5px; color: var(--c-text-tertiary, #6b7280); }
.sfh-article a.sfh-start-title { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; color: var(--c-text, #111827); text-decoration: none; }
.sfh-article a.sfh-start-title::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.sfh-start-card:hover .sfh-start-title { color: var(--c-primary-text, #6d28d9); }
.sfh-start-more { position: relative; z-index: 1; margin-top: 6px; font-size: 12.5px; color: var(--c-text-secondary, #4b5563); }

/* Narrower windows, and the Assistant open beside the page */
@media (max-width: 1280px) {
  .sfh-hero { grid-template-columns: minmax(0, 1fr); }
  .sfh-hero-art { display: none; }
  .sfh-article ol.sfh-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .sfh-roles, .sfh-places, .sfh-start { grid-template-columns: minmax(0, 1fr); }
  .sfh-blocks { grid-template-columns: minmax(0, 1fr); }
  .sfh-blocks > .sfh-block, .sfh-blocks > .sfh-block:nth-child(-n+2) { grid-column: auto; }
}
#sf-view-help.has-asst .sfh-hero { grid-template-columns: minmax(0, 1fr); }
#sf-view-help.has-asst .sfh-hero-art { display: none; }
#sf-view-help.has-asst .sfh-article ol.sfh-steps { grid-template-columns: minmax(0, 1fr); }
#sf-view-help.has-asst .sfh-roles, #sf-view-help.has-asst .sfh-places, #sf-view-help.has-asst .sfh-start, #sf-view-help.has-asst .sfh-blocks { grid-template-columns: minmax(0, 1fr); }
#sf-view-help.has-asst .sfh-blocks > .sfh-block { grid-column: auto; }

@media (prefers-reduced-motion: reduce) {
  .sfh-hero-art *, .sfh-hero-art *::after, .sfh-flow .hsw-links line { animation: none !important; }
  .sfh-steps li, .sfh-start-card, .sfh-btn svg, .sfh-caret svg, .sfh-row, .sfh-sub-item { transition: none; }
}
