/* Long-form document pages (/docs, /privacy).
 *
 * base.css is built for the two credential-entry cards: a 440px box centred in the
 * viewport. A policy or an API reference is neither narrow nor short, so this file
 * widens the card, re-anchors the page to the top — a vertically centred flex child
 * taller than its container puts its own top out of reach — and supplies the element
 * styles that Markdown output needs and a form never did. It loads after base.css via
 * the extra_css block, so every rule here is an override, not a duplicate.
 */

.page-body { align-items: flex-start; }

.card--document {
  max-width: 860px;
  padding: 44px 48px 52px;
}

/* ── Document typography ── */
.doc { font-size: 15px; line-height: 1.65; color: var(--text-secondary); }

.doc > :first-child { margin-top: 0; }
.doc > :last-child  { margin-bottom: 0; }

.doc h1 {
  font-size: 27px; line-height: 1.25; margin: 0 0 20px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.doc h2 {
  font-size: 19px; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.2px; margin: 40px 0 12px;
}
.doc h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 28px 0 10px; }
.doc h4 { font-size: 14.5px; font-weight: 600; color: var(--text-primary); margin: 22px 0 8px; }

.doc p  { margin: 0 0 14px; }
.doc strong { color: var(--text-primary); font-weight: 600; }
.doc hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }

.doc a { color: var(--accent-text); text-decoration: none; border-bottom: 1px solid transparent; }
.doc a:hover { border-bottom-color: currentColor; }

.doc ul, .doc ol { margin: 0 0 14px; padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc li > ul, .doc li > ol { margin-top: 6px; }

.doc blockquote {
  margin: 0 0 16px; padding: 12px 16px;
  background: var(--accent-light); border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
}
.doc blockquote > :last-child { margin-bottom: 0; }

/* ── Code ── */
.doc code {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.875em; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 1.5px 5px; color: var(--text-primary);
  overflow-wrap: break-word;
}
.doc pre {
  margin: 0 0 16px; padding: 14px 16px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px;
  overflow-x: auto;
}
.doc pre code { background: none; border: 0; padding: 0; font-size: 13px; line-height: 1.55; }

/* Fallback rendering when the Markdown library is unavailable (see mcp/documents.py). */
.doc pre.doc-raw { white-space: pre-wrap; font-size: 12.5px; }

/* ── Tables ──
 * Both documents carry their substance in tables, several of them wider than the card
 * on a phone. The wrapper scrolls the table rather than the page. */
.doc table {
  width: 100%; border-collapse: collapse; margin: 0 0 18px;
  font-size: 14px; display: block; overflow-x: auto;
}
.doc thead th {
  text-align: left; font-weight: 600; color: var(--text-primary);
  background: var(--bg-surface); white-space: nowrap;
}
.doc th, .doc td {
  border: 1px solid var(--border); padding: 8px 12px; vertical-align: top;
}
.doc tbody tr:nth-child(even) td { background: #fcfcfd; }

/* ── Small screens ── */
@media (max-width: 640px) {
  .page-body { padding: 24px 12px; }
  .card--document { padding: 28px 20px 34px; border-radius: 10px; }
  .doc { font-size: 14.5px; }
  .doc h1 { font-size: 23px; }
  .doc h2 { font-size: 17.5px; margin-top: 32px; }
}
