/* Legal content uses a light surface; keep legacy inline color tokens readable. */
.funding-legal .legal-body {
  --white: #142137;
  --gold: #795715;
  --muted: #526071;
  color: #142137;
}

.funding-legal .legal-hero .gold-text { color: var(--gold); }
.funding-legal .legal-layout { align-items: start; }
.funding-legal .legal-content { min-width: 0; overflow-wrap: anywhere; }
.funding-legal .legal-section { scroll-margin-top: 110px; }
.funding-legal .legal-section :is(h2, h3, strong) { color: #142137; }
.funding-legal .legal-content a { color: #795715; text-underline-offset: 3px; }
.funding-legal .legal-content a:hover { color: #4f390e; }

.funding-legal .legal-toc {
  position: sticky;
  top: 90px;
  align-self: start;
  max-height: calc(100vh - 114px);
  max-height: calc(100dvh - 114px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 20px 14px;
  background: #f5f6f8;
  border: 1px solid #e0e4e9;
  border-radius: 8px;
}

.funding-legal .legal-toc h4 {
  font-family: Montserrat, sans-serif;
  font-weight: 800;
  color: #142137;
  margin: 0 10px 14px;
}
.funding-legal .legal-toc ul { margin: 0; columns: auto; }
.funding-legal .legal-toc li { margin: 2px 0; }
.funding-legal .legal-toc a {
  display: block;
  padding: 7px 10px;
  border-left: 3px solid transparent;
  border-radius: 3px;
  color: #526071;
  font-size: .8125rem;
  line-height: 1.45;
}
.funding-legal .legal-toc a:hover { color: #142137; background: #e9edf2; }
.funding-legal .legal-toc a.active,
.funding-legal .legal-toc a[aria-current="location"] {
  color: #62460e;
  background: #f7ecd3;
  border-left-color: #987024;
  font-weight: 700;
}
.funding-legal .legal-toc a:focus-visible { outline-offset: -3px; }

/* Match the live legal pages: no contents sidebar on mobile/tablet widths. */
@media (min-width: 901px) {
  .funding-legal .legal-toc {
    top: 112px;
    max-height: calc(100vh - 136px);
    max-height: calc(100dvh - 136px);
  }
}

@media (max-width: 768px) {
  .funding-legal .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .funding-legal .legal-toc { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html:has(.funding-legal) { scroll-behavior: auto; }
}
