.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.7);
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  width: min(600px, 100%);
  max-height: none;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #171b25;
  box-shadow: var(--shadow);
}

.modal-lg {
  width: min(1120px, 100%);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border-soft);
}

.modal-head h2 {
  margin: 0 0 6px;
}

.modal-head p {
  margin: 0;
  color: var(--text-muted);
}

.modal-body {
  overflow: hidden;
  padding: 20px 24px 24px;
}

.modal-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 4px;
  position: relative;
  z-index: 1;
  background: #171b25;
}

@media (max-width: 1100px) {
  .modal-overlay {
    align-items: flex-start;
    padding-top: 16px;
    padding-bottom: 16px;
    overflow-y: auto;
  }

  .modal-card {
    max-height: none;
  }

  .modal-body {
    overflow: visible;
  }
}
