html.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(20px, 5vw, 60px) clamp(16px, 4vw, 40px);
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.modal__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  background: var(--white);
  margin: auto 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - clamp(40px, 10vw, 120px));
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(18px, 2.5vw, 28px) clamp(20px, 3vw, 40px);
  background: var(--ink);
  flex: 0 0 auto;
}

.modal__title {
  margin: 0;
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  color: var(--white);
}

.modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid var(--white);
  background: transparent;
  color: var(--white);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.modal__close:hover {
  background: var(--white);
  color: var(--ink);
}

.modal__close svg {
  width: 18px;
  height: 18px;
}

.modal__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: clamp(24px, 3.5vw, 48px) clamp(20px, 3vw, 40px);
}

.modal__content h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  margin-top: 30px;
  margin-bottom: 10px;
}

.modal__content h2:first-child {
  margin-top: 0;
}

.modal__content h3 {
  font-size: clamp(1rem, 2vw, 1.3rem);
  margin-top: 20px;
  margin-bottom: 8px;
}

.modal__content p,
.modal__content address {
  font-size: 1rem;
  margin-bottom: 12px;
  font-style: normal;
}

.modal__content a {
  color: var(--blue);
  text-decoration: underline;
}

.modal__content ul,
.modal__content ol {
  padding-left: 22px;
  margin-bottom: 12px;
  font-size: 1rem;
}

.modal__loading {
  color: var(--gray);
  font-style: italic;
  padding: 24px 0;
}

.modal__error {
  color: var(--brick);
  padding: 24px 0;
}
