/* Legal and account pages. Tokens, nav and footer come from site.css. */

.page-head { padding: clamp(40px, 6vw, 88px) 0 clamp(32px, 4vw, 48px); }
.page-head h1 { font-size: var(--display-m); letter-spacing: -0.045em; }
.page-sub { margin-top: 14px; font-size: var(--text-lg); color: var(--muted); max-width: 34em; }
.page-meta { margin-top: 20px; display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: var(--r-pill); background: var(--sunk); color: var(--ink-2); font-size: var(--text-xs); font-weight: 600; }

.legal-grid { padding-bottom: clamp(72px, 9vw, 128px); }
.legal-grid > .prose { border-top: 1px solid var(--line); padding-top: 40px; }
@media (min-width: 1024px) {
  .legal-grid.has-toc { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 64px; align-items: start; }
}

/* "On this page", built by site.js from the document's h2s */
.toc { display: none; }
@media (min-width: 1024px) {
  .toc:not([hidden]) {
    display: block; position: sticky; top: calc(var(--nav-h) + 24px);
    max-height: calc(100dvh - var(--nav-h) - 48px); overflow-y: auto; padding: 40px 4px 24px 0;
    border-top: 1px solid var(--line); scrollbar-width: thin;
  }
}
.toc-title { font-size: var(--text-sm); font-weight: 650; margin: 0 0 10px 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a {
  display: block; padding: 6px 12px; border-radius: var(--r-pill);
  color: var(--muted); font-size: var(--text-xs); line-height: 1.4; text-decoration: none;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
/* The Termly export's headings are in capitals; show them in sentence case in the list. */
.legal-grid:has(.prose-termly) .toc a { text-transform: lowercase; }
.legal-grid:has(.prose-termly) .toc a::first-letter { text-transform: uppercase; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current] { background: var(--sunk); color: var(--ink); font-weight: 600; }

/* ---------- Prose ---------- */
.prose { max-width: 72ch; color: var(--ink-2); font-size: var(--text-md); line-height: 1.7; overflow-wrap: break-word; }
.prose h2 { margin: 56px 0 16px; font-size: 1.5rem; letter-spacing: -0.025em; line-height: 1.25; color: var(--ink); scroll-margin-top: calc(var(--nav-h) + 24px); }
.prose > h2:first-child, .prose > section:first-child, .prose > :first-child { margin-top: 0; }
.prose h3 { margin: 32px 0 10px; font-size: 1.1875rem; letter-spacing: -0.015em; line-height: 1.3; color: var(--ink); scroll-margin-top: calc(var(--nav-h) + 24px); }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 1.25em; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose a { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }

/* The Termly export sets its section titles in capitals: lighter tracking reads better. */
.prose-termly h2 { font-size: 1.125rem; letter-spacing: 0.01em; line-height: 1.4; padding-top: 28px; border-top: 1px solid var(--line); }
.prose-termly h2#toc { border-top: 0; padding-top: 0; }
.prose-termly .termly-badge { display: block; margin: 0 0 32px; }
.prose-termly .in-short { padding: 14px 18px; border-radius: var(--r-inner); background: var(--accent-softer); color: var(--ink-2); }
.prose-termly .in-short strong { color: var(--accent-ink); }

.table-scroll { margin: 8px 0 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-inner); background: var(--surface); }
.prose table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: var(--text-sm); line-height: 1.5; }
.prose th, .prose td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: var(--sunk); color: var(--ink); font-weight: 650; }
.prose tr:last-child td { border-bottom: 0; }
.prose td:last-child { font-weight: 650; color: var(--ink); white-space: nowrap; }
/* Data tables whose last column is prose, not a short value: no emphasis, wraps normally. */
.prose .table-plain td:last-child { font-weight: inherit; color: inherit; white-space: normal; }
.prose .table-plain td:first-child { color: var(--ink); font-weight: 600; }

/* ---------- Notices ---------- */
.notice { margin: 8px 0 24px; padding: clamp(22px, 3vw, 32px); border-radius: var(--r-surface); background: var(--surface); border: 1px solid var(--line); }
.prose .notice h2 { margin: 0 0 12px; display: flex; align-items: center; gap: 10px; font-size: 1.3125rem; }
.notice .i { width: 24px; height: 24px; color: var(--accent-ink); }
.notice-warning { margin-top: 40px; background: var(--accent-softer); border-color: var(--accent-soft); }
.notice > :last-child { margin-bottom: 0; }

/* ---------- Delete account steps ---------- */
.prose .steps { list-style: none; padding: 0; margin: 24px 0 0; counter-reset: step; display: grid; gap: 0; }
.steps li { position: relative; margin: 0; padding: 0 0 28px 64px; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -4px;
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 750; font-variant-numeric: tabular-nums;
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 19.5px; top: 44px; bottom: 4px; width: 1px; background: var(--line-strong); }
.prose .steps h3 { margin: 0 0 4px; font-size: 1.125rem; }
.steps p { margin: 0; color: var(--muted); }

/* ---------- Terms of Service: numbered clauses ---------- */
.prose-terms h2 { padding-top: 28px; border-top: 1px solid var(--line); font-size: 1.3125rem; }
.prose-terms .notice + h2 { border-top: 0; padding-top: 0; }
.prose-terms .notice h2 { border-top: 0; padding-top: 0; }
.clause { position: relative; padding-left: 3.25em; }
.clause .cl { position: absolute; left: 0; top: 0; color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.prose .clause-list { margin: -4px 0 18px 3.25em; padding-left: 1.6em; list-style-type: lower-alpha; }
.prose .clause-list li::marker { color: var(--muted); font-weight: 600; }
/* Conspicuous disclaimers: capitals, so a touch smaller and tracked out to stay readable. */
.clause.caps { font-size: var(--text-sm); letter-spacing: 0.015em; line-height: 1.65; color: var(--ink); }
.notice-key { margin: 0 0 40px; background: var(--accent-softer); border-color: var(--accent-soft); }
.notice-key p { color: var(--ink-2); }
@media (max-width: 640px) {
  .clause { padding-left: 2.6em; }
  .prose .clause-list { margin-left: 1em; }
}

/* ---------- /legal: one card per app ---------- */
.app-legal { list-style: none; margin: 0; padding: 40px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.app-legal-card { padding: clamp(22px, 3vw, 32px); border-radius: var(--r-surface); background: var(--surface); border: 1px solid var(--line); }
.app-legal-card h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; font-size: 1.3125rem; letter-spacing: -0.02em; }
.app-legal-card h2 img { border-radius: var(--r-inner); }
.app-legal-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.app-legal-card a { color: var(--accent-ink); font-weight: 550; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.app-legal-card a:hover { text-decoration-thickness: 2px; }
