/* ================================================================
   legal-public.css — standalone legal page (public/legal.html)
   ================================================================
   Adds what the standalone page needs on top of terms&policy.css:
     - Body padding (layout.css is not loaded here)
     - Minimal top bar with brand + back link

   All .legal-* styles come from terms&policy.css unchanged, so the
   standalone page renders identically to the in-app version.
   ================================================================ */

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-base);
  min-height: 100vh;
  padding: var(--space-4) var(--space-3);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 768px) {
  body {
    padding: var(--space-6) var(--space-4);
  }
}

/* ----------------------------------------------------------------
   Top bar
   ---------------------------------------------------------------- */

.legal-public-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  max-width: 780px;
  margin: 0 auto var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--divider);
}

.legal-public-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color var(--duration-fast) var(--ease);
}

.legal-public-brand svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.legal-public-brand:hover {
  color: var(--accent);
}

.legal-public-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 var(--space-2);
  min-height: 30px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease);
}

.legal-public-back:hover {
  background: var(--bg-subtle);
}

.legal-public-back svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* ----------------------------------------------------------------
   Main wrapper — no layout.css here, so we compose it locally
   ---------------------------------------------------------------- */

.main-wrapper {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  flex: none;
}

/* ----------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------- */

@media (max-width: 640px) {
  body {
    padding: var(--space-3);
  }

  .legal-public-bar {
    margin-bottom: var(--space-3);
  }

  .legal-public-brand {
    font-size: var(--text-xs);
  }

  .legal-public-back span {
    display: none;
  }

  .legal-public-back {
    min-width: 32px;
    justify-content: center;
    padding: 0;
  }
}

/* ----------------------------------------------------------------
   Reduced motion
   ---------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .legal-public-brand,
  .legal-public-back {
    transition-duration: 0.01ms !important;
  }
}