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

.legal-trigger {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.legal-modal[hidden] {
  display: none;
}

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
}

.legal-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 5, 18, 0.7);
  backdrop-filter: blur(6px);
}

.legal-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(960px, calc(100vw - 1.5rem));
  max-height: min(88vh, 920px);
  margin: min(6vh, 2rem) auto;
  border-radius: 24px;
  background: #ffffff;
  color: #24163a;
  box-shadow: 0 30px 80px rgba(8, 5, 18, 0.28);
  overflow: hidden;
}

.legal-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(36, 22, 58, 0.08);
}

.legal-modal__title {
  margin: 0;
  color: #24163a;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 800;
  line-height: 1.2;
}

.legal-modal__close {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: rgba(36, 22, 58, 0.06);
  color: #24163a;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.legal-modal__body {
  padding: 0 1.25rem 1.25rem;
  overflow: auto;
}

.legal-modal__content {
  color: #24163a;
  font-size: 0.98rem;
  line-height: 1.7;
}

.legal-modal__content h1,
.legal-modal__content h2,
.legal-modal__content h3,
.legal-modal__content h4 {
  color: #24163a;
  line-height: 1.25;
}

.legal-modal__content a {
  color: #4a2bb3;
  text-decoration: underline;
}

.legal-modal__content ul,
.legal-modal__content ol {
  padding-left: 1.25rem;
}

.legal-modal__content table {
  width: 100%;
  border-collapse: collapse;
}

.legal-modal__content img,
.legal-modal__content iframe {
  max-width: 100%;
  height: auto;
}

@media (max-width: 640px) {
  .legal-modal__dialog {
    width: min(100vw - 1rem, 960px);
    max-height: calc(100vh - 1rem);
    margin: 0.5rem auto;
    border-radius: 18px;
  }

  .legal-modal__header,
  .legal-modal__body {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
