/* RIFF docs page. Uses the design tokens from app.css (--bg, --panel, --acid, --text, --muted,
   --line, --line-acid, --down). No new colors invented here. */

/* Lives inside the shared app shell (.app > .side + .main). Content on the left, in-page
   section nav (TOC) sticky on the right, so the site's left sidebar stays the primary nav. */
.docs{display:grid;grid-template-columns:minmax(0,1fr) 236px;gap:40px;max-width:1180px;padding:6px 2px 64px;align-items:start}

/* Right: sticky grouped TOC (in-page section nav) */
.toc{position:sticky;top:16px;align-self:start;display:flex;flex-direction:column;gap:18px;max-height:calc(100vh - 32px);overflow-y:auto}
.toc .grp{display:flex;flex-direction:column;gap:2px}
.toc .grp-h{color:var(--muted);font-size:10.5px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;padding:6px 10px 8px}
.toc a{display:block;padding:7px 10px;border-radius:8px;color:var(--muted);text-decoration:none;font-size:13px;font-weight:600;line-height:1.35}
.toc a:hover{color:var(--text);background:var(--card-hover)}
.toc a.on{color:var(--acid);background:var(--acid-dim)}

/* Left: prose column */
.doc{max-width:840px;min-width:0}
.doc section{margin-bottom:44px;scroll-margin-top:90px}
.doc h1{font-size:26px;font-weight:800;letter-spacing:-.01em;margin-bottom:10px}
.doc h2{font-size:19px;font-weight:800;letter-spacing:-.005em;margin-bottom:12px;padding-top:6px}
.doc h3{font-size:14px;font-weight:800;color:var(--text);margin:18px 0 8px}
.doc p{color:#c7cfc3;font-size:13.5px;line-height:1.65;margin-bottom:12px}
.doc p.lead{color:var(--muted);font-size:14.5px}
.doc ul,.doc ol{color:#c7cfc3;font-size:13.5px;line-height:1.65;margin:0 0 12px 20px}
.doc li{margin-bottom:5px}
.doc a{color:var(--acid);text-decoration:none}
.doc a:hover{text-decoration:underline}
.doc strong,.doc b{color:var(--text)}

.doc table{width:100%;border-collapse:collapse;font-size:12.5px;margin:6px 0 16px}
.doc th{text-align:left;color:var(--muted);font-weight:700;font-size:10px;text-transform:uppercase;letter-spacing:.06em;padding:9px 12px;border-bottom:1px solid var(--line)}
.doc td{padding:9px 12px;border-bottom:1px solid var(--line);color:#c7cfc3}
.doc td code,.doc td.mono{font-family:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,monospace;font-size:11.5px;color:var(--text)}
.doc tr:last-child td{border-bottom:none}

/* Inline code */
.doc code{font-family:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;background:var(--card-2);border:1px solid var(--line);border-radius:5px;padding:1px 6px;color:var(--text)}

/* Code blocks: static text, copyable, CSP-safe (no highlighter). */
.code{background:var(--card-2);border:1px solid var(--line-acid);border-radius:11px;padding:14px 16px;margin:6px 0 18px;overflow-x:auto}
.code .cap{color:var(--muted);font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;font-weight:700;margin-bottom:9px}
.code pre{font-family:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;line-height:1.6;color:var(--text);white-space:pre;overflow-x:auto}

/* Trust chips */
.trust{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 18px}
.trust span{background:var(--acid-dim);color:var(--acid);border:1px solid var(--line-acid);border-radius:8px;padding:6px 11px;font-size:11.5px;font-weight:700}

/* Callouts */
.callout{background:var(--panel);border:1px solid var(--line);border-left:3px solid var(--line-acid);border-radius:9px;padding:12px 15px;margin:6px 0 18px;color:#c7cfc3;font-size:13px;line-height:1.6}
.callout b{color:var(--text)}
.callout.warn{border-left-color:var(--down)}
.callout.warn b{color:var(--down)}

/* Footer nav at the end of the content: back to top + back to the board. */
.docnav{display:flex;gap:12px;align-items:center;margin-top:40px;padding-top:20px;border-top:1px solid var(--line)}
.docnav a{color:var(--muted);font-size:13px;font-weight:700;text-decoration:none;padding:8px 14px;border:1px solid var(--line);border-radius:9px}
.docnav a:hover{color:var(--acid);border-color:var(--line-acid)}

@media(max-width:900px){
  .docs{grid-template-columns:1fr;gap:20px;padding:4px 0 56px}
  /* TOC moves above the content on narrow screens (content-first in the DOM). */
  .toc{order:-1;position:static;max-height:none;overflow-y:visible;flex-direction:row;flex-wrap:wrap;gap:10px 20px}
  .toc .grp{flex:1 1 200px}

  /* Wide tables (addresses, selectors) scroll inside themselves instead of pushing the page
     sideways on a phone. Same approach .code already uses at docs.css:40. Scoped to this
     media query: display:block would defeat the desktop width:100% rule at docs.css:30. */
  .doc table{display:block;overflow-x:auto;max-width:100%}
  .doc th,.doc td{white-space:nowrap}
  .doc td code{white-space:normal;word-break:break-all}
}
