/* Legal pages (privacy-policy, terms). Tokens come from styles.css. */
.legal {
  box-sizing: content-box;
  max-width: var(--container);
  margin: 0 auto;
  padding: 72px var(--gutter) 112px;
  display: flex;
  gap: 64px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.legal__side {
  position: sticky;
  top: 88px;
  flex: 0 0 220px;
  font-size: 13.5px;
  font-weight: 500;
}

.legal-toc__label {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
}

.legal-toc__links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.legal-toc__links a {
  padding: 5px 0;
  color: var(--muted);
}

.legal-toc__links a:hover { color: var(--blue); }

.legal-toc--details { display: none; }

.legal-toc--details summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.legal-toc--details summary::-webkit-details-marker { display: none; }
.legal-toc--details summary::after { content: "+"; }
.legal-toc--details[open] summary::after { content: "-"; }

.legal__main {
  flex: 1 1 520px;
  min-width: 0;
  max-width: 680px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--body);
}

/* Date sits above the title as in the design; DOM order follows the source text. */
.legal__head {
  display: flex;
  flex-direction: column-reverse;
}

.legal__head h1 {
  margin: 0 0 24px;
  font-size: clamp(32px, 7vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 600;
  color: var(--ink);
}

.legal__updated {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.legal__main h2 {
  margin: 40px 0 12px;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--ink);
  scroll-margin-top: 88px;
}

.legal__main p { margin: 0 0 12px; }

.legal__main p a {
  color: var(--blue);
  overflow-wrap: anywhere;
}

.legal__main p a:hover { color: var(--blue-hover); }

.legal-table {
  overflow-x: auto;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.legal-table table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.5;
  overflow-wrap: normal; /* body sets anywhere, which squeezes narrow columns mid-word */
}

.legal-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.legal-table td {
  padding: 12px 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--surface-soft);
}

.legal-table tr:last-child td { border-bottom: 0; }

@media (max-width: 860px) {
  .legal {
    padding: 48px 24px 80px;
    gap: 24px;
  }
  .legal__side {
    position: static;
    flex: 1 1 100%;
    min-width: 0;
  }
  .legal-toc--side { display: none; }
  .legal-toc--details { display: block; }
  .legal__main {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
  }
}
