:root {
  --ink: #0c152c;
  --text: #2d3545;
  --muted: #70798a;
  --paper: #fff;
  --page: #f3f4f6;
  --accent: #e8223a;
  --line: #dfe3e9;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  min-width: 0;
  color: var(--text);
  background: var(--page);
  font-family: Montserrat, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.legal-header {
  min-height: 72px;
  padding: 13px max(24px, calc((100vw - 1680px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #fff;
  background: var(--ink);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.legal-brand {
  position: relative;
  padding-left: 17px;
  display: grid;
  gap: 4px;
  color: #fff;
  text-decoration: none;
}

.legal-brand::before {
  content: "";
  position: absolute;
  inset: 1px auto 1px 0;
  width: 3px;
  background: var(--accent);
  border-radius: 999px;
}

.legal-brand span {
  color: rgba(255, 255, 255, .52);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 1.4px;
  line-height: 1;
  text-transform: uppercase;
}

.legal-brand strong {
  font-size: 14px;
  letter-spacing: -.25px;
}

.legal-back {
  min-height: 40px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.legal-back:hover { border-color: rgba(255, 255, 255, .55); }

.legal-back svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.legal-back:focus-visible,
.legal-document a:focus-visible,
.legal-footer a:focus-visible,
.legal-footer button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.legal-main {
  width: min(1060px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.legal-document {
  padding: 58px clamp(34px, 6.2vw, 76px) 66px;
  background: var(--paper);
  border: 1px solid #e0e3e8;
  box-shadow: 0 12px 34px rgba(12, 21, 44, .055);
}

.legal-document-header {
  padding-bottom: 30px;
  border-bottom: 2px solid var(--ink);
}

.legal-document-type {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.legal-document h1 {
  max-width: 850px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 4.5vw, 46px);
  line-height: 1.12;
  letter-spacing: -1.5px;
}

.legal-document-date {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.legal-toc {
  padding: 28px 0 30px;
  border-bottom: 1px solid var(--line);
}

.legal-toc > strong {
  display: block;
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 12px;
}

.legal-toc ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 38px;
}

.legal-toc li {
  padding-left: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.legal-toc a {
  text-decoration-color: #b6bdc8;
  text-underline-offset: 3px;
}

.legal-toc a:hover,
.legal-section a:hover { color: var(--accent); }

.legal-section {
  padding: 31px 0;
  border-bottom: 1px solid var(--line);
}

.legal-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.legal-section h2 {
  margin: 0 0 17px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: -.35px;
}

.legal-section h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.legal-section p {
  margin: 0;
  font-size: 13px;
  line-height: 1.78;
}

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

.legal-section a {
  color: var(--ink);
  font-weight: 650;
  text-underline-offset: 3px;
}

.legal-data-table {
  margin: 20px 0;
  border-top: 1px solid var(--ink);
}

.legal-data-table > div {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.legal-data-table p {
  color: #4e586a;
  font-size: 12px;
  line-height: 1.72;
}

.legal-data-table p + p { margin-top: 6px; }

.legal-data-table strong { color: var(--ink); }

.legal-details {
  margin: 23px 0 0;
  border-top: 1px solid var(--ink);
}

.legal-details > div {
  padding: 11px 0;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.legal-details dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.6;
}

.legal-details dd {
  margin: 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.legal-details a { color: inherit; }

.legal-footer {
  min-height: 82px;
  padding: 23px max(24px, calc((100vw - 1680px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: rgba(255, 255, 255, .58);
  background: var(--ink);
  border-top: 1px solid rgba(255, 255, 255, .09);
  font-size: 10px;
  line-height: 1.55;
}

.legal-footer p { margin: 0; }

.legal-footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 20px;
  flex-wrap: wrap;
}

.legal-footer a,
.legal-footer .analytics-settings-button {
  color: rgba(255, 255, 255, .88);
  font: inherit;
  font-weight: 700;
  text-underline-offset: 4px;
}

.legal-footer a:hover,
.legal-footer .analytics-settings-button:hover { color: #fff; }

@media (max-width: 760px) {
  html { scroll-padding-top: 14px; }

  .legal-header {
    min-height: 64px;
    padding: 12px 16px;
  }

  .legal-brand { padding-left: 13px; }
  .legal-brand strong { max-width: 185px; font-size: 10.5px; line-height: 1.25; }
  .legal-brand span { font-size: 6.5px; }

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

  .legal-back span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

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

  .legal-document {
    padding: 34px 20px 44px;
    border: 0;
    box-shadow: none;
  }

  .legal-document-header { padding-bottom: 24px; }

  .legal-document h1 {
    font-size: clamp(27px, 8.4vw, 36px);
    letter-spacing: -1px;
  }

  .legal-toc { padding: 24px 0; }
  .legal-toc ol { grid-template-columns: 1fr; gap: 7px; }

  .legal-section { padding: 27px 0; }
  .legal-section h2 { margin-bottom: 14px; font-size: 18px; }
  .legal-section h3 { font-size: 13px; }
  .legal-section p { font-size: 12px; line-height: 1.75; }
  .legal-data-table p { font-size: 11.5px; }

  .legal-details > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .legal-footer {
    padding: 24px 18px calc(26px + env(safe-area-inset-bottom));
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .legal-footer-links {
    justify-content: flex-start;
    gap: 10px 16px;
  }
}
