:root {
  --legal-ink: #1c2538;
  --legal-muted: #505d73;
  --legal-blue: #304a84;
  --legal-paper: #fff;
  --legal-surface: #f3f5fa;
  --legal-line: #dfe5ef;
  --legal-tint: #edf2fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--legal-ink);
  background: var(--legal-surface);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

.legal-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  min-height: 82px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px clamp(24px, 4vw, 70px);
  border-bottom: 1px solid var(--legal-line);
  background: var(--legal-paper);
}

.legal-business {
  display: flex;
  min-width: 0;
  grid-column: 2;
  align-items: center;
  justify-self: center;
  gap: 10px;
  font-weight: 650;
  line-height: 1.35;
}

.legal-business img {
  width: 142px;
  height: auto;
  max-height: 66px;
  object-fit: contain;
}

.legal-business span {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legal-header-actions {
  display: flex;
  flex: 0 0 auto;
  grid-column: 3;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.legal-header-actions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--legal-line);
  border-radius: 12px;
  color: var(--legal-blue);
}

.legal-back-link {
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
}

.legal-header-actions .legal-account-icon,
.legal-header-actions .legal-close {
  width: 44px;
}

.legal-header-actions .legal-close {
  display: none;
}

.legal-header-actions a:hover {
  background: var(--legal-tint);
}

.legal-header-actions svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.legal-main {
  width: min(840px, calc(100% - 2 * clamp(12px, 4vw, 32px)));
  margin: 0 auto;
  padding: clamp(28px, 6vw, 64px) 0 clamp(44px, 7vw, 76px);
}

.legal-title {
  margin-bottom: 20px;
  padding: 0 4px;
}

.legal-title h1 {
  margin: 0;
  font-size: clamp(29px, 4.3vw, 48px);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 10px 0 0;
  color: var(--legal-muted);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.legal-meta span:last-child {
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--legal-blue);
  background: var(--legal-tint);
  font-size: 12px;
}

.legal-content {
  padding: clamp(18px, 5vw, 48px);
  border: 1px solid var(--legal-line);
  border-radius: 16px;
  background: var(--legal-paper);
  box-shadow: 0 6px 24px rgba(28, 37, 56, 0.045);
  overflow-wrap: anywhere;
}

.legal-content p,
.legal-content ul {
  margin: 0;
}

.legal-content .legal-intro {
  color: var(--legal-ink);
  font-size: clamp(17px, 2.4vw, 20px);
  line-height: 1.5;
}

.legal-content section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--legal-line);
  color: var(--legal-muted);
}

.legal-content h2 {
  margin: 0 0 8px;
  color: var(--legal-ink);
  font-size: clamp(19px, 2.8vw, 23px);
  font-weight: 650;
  line-height: 1.3;
}

.legal-content p + p,
.legal-content p + ul,
.legal-content ul + p {
  margin-top: 10px;
}

.legal-content ul {
  padding-inline-start: 20px;
}

.legal-content li + li {
  margin-top: 5px;
}

.legal-content strong {
  color: var(--legal-ink);
  font-weight: 650;
}

.legal-content code {
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--legal-blue);
  background: var(--legal-tint);
  font-size: 0.88em;
}

.legal-content a {
  color: var(--legal-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 24px;
  padding: 16px clamp(12px, 4vw, 32px);
  border-top: 1px solid var(--legal-line);
  color: var(--legal-muted);
  background: var(--legal-paper);
  font-size: 13px;
  text-align: center;
}

.legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 4px;
}

.legal-footer a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 8px;
}

.legal-footer a:hover,
.legal-footer [aria-current="page"] {
  color: var(--legal-blue);
  background: var(--legal-tint);
}

.legal-footer .legal-credit {
  gap: 8px;
}

.legal-credit img {
  display: block;
  height: auto;
}

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

@media (max-width: 720px) {
  .legal-header {
    min-height: 68px;
    padding: 9px 14px;
  }

  .legal-business img {
    width: 112px;
  }
}

@media (max-width: 600px) {
  .legal-header-actions .legal-back-link {
    display: none;
  }

  .legal-header-actions .legal-close {
    display: inline-flex;
  }

  .legal-content section {
    margin-top: 20px;
    padding-top: 16px;
  }
}
