/* ──────────────────────────────────────────────────────────────────────────
   legal.css — shared styling for the six policy pages (disclaimer, terms,
   privacy, sources, methodology, about).

   These pages are plain documents, so they share one stylesheet instead of
   each carrying an inline copy. Same CSS-variable names as the app pages, so
   the theme system, the pre-paint theme script and bg.js all work unchanged.
   ────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #08090d; --surf: #101115; --surf2: #17181c;
  --border: #212225; --border2: #2f3033;
  --text: #dce3ec; --dim: #5e6e82; --mid: #92a2b4;
  --green: #00d68f; --red: #ff4465; --blue: #4fa8e8;
  --logo-start: #fff;
  --panel: #14171e;
  /* Liquid-glass panel. Translucent ON PURPOSE here, unlike the app pages'
     solid surfaces (v85.1) — the difference is backdrop-filter, which blurs
     the gradient behind the panel instead of letting it show through sharp. */
  --glass:     rgba(16, 17, 21, 0.78);
  --glass-brd: rgba(255, 255, 255, 0.10);
  --glass-hi:  rgba(255, 255, 255, 0.055);
  --glass-in:  rgba(255, 255, 255, 0.045);
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #f5f8fc; --surf: #eef1f6; --surf2: #e8ebf1;
  --border: #d8dce3; --border2: #c8cdd6;
  --text: #16202e; --dim: #6a7889; --mid: #4c5a6b;
  --green: #00996a; --red: #e11d48; --blue: #2b7fc9;
  --logo-start: #16202e;
  --panel: #ffffff;
  --glass:     rgba(255, 255, 255, 0.76);
  --glass-brd: rgba(15, 30, 55, 0.10);
  --glass-hi:  rgba(255, 255, 255, 0.55);
  --glass-in:  rgba(15, 30, 55, 0.035);
  color-scheme: light;
}

body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.65;
}

/* ── header (matches the app pages' look, trimmed to logo + nav) ── */
.hdr {
  max-width: 1480px; margin: 0 auto; padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo {
  font-size: 17px; font-weight: 700; letter-spacing: -0.3px;
  color: var(--logo-start); text-decoration: none;
}
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-btn {
  font-size: 12.5px; color: var(--mid); text-decoration: none;
  padding: 6px 10px; border-radius: 7px;
}
.nav-btn:hover { background: var(--surf2); color: var(--text); }

/* ── document body ──
   A solid reading panel, so the prose sits on a surface instead of directly on
   the animated gradient. Uses --surf (a SOLID hex, per v85.1) — never an rgba
   tint, which would let the gradient pour through the panel.
   width: calc(100% - 36px) with margin auto keeps an 18px gutter on narrow
   screens while max-width still centres it on wide ones. */
.doc {
  max-width: 820px; width: calc(100% - 36px);
  margin: 4px auto 46px; padding: 30px 34px 36px;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: 18px;
  /* blur what's behind, so the gradient reads as colour and motion rather
     than as texture competing with the text */
  -webkit-backdrop-filter: blur(26px) saturate(165%);
          backdrop-filter: blur(26px) saturate(165%);
  box-shadow: 0 1px 0 var(--glass-hi) inset, 0 14px 44px rgba(0, 0, 0, 0.20);
}
/* Firefox/Safari without backdrop-filter would show raw translucency over a
   moving gradient, which is unreadable — fall back to the solid surface. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .doc { background: var(--surf); border-color: var(--border); box-shadow: none; }
}
.doc-head { margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--glass-brd); }
.doc h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.6px; margin-bottom: 8px; }
.doc .lede { font-size: 14.5px; color: var(--mid); }
.doc .eff { font-size: 12px; color: var(--dim); margin-top: 10px; }

.doc h2 {
  font-size: 18px; font-weight: 650; letter-spacing: -0.2px;
  margin: 30px 0 10px; padding-top: 4px;
}
.doc h3 { font-size: 14.5px; font-weight: 650; margin: 20px 0 7px; color: var(--mid); }
.doc p  { font-size: 14px; margin-bottom: 12px; }
.doc ul, .doc ol { margin: 0 0 13px 20px; font-size: 14px; }
.doc li { margin-bottom: 6px; }
.doc a  { color: var(--blue); text-decoration: none; }
.doc a:hover { text-decoration: underline; }
.doc strong { font-weight: 650; }
.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; background: var(--glass-in); padding: 1.5px 5px;
  border-radius: 4px; border: 1px solid var(--glass-brd);
}

/* callout box for the lines that actually matter */
.note {
  background: var(--glass-in); border: 1px solid var(--glass-brd);
  border-left: 3px solid var(--blue);
  border-radius: 9px; padding: 14px 16px; margin: 16px 0;
  font-size: 13.5px;
}
.note.warn { border-left-color: var(--red); }
.note p:last-child { margin-bottom: 0; }

/* source / data tables */
.tbl { width: 100%; border-collapse: collapse; margin: 14px 0 18px; font-size: 13px; }
.tbl th, .tbl td {
  text-align: left; padding: 9px 11px;
  border-bottom: 1px solid var(--glass-brd); vertical-align: top;
}
.tbl th { color: var(--mid); font-weight: 650; font-size: 12px; background: var(--glass-in); }
.tbl tr:last-child td { border-bottom: none; }
.tbl td a { word-break: break-word; }

@media (max-width: 620px) {
  .doc { width: calc(100% - 24px); padding: 22px 20px 26px; border-radius: 13px; margin-bottom: 34px; }
  .doc h1 { font-size: 24px; }
  .hdr { padding: 14px 16px; }
  .tbl { font-size: 12px; }
  .tbl th, .tbl td { padding: 7px 8px; }
}
