/* ============================================================
   DirectRT User Guide — docs layout, layered on app.css tokens.
   Scoped to .help-* so it never touches the marketing pages.
   ============================================================ */

.help-body { background: var(--paper); }

/* ---------- Shell: sidebar + content ---------- */
.help-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 46px;
  align-items: start;
}

/* ---------- Sidebar ---------- */
.help-sidebar { align-self: start; }
.help-sidebar-inner {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  padding: 26px 8px 40px 2px;
  scrollbar-width: thin;
}
.help-side-head { margin-bottom: 16px; padding-right: 8px; }
.help-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 12px;
}
.help-eyebrow::before { content: ""; width: 20px; height: 2px; background: var(--coral); display: inline-block; }
.help-home {
  display: block; font-family: var(--serif); font-weight: 600; font-size: 1.32rem;
  color: var(--navy); letter-spacing: -.02em; line-height: 1.1; margin-bottom: 16px;
}
.help-home:hover { color: var(--blue-dk); }

.help-filter {
  width: 100%; font: inherit; font-size: .9rem;
  padding: 9px 12px; border: 1px solid var(--line-cool); border-radius: 10px;
  background: var(--card); color: var(--ink); outline: none;
}
.help-filter:focus { border-color: var(--blue-br); box-shadow: 0 0 0 3px var(--blue-tint); }
.help-filter::placeholder { color: var(--ink-faint); }

/* TOC tree */
.help-toc, .help-toc ul { list-style: none; margin: 0; padding: 0; }
.help-toc { margin-top: 8px; font-size: .905rem; }
.help-toc li { margin: 1px 0; }

.help-toc a {
  display: block; padding: 6px 12px; border-radius: 8px;
  color: var(--ink-soft); line-height: 1.35;
  border-left: 2px solid transparent;
}
.help-toc a:hover { background: var(--blue-tint); color: var(--blue-dk); }
.help-toc a.active {
  background: var(--blue-tint); color: var(--blue-dk); font-weight: 600;
  border-left-color: var(--blue);
}

/* Collapsible groups */
.help-toc details { margin: 1px 0; }
.help-toc summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px;
  font-weight: 600; color: var(--navy); line-height: 1.3;
}
.help-toc summary::-webkit-details-marker { display: none; }
.help-toc summary:hover { background: var(--paper); }
.help-toc summary::before {
  content: ""; flex: none; width: 0; height: 0; margin-left: 3px;
  border-style: solid; border-width: 5px 0 5px 7px;
  border-color: transparent transparent transparent var(--ink-faint);
  transition: transform .15s ease;
}
.help-toc details[open] > summary::before { transform: rotate(90deg); }
.help-toc details ul { margin-left: 12px; padding-left: 10px; border-left: 1px solid var(--line); }
.help-toc .toc-self a { font-weight: 600; color: var(--blue-dk); }

/* ---------- Topic pages: full-bleed, one page — navy menu + white content ----------
   No beige frame, no rounded cards, no independent scroll panes. The menu and the
   content are two columns of a single page that scrolls as one, like the rest of the site. */
.help-topic .help-shell {
  max-width: none;                               /* edge to edge — kill the beige frame */
  padding: 0;
  gap: 0;                                        /* blue meets white on a sharp seam */
}
.help-topic .help-sidebar {
  background:
    radial-gradient(420px 220px at 24% 100%, rgba(47,146,222,.34), transparent 60%),  /* soft glow anchored to the bottom edge */
    radial-gradient(420px 220px at 20% -10%, rgba(47,146,222,.18), transparent 60%),
    linear-gradient(160deg, var(--navy-2), var(--navy) 70%);
  border-radius: 0;
  align-self: stretch;                           /* full height, flush left */
  margin: 0;
}
.help-topic .help-sidebar-inner {
  position: sticky;                              /* the menu is its own scroll pane */
  top: 72px;                                     /* sits under the sticky header */
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  overscroll-behavior: contain;                 /* never chains to the document */
  padding: 30px 16px 48px 28px;
  scrollbar-width: none;                         /* keep the clean edge */
}
.help-topic .help-sidebar-inner::-webkit-scrollbar { display: none; }
/* white content runs flush to the navy menu, no border/shadow/radius */
.help-topic .help-main.sheet {
  align-self: stretch;                           /* fill the column so no beige shows */
  background: var(--card);
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  padding: 36px 52px 72px;
}
/* content stays left-aligned (tied to the menu); the pager matches the reading width
   so it doesn't stretch into the empty space on the right */
.help-topic .help-pager { max-width: 760px; }
.help-topic .help-eyebrow { color: #8fc4f0; }
.help-topic .help-home { color: #fff; }
.help-topic .help-home:hover { color: #cfe3f6; }
.help-topic .help-filter {
  background: #fff; border-color: transparent; color: var(--ink);
}
.help-topic .help-filter::placeholder { color: var(--ink-faint); }
.help-topic .help-filter:focus { border-color: var(--blue-br); box-shadow: 0 0 0 3px rgba(47,146,222,.28); }
.help-topic .help-toc a { color: #c4d5e6; }
.help-topic .help-toc a:hover { background: rgba(255,255,255,.09); color: #fff; }
/* selected item is white and bleeds to the seam so it connects to the page */
.help-topic .help-toc a.active {
  background: #fff; color: var(--navy); font-weight: 600;
  border-left-color: transparent;
  border-radius: 8px 0 0 8px;
  margin-right: -12px; padding-right: 18px;
}
.help-topic .help-toc summary { color: #eef4fb; }
.help-topic .help-toc summary:hover { background: rgba(255,255,255,.07); }
.help-topic .help-toc summary::before { border-left-color: #fff; }
.help-topic .help-toc details ul { border-left-color: rgba(255,255,255,.16); }
.help-topic .help-toc .toc-self a { color: #8fc4f0; }
.help-topic .help-toc .toc-plain { color: #9fb4c9; }

/* ---------- Content ---------- */
.help-main { min-width: 0; padding: 30px 0 70px; }

/* Topic pages: a white "sheet" of content against the beige chrome */
.help-main.sheet {
  background: var(--card);
  border: 1px solid var(--line-cool);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 34px 46px 56px;
  margin: 26px 0 64px;
}

.help-crumbs { font-size: .82rem; color: var(--ink-faint); margin-bottom: 18px; }
.help-crumbs a { color: var(--ink-faint); }
.help-crumbs a:hover { color: var(--blue); }
.help-crumbs span { margin: 0 7px; opacity: .6; }

.help-content { max-width: 760px; }
.help-content h1 {
  font-family: var(--serif); font-weight: 600; color: var(--navy);
  font-size: clamp(2rem, 3.6vw, 2.7rem); letter-spacing: -.03em; line-height: 1.08;
  margin: 0 0 .7em;
}
.help-content h2 {
  font-family: var(--sans); font-weight: 700; color: var(--navy);
  font-size: 1.28rem; letter-spacing: -.01em; line-height: 1.25;
  margin: 2.1em 0 .7em; padding-top: .2em;
}
.help-content h2:first-child, .help-content h1 + h2 { margin-top: .4em; }
.help-content h3 {
  font-family: var(--sans); font-weight: 700; color: var(--navy);
  font-size: 1.05rem; margin: 1.6em 0 .5em;
}
.help-content p { margin: 0 0 1.05em; color: var(--ink); line-height: 1.7; }
.help-content ul, .help-content ol { margin: 0 0 1.15em; padding-left: 1.35em; }
.help-content li { margin: .32em 0; line-height: 1.65; }
.help-content a { color: var(--blue-dk); border-bottom: 1px solid var(--blue-tint); }
.help-content a:hover { color: var(--blue); border-bottom-color: var(--blue-br); }
.help-content a.ext::after {
  content: "\2197"; font-size: .8em; margin-left: 2px; color: var(--ink-faint);
  vertical-align: super; border: none;
}
.help-content strong { color: var(--navy); }
.help-content .term { color: var(--blue-dk); font-weight: 700; }
.help-content hr { border: none; border-top: 1px solid var(--line); margin: 2em 0; }

/* QuickInfo lead callout */
.help-content .help-quick {
  background: var(--blue-tint);
  border-left: 3px solid var(--blue);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px; margin: 0 0 1.4em;
  color: var(--navy); font-size: 1.05rem; line-height: 1.6;
}
.help-content .help-quick strong, .help-content .help-quick .term { color: var(--navy); }

/* Code */
.help-content code {
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em; background: var(--paper-2); border: 1px solid var(--line);
  padding: .1em .38em; border-radius: 6px; color: var(--blue-dk);
}
.help-content pre.help-code {
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88rem; line-height: 1.55;
  background: var(--navy); color: #e9f1f8;
  padding: 16px 18px; border-radius: 12px; margin: 0 0 1.3em;
  overflow-x: auto; white-space: pre-wrap; word-break: break-word;
}
.help-content pre.help-code code { background: none; border: none; color: inherit; padding: 0; }

/* Images */
.help-content img {
  border: 1px solid var(--line-cool); border-radius: 10px;
  box-shadow: var(--shadow-sm); background: var(--card);
  margin: 6px 0; max-width: 100%; height: auto;
}
.help-content figure { margin: 0 0 1.4em; }
.help-content figcaption { font-size: .84rem; color: var(--ink-faint); margin-top: 8px; }

/* Layout tables (old side-by-side blocks) — de-gridded, kept readable */
.help-content table.help-layout { width: 100%; border-collapse: collapse; margin: 0 0 1em; }
.help-content table.help-layout td { vertical-align: top; padding: 0 14px 0 0; }

/* Data tables */
.help-content table.help-table {
  border-collapse: collapse; width: 100%; margin: 0 0 1.5em;
  font-size: .92rem; background: var(--card);
  border: 1px solid var(--line-cool); border-radius: 10px; overflow: hidden;
}
.help-content table.help-table th,
.help-content table.help-table td {
  border: 1px solid var(--line-cool); padding: 7px 11px; text-align: left; vertical-align: top;
}
.help-content table.help-table th {
  background: var(--blue-tint); color: var(--navy); font-weight: 700; font-size: .82rem;
  letter-spacing: .02em;
}
.help-content table.help-table tr:nth-child(even) td { background: var(--paper-2); }
.help-table-wrap { overflow-x: auto; margin: 0 0 1.5em; }
.help-table-wrap .help-table { margin: 0; }

/* ---------- Prev / next pager ---------- */
.help-pager {
  display: flex; gap: 16px; margin-top: 46px; padding-top: 26px;
  border-top: 1px solid var(--line);
}
.help-pager a {
  flex: 1; display: flex; flex-direction: column; gap: 3px;
  padding: 14px 18px; border: 1px solid #cfe1f4; border-radius: 12px;
  background: var(--blue-tint);                   /* the soft callout blue */
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.help-pager a:hover { background: #dcebf9; border-color: var(--blue-br); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.help-pager .next { text-align: right; }
.help-pager .lbl { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.help-pager .ttl { font-weight: 600; color: var(--navy); }
.help-pager a.disabled { visibility: hidden; }

/* ---------- Landing / index extras ---------- */
.help-landing-body { max-width: none; }
.help-content .help-lede { font-size: 1.1rem; line-height: 1.6; color: var(--ink-soft); margin: 0 0 1.6em; }
.help-start { margin-top: .2em !important; }
.help-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 6px 0 8px; }
.help-card {
  display: block; padding: 20px 22px; border: 1px solid var(--line-cool);
  border-radius: 14px; background: var(--card); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.help-card:hover { border-color: var(--blue-br); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.help-card h3 { margin: 0 0 .3em; color: var(--navy); }
.help-card p { margin: 0; color: var(--ink-soft); font-size: .94rem; }
.help-card .k { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); display: block; margin-bottom: 8px; }

/* ---------- Mobile drawer ---------- */
.help-side-toggle {
  display: none; position: fixed; z-index: 55; left: 18px; bottom: 18px;
  align-items: center; gap: 8px; padding: 12px 18px;
  background: var(--navy); color: #fff; border: none; border-radius: 999px;
  font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
  box-shadow: var(--shadow-md);
}
.help-scrim { display: none; }
/* when the mobile contents drawer is open, freeze the page behind it */
body.help-nav-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }

@media (max-width: 940px) {
  .help-shell { grid-template-columns: 1fr; gap: 0; padding: 0 20px; }
  .help-cards { grid-template-columns: 1fr; }
  .help-side-toggle { display: inline-flex; }
  .help-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 70;
    width: 320px; max-width: 86vw;
    background: var(--paper-2); border-right: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    transform: translateX(-102%); transition: transform .22s ease;
  }
  .help-sidebar.open { transform: none; }
  /* on mobile the drawer itself is the scroller — reset the inner (incl. topic pages) */
  .help-sidebar-inner,
  .help-topic .help-sidebar-inner {
    position: static; max-height: none; overflow: visible; padding: 22px 16px 40px;
  }
  .help-topic .help-sidebar { margin: 0; border-radius: 0; }
  .help-scrim.show { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(14,35,56,.4); cursor: pointer; }
  .help-main { padding: 22px 0 90px; }
  .help-main.sheet { padding: 24px 20px 60px; margin: 16px 0 60px; border-radius: 12px; }
}
