.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none; /* hidden by default */
  justify-content: center;
  align-items: center;
  padding: 1rem;
  z-index: 10000;
}

/* the white “card” */
.modal {
  background: white;
  border-radius: 8px;
  max-width: 800px;
  width: 90vw;
  max-height: 90vh; /* allow taller height on small screens */
  height: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column; /* so body fills available space */
}

.modal-body {
  padding: 1rem;
  font-size: 1rem;
  line-height: 1.4;
  overflow-y: auto;
  max-height: 70vh; /* enables scroll inside modal */
}
/* header with close button */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eee;
}
.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}


/* when open, show the overlay as a flex container */
.modal-overlay.open {
  display: flex;
}

/* small tweaks for very small screens */
@media (max-width: 360px) {
  .modal {
    width: 100%;
    border-radius: 0;
  }
  .modal-header {
    padding: 0.5rem;
  }
  .modal-body {
    padding: 0.5rem;
  }
  .modal-close {
    font-size: 1.25rem;
  }
}
