/* Shared look for the public legal pages. Inlined into each page at build
   time is not worth a build step for two files, so each page <link>s this
   from /_legal-shared.css, which express.static already serves out of public/.

   Privacy reuses the homepage marketing chrome (/static/marketing.css + the
   same header/footer/logo). Terms still uses the compact header below.
   Article typography lives on .legal-doc so the two chrome styles can share
   readable legal text. */
:root {
  --navy: #0F2E4D;
  --ink: #1a2432;
  --muted: #5a6b7f;
  --rule: #dfe5ee;
  --bg: #f7f9fc;
  --card: #ffffff;
  --accent: #CC2027;
  --mkt-navy: #1B2A6B;
  --mkt-iq-blue: #2EA3FF;
  --mkt-text: #1F2933;
  --mkt-muted: #6B7280;
  --mkt-border: #E3E7ED;
}
@media (prefers-color-scheme: dark) {
  :root {
    --navy: #cfe0f2; --ink: #e8eef6; --muted: #9aabbf;
    --rule: #26333f; --bg: #0e161f; --card: #141f2b; --accent: #ff6b73;
  }
}
* { box-sizing: border-box; }
body:not(.legal-page--marketing) {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* Homepage match: same body/heading stack as fm-theme.css on / */
body.legal-page--marketing {
  margin: 0;
  background: #f4f6f9;
  color: var(--mkt-text);
  font-family: Tahoma, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.legal-page--marketing h1,
body.legal-page--marketing h2,
body.legal-page--marketing h3 {
  font-family: Inter, Tahoma, sans-serif;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px 72px; }
header.top {
  border-bottom: 1px solid var(--rule);
  background: var(--card);
  margin-bottom: 32px;
}
header.top .wrap { padding-top: 18px; padding-bottom: 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { font-weight: 800; color: var(--navy); text-decoration: none; font-size: 19px; letter-spacing: -.01em; }
.brand span { color: var(--accent); }
.top nav { margin-left: auto; display: flex; gap: 8px; }
/* 44px tall so a thumb hits it — same rule the app follows. */
.top nav a {
  color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px;
}
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--navy); background: rgba(15,46,77,.06); }

.legal-doc {
  max-width: 760px;
  padding-bottom: 48px;
}
.legal-doc h1 { font-size: 30px; line-height: 1.2; margin: 0 0 6px; color: var(--mkt-navy); letter-spacing: -.02em; }
body:not(.legal-page--marketing) h1 { font-size: 30px; line-height: 1.2; margin: 0 0 6px; color: var(--navy); letter-spacing: -.02em; }
.eff { color: var(--muted); font-size: 15px; margin: 0 0 28px; }
.legal-doc h2, body:not(.legal-page--marketing) h2 {
  font-size: 20px; margin: 38px 0 10px; color: var(--navy);
  padding-top: 22px; border-top: 1px solid var(--rule); letter-spacing: -.01em;
}
.legal-doc h2 { color: var(--mkt-navy); border-top-color: var(--mkt-border); }
h2:first-of-type { border-top: 0; padding-top: 0; }
h3 { font-size: 16px; margin: 22px 0 6px; color: var(--ink); }
.legal-doc h3 { color: var(--mkt-text); }
p, li { color: var(--ink); }
.legal-doc p, .legal-doc li { color: var(--mkt-text); }
ul { padding-left: 22px; margin: 10px 0; }
li { margin: 6px 0; }
a { color: #1d4ed8; }
.legal-doc a { color: var(--mkt-navy); }
@media (prefers-color-scheme: dark) { a { color: #8ab4ff; } }
.callout {
  background: var(--card); border: 1px solid var(--rule); border-left: 3px solid var(--navy);
  border-radius: 10px; padding: 16px 18px; margin: 18px 0;
}
.legal-doc .callout {
  border-color: var(--mkt-border);
  border-left-color: var(--mkt-navy);
}
.callout h3 { margin-top: 0; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.legal-doc th, .legal-doc td { border-bottom-color: var(--mkt-border); }
th { color: var(--navy); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.legal-doc th { color: var(--mkt-navy); }
.legal-doc code {
  font-size: 13px;
  background: #eef2f8;
  padding: 1px 5px;
  border-radius: 4px;
}
.scroller { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* MEASURED at 390px: the footer links came out 16px tall — the same miss the
   app's own sweep found on short navigation links. The header nav already has
   a 44px floor; the footer needs it too. A flex row rather than a run of text
   separated by dots, so each link is its own target instead of two words in a
   sentence. */
footer.btm {
  border-top: 1px solid var(--rule); margin-top: 48px; padding-top: 12px;
  color: var(--muted); font-size: 14px;
}
footer.btm nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
footer.btm a {
  color: var(--muted); text-decoration: none; font-weight: 600;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
  border-radius: 8px;
}
footer.btm a:hover { color: var(--navy); background: rgba(15,46,77,.06); text-decoration: underline; }
footer.btm .mark { color: var(--muted); padding: 0 4px; }
