/* /privacy and /terms
   Desktop: the table of contents sits in a sticky left column, so the reader
   keeps their place in a long document; the text keeps a readable measure in
   the right column. Below 1000px it folds back to a single column with the
   contents at the top. */
.legal { padding-top: clamp(48px, 7vw, 88px); }

/* The two columns span the header's own edges: the contents start where the
   logo starts and the text ends where the header button ends. The text keeps
   its reading measure; spare width goes into the gutter between them. */
.legal-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 720px);
  column-gap: var(--space-12);
  justify-content: space-between;
  align-items: start;
}
.legal-head { grid-column: 2; display: grid; gap: var(--space-3); margin-bottom: var(--space-12); }
.legal-head h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); letter-spacing: -0.04em; line-height: 1.06; }
.legal-head .updated { font-size: var(--text-sm); color: var(--muted); }
.legal-body { grid-column: 2; }
.legal-body h2 { font-size: 1.3125rem; }
.legal-body ol.roman { list-style: lower-roman; }

.legal-toc {
  grid-column: 1;
  grid-row: 1 / span 2;
  position: sticky;
  top: calc(var(--header-h) + var(--space-8));
  max-height: calc(100dvh - var(--header-h) - var(--space-16));
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Line the first entry up with the page title. */
  padding-top: var(--space-2);
}
.legal-toc .lbl { margin-bottom: var(--space-4); font-size: var(--text-sm); font-weight: 600; }
.legal-toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; border-left: 1px solid var(--border); }
.legal-toc a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px var(--space-4);
  border-left: 2px solid transparent;
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--muted);
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .legal-toc a:hover { color: var(--text); } }
.legal-toc a[aria-current="true"] { color: var(--text); font-weight: 500; border-left-color: var(--accent); }
.legal-toc a:focus-visible { border-radius: 4px; }

@media (max-width: 1000px) {
  .legal-layout { display: block; max-width: calc(var(--container-narrow)); }
  .legal-head { margin-bottom: 0; }
  .legal-toc {
    position: static;
    max-height: none;
    overflow: visible;
    margin: var(--space-10) 0 var(--space-12);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    background: var(--bg-alt);
  }
  .legal-toc ol { display: block; columns: 2; column-gap: var(--space-8); border-left: 0; }
  .legal-toc li { break-inside: avoid; }
  .legal-toc a { margin-left: 0; padding: 4px 0; border-left: 0; font-size: var(--text-base); color: var(--text-soft); }
  .legal-toc a[aria-current="true"] { font-weight: 400; }
}
@media (max-width: 640px) { .legal-toc ol { columns: 1; } }
