/* Privacy and Terms. Numbered section headings always; the table of contents and the
   progress bar come from legal.js. */
.legal { counter-reset: lg; }
.legal h2 { counter-increment: lg; display: flex; align-items: baseline; gap: 12px; scroll-margin-top: 90px; padding-top: 18px; border-top: 1px solid var(--line); }
.legal h2::before {
  content: counter(lg, decimal-leading-zero); flex: none;
  font: 700 .82rem ui-monospace, Consolas, monospace; color: var(--orange-text); letter-spacing: .04em;
}
.legal .legal-updated {
  display: inline-block; padding: 5px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 600;
}

.legal-shell { display: grid; grid-template-columns: 250px minmax(0, 760px); gap: 48px; justify-content: center; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.legal-shell .wrap.legal { padding: 0; margin: 0; max-width: none; }
.legal-toc { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; }
.legal-toc summary {
  list-style: none; cursor: pointer; font: 700 .76rem var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 6px 0 10px;
}
.legal-toc summary::-webkit-details-marker { display: none; }
.legal-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: tc; border-left: 2px solid var(--line); }
.legal-toc li { counter-increment: tc; }
.legal-toc a {
  display: flex; gap: 10px; padding: 7px 10px 7px 14px; margin-left: -2px; border-left: 2px solid transparent;
  color: var(--muted); text-decoration: none; font-size: .9rem; line-height: 1.3; transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.legal-toc a::before { content: counter(tc, decimal-leading-zero); font: 600 .74rem ui-monospace, Consolas, monospace; color: #9aa8b5; padding-top: 2px; }
.legal-toc a:hover { color: var(--navy); }
.legal-toc a.is-on { color: var(--navy); font-weight: 700; border-left-color: var(--orange); background: linear-gradient(90deg, rgba(242, 118, 46, .08), transparent); }
.legal-toc a.is-on::before { color: var(--orange-text); }

.legal-progress {
  position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 60; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--orange), #ffb27d); pointer-events: none;
}

@media (max-width: 999px) {
  .legal-shell { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; }
  .legal-shell .wrap.legal { padding: 0 20px; }
  .legal-toc { position: static; max-height: none; overflow: visible; margin: 0 20px 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; }
  .legal-toc summary { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; color: var(--navy); }
  .legal-toc summary::after { content: "+"; font-size: 1.2rem; color: var(--orange-text); }
  .legal-toc details[open] summary::after { content: "\2212"; }
  .legal-toc ol { margin-bottom: 12px; }
  .legal h2 { scroll-margin-top: 120px; }
}
@media (prefers-reduced-motion: reduce) { .legal-toc a { transition: none; } }
