.legal-body { padding-top: 120px; }

/* the global .container-xl rule sets overflow:hidden (for hero clipping
   elsewhere), which silently breaks position:sticky on the TOC below —
   the hero's own decorative layers are already clipped by .legal-hero
   itself, so this override is safe. */
.legal-body .container-xl { overflow: visible; }

/* ══════════════════════
   HERO
══════════════════════ */
.legal-hero {
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden;
}
.legal-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 15% 50%, rgba(78,222,163,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 85% 30%, rgba(16,185,129,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.legal-hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.016) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 70%, transparent 100%);
  pointer-events: none;
}
.legal-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  margin-top: 20px;
}
.legal-meta .material-symbols-outlined { font-size: 15px; color: var(--emerald); }

/* ══════════════════════
   TABLE OF CONTENTS
══════════════════════ */
.legal-toc {
  position: sticky;
  top: 120px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px 22px 22px;
}
.legal-toc-body {
  position: relative;
  display: flex;
}
.legal-toc-rail {
  position: relative;
  width: 2px;
  flex-shrink: 0;
  margin-right: 16px;
  background: var(--border);
  border-radius: 2px;
}
.legal-toc-progress-fill {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0%;
  background: var(--emerald);
  border-radius: 2px;
  transition: height 0.15s linear;
}
.legal-toc nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.toc-link {
  display: block;
  padding: 7px 10px;
  margin-left: -10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  line-height: 1.4;
  white-space: normal;
}
.toc-link:hover {
  color: var(--text-primary);
  background: var(--bg-card-high);
}
.toc-link.active {
  color: var(--emerald);
  font-weight: 600;
  background: rgba(78,222,163,0.09);
}

/* ══════════════════════
   CONTENT
══════════════════════ */
.legal-content section {
  padding-bottom: 44px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 96px;
}
.legal-content section:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}
.legal-content h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.legal-content h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-primary);
  margin: 24px 0 10px;
}
.legal-content p {
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.legal-content ul {
  margin: 0 0 14px;
  padding-left: 0;
  list-style: none;
}
.legal-content ul li {
  position: relative;
  padding-left: 22px;
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.legal-content ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  opacity: 0.7;
}
.legal-content ul li strong { color: var(--text-primary); }
.legal-content a { color: var(--emerald); text-decoration: none; }
.legal-content a:hover { text-decoration: underline; }
.legal-content strong { color: var(--text-primary); }

.legal-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  background: rgba(78,222,163,0.04);
  border: 1px solid rgba(78,222,163,0.14);
  border-radius: var(--radius-md);
  margin: 4px 0 14px;
}
.legal-callout .material-symbols-outlined {
  color: var(--emerald);
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.legal-callout p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.7;
}

.legal-contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-top: 6px;
}
.legal-contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.legal-contact-row:last-child { border-bottom: none; }
.legal-contact-row .material-symbols-outlined { color: var(--emerald); font-size: 18px; }
.legal-contact-row a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
}
.legal-contact-row span.legal-contact-label {
  color: var(--text-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 130px;
  display: inline-block;
}

/* ══════════════════════
   MOBILE TOC (pill nav)
══════════════════════ */
.legal-toc-mobile {
  display: none;
  position: sticky;
  top: 100px;
  z-index: 5;
  margin: 0 0 28px;
  padding: 10px 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.legal-toc-mobile nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 2px 4px;
}
.legal-toc-mobile nav::-webkit-scrollbar { display: none; }
.legal-toc-mobile .toc-link {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 12.5px;
  white-space: nowrap;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}
.legal-toc-mobile .toc-link.active {
  color: var(--emerald);
  border-color: var(--emerald);
  background: rgba(78,222,163,0.09);
  font-weight: 600;
}

@media (max-width: 991px) {
  .legal-toc { display: none; }
  .legal-toc-mobile { display: block; }
}
