/* In-app documentation. Uses the app's own tokens — no literals, so the
   panel follows the theme instead of drifting from it. */

#view-docs { flex: 1; min-height: 0; overflow: hidden; }

.docs-wrap {
  display: grid; grid-template-columns: 260px 1fr;
  gap: 16px; padding: 16px; height: 100%; min-height: 0;
}
@media (max-width: 860px) { .docs-wrap { grid-template-columns: 1fr; } }

.docs-nav { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.docs-link {
  display: block; text-align: start; cursor: pointer;
  background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; font: inherit; line-height: 1.4;
}
.docs-link:hover { border-color: var(--accent); }
.docs-link.on { border-color: var(--accent); background: var(--panel); }
.docs-link b { display: block; font-size: 14px; }
.docs-link span { display: block; color: var(--dim); font-size: 12px; margin-top: 2px; }

.docs-body {
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  padding: 20px 24px; overflow-y: auto; min-height: 0;
}
.docs-hint { color: var(--dim); }
.docs-meta {
  color: var(--dim); font-size: 12px; direction: ltr; text-align: start;
  border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 14px;
}

/* Rendered markdown. Capped measure: these are documents, and a heading
   stretched across a 2,000px monitor is unreadable regardless of theme. */
.docs-md { max-width: 74ch; }
.docs-md h1 { font-size: 21px; margin: 0 0 6px; }
.docs-md h2 { font-size: 17px; margin: 22px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.docs-md h3 { font-size: 15px; margin: 18px 0 6px; color: var(--accent); }
.docs-md p, .docs-md li { line-height: 1.65; }
.docs-md strong { color: #fff; }
.docs-md code {
  background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 5px; font-size: 12.5px; direction: ltr; unicode-bidi: embed;
}
.docs-md pre { background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; overflow-x: auto; direction: ltr; }
.docs-md pre code { border: 0; background: none; padding: 0; }
.docs-md hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.docs-md blockquote {
  margin: 12px 0; padding: 2px 12px; color: var(--dim);
  border-inline-start: 3px solid var(--line);
}

/* Tables carry the ladder itself, so they are the one thing that must stay
   legible at any width — hence the scroll container rather than a squeeze. */
.docs-md table {
  border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13.5px;
  display: block; overflow-x: auto;
}
.docs-md th, .docs-md td {
  border: 1px solid var(--line); padding: 6px 9px; text-align: start;
  vertical-align: top;
}
.docs-md th { background: var(--card); font-weight: 600; }
