/* Autorestage — the legal pages (privacy.html, data-deletion.html).
 *
 * Tokens, the nav, the pills, the footer and .ticks come from style.css and
 * sections.css; the breadcrumb and the current-page nav state from
 * landing.css. This file is only what a long document adds. Nothing here
 * defines a colour of its own, so both themes work from the same token names.
 *
 * A separate file and not a <style> block because the vhost's CSP is
 * `style-src 'self'`. The build hashes it like every other top-level .css. */

/* An owner detail still to be filled in. Literal {{NAME}} text, so it can be
   found with grep, and highlighted so it cannot be missed on the page. */
.ph { padding: .04em .4em; border-radius: 6px; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); color: var(--ink); font: 500 .9em var(--mono); -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* ── the page head ─────────────────────────────────────────────────────── */
.legal-hero { max-width: var(--wrap); margin: 0 auto; padding: clamp(20px, 3vw, 40px) var(--gut) clamp(36px, 5vw, 64px); }
.legal-hero h1 { margin-top: 18px; max-width: 16ch; font-size: clamp(2.4rem, 1.2rem + 4.4vw, 5rem); font-weight: 600; line-height: .98; letter-spacing: -.052em; text-wrap: balance; }
.legal-lede { max-width: 56ch; margin-top: 24px; color: var(--ink-2); font-size: var(--t-lead); line-height: 1.55; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 8px 30px; margin-top: 28px; color: var(--ink-3); font-size: .88rem; line-height: 1.7; }
.legal-meta li { position: relative; }
.legal-meta li + li::before { content: ''; position: absolute; left: -17px; top: calc(.85em - 2px); width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.legal-meta b { color: var(--ink-2); font-weight: 600; }

/* Privacy <-> Data deletion, the pricing page's segmented control as two links. */
.doc-switch { display: inline-flex; gap: 4px; margin-top: 30px; padding: 5px; border-radius: 999px; background: var(--bg-alt); box-shadow: inset 0 0 0 1px var(--line); }
.doc-switch a { display: inline-flex; align-items: center; height: 38px; padding: 0 18px; border-radius: 999px; color: var(--ink-2); font-size: .93rem; font-weight: 500; text-decoration: none; transition: background-color .22s var(--ease), color .16s, transform .12s var(--ease); }
.doc-switch a:hover { color: var(--ink); }
.doc-switch a:active { transform: scale(.97); }
.doc-switch a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-s); }

/* ── body: contents on the left, the document on the right ─────────────── */
.legal-body { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut) var(--sec); display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 8fr); gap: clamp(32px, 5vw, 96px); align-items: start; }
.toc { position: sticky; top: calc(var(--nav-h) + 28px); max-height: calc(100vh - var(--nav-h) - 56px); overflow-y: auto; overscroll-behavior: contain; padding-bottom: 8px; }
.toc-h { margin-bottom: 14px; color: var(--ink-3); font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.toc ol { display: grid; gap: 1px; border-left: 1px solid var(--line-2); }
.toc a { display: flex; gap: 10px; margin-left: -1px; padding: 6px 0 6px 16px; border-left: 2px solid transparent; color: var(--ink-3); font-size: .9rem; line-height: 1.35; text-decoration: none; transition: color .16s, border-color .16s; }
.toc a:hover { color: var(--ink); border-left-color: var(--accent); }
.toc a span { flex: none; min-width: 1.6em; font: 500 .76rem/1.75 var(--mono); }

/* ── the document ──────────────────────────────────────────────────────── */
.doc { min-width: 0; }
.glance { padding: clamp(22px, 3vw, 38px); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-s), 0 0 0 1px var(--line); }
.glance h2 { font-size: clamp(1.3rem, 1.1rem + .7vw, 1.65rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.15; }
.glance > p { margin-top: 8px; color: var(--ink-3); font-size: .9rem; }
.glance .ticks { margin-top: 22px; gap: 14px; }
.glance .ticks li { max-width: 70ch; color: var(--ink-2); }
.glance .ticks b { color: var(--ink); font-weight: 600; }
.glance a { color: var(--accent-ink); text-underline-offset: 3px; }

.doc > section { margin-top: clamp(40px, 5vw, 64px); padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--line); scroll-margin-top: calc(var(--nav-h) + 16px); }
.doc h2 { display: flex; align-items: baseline; gap: 14px; font-size: clamp(1.45rem, 1.1rem + 1.1vw, 2rem); font-weight: 600; line-height: 1.1; letter-spacing: -.038em; text-wrap: balance; }
.doc h2 .n { flex: none; font: 500 .84rem/1 var(--mono); color: var(--accent-ink); letter-spacing: 0; }
.doc h3 { margin-top: 32px; font-size: 1.08rem; font-weight: 600; letter-spacing: -.02em; scroll-margin-top: calc(var(--nav-h) + 16px); }
.doc p, .doc li { max-width: 68ch; color: var(--ink-2); font-size: 1.01rem; line-height: 1.7; }
.doc p { margin-top: 14px; }
.doc h2 + p, .doc h3 + p { margin-top: 12px; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc a:not(.pill) { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.doc a:not(.pill):hover { text-decoration-thickness: 2px; }
.doc code { padding: 1px 6px; border-radius: 6px; background: var(--bg-alt); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font: .86em var(--mono); overflow-wrap: anywhere; }

.dots { margin-top: 14px; display: grid; gap: 10px; }
.dots li { position: relative; padding-left: 22px; }
.dots li::before { content: ''; position: absolute; left: 3px; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* Numbered steps, the "how it works" rail at document size. Not .steps:
   sections.css already owns that name for the home page's story. */
.legal-steps { margin-top: 18px; display: grid; gap: 14px; counter-reset: step; }
.legal-steps li { position: relative; padding-left: 44px; counter-increment: step; }
.legal-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--line-2); color: var(--accent-ink); font-size: .85rem; font-weight: 600; line-height: 1; }

.callout { margin-top: 22px; padding: 20px 22px; border-radius: var(--r-m); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--line-2); }
.callout p { margin-top: 0; color: var(--ink); }
.callout p + p { margin-top: 10px; }

/* Two ways in, side by side: the iPhone and the Android path. */
.paths { margin-top: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.path { padding: 20px 22px 22px; border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow-s), 0 0 0 1px var(--line); }
.path h3 { margin-top: 0; }
.path .legal-steps { margin-top: 14px; gap: 10px; }
.path .legal-steps li { font-size: .97rem; }

/* The button that reopens the consent notice. consent.js answers it, so it
   is not shown without scripts (the footer's Cookie settings does the same). */
.consent-open { margin-top: 20px; }
:root:not(.js) .consent-open { display: none; }

/* Tables: a card with hairline rows; under 680px each row becomes a card of
   its own, labelled from data-label, rather than scrolling sideways. */
.dtable { width: 100%; margin-top: 22px; border-collapse: separate; border-spacing: 0; border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow-s), 0 0 0 1px var(--line); overflow: hidden; font-size: .94rem; line-height: 1.55; }
.dtable th, .dtable td { padding: 14px 18px; text-align: left; vertical-align: top; }
.dtable thead th { background: var(--bg-alt); color: var(--ink-3); font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.dtable tbody tr + tr > * { border-top: 1px solid var(--line); }
.dtable tbody th { width: 24%; color: var(--ink); font-weight: 600; }
.dtable td { color: var(--ink-2); }
.dtable td small { display: block; margin-top: 4px; color: var(--ink-3); font-size: .85rem; }
.dtable code { font-size: .84em; }

/* ── responsive ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .legal-body { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; overflow: visible; padding: 18px 20px; border-radius: var(--r-m); background: var(--bg-alt); box-shadow: inset 0 0 0 1px var(--line); }
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; border-left: 0; }
  .toc a { margin-left: 0; padding: 6px 0; border-left: 0; }
}
@media (max-width: 680px) {
  .paths { grid-template-columns: minmax(0, 1fr); }
  .dtable thead { display: none; }
  .dtable, .dtable tbody, .dtable tr, .dtable th, .dtable td { display: block; width: auto; }
  .dtable tr { padding: 16px 18px; }
  .dtable tbody tr + tr > * { border-top: 0; }
  .dtable tbody tr + tr { border-top: 1px solid var(--line); }
  .dtable tbody th, .dtable td { width: auto; padding: 0; }
  .dtable td { margin-top: 10px; }
  .dtable td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--ink-3); font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
}
@media (max-width: 600px) {
  .legal-meta { flex-direction: column; gap: 6px; }
  .legal-meta li + li::before { display: none; }
}
@media (max-width: 520px) {
  .toc ol { grid-template-columns: minmax(0, 1fr); }
  .doc-switch { display: flex; }
  .doc-switch a { flex: 1; justify-content: center; padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .doc-switch a { transition: none; }
}

@media print {
  .toc, .doc-switch, .consent-open { display: none !important; }
  .legal-body { display: block; padding-bottom: 0; }
  .glance, .dtable, .path { box-shadow: 0 0 0 1px #999; }
  .doc a:not(.pill)::after { content: ' (' attr(href) ')'; font-size: .85em; }
}

