/* ============================================================================
   Foluka waitlist: the extra rules the legal pages need (Privacy, Terms, Legal and the rest).

   Loaded by those thirteen pages only, after waitlist.css, so the home page's first load does not
   grow. It uses the page's own tokens and writes no colour of its own: the light finish and the dark
   page both come from the tokens, exactly as the other long pages do. waitlist/test/legal.pages.test.js
   holds that.

   Reading comes first (the 2026-10-24 upgrade, in the app's look): a measure of about 70 letters, generous lines, clear
   section headings between hairlines, the short version on the app's card, and nothing drawn that gets in the way of the words.
   ============================================================================ */

/* The date line under the summary: small and grey. */
.page p.prose__meta {
  margin-top: var(--s-4);
  color: var(--ink-3);
  font-size: max(12px, 0.875rem);
}

/* The words: one measure for paragraphs and lists, and room between the lines. */
.page.prose p:not(.kicker, .lede, .prose__meta),
.prose ul,
.prose ol {
  max-width: 34em;
  line-height: 1.65;
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

/* Lists: a small dot for each point (the page's own dots), hung outside the words so every line starts at the same place. */
.prose ul {
  margin-top: var(--s-3);
  padding-left: 1.375rem;
  color: var(--ink-2);
}

.prose ul > li {
  position: relative;
}

.prose ul > li::before {
  content: '';
  position: absolute;
  top: calc(0.825em - 3px);
  left: -1rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-3);
}

.prose li + li {
  margin-top: var(--s-2);
}

/* A numbered list reads like the bulleted one beside it. */
.prose ol {
  margin-top: var(--s-3);
  padding-left: 1.5rem;
  color: var(--ink-2);
  list-style: decimal;
}

.prose ol li::marker {
  color: var(--ink-3);
}

/* A link in a sentence is one box, so a link that wraps onto a second line never lies over the line below it or over the link beside it
   (two links' boxes meeting is a fault a finger cannot sort out). */
.prose p a,
.prose li a,
.legal-table a {
  display: inline-block;
  max-width: 100%;
}

/* A list that is only links (the "More" lists): each link is a row a finger can hit. */
.prose .link-list {
  list-style: none;
  padding-left: 0;
}

.prose .link-list > li::before {
  content: none;
}

.prose .link-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.prose .link-list li + li {
  margin-top: 0;
}

/* Each section stands between hairlines, under a heading a size below the page's own. The bar is pinned, so the page keeps its
   height clear at the top (scroll-padding-top on the root); this keeps a heading from sitting right against it. */
.legal-section {
  margin-top: var(--s-7);
  padding-top: var(--s-6);
  border-top: 1px solid var(--edge-soft);
  scroll-margin-top: var(--s-4);
}

.page .legal-section h2 {
  margin-top: 0;
  font: 700 clamp(1.3125rem, 1.2rem + 0.4vw, 1.5rem) / 1.25 var(--font-display);
  letter-spacing: -0.014em;
}

/* A small heading inside a section. */
.prose h3 {
  margin-top: var(--s-5);
  color: var(--ink);
  font: 700 1.0625rem / 1.35 var(--font-body);
  text-wrap: balance;
}

/* The short version at the top: the app's card (a hairline, the surface, a small shadow), in the column. */
.page .inshort {
  max-width: calc(34em + 2 * var(--s-5) + 2px);
  margin-top: var(--s-2);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 479px) {
  .page .inshort {
    padding: var(--s-4);
  }
}

.page .inshort h2 {
  margin-top: 0;
  font: 700 1.1875rem / 1.3 var(--font-display);
  letter-spacing: -0.01em;
}

.page .inshort ul {
  margin-top: var(--s-3);
}

.page .inshort p {
  max-width: none;
}

/* A quiet list of the sections, folded away until it is wanted: a flat row of the app's, which opens in place. A native disclosure,
   so it works without scripts. */
.page .toc {
  max-width: calc(34em + 2 * var(--s-5) + 2px);
  margin-top: var(--s-4);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--surface-2);
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.page .toc[open] {
  border-color: var(--line);
  background: var(--surface);
}

.toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: 44px;
  padding: 2px var(--s-4);
  border-radius: calc(var(--r-md) - 1px);
  color: var(--ink);
  font: 600 max(12px, 0.9375rem) / 1.35 var(--font-body);
  cursor: pointer;
  list-style: none;
}

.toc summary:focus-visible {
  border-radius: var(--r-md);
}

.toc summary::-webkit-details-marker {
  display: none;
}

.toc summary::after {
  content: '';
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--dur) var(--ease);
}

.toc[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.toc ol {
  margin: 0;
  padding: 0 var(--s-4) var(--s-3);
  list-style: none;
}

.toc li + li {
  margin-top: 0;
}

/* (.prose .toc a, not .toc a: .prose li a, above, is more specific and made a short link like "More" 35px wide) */
.prose .toc a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent-text);
  font-size: max(12px, 0.9375rem);
  text-decoration: none;
}

.prose .toc a:hover {
  text-decoration: underline;
}

@media (min-width: 640px) {
  .toc ol {
    columns: 2;
    column-gap: var(--s-6);
  }

  .toc li {
    break-inside: avoid;
  }
}

/* Tables: a real table where there is room; one card per row on a narrow screen, with each cell's heading in front of it. The
   headings are set like the words around them, small and bold, never in capitals. */
.page .table-wrap {
  max-width: 100%;
  margin-top: var(--s-4);
  overflow-x: auto;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: max(12px, 0.9375rem);
  line-height: 1.5;
}

.legal-table th,
.legal-table td {
  padding: var(--s-3) var(--s-3) var(--s-3) 0;
  border-bottom: 1px solid var(--edge-soft);
  color: var(--ink-2);
  text-align: left;
  vertical-align: top;
}

.legal-table thead th {
  border-bottom-color: var(--edge);
  color: var(--ink-3);
  font: 700 max(12px, 0.8125rem) / 1.3 var(--font-body);
}

.legal-table tbody th {
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 639px) {
  .legal-table,
  .legal-table tbody,
  .legal-table tr,
  .legal-table th,
  .legal-table td {
    display: block;
  }

  .legal-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .legal-table tr {
    padding-block: var(--s-3);
    border-bottom: 1px solid var(--edge-soft);
  }

  .legal-table th,
  .legal-table td {
    padding: var(--s-1) 0;
    border-bottom: 0;
    overflow-wrap: anywhere;
  }

  .legal-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--ink-3);
    font: 700 max(12px, 0.8125rem) / 1.3 var(--font-body);
  }
}

/* The postal address, where the one setting puts it: a line or two of plain text. */
.page p.legal-address {
  color: var(--ink);
  white-space: pre-line;
}

/* The page arrives the way the app's cards do (home-in, the home's own): the head, then the short version, within half a second. */
@media (prefers-reduced-motion: no-preference) {
  .prose .page__head > *,
  .page .inshort,
  .page .toc {
    animation: home-in var(--dur-slow) var(--ease-out) backwards;
  }

  .prose .page__head > :nth-child(2) {
    animation-delay: 40ms;
  }

  .prose .page__head > :nth-child(n + 3) {
    animation-delay: 80ms;
  }

  .page .inshort,
  .page .toc {
    animation-delay: 120ms;
  }
}

@media (forced-colors: active) {
  .page .inshort,
  .page .toc {
    border-color: CanvasText;
  }

  .prose ul > li::before {
    forced-color-adjust: none;
    background: CanvasText;
  }

  .legal-table th,
  .legal-table td,
  .legal-table tr {
    border-color: CanvasText;
  }
}

/* On paper: no bar, no list of sections, no card; the words and where they came from. */
@media print {
  .top,
  .skip,
  .toc,
  .foot__nav {
    display: none;
  }

  .page .inshort {
    border-color: CanvasText;
    background: none;
    box-shadow: none;
  }

  .page {
    max-width: none;
    margin: 0;
  }

  .page a[href^='http']::after {
    content: ' (' attr(href) ')';
  }
}
