/* ============================================================
   site-legal.css — the legal pages

   One stylesheet for all thirteen legal pages: the hub, the
   policies, and Your Privacy Choices. It rides on top of
   site-styles.css and uses its tokens only, so the header and
   footer stay exactly as they are everywhere else.

   Elizabeth, Sep 11: "nothing that looks fancy or cute, no
   little colorful numbers or rainbow bars, just simple legal
   jargon." So: ink on white, DM Sans body, a Noto Serif
   document name, blue underlined links, plain bullets, plain
   bordered tables, and no tint or colour wash anywhere. Line
   length stays around 72 characters and a phone reader never
   has to scroll sideways.
   ============================================================ */

.lp {
  --lp-line: 72ch;
  --lp-rule: #d7d4db;
  --lp-quiet: #4c4655;
  --lp-soft: #faf8fc;          /* the sidebar card only */
  --lp-cardrule: rgba(0, 0, 0, .09);
  background: var(--white);
  color: var(--ink);
  padding: 30px 0 76px;
}

/* ── the page opening ─────────────────────────────────────── */
.lp-head {
  padding-bottom: 20px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--lp-rule);
}
.lp-title {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.22;
  letter-spacing: -.005em;
  color: var(--ink);
}
.lp-meta {
  margin: 0;
  color: var(--lp-quiet);
  font: 400 14px/1.5 var(--body);
  letter-spacing: 0;
  text-transform: none;
}

/* ── the two column shell ─────────────────────────────────── */
.lp-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: clamp(26px, 3.4vw, 54px);
  align-items: start;
}
.lp-shell-solo { grid-template-columns: minmax(0, 1fr); }

/* ── on this page ─────────────────────────────────────────────
   Elizabeth, Sep 11: the sidebar goes back to the card it was
   before this pass, rounded and lightly tinted. It is the one
   piece of the old styling she kept. */
.lp-toc {
  position: sticky;
  top: 132px;
  padding: 20px 20px 14px;
  border-radius: 20px;
  background: var(--lp-soft);
  border: 1px solid var(--lp-cardrule);
  max-height: calc(100vh - 172px);
  overflow: auto;
  overscroll-behavior: contain;
}
.lp-toc-title {
  margin: 0 0 12px;
  color: var(--ink);
  font: 800 11.5px/1 var(--sans);
  letter-spacing: .18em;
  text-transform: uppercase;
}
.lp-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.lp-toc li { margin: 0 0 3px; }
.lp-toc a {
  display: block;
  padding: 5px 8px 5px 10px;
  border-radius: 9px;
  color: var(--muted);
  font: 600 13.5px/1.38 var(--body);
  text-decoration: none;
  transition: background .14s ease, color .14s ease;
}
.lp-toc a:hover,
.lp-toc a:focus-visible {
  background: rgba(174, 95, 224, .12);
  color: var(--ink);
}

/* ── the document body ────────────────────────────────────── */
.lp-body { max-width: var(--lp-line); }
.lp-body > :first-child { margin-top: 0; }

.lp-body p,
.lp-body li {
  font: 400 16px/1.7 var(--body);
  color: var(--ink);
  /* the policies quote long addresses in plain text; they break rather than
     push the page sideways on a phone */
  overflow-wrap: break-word;
}
.lp-body p { margin: 0 0 16px; }

.lp-body h2 {
  margin: 34px 0 12px;
  font: 600 20px/1.35 var(--body);
  letter-spacing: 0;
  color: var(--ink);
  scroll-margin-top: 150px;
}
.lp-body h3 {
  margin: 24px 0 8px;
  font: 600 16px/1.4 var(--body);
  letter-spacing: 0;
  color: var(--ink);
  scroll-margin-top: 150px;
}

.lp-body ol,
.lp-body ul { margin: 0 0 16px; padding-left: 26px; }
.lp-body li { margin-bottom: 8px; }
.lp-body li::marker { color: var(--ink); font-weight: 400; }
.lp-body li > ol,
.lp-body li > ul { margin: 8px 0 4px; }

.lp-body strong { font-weight: 700; color: var(--ink); }
.lp-body em { font-style: italic; }

.lp-body a {
  color: var(--blue);
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

/* the hub's index of documents */
.lp-docs { margin: 0; padding-left: 26px; }
.lp-docs li { margin-bottom: 10px; }

/* a quoted notice, the text a member actually sees in the product */
.lp-body blockquote.lp-note {
  margin: 18px 0 20px;
  padding: 0 0 0 18px;
  border: 0;
  border-left: 2px solid var(--lp-rule);
  background: none;
}
.lp-body blockquote.lp-note > :last-child { margin-bottom: 0; }

/* ── tables scroll inside their own box, never the page ───── */
.lp-table {
  margin: 18px 0 22px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.lp-table table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font: 400 15px/1.55 var(--body);
  color: var(--ink);
}
.lp-table th,
.lp-table td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--lp-rule);
  overflow-wrap: break-word;
}
.lp-table thead th {
  background: none;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

/* ── contact lines at the foot of a document ──────────────── */
.lp-contact {
  margin: 34px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--lp-rule);
}
.lp-contact p { margin: 0 0 10px; }
.lp-contact address {
  font: 400 16px/1.7 var(--body);
  font-style: normal;
  color: var(--ink);
}

/* ── the request form on Your Privacy Choices ─────────────── */
.lp-form { display: grid; gap: 16px; max-width: 520px; margin: 6px 0 8px; }
.lp-field { display: grid; gap: 5px; }
.lp-field > span {
  font: 400 15px/1.4 var(--body);
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.lp-form input,
.lp-form select,
.lp-form textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #8b8792;
  border-radius: 3px;
  background: var(--white);
  color: var(--ink);
  font: 400 16px/1.45 var(--body);
}
.lp-form textarea { min-height: 120px; resize: vertical; }
.lp-form input:focus-visible,
.lp-form select:focus-visible,
.lp-form textarea:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.lp-form-note { margin: 0; color: var(--lp-quiet); font: 400 14px/1.6 var(--body); }

/* one plain button, in the site's ink */
.lp-form .btn,
.lp-form .btn-dark {
  align-self: start;
  min-height: 0;
  padding: 11px 22px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--white);
  font: 500 15px/1.2 var(--body);
  letter-spacing: 0;
  text-transform: none;
  transition: none;
}
.lp-form .btn:hover { transform: none; background: #000; }

/* ── focus, for anyone on a keyboard ──────────────────────── */
.lp a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ── phone and tablet ─────────────────────────────────────── */
@media (max-width: 900px) {
  .lp-shell { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  /* Sep 12: no scroll box inside the page. The whole list shows, and
     site-legal.js turns the title into a button that opens and closes it,
     closed by default. */
  .lp-toc {
    position: static;
    max-height: none;
    overflow: visible;
    border-radius: 18px;
    padding: 16px 14px 10px;
  }
  .lp-toc a { font-size: 14.5px; }
  .lp-toc.is-collapsible { padding: 4px 14px; }
  .lp-toc.is-collapsible.is-open { padding-bottom: 10px; }
  .lp-toc.is-collapsible .lp-toc-title { margin: 0; }
  .lp-toc.is-collapsible.is-open .lp-toc-title { margin-bottom: 6px; }
  .lp-toc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 0 2px 0 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    text-align: left;
    cursor: pointer;
  }
  .lp-toc-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
  .lp-toc-chev { flex: none; transition: transform .18s ease; }
  .lp-toc.is-open .lp-toc-chev { transform: rotate(180deg); }
}

@media (prefers-reduced-motion: reduce) {
  .lp-toc a, .lp-toc-chev { transition: none; }
}

@media (max-width: 700px) {
  .lp { padding: 22px 0 58px; }
  .lp-head { padding-bottom: 16px; margin-bottom: 24px; }
  .lp-title { font-size: 27px; }
  .lp-body p, .lp-body li { font-size: 16px; line-height: 1.68; }
  .lp-body h2 { margin: 30px 0 11px; font-size: 19px; }
  .lp-body h3 { margin: 22px 0 7px; font-size: 16px; }
  .lp-body ol, .lp-body ul { padding-left: 22px; }
  /* the hub's document cards line up with the heading, equal margins both sides */
  .lp-body .lp-docs { padding-left: 0; }

  /* Sep 12: on a phone a table never scrolls sideways. Each row reads as its
     own bordered card: the first cell is the card's title, and every other
     cell carries its column heading as a small label (data-label on the td). */
  .lp-table { overflow: visible; }
  .lp-table table,
  .lp-table tbody,
  .lp-table tr,
  .lp-table td { display: block; }
  .lp-table table { width: 100%; min-width: 0; font-size: 15px; }
  .lp-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .lp-table tr { padding: 12px 14px; border: 1px solid var(--lp-rule); }
  .lp-table tr + tr { margin-top: 10px; }
  .lp-table td { padding: 0; border: 0; }
  .lp-table td + td { margin-top: 10px; }
  .lp-table td:first-child:not(:only-child) {
    padding-bottom: 9px;
    border-bottom: 1px solid var(--lp-rule);
    font-weight: 700;
  }
  .lp-table td[data-label]:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 1px;
    font: 700 13px/1.4 var(--body);
    color: var(--lp-quiet);
  }
}

/* Legal & Trust hub: one card per document, same look as the "On this page" card */
.lp-docs { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 12px; }
.lp-docs li { margin: 0; }
.lp-doc { display: block; padding: 18px 20px; border-radius: 20px; background: var(--lp-soft);
  border: 1px solid var(--lp-cardrule); text-decoration: none; color: var(--ink);
  transition: border-color .15s ease, transform .15s ease; }
.lp-doc:hover { border-color: rgba(0,0,0,.22); transform: translateY(-1px); }
.lp-doc:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.lp-doc-title { display: block; font: 700 16px/1.3 var(--body); color: var(--ink); margin-bottom: 4px; }
.lp-doc-desc { display: block; font: 400 14.5px/1.55 var(--body); color: var(--muted); }

.lp-body a.lp-doc, .lp-body a.lp-doc:hover { text-decoration: none; color: var(--ink); }
.lp-body a.lp-doc .lp-doc-title { color: var(--ink); text-decoration: none; }
.lp-body a.lp-doc .lp-doc-desc { color: var(--muted); text-decoration: none; }
