.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 14, 0.72);
}

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

.modal-panel {
  position: relative;
  width: min(100%, 560px);
  padding: 34px 28px 26px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
}

.modal-title {
  font-size: 24px;
  margin: 0 44px 12px 0;
}

.modal-copy {
  font-size: 16px;
  margin-bottom: 24px;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: color 160ms var(--ease), background 160ms var(--ease);
}

.modal-close:hover,
.modal-close:focus-visible {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}

.btn-modal {
  min-width: 136px;
  min-height: 42px;
}

@media (max-width: 640px) {
  .modal-backdrop {
    align-items: end;
    padding: 12px;
  }

  .modal-panel {
    max-height: calc(100vh - 24px);
    overflow: auto;
    padding: 30px 20px 20px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .btn-modal {
    width: 100%;
  }
}
