/* Legal document page — Privacy Policy & Terms of Use.
   Rides on site.css for the shell (brand, nav, footer); everything here is
   long-form reading: a measured column, a sticky contents rail, and the
   Section 5 subprocessor table. */

.legal-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 132px var(--gutter) 96px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* ------------------------------------------------------------- contents */

.legal-toc {
  position: sticky;
  top: 108px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 13px;
  border-right: 1px solid rgba(255, 255, 255, .06);
  padding-right: 20px;
}
/* The contents rail is a <details> so it can collapse on narrow screens; on
   desktop it is always open and the summary is replaced by the title below. */
.legal-toc > summary { display: none; }

.legal-toc__title {
  margin: 0 0 14px;
  font-size: 11px; font-weight: 800; letter-spacing: .22em;
  text-transform: uppercase; color: var(--primary);
}
.legal-toc ol { list-style: none; margin: 0 0 20px; padding: 0; }
.legal-toc li { margin: 0 0 2px; }
.legal-toc a {
  display: block; padding: 4px 0;
  color: var(--text-muted); line-height: 1.35;
}
.legal-toc a:hover { color: var(--on-bg); }
.legal-toc__part > a {
  color: var(--on-bg); font-weight: 700;
  padding-top: 10px; letter-spacing: -.01em;
}
.legal-toc__part > a:hover { color: var(--primary); }

/* ---------------------------------------------------------------- document */

.legal-doc { min-width: 0; }

.legal-doc h1.legal-part__title {
  margin: 0 0 8px;
  font-size: clamp(30px, 4vw, 44px); font-weight: 800;
  letter-spacing: -.03em; line-height: 1.05;
}
.legal-part + .legal-part { margin-top: 88px; padding-top: 56px; border-top: 1px solid rgba(0, 255, 64, .2); }

.legal-meta {
  margin: 0 0 32px;
  font-size: 14px; line-height: 1.7; color: var(--text-dim);
}

.legal-doc h2 {
  margin: 44px 0 14px;
  font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25;
  scroll-margin-top: 96px;
}
.legal-doc h3 {
  margin: 30px 0 10px;
  font-size: 16px; font-weight: 800; color: var(--primary);
  letter-spacing: -.005em;
  scroll-margin-top: 96px;
}
.legal-doc p { margin: 0 0 16px; font-size: 15.5px; line-height: 1.72; color: var(--text-body); }
.legal-doc strong { color: var(--on-bg); font-weight: 700; }

.legal-list { margin: 0 0 20px; padding-left: 22px; }
.legal-list li {
  margin: 0 0 12px;
  font-size: 15.5px; line-height: 1.72; color: var(--text-body);
}
.legal-list li::marker { color: var(--primary); }

/* Boxed summaries and the all-caps arbitration notices. */
.legal-callout {
  margin: 0 0 26px; padding: 20px 24px;
  border: 1px solid var(--outline); border-left: 3px solid var(--primary);
  border-radius: 14px; background: var(--surface);
}
.legal-callout p { margin: 0; color: var(--on-bg); }
.legal-callout p + p { margin-top: 12px; }

/* The FitnessOS Inbox panel inside Privacy §5. */
.legal-panel {
  margin: 32px 0; padding: 26px 28px;
  border: 1px solid rgba(0, 255, 64, .28); border-radius: 20px;
  background: linear-gradient(to bottom, rgba(0, 255, 64, .05), rgba(0, 255, 64, .01));
  scroll-margin-top: 96px;
}
.legal-panel__title {
  margin: 0 0 14px !important;
  font-size: 19px !important; color: var(--primary);
}
.legal-figcaption {
  margin: 4px 0 0 !important;
  font-size: 13px !important; color: var(--text-dim) !important; font-style: italic;
}

/* ------------------------------------------------------------------ table */

.legal-table-wrap {
  margin: 0 0 26px;
  overflow-x: auto;
  border: 1px solid var(--outline); border-radius: 16px;
}
.legal-table {
  width: 100%; min-width: 640px;
  border-collapse: collapse;
  font-size: 14px; line-height: 1.6;
}
.legal-table th {
  position: sticky; top: 0;
  text-align: left; padding: 14px 18px;
  background: #0d130e; color: var(--primary);
  font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  border-bottom: 1px solid var(--outline);
}
.legal-table td {
  padding: 14px 18px;
  color: var(--text-body); vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.legal-table tbody tr:last-child td { border-bottom: 0; }
.legal-table tbody tr:hover td { background: rgba(0, 255, 64, .03); }
.legal-table td:first-child { color: var(--on-bg); font-weight: 600; }

/* -------------------------------------------------------------- responsive */

@media (max-width: 1000px) {
  .legal-shell { grid-template-columns: 1fr; gap: 0; padding-top: 108px; }
  .legal-toc {
    position: static; max-height: none; overflow: visible;
    border-right: 0; padding-right: 0; margin-bottom: 40px;
    border: 1px solid var(--outline); border-radius: 16px;
    background: var(--surface);
  }
  .legal-toc > summary {
    display: block;
    cursor: pointer; padding: 16px 20px; list-style: none;
    font-size: 11px; font-weight: 800; letter-spacing: .22em;
    text-transform: uppercase; color: var(--primary);
  }
  .legal-toc > summary::-webkit-details-marker { display: none; }
  .legal-toc > summary::after { content: ' +'; }
  .legal-toc[open] > summary::after { content: ' –'; }
  .legal-toc__inner { padding: 0 20px 16px; }
  .legal-toc__title { display: none; }
}

@media (max-width: 560px) {
  .legal-shell { padding-left: 20px; padding-right: 20px; }
  .legal-doc h2 { font-size: 19px; }
  .legal-callout, .legal-panel { padding: 18px 18px; }
}
