:root {
  --legal-danger: #ff5a67;
  --legal-danger-strong: #ff7a84;
  --legal-danger-surface: rgba(122, 12, 26, 0.34);
  --legal-danger-border: rgba(255, 90, 103, 0.78);
  --legal-card: rgba(255, 255, 255, 0.065);
}

.legal-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(217, 42, 138, 0.18), transparent 38rem),
    radial-gradient(circle at 92% 18%, rgba(70, 215, 232, 0.08), transparent 32rem),
    var(--navy-950);
}

.legal-page a {
  overflow-wrap: anywhere;
}

.legal-skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: #10111a;
  font-weight: 900;
  background: white;
  border-radius: 8px;
  transform: translateY(-160%);
}

.legal-skip-link:focus {
  transform: translateY(0);
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(calc(100% - 36px), 1040px);
  margin: 0 auto;
  padding: 26px 0;
}

.legal-header__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.legal-header__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 13px;
  color: white;
  font-size: 0.9rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.legal-header__link:hover,
.legal-header__link:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.legal-main {
  width: min(calc(100% - 36px), 900px);
  margin: 0 auto;
  padding: 42px 0 96px;
}

.legal-hero {
  margin-bottom: 34px;
}

.legal-hero h1 {
  max-width: 860px;
  margin: 0;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: clamp(3.1rem, 10vw, 6.7rem);
  line-height: 0.92;
  text-wrap: balance;
}

.legal-lead {
  max-width: 760px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  line-height: 1.6;
}

.legal-draft-banner,
.legal-pending {
  color: #fff;
  background: var(--legal-danger-surface);
  border: 2px solid var(--legal-danger-border);
  border-radius: 10px;
}

.legal-draft-banner {
  display: grid;
  gap: 7px;
  margin: 28px 0 0;
  padding: 18px 20px;
}

.legal-draft-banner strong,
.legal-pending strong {
  color: #fff;
  font-size: 0.92rem;
  font-weight: 950;
  letter-spacing: 0.025em;
}

.legal-draft-banner span:last-child,
.legal-pending p {
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.55;
}

.legal-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
}

.legal-meta div {
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.legal-meta dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-meta dd {
  margin: 6px 0 0;
  color: white;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.4;
}

.legal-meta__pending {
  color: var(--legal-danger-strong);
}

.legal-toc {
  margin: 30px 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.legal-toc strong {
  display: block;
  margin-bottom: 10px;
}

.legal-toc ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal-toc a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.38);
  text-underline-offset: 4px;
}

.legal-section {
  margin-top: 18px;
  padding: clamp(22px, 4vw, 34px);
  background: var(--legal-card);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.legal-section h2 {
  margin: 0 0 14px;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  line-height: 1.2;
}

.legal-section h3 {
  margin: 24px 0 9px;
  font-size: 1.05rem;
}

.legal-section p,
.legal-section li,
.legal-section td,
.legal-section th {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
}

.legal-section p:first-of-type {
  margin-top: 0;
}

.legal-section p:last-child,
.legal-section ul:last-child,
.legal-section ol:last-child,
.legal-section dl:last-child {
  margin-bottom: 0;
}

.legal-section a,
.legal-contact-card a {
  color: white;
  font-weight: 850;
  text-decoration: underline;
  text-decoration-color: rgba(70, 215, 232, 0.7);
  text-underline-offset: 4px;
}

.legal-section ul,
.legal-section ol {
  padding-left: 1.3rem;
}

.legal-pending {
  margin: 20px 0 0;
  padding: 16px 18px;
}

.legal-pending p {
  margin: 7px 0 0;
}

.legal-table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.legal-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.legal-table th,
.legal-table td {
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.legal-table th {
  color: white;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.06);
}

.legal-table tr:last-child td {
  border-bottom: 0;
}

.legal-contact-card {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(255, 68, 88, 0.16), rgba(217, 42, 138, 0.12));
  border: 1px solid rgba(255, 157, 108, 0.38);
  border-radius: 10px;
}

.legal-contact-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
}

.legal-contact-card .button {
  width: fit-content;
}

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

.legal-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 18px;
  max-width: 780px;
}

.legal-footer a[aria-current="page"] {
  color: var(--peach);
  text-decoration: underline;
  text-underline-offset: 4px;
}

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

  .legal-header__actions {
    display: grid;
    justify-items: stretch;
  }

  .legal-meta {
    grid-template-columns: 1fr;
  }

  .legal-toc ul {
    display: grid;
    gap: 2px;
  }

  .legal-footer {
    display: grid;
  }

  .legal-footer .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .legal-header {
    display: grid;
  }

  .legal-header__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legal-header__link {
    padding-inline: 10px;
  }

  .legal-main {
    padding-top: 22px;
  }

  .legal-section,
  .legal-draft-banner,
  .legal-pending {
    border-radius: 8px;
  }

  .legal-contact-card .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-page *,
  .legal-page *::before,
  .legal-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .legal-page {
    color-scheme: light;
    color: #111;
    background: white;
  }

  .legal-header,
  .legal-toc,
  .legal-footer {
    display: none !important;
  }

  .legal-main {
    width: 100%;
    padding: 0;
  }

  .legal-section,
  .legal-meta div {
    color: #111;
    background: white;
    border-color: #bbb;
    break-inside: avoid;
  }

  .legal-section p,
  .legal-section li,
  .legal-section td,
  .legal-section th,
  .legal-lead {
    color: #222;
  }

  .legal-draft-banner,
  .legal-pending {
    color: #111;
    background: #ffe8ea;
    border-color: #b00020;
  }
}
