/* The legal pages (/privacy, /terms, /dpa), on top of app.css (tokens) and site.css (nav, footer, .wrap).
   Mobile first: one column with a fold-out contents list; from 1000px a sticky "On this page" column. */

/* the navy band under the nav */
.legal-hero { padding: var(--s7) 0 var(--s6); position: relative; overflow: hidden; }
.legal-hero::before { content: ""; position: absolute; right: -25%; top: -60%; width: 70vw; height: 70vw; max-width: 720px; max-height: 720px; border-radius: 50%;
  background: radial-gradient(circle, rgba(198, 244, 50, .09) 0%, transparent 62%); pointer-events: none; }
.legal-hero .wrap { position: relative; }
.legal-hero .eyebrow { font-size: .74rem; margin-bottom: var(--s3); }
.legal-hero h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.3rem); letter-spacing: -1.2px; line-height: 1.04; font-weight: 800; }
.legal-hero .lead { margin-top: var(--s4); max-width: 56ch; color: var(--on-navy-2); font-size: 1.08rem; }
.legal-hero .updated { margin: var(--s4) 0 0; color: var(--on-navy-3); font-size: .9rem; font-weight: 600; }
@media (min-width: 900px) { .legal-hero { padding: var(--s8) 0 var(--s7); } }

/* Privacy / Terms / DPA switcher */
.legal-tabs { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); }
.legal-tabs a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid #3A4770;
  color: var(--on-navy); font-weight: 600; font-size: .92rem; text-decoration: none; }
.legal-tabs a:hover { border-color: var(--on-navy-2); background: var(--navy-2); }
.legal-tabs a[aria-current="page"] { background: var(--lime); border-color: var(--lime); color: var(--navy); font-weight: 800; }

/* layout */
.legal-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); padding-top: var(--s5); padding-bottom: var(--s8); }
@media (min-width: 1000px) {
  .legal-layout { grid-template-columns: 250px minmax(0, 1fr); gap: var(--s8); padding-top: var(--s7); }
}

/* "On this page" */
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.toc summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 var(--s4);
  font-weight: 800; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform var(--fast); }
.toc[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.toc ol { list-style: none; margin: 0; padding: 0 var(--s2) var(--s3); counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 10px; padding: 8px var(--s3); border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; font-size: .93rem; font-weight: 600; line-height: 1.35; }
.toc a::before { content: counter(toc); min-width: 1.4em; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.toc a:hover { background: var(--bg-2); color: var(--text); }
.toc a[aria-current="true"] { background: color-mix(in srgb, var(--lime) 30%, transparent); color: var(--text); }
.toc a[aria-current="true"]::before { color: var(--text); }
@media (min-width: 1000px) {
  .toc-wrap { position: relative; }
  .toc { position: sticky; top: 88px; max-height: calc(100vh - 112px); overflow-y: auto; background: none; border: 0; border-left: 1px solid var(--line); border-radius: 0; }
  .toc summary { cursor: default; pointer-events: none; padding-left: var(--s4); }
  .toc summary::after { display: none; }
  .toc ol { padding: 0 0 0 var(--s2); }
}

/* the text */
.legal { max-width: 72ch; overflow-wrap: break-word; font-size: 1.02rem; line-height: 1.7; }
.legal > :first-child { margin-top: 0; }
.legal h2 { margin: var(--s7) 0 var(--s3); font-size: clamp(1.3rem, 1.15rem + .6vw, 1.6rem); letter-spacing: -.6px; line-height: 1.2; scroll-margin-top: 88px; }
.legal > h2:first-child { margin-top: 0; }
.legal h3 { margin: var(--s5) 0 var(--s2); font-size: 1.08rem; letter-spacing: -.3px; scroll-margin-top: 88px; }
.legal p, .legal ul, .legal ol { margin: 0 0 var(--s4); color: var(--text-2); }
.legal ul { padding-left: 1.25em; }
.legal li { margin: 8px 0; padding-left: 4px; }
.legal li::marker { color: var(--muted); }
.legal b { color: var(--text); font-weight: 800; }
.legal a { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--text) 35%, transparent); text-underline-offset: 3px; }
.legal a:hover { text-decoration-color: var(--text); }
.legal code { font-size: .88em; padding: 2px 6px; border-radius: 6px; background: var(--bg-2); color: var(--text); }
.legal .box { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--lime); border-radius: var(--r-lg); padding: var(--s4) var(--s5); margin: 0 0 var(--s5); }
.legal .box p:first-child { margin-bottom: var(--s2); color: var(--text); }
.legal .box ul { margin-bottom: 0; }

/* tables */
.legal .tbl { overflow-x: auto; margin: 0 0 var(--s5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.legal table { width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.5; }
.legal th[scope="row"] { width: 30%; }
.legal th, .legal td { overflow-wrap: anywhere; text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--text-2); }
.legal th { background: var(--surface-2); font-weight: 800; color: var(--text); }
.legal thead th { font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
.legal tr:last-child td, .legal tr:last-child th { border-bottom: 0; }
.legal td:first-child { color: var(--text); font-weight: 600; }
/* On a phone each row becomes a small card, so nothing scrolls sideways. */
@media (max-width: 640px) {
  .legal .tbl.cards { border: 0; background: none; overflow: visible; }
  .legal .tbl.cards table, .legal .tbl.cards tbody { display: block; }
  .legal .tbl.cards thead { display: none; }
  .legal .tbl.cards tr { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px 0; margin-bottom: var(--s3); }
  .legal .tbl.cards td { display: block; border: 0; padding: 4px 16px; }
  .legal .tbl.cards td::before { content: attr(data-th); display: block; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .legal .tbl:not(.cards) th[scope="row"] { width: 38%; }
}

.legal-page footer .wrap { align-items: flex-start; }
/* On wider screens let the table size its columns by whole words (names never break mid-word). */
@media (min-width: 641px) {
  .legal th, .legal td { overflow-wrap: normal; hyphens: manual; }
  .legal td:first-child, .legal thead th:first-child { white-space: nowrap; }
}
