/* CSVisualizer — the layout of a document page (v0.9.7, js-shared/doc-toc.js): as the help page, a table of contents
   at the side (sticky), the sections beside it, and a link back to the table of contents at the end of every section.
   Narrow screens: the table of contents comes first, above the sections. Reads the site tokens (css/site-header.css). */
.doc-layout {
  max-width: 1100px; width: 100%; margin: 0 auto; padding: 28px 24px 48px; box-sizing: border-box; flex: 1;
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start;
}
.doc-layout > main { max-width: none; width: auto; margin: 0; padding: 0; min-width: 0; }
.doc-toc {
  position: sticky; top: var(--doc-toc-top, 16px); padding: 18px 18px 14px; box-sizing: border-box;
  max-height: calc(100vh - var(--doc-toc-top, 16px) - 16px); overflow-y: auto;
  background: var(--csv-surface); border: 1px solid var(--csv-line); border-radius: 12px; font-family: var(--csv-font);
}
.doc-toc:focus { outline: none; }
.doc-toc-title { margin: 0 0 10px; font-size: 16px; color: var(--csv-accent-text); }
.doc-toc ol { margin: 0; padding-inline-start: 20px; padding-inline-end: 0; line-height: 1.9; font-size: 14px; }
.doc-toc ol.doc-toc-sub { list-style: disc; padding-inline-start: 16px; font-size: 13px; line-height: 1.7; }
.doc-toc a { color: var(--csv-accent-text); }
.doc-toc a[dir] { unicode-bidi: isolate; }
.doc-toc ol.doc-toc-numbered { list-style: none; padding-inline-start: 0; }
.doc-toc-back { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--csv-line); font-size: 14px; }
.doc-to-toc { margin: 10px 0 0 !important; font-size: 13.5px; text-align: end; }
.doc-to-toc a { color: var(--csv-accent-text); text-decoration: none; font-weight: 600; }
.doc-to-toc a:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .doc-layout { grid-template-columns: 1fr; padding: 18px 14px 36px; gap: 16px; }
  .doc-toc { position: static; max-height: none; }
}
@media print {
  .doc-layout { display: block; padding: 0; }
  .doc-toc, .doc-to-toc { display: none; }
}
