/* ── Legal pages (Privacy Policy / Terms of Service) ──────────────────
   Reuses the standard dashboard shell (.dashboard-page/.app-body/.sidebar/
   .main-content/.main-inner from dashboard.css) so the TOC sits flush
   left with no radius/margin — same shell as profile.html etc. — and the
   article flows directly on the page background instead of its own card.
   See legal.js for the scrollspy behavior this markup expects. */

/* ── Sidebar: table of contents ──
   Width/background/border/padding all come from .sidebar — this only adds
   the TOC-specific content (doc switcher, numbered links). */
.legal-toc-switch {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 20px;
}
.legal-toc-switch a {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all var(--dur-fast) var(--ease-standard);
}
.legal-toc-switch a:hover { color: var(--text); background: var(--surface); }
.legal-toc-switch a.is-active {
  color: var(--accent2);
  background: var(--accent-tint-08);
  border-color: var(--accent-tint-30);
}

.legal-toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.legal-toc-list a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast), border-color var(--dur-fast);
}
.legal-toc-list a:hover { color: var(--text); background: var(--surface); }
.legal-toc-list a.is-active {
  color: var(--accent2);
  background: var(--accent-tint-08);
  border-left-color: var(--accent);
  font-weight: 600;
}
.legal-toc-list .legal-toc-num {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.legal-toc-list a.is-active .legal-toc-num { color: var(--accent); }

/* ── Main content: no card, just flowing text on the page background ── */
.legal-doc-page .main-inner {
  padding: 44px 48px 96px;
}

.legal-hero {
  margin-bottom: 12px;
}
.legal-eyebrow {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-tint-08);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  margin-bottom: 16px;
}
.legal-hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 34px;
  color: var(--heading);
  line-height: 1.15;
  margin-bottom: 12px;
}
.legal-dek {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  max-width: 640px;
}
.legal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
}
.legal-badge svg { width: 13px; height: 13px; opacity: .8; }

.legal-section {
  padding: 26px 0;
  scroll-margin-top: 20px;
  border-top: 1px solid var(--glass-border);
}

.legal-section h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 19px;
  color: var(--heading);
  margin-bottom: 14px;
  scroll-margin-top: 20px;
}
.legal-num {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-tint-12);
  border: 1px solid var(--accent-tint-30);
  color: var(--accent2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
}

.legal-section h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--heading);
  margin: 20px 0 8px;
}

.legal-section p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 12px;
}
.legal-section p:last-child { margin-bottom: 0; }

.legal-section ul,
.legal-section ol {
  margin: 0 0 14px 0;
  padding-left: 4px;
  list-style: none;
}
.legal-section ol { counter-reset: legal-ol; }
.legal-section li {
  position: relative;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  padding-left: 20px;
  margin-bottom: 8px;
}
.legal-section li:last-child { margin-bottom: 0; }
.legal-section ul > li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .7;
}
.legal-section ol > li {
  counter-increment: legal-ol;
  padding-left: 24px;
}
.legal-section ol > li::before {
  content: counter(legal-ol) '.';
  position: absolute;
  left: 0;
  top: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent2);
}
.legal-section li > ul,
.legal-section li > ol { margin-top: 8px; }

.legal-section strong { color: var(--heading); font-weight: 600; }
.legal-section a { color: var(--accent); text-decoration: none; }
.legal-section a:hover { text-decoration: underline; }
.legal-section code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--accent2);
}

/* ── Callouts — the only elements allowed their own "boxed" surface,
   same as a table or stat card would get inline in any doc. ── */
.legal-callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.65;
}
.legal-callout svg { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 1px; }
.legal-callout p { font-size: 13px; margin: 0; color: inherit; }
.legal-callout p + p { margin-top: 6px; }
.legal-callout-info {
  background: var(--accent-tint-08);
  border: 1px solid var(--accent-tint-30);
  color: var(--text);
}
.legal-callout-info svg { color: var(--accent); }
.legal-callout-warn {
  background: var(--warning-tint);
  border: 1px solid rgba(253,230,138,.3);
  color: var(--text);
}
.legal-callout-warn svg { color: var(--warning); }

/* ── Data tables (sub-processors, retention) ── */
.legal-table-wrap {
  overflow-x: auto;
  margin: 8px 0 16px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}
.legal-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}
.legal-table th,
.legal-table td {
  text-align: left;
  padding: 10px 14px;
  font-size: 12.5px;
  line-height: 1.55;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text);
  vertical-align: top;
}
.legal-table th {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  background: var(--glass);
  white-space: nowrap;
}
.legal-table tr:last-child td { border-bottom: none; }
.legal-table td strong { color: var(--heading); }

/* ── Contact card (closing section) ── */
.legal-contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 6px;
}
.legal-contact-card div { min-width: 0; }
.legal-contact-card .lcc-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.legal-contact-card .lcc-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  color: var(--heading);
}
.legal-contact-card a.btn-secondary { flex-shrink: 0; padding: 9px 18px; font-size: 13px; }

@media (max-width: 768px) {
  .legal-doc-page .main-inner { padding: 20px 20px 64px; }
  .legal-hero h1 { font-size: 27px; }
}

@media (max-width: 520px) {
  .legal-contact-card { flex-direction: column; align-items: flex-start; }
}

.main-inner{
  max-width: fit-content;
}