/**
 * Legal / policy pages — prose layout aligned with public shell.
 */
.legal-main {
  max-width: var(--page-max, 1180px);
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2rem) max(1.25rem, env(safe-area-inset-right, 0px))
    clamp(2rem, 5vw, 3rem) max(1.25rem, env(safe-area-inset-left, 0px));
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .legal-main {
    grid-template-columns: minmax(11rem, 14rem) minmax(0, 1fr);
    align-items: start;
    gap: 1.5rem;
  }
}

.legal-sidebar {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md, 14px);
}

.legal-sidebar__label {
  margin: 0 0 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted, #71717a);
}

.legal-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.legal-sidebar__nav a {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  font-size: 0.875rem;
  color: var(--color-text-secondary, #a1a1aa);
  text-decoration: none;
  transition:
    color 150ms ease,
    background 150ms ease;
}

.legal-sidebar__nav a:hover {
  color: var(--color-text-primary, #f8fafc);
  background: rgba(123, 66, 246, 0.1);
}

.legal-sidebar__nav a.is-active {
  color: #e9d5ff;
  background: rgba(123, 66, 246, 0.2);
  font-weight: 600;
}

html[data-theme="light"] .legal-sidebar__nav a.is-active {
  color: #5b21b6;
  background: rgba(123, 66, 246, 0.12);
}

.legal-article {
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--radius-lg, 18px);
  min-width: 0;
}

#legal-effective:empty {
  display: none;
}

.legal-effective {
  margin: 0 0 0.35rem;
}

.legal-article__head h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.legal-intro {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  color: var(--color-text-secondary, #a1a1aa);
  line-height: 1.65;
}

.legal-intro a,
.legal-section a {
  color: #c4b5fd;
  text-decoration: underline;
  text-underline-offset: 2px;
}

html[data-theme="light"] .legal-intro a,
html[data-theme="light"] .legal-section a {
  color: #6d28d9;
}

.legal-section {
  margin-bottom: 1.75rem;
  scroll-margin-top: calc(var(--nav-offset, 4rem) + 1rem);
}

.legal-section h2 {
  margin: 0 0 0.65rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary, #f8fafc);
}

.legal-section p {
  margin: 0 0 0.75rem;
  color: var(--color-text-secondary, #a1a1aa);
  line-height: 1.7;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section ul {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
  color: var(--color-text-secondary, #a1a1aa);
  line-height: 1.65;
}

.legal-section li {
  margin-bottom: 0.35rem;
}

.legal-section strong {
  color: var(--color-text-primary, #e4e4e7);
  font-weight: 600;
}

.legal-page .site-footer {
  margin-top: 0;
}

.legal-page .site-footer.site-footer--legal {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
  padding-top: 1.75rem;
}

.legal-page .site-footer__legal {
  display: none !important;
}

.legal-page .site-footer__copy {
  width: 100%;
  margin: 0;
  text-align: center;
}

.legal-page .site-footer__utility {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.25rem 0.45rem;
  margin: 0;
  font-size: 0.8125rem;
}

.legal-page .site-footer__utility a {
  padding: 0.25rem 0.45rem;
  border-radius: 999px;
  color: var(--color-text-secondary, #a1a1aa);
  text-decoration: none;
  font-weight: 500;
  transition:
    color 150ms ease,
    background 150ms ease;
}

.legal-page .site-footer__utility a:hover {
  color: var(--color-text-primary, #f8fafc);
  background: rgba(123, 66, 246, 0.12);
}

html[data-theme="light"] .legal-page .site-footer__utility a {
  color: #64748b;
}

html[data-theme="light"] .legal-page .site-footer__utility a:hover {
  color: #5b21b6;
  background: rgba(123, 66, 246, 0.08);
}

.legal-page .site-footer__sep {
  color: var(--color-text-muted, #71717a);
  user-select: none;
  line-height: 1;
}
