:root {
  --legal-pink: #ff0054;
  --legal-pink-dark: #e6004c;
  --legal-pink-soft: #fff0f5;
  --legal-ink: #121214;
  --legal-text: #5c5d63;
  --legal-muted: #96969c;
  --legal-line: #e8e8eb;
}

/* Public legal page */
.legal-public-page {
  background: #fff;
}

.legal-hero {
  padding: 52px 0 20px;
}

.legal-hero__inner {
  position: relative;
  min-height: 230px;
  padding: clamp(28px, 4vw, 48px);
  overflow: hidden;
  border: 1px solid #efdce4;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 34px;
  background:
    radial-gradient(circle at 94% 5%, rgba(255, 0, 84, 0.1), transparent 31%),
    radial-gradient(
      circle at 52% 120%,
      rgba(255, 0, 84, 0.035),
      transparent 34%
    ),
    linear-gradient(145deg, #fff4f8 0%, #ffffff 72%);
}

.legal-hero__inner::after {
  content: "";
  position: absolute;
  right: -88px;
  bottom: -138px;
  width: 300px;
  height: 300px;
  border: 42px solid rgba(255, 0, 84, 0.034);
  border-radius: 50%;
  pointer-events: none;
}

.legal-hero__inner > * {
  position: relative;
  z-index: 1;
}

.legal-hero__copy {
  min-width: 0;
  max-width: 760px;
}

.legal-kicker {
  margin: 0;
  color: var(--legal-pink);
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.legal-hero h1 {
  margin: 14px 0 0;
  color: var(--legal-ink);
  font-size: clamp(40px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 700;
}

.legal-hero__intro {
  max-width: 650px;
  margin: 18px 0 0;
  color: var(--legal-text);
  font-size: 14px;
  line-height: 1.75;
}

.legal-page-count {
  width: 104px;
  height: 104px;
  flex: 0 0 104px;
  border: 1px solid #ffd0de;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 45px rgba(18, 18, 20, 0.07);
}

.legal-page-count strong {
  color: var(--legal-pink);
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 700;
}

.legal-page-count span {
  margin-top: 8px;
  color: var(--legal-muted);
  font-size: 8px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.legal-document-section {
  padding: 0 0 72px;
}

.legal-document-list {
  padding: clamp(12px, 2vw, 22px);
  border: 1px solid var(--legal-line);
  border-radius: 28px;
  display: grid;
  gap: 18px;
  background: #f7f7f8;
}

.legal-document-page {
  position: relative;
  width: min(100%, 1080px);
  margin: 0 auto;
}

.legal-document-frame {
  overflow: hidden;
  border: 1px solid #e5e5e8;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(18, 18, 20, 0.05);
}

.legal-document-frame img {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
}

.legal-document-page::before {
  content: "Page " attr(data-page);
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid #ececef;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.93);
  color: var(--legal-muted);
  font-size: 8px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.legal-tap-view {
  display: none;
}

/* Mobile document viewer. No zoom controls: the document opens at a
   readable fixed width and the user scrolls around it. */
.legal-viewer {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.99);
}

.legal-viewer.is-open {
  display: flex;
}

.legal-viewer__top {
  min-height: 62px;
  padding: 10px 14px;
  border-bottom: 1px solid #e8e8eb;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
}

.legal-viewer__top strong {
  min-width: 0;
  color: var(--legal-ink);
  font-size: 13px;
  font-weight: 700;
}

.legal-viewer__top > span {
  margin-left: auto;
  color: var(--legal-muted);
  font-size: 10px;
  font-weight: 600;
}

.legal-viewer__close {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid #e6e6e9;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--legal-ink);
  font: inherit;
  cursor: pointer;
}

.legal-viewer__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #f3f3f4;
}

.legal-viewer__scroll img {
  width: 920px;
  max-width: none;
  height: auto;
  display: block;
  margin: 12px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(18, 18, 20, 0.12);
}

body.legal-viewer-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .legal-hero {
    padding: 26px 0 14px;
  }

  .legal-hero__inner {
    min-height: 0;
    padding: 24px;
    border-radius: 24px;
    align-items: flex-start;
    gap: 16px;
  }

  .legal-hero h1 {
    margin-top: 12px;
    font-size: 34px;
    line-height: 1;
  }

  .legal-hero__intro {
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.65;
  }

  .legal-page-count {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    border-radius: 18px;
  }

  .legal-page-count strong {
    font-size: 25px;
  }

  .legal-page-count span {
    margin-top: 5px;
    font-size: 7px;
  }

  .legal-document-section {
    padding-bottom: 48px;
  }

  .legal-document-list {
    padding: 8px;
    gap: 12px;
    border-radius: 20px;
  }

  .legal-document-frame {
    border-radius: 13px;
  }

  .legal-document-page::before {
    top: 8px;
    right: 8px;
    min-height: 23px;
    padding: 0 7px;
    font-size: 7px;
  }

  .legal-tap-view {
    width: 100%;
    min-height: 44px;
    margin-top: 7px;
    padding: 0 14px;
    border: 1px solid #e7e7ea;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: #fff;
    color: var(--legal-ink);
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
  }

  .legal-tap-view span {
    color: var(--legal-pink);
  }
}

@media (min-width: 761px) {
  .legal-viewer {
    display: none !important;
  }
}
