/* Legal and support pages. Self-contained (no app JS, no web fonts); colours match the app (public/style.css tokens). */
:root {
  color-scheme: dark;
  --bg: #0b0d10; --surface: #14171c; --raised: #1c2026;
  --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .18);
  --text: #f2f4f7; --muted: #98a2ad; --accent: #ffb020; --danger: #ff5a4f; --info: #4da3ff;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 1.0625rem/1.6 var(--font);
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
main { max-width: 46rem; margin: 0 auto; }
a { color: var(--info); text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.top { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; justify-content: space-between; max-width: 46rem; margin: 0 auto 8px; font-size: .9375rem; }
.top a { color: var(--muted); }
.top .brand { color: var(--text); font-weight: 600; text-decoration: none; }
h1 { font-size: 1.75rem; line-height: 1.25; margin: 16px 0 4px; }
h2 { font-size: 1.25rem; line-height: 1.3; margin: 36px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
h3 { font-size: 1.0625rem; margin: 22px 0 6px; }
h2 a.self, h3 a.self { color: var(--muted); text-decoration: none; font-weight: 400; margin-left: 6px; opacity: .55; }
h2 a.self:hover, h3 a.self:hover { opacity: 1; }
p, ul, ol { margin: 8px 0; }
li { margin: 4px 0; }
.meta { color: var(--muted); font-size: .9375rem; margin: 0 0 16px; }
.summary { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; padding: 12px 16px; margin: 16px 0; }
.summary h2 { border: 0; margin: 4px 0; padding: 0; font-size: 1.0625rem; }
.summary ul { padding-left: 1.2em; }
.safety { border-left: 4px solid var(--danger); background: var(--surface); border-radius: 0 16px 16px 0; padding: 4px 16px 8px; margin: 16px 0; }
.safety h2 { border: 0; color: var(--danger); margin-top: 12px; padding-top: 0; }
.note { color: var(--muted); font-size: .9375rem; }
.draft { border: 1px dashed var(--accent); color: var(--accent); border-radius: 12px; padding: 8px 12px; font-size: .9375rem; margin: 8px 0 16px; }
nav.toc { background: var(--surface); border-radius: 16px; padding: 8px 16px; margin: 16px 0; font-size: .9375rem; }
nav.toc ol { padding-left: 1.4em; columns: 2 14rem; column-gap: 24px; }
nav.toc li { break-inside: avoid; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; margin: 12px 0; display: block; overflow-x: auto; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
code { font: .875em ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--raised); padding: 1px 5px; border-radius: 6px; overflow-wrap: anywhere; }
.cards { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.cards a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; color: var(--text); text-decoration: none; min-height: 48px; }
.cards a:hover, .cards a:focus-visible { border-color: var(--accent); }
.cards strong { display: block; font-size: 1.0625rem; }
.cards span { color: var(--muted); font-size: .9375rem; }
footer { max-width: 46rem; margin: 40px auto 0; color: var(--muted); font-size: .875rem; border-top: 1px solid var(--line); padding-top: 12px; }
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; font-size: 11pt; padding: 0; }
  a { color: #000; }
  .top, nav.toc, h2 a.self, h3 a.self { display: none; }
  .summary, .safety, nav.toc, .draft { background: none; border-color: #000; color: #000; }
  .safety h2 { color: #000; }
  .note, .meta, th, footer { color: #333; }
  h2 { break-after: avoid; border-color: #999; }
  table { display: table; }
  code { background: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
/* phones: tables become stacked rows (first cell as the row's heading; data-label names the other cells where a table has them) */
@media screen and (max-width: 600px) {
  table, tbody, tr, td { display: block; width: auto; }
  thead { display: none; }
  tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  td { border: 0; padding: 2px 0; }
  td:first-child { font-weight: 600; color: var(--text); }
  td[data-label]::before { content: attr(data-label); color: var(--muted); font-weight: 600; }
}
