/* Legal pages (/privacy, /terms-of-service). The head row has the title and a
   meta column. The body row has the article and a sticky table of contents.
   /assets/js/legal-toc.js marks the current section in the contents, and at
   1080px and below opens and closes the list. */

.lh-m {
  padding: 64px var(--pad) 56px;
}
.lh h1 {
  margin: 0 0 24px;
  font: 500 clamp(48px, 6.4vw, 96px) / 0.95 var(--font-display);
  letter-spacing: -0.026em;
  text-wrap: balance;
}
.lh .dek {
  max-width: 58ch;
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-secondary);
  text-wrap: pretty;
}
.meta {
  display: flex;
  flex-direction: column;
}
.meta > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px var(--pad-r);
  border-bottom: 1px solid var(--hair);
}
.meta .v {
  font: 13px var(--font-mono);
  color: var(--apx-ink);
}
.meta a:hover {
  color: var(--apx-blue-deep);
}

.lb-m {
  min-width: 0;
  padding: 56px var(--pad) 96px;
}
.toc {
  position: sticky;
  top: var(--hdr);
  max-height: calc(100vh - var(--hdr));
  overflow: auto;
}
.toc-d > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px var(--pad-r);
  border-bottom: 1px solid var(--hair);
  list-style: none;
}
.toc-d > summary::-webkit-details-marker {
  display: none;
}
/* The current section and the open sign show only in the narrow bar. */
.toc-cur,
.toc-d .tg {
  display: none;
}
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: i;
}
.toc li {
  counter-increment: i;
}
.toc a {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  padding: 9px var(--pad-r);
  border-bottom: 1px solid var(--hair);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
  transition: background var(--d-fast);
}
.toc a::before {
  content: counter(i, decimal-leading-zero);
  padding-top: 2px;
  font: 10px var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.toc a:hover {
  background: var(--apx-mist);
  color: var(--apx-ink);
}
.toc a.active {
  background: var(--apx-paper);
  color: var(--apx-ink);
  box-shadow: inset 2px 0 0 var(--apx-ink);
}

.prose {
  max-width: 68ch;
  font-size: 16px;
  line-height: 1.7;
  color: var(--apx-graphite);
}
.prose .lede {
  margin: 0 0 40px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--apx-ink);
}
.prose h2 {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 56px 0 16px;
  font: 500 26px / 1.15 var(--font-display);
  letter-spacing: -0.012em;
  color: var(--apx-ink);
  scroll-margin-top: calc(var(--hdr) + 24px);
}
.prose h2:first-of-type {
  margin-top: 40px;
}
.prose .lede + h2 {
  margin-top: 0;
}
.prose h2 .num {
  min-width: 28px;
  font: 500 11px var(--font-mono);
  letter-spacing: 0.16em;
  color: var(--text-muted);
}
.prose h3 {
  margin: 28px 0 10px;
  font: 500 18px / 1.3 var(--font-display);
  color: var(--apx-ink);
}
.prose p {
  margin: 0 0 16px;
}
.prose strong {
  font-weight: 600;
  color: var(--apx-ink);
}
.prose a {
  color: var(--apx-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.prose a:hover {
  color: var(--apx-blue-deep);
}
.prose ul {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.prose ul li {
  position: relative;
  margin-bottom: 8px;
  padding-left: 24px;
}
.prose ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  font: 13px var(--font-mono);
  color: var(--apx-ink);
}
.prose ol {
  margin: 0 0 20px;
  padding-left: 22px;
}
.prose ol li {
  margin-bottom: 8px;
}

/* When the rows stack, the contents become a bar that sticks under the top
   bar. It shows the current section, and a tap opens the list. */
@media (max-width: 1080px) {
  .rw.lb > .sd {
    order: -1;
    position: sticky;
    top: var(--hdr);
    z-index: 10;
    align-self: start;
    border-top: 0;
    border-bottom: 1px solid var(--apx-ink);
    background: var(--apx-bone);
  }
  .toc {
    position: static;
    max-height: none;
  }
  .toc-d > summary {
    min-height: 48px;
    padding: 0 var(--pad);
    border-bottom: 0;
    cursor: pointer;
  }
  .toc-d > summary:hover {
    background: var(--apx-mist);
  }
  .toc-cur {
    display: block;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    color: var(--apx-ink);
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .toc-d .tg {
    display: block;
    margin-left: auto;
    font: 18px / 1 var(--font-mono);
    color: var(--apx-ink);
    transition: transform var(--d-fast) var(--ease-out);
  }
  .toc-d[open] .tg {
    transform: rotate(45deg);
  }
  /* The open list covers the article, so the text under it does not move. */
  .toc-d[open] > ol {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--hdr) - 96px);
    overflow: auto;
    overscroll-behavior: contain;
    border-top: 1px solid var(--hair);
    border-bottom: 1px solid var(--apx-ink);
    background: var(--apx-bone);
    box-shadow: 0 16px 32px rgba(20, 19, 18, 0.12);
  }
  .toc a {
    align-items: center;
    min-height: 44px;
    padding: 8px var(--pad);
  }
  .prose h2 {
    scroll-margin-top: calc(var(--hdr) + 64px);
  }
}
@media (max-width: 720px) {
  .lh-m {
    padding: 40px var(--pad) 36px;
  }
  .lb-m {
    padding: 40px var(--pad) 64px;
  }
  .prose h2 {
    margin-top: 44px;
    font-size: 22px;
  }
}
