/* The guide: its opening panel, contents and reading panels. */
/* ---------- guide: an opening panel (what the app does, who does what, the steps as one flow), then the stages on reading
   panels beside contents that open only the stage being read. The section a link points to lights up on arrival. ---------- */
.guide { padding: 24px 0 56px; }
.g-ico { display: block; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.g-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px 48px; padding: 32px 32px 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.g-intro h1 { margin: 0 0 12px; font-size: 32px; letter-spacing: -.01em; }
.g-intro .g-use { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: var(--fs-sm); line-height: 1.55; }
.g-intro p { max-width: 56ch; margin: 0; color: var(--ink-2); font-size: 17px; line-height: 1.6; }
.g-roles { display: grid; margin: 0; align-self: start; }
.g-roles > div { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; padding: 12px 0; }
.g-roles > div + div { border-top: 1px solid var(--line); }
.g-roles > div:first-child { padding-top: 0; }
.g-roles .g-ico { grid-row: span 2; width: 32px; height: 32px; padding: 7px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent); }
.g-roles dt { font-weight: 600; }
.g-roles dd { margin: 2px 0 0; color: var(--ink-2); font-size: var(--fs-sm); }
/* the steps as one connected flow; Insights follows the four on a dashed line */
.g-flow { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 -32px; padding: 24px 32px 28px; list-style: none; border-top: 1px solid var(--line); background: var(--sunken); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.g-flow li { position: relative; }
.g-flow li:not(:last-child)::after { content: ""; position: absolute; top: 17px; left: 44px; right: 8px; border-top: 1.5px solid var(--line-2); }
.g-flow li:nth-last-child(2)::after { border-top-style: dashed; }
.g-flow a { display: grid; justify-items: start; gap: 4px; padding-right: 20px; color: var(--ink-2); font-size: var(--fs-sm); text-decoration: none; }
.g-node { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 8px; border-radius: var(--r-pill); border: 1.5px solid var(--accent); background: var(--panel); color: var(--accent); font-family: var(--font-brand); font-size: 15px; font-weight: 600; transition: background-color var(--t), color var(--t); }
.g-flow .then .g-node { border-color: var(--line-2); color: var(--ink-2); }
.g-flow b { color: var(--ink); font-family: var(--font-brand); font-size: var(--fs-md); font-weight: 600; }
.g-flow a:hover b { color: var(--accent); }
.g-flow a:hover .g-node { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.g-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 32px; }
/* contents: every stage, with the sections of the one being read */
.g-toc { position: sticky; top: calc(var(--bar-h) + 20px); font-size: var(--fs-sm); }
.g-toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.g-toc ol ol { display: none; margin: 4px 0 6px 11px; padding-left: 14px; border-left: 1px solid var(--line); }
.g-toc li.open > ol { display: grid; }
.g-toc a { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: var(--r); color: var(--ink-2); text-decoration: none; transition: color var(--t), background-color var(--t); }
.g-toc > ol > li > a { padding-left: 0; color: var(--ink); font-weight: 600; }
.g-toc a:hover { color: var(--accent); }
.g-toc ol ol a[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }
.g-n { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); font-family: var(--font-brand); font-size: var(--fs-xs); font-weight: 600; }
.g-mark { color: var(--ink-3); }
.g-toc > ol > li > a[aria-current="true"] .g-n { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
/* each stage on its own reading panel */
.g-main { display: grid; gap: 24px; min-width: 0; }
.g-stage { padding: 28px 32px 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.g-stage-head { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.g-stage-head h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; font-family: var(--font-brand); font-size: 24px; }
.g-stage-head h2 .g-n { width: 32px; height: 32px; border: 1.5px solid var(--accent); color: var(--accent); font-size: 15px; }
.g-stage-head p { margin: 0; max-width: 68ch; font-size: 17px; }
.g-stage-head .g-where { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 3px 10px 3px 8px; border-radius: var(--r-pill); background: var(--sunken); color: var(--ink-2); font-size: var(--fs-sm); }
.g-sec { margin: 0 -16px; padding: 22px 16px; border-radius: var(--r-lg); scroll-margin-top: calc(var(--bar-h) + 16px); outline: none; }
.g-sec + .g-sec { margin-top: -4px; }
.g-sec h3 { margin: 0 0 10px; font-family: var(--font-brand); font-size: 18px; }
.g-sec p, .g-sec ul { margin: 0; max-width: 68ch; }
.g-sec > * + * { margin-top: 14px; }
.g-sec ul { display: grid; gap: 6px; padding-left: 20px; }
.g-sub { margin: 20px 0 0; font-size: var(--fs-sm); font-weight: 600; }
/* a screen's words and what they mean: the word in its own column, so a reader finds it by scanning */
.g-terms { display: grid; margin: 0; border-top: 1px solid var(--line); }
.g-terms > div { display: grid; grid-template-columns: minmax(9rem, 12rem) minmax(0, 1fr); gap: 4px 24px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.g-terms dt { font-weight: 600; }
.g-terms dd { margin: 0; color: var(--ink-2); }
.g-sec > .g-terms + * { margin-top: 20px; }
.g-sec.arrived { animation: arrive 2.4s ease-out; }
@keyframes arrive { 0%, 35% { background: var(--accent-soft); } 100% { background: transparent; } }
.g-kpi { padding-left: 32px; }
.g-kpi h4 { margin: 0 0 8px; font-size: var(--fs-md); font-weight: 600; }
.g-kpi .formula { display: inline-block; margin-bottom: 0; }
.g-calc { padding: 14px 16px; border-radius: var(--r); background: var(--sunken); }
.g-calc h4 { margin: 0 0 6px; font-size: var(--fs-sm); font-weight: 600; }
.g-calc ul { font-size: var(--fs-sm); }
@media (max-width: 960px) {
  .g-hero { grid-template-columns: 1fr; }
  .g-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 24px; }
  .g-flow li:nth-child(3)::after { display: none; }
  .g-body { grid-template-columns: 1fr; gap: 24px; }
  .g-toc { position: static; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
  .g-toc li.open > ol { display: none; }  /* on one column the contents is a list of stages; the stages follow below */
}
@media (max-width: 600px) {
  .g-hero { padding: 24px 16px 0; gap: 24px; }
  .g-intro h1 { font-size: 28px; }
  .g-flow { grid-template-columns: 1fr; margin: 0 -16px; padding: 20px 16px; row-gap: 0; }
  .g-flow li:not(:last-child)::after { display: block; top: 40px; bottom: -4px; left: 17px; right: auto; border-top: 0; border-left: 1.5px solid var(--line-2); }
  .g-flow li:nth-last-child(2)::after { border-left-style: dashed; }
  .g-flow a { grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; padding: 0 0 16px; }
  .g-node { grid-row: span 2; margin: 0; }
  .g-stage { padding: 20px 16px 4px; }
  .g-terms > div { grid-template-columns: 1fr; }
  .g-kpi { padding-left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .g-sec.arrived { animation: none; background: var(--accent-soft); }
}
