/* Terms pages, on top of landing.css: the site header, a side list of the documents and their sections, the text at reading width. */
.legal .wrap { gap: 2.5rem; }
.legal main { display: grid; grid-template-columns: 15rem minmax(0, 44rem); gap: 3.5rem; align-items: start; }
.side { position: sticky; top: 1.5rem; display: grid; gap: 1.5rem; max-height: calc(100dvh - 3rem); overflow-y: auto; font-size: 0.92rem; }
.home { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; font-weight: 600; text-decoration: none; justify-self: start; }
.home:hover { color: var(--accent); }
.docs { display: grid; gap: 0.15rem; }
.docs a { padding: 0.6rem 0.8rem; border-radius: 10px; color: var(--muted); font-weight: 500; text-decoration: none; line-height: 1.3; }
.docs a:hover { color: var(--ink); background: var(--sunk); }
.docs a[aria-current="page"] { color: var(--ink); background: var(--surface); font-weight: 600; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; }
.toc a { display: block; padding: 0.3rem 0.8rem; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--ink); }

.doc { line-height: 1.7; }
.doc h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); }
.doc h2 { font-size: 1.25rem; margin: 2.5rem 0 0.6rem; scroll-margin-top: 1.5rem; }
.doc p { max-width: none; margin: 0.8rem 0; }
.doc .meta { color: var(--muted); font-size: 0.9rem; margin-top: 0.75rem; }
.doc a { color: var(--accent); text-underline-offset: 0.15em; }
.doc ul { padding-left: 1.25rem; margin: 0.8rem 0; }
.doc li { margin: 0.45rem 0; }
.doc mark { background: var(--todo); color: var(--todo-ink); border-radius: 4px; padding: 0 0.25em; }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.95rem; display: block; overflow-x: auto; margin: 1rem 0; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 600; white-space: nowrap; }

@media (max-width: 820px) {
  .legal main { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .side { position: static; max-height: none; overflow: visible; gap: 0.75rem; }
  .docs { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .docs a { display: flex; align-items: center; min-height: 44px; padding: 0.45rem 0.7rem; text-wrap: balance; }
  .docs a { box-shadow: inset 0 0 0 1px var(--line); }
  .docs a[aria-current="page"] { box-shadow: inset 0 0 0 2px var(--accent); }
  .toc { display: none; }
}
