.legal-page {
  background: #f7f8f7;
  color: var(--ink);
}

.legal-page a:focus-visible,
.legal-page select:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.legal-header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.legal-header-actions > a,
.legal-footer a {
  color: var(--ink);
  text-decoration: none;
}

.legal-header-actions > a:hover,
.legal-footer a:hover,
.legal-sidebar a:hover {
  color: var(--cyan);
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 760px);
  justify-content: center;
  gap: clamp(32px, 6vw, 84px);
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 64px 0 88px;
}

.legal-sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.legal-sidebar nav {
  display: grid;
  gap: 10px;
}

.legal-sidebar a {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
  text-decoration: none;
}

.legal-document-header {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.legal-document-header h1 {
  margin: 8px 0 18px;
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.legal-document-header p {
  color: var(--muted);
  line-height: 1.65;
}

.legal-document-header p:last-child {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.legal-section {
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.legal-section h2 {
  margin: 0 0 16px;
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  letter-spacing: 0;
}

.legal-section p,
.legal-section li,
.legal-language-priority {
  line-height: 1.75;
}

.legal-section p {
  margin: 0;
}

.legal-section p + p {
  margin-top: 14px;
}

.legal-section ul {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding-left: 1.2rem;
}

.legal-language-priority {
  margin-top: 36px;
  color: var(--muted);
  font-size: 0.92rem;
}

.legal-footer {
  align-items: flex-start;
}

.legal-footer > div,
.legal-footer nav {
  display: grid;
  gap: 8px;
}

.legal-footer > p {
  max-width: 420px;
  line-height: 1.6;
}

@media (max-width: 760px) {
  .legal-header,
  .legal-header-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .legal-header-actions {
    width: 100%;
    gap: 12px;
  }

  .legal-header-actions .language-select {
    width: min(100%, 280px);
  }

  .legal-layout {
    grid-template-columns: 1fr;
    padding-top: 36px;
  }

  .legal-sidebar {
    position: static;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
  }

  .legal-sidebar nav {
    display: flex;
    width: max-content;
  }

  .legal-sidebar a {
    max-width: 220px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
  }

  .legal-document-header h1 {
    font-size: 2.5rem;
  }
}
