/*
 * Prose styles for /privacy/, /terms/ and /home/ only.
 *
 * Loaded *after* app.css, which supplies the palette, the type scale and the
 * header. Kept out of app.css on purpose: those three pages are read once, and
 * every byte in app.css is re-downloaded by every phone on every deploy.
 *
 * Same constraint as the rest of the app -- the server sends COEP
 * `require-corp`, so nothing here may reference a cross-origin font or image.
 */

/* The wordmark is the way back to the app on these pages, so it is a link --
   but it must not look like body copy that happens to be underlined. */
a.brand {
  text-decoration: none;
  color: inherit;
}

.legal {
  max-width: 34rem;
  margin: 0 auto;
  padding: 0.5rem var(--pad) 3rem;
}

.legal p,
.legal li {
  font-size: 0.92rem;
}

.legal p {
  margin: 0.85rem 0;
}

.legal h2 {
  margin-top: 2.4rem;
}

.legal h2:first-of-type {
  margin-top: 1.4rem;
}

/* Numbered clauses read as an outline; the number is the address you quote in
   an email, so it stays visible rather than being a list marker. */
.legal h2 .n {
  font: 600 0.8rem/1 var(--font-mono);
  color: var(--accent);
  margin-right: 0.5rem;
  vertical-align: 0.12em;
}

.legal ul {
  padding-left: 1.15rem;
  margin: 0.8rem 0;
}

.legal li {
  margin: 0.5rem 0;
}

.legal a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

/* /home/ only: the way *into* the app, where the legal pages only ever lead back
   out of it. An anchor rather than a `button`, because it navigates -- app.css
   styles the bare `button` element, so a class here inherits none of it and the
   48px table-friendly target has to be restated. Two classes deep so it beats
   `.legal a` above, which would otherwise win on colour. */
.legal .cta {
  display: inline-block;
  margin: 1.4rem 0 0.5rem;
  padding: 0.8rem 1.4rem;
  min-height: 48px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 1rem/1.6 var(--font-body);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.legal strong {
  font-weight: 600;
}

/* The dateline under the title: who wrote this and when it last changed. */
.dateline {
  color: var(--ink-soft);
  font-size: 0.8rem;
  margin: 0.4rem 0 1.6rem;
  line-height: 1.5;
}

/* Tables are the honest shape for "what leaves, and for how long". Mobile-first:
   they scroll inside their own box rather than widening the page. */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  margin: 1rem 0;
}

.legal table {
  border-collapse: collapse;
  width: 100%;
  min-width: 30rem;
  font-size: 0.82rem;
}

.legal th,
.legal td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.legal tr:last-child td {
  border-bottom: 0;
}

.legal th {
  font: 600 0.7rem/1.3 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* A claim that would be worth arguing about if it were vague. */
.legal .key {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-s);
  padding: 0.85rem 1rem;
  margin: 1.2rem 0;
  font-size: 0.9rem;
}

.legal code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}

/* The app's diagnostics rows are `yes`, `no` or a number, so app.css pairs a label
   column with a mono value column. Here the value is a sentence, and on a phone that
   column came out ~9rem wide -- "falling back to universal-2" wrapped six deep with
   the endpoint broken mid-hostname. Stack label over value until there is room. */
.legal dl.diag {
  margin: 1rem 0;
  grid-template-columns: 1fr;
  gap: 0.15rem;
}

.legal dl.diag dt {
  font: 600 0.7rem/1.3 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.legal dl.diag dt + dd {
  font-family: var(--font-body);
  font-size: 0.88rem;
}

.legal dl.diag dt ~ dt {
  margin-top: 0.9rem;
}

@media (min-width: 34rem) {
  .legal dl.diag {
    grid-template-columns: auto 1fr;
    gap: 0.55rem 1.2rem;
  }

  .legal dl.diag dt ~ dt {
    margin-top: 0;
  }
}

/* Back to the app, at both ends: nobody should have to find the browser's back
   button after reading to the bottom. */
.legal .back {
  display: inline-block;
  margin: 2.2rem 0 0;
  font-size: 0.88rem;
  color: var(--accent);
}

.legal hr {
  margin: 2.2rem 0 0;
}
