html {
  --legal-background: #faf7ef;
  --legal-text: #201d19;
  --legal-surface: #fffefb;
  --legal-border: #d4cdbf;
  --legal-highlight: #fff5c2;
  --legal-shadow: #201d19;
  color-scheme: light;
  background: var(--legal-background);
}

html[data-color-scheme="dark"] {
  --legal-background: #191815;
  --legal-text: #f3ecdf;
  --legal-surface: #24221e;
  --legal-border: #756b5a;
  --legal-highlight: #383325;
  --legal-shadow: #0c0b09;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html:not([data-color-scheme]) {
    --legal-background: #191815;
    --legal-text: #f3ecdf;
    --legal-surface: #24221e;
    --legal-border: #756b5a;
    --legal-highlight: #383325;
    --legal-shadow: #0c0b09;
    color-scheme: dark;
  }
}

/* Standalone legal pages. Uses the same ink, paper, and hard shadow as the app. */
body.legal-page {
  margin: 0;
  background: var(--legal-background);
  color: var(--legal-text);
  font-family: "Fibo Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.legal-page .max-w-4xl {
  width: min(50rem, calc(100% - 2rem));
  padding-top: calc(2.5rem + env(safe-area-inset-top, 0px));
  padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0px));
}

body.legal-page h1 {
  margin: 0;
  color: var(--legal-text);
  font-size: clamp(2.4rem, 6vw, 3.5rem);
  font-family: "Fibo Serif", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

body.legal-page h2,
body.legal-page h3 {
  color: var(--legal-text);
  font-family: "Fibo Serif", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

body.legal-page p,
body.legal-page li {
  color: var(--legal-text);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
}

body.legal-page .bg-white.rounded-xl {
  border: 2px solid var(--legal-border) !important;
  border-radius: 10px !important;
  background: var(--legal-surface) !important;
  box-shadow: 3px 3px 0 var(--legal-shadow) !important;
}

body.legal-page .bg-gray-50,
body.legal-page .text-gray-500,
body.legal-page .text-gray-600,
body.legal-page .text-gray-700,
body.legal-page .text-gray-800,
body.legal-page .text-gray-900,
body.legal-page .text-blue-600,
body.legal-page .text-blue-800 {
  color: var(--legal-text) !important;
  background: transparent;
}

body.legal-page a {
  color: var(--legal-text);
  font-weight: 650;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

body.legal-page .text-sm,
body.legal-page .text-xs {
  font-size: 1rem !important;
}

body.legal-page .rounded-lg {
  border: 1px solid var(--legal-border);
  background: var(--legal-highlight) !important;
  box-shadow: none;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  text-decoration: none;
}

.legal-brand strong {
  font-family: "Fibo Serif", Georgia, serif;
  font-weight: 400;
  font-size: 30px;
  letter-spacing: -0.025em;
}

@media (max-width: 600px) {
  body.legal-page .max-w-4xl {
    padding-inline: 8px;
  }

  body.legal-page .bg-white {
    padding: 22px;
  }
}
