.edit-attachment-frame .attachment-actions .wpps-replace-media-trigger {
	margin-left: 8px;
	vertical-align: middle;
}

.edit-attachment-frame .compat-field-wpps_replace_media {
	display: none;
}

.media-modal .compat-field-wpps_replace_media .field {
	margin-top: 0;
}

.media-modal .compat-field-wpps_replace_media .wpps-replace-media-trigger {
	margin-top: 4px;
}

.wpps-replace-media-meta-box {
	margin: 0;
}

.wpps-replace-media-meta-box .wpps-replace-meta-desc {
	margin: 0 0 12px;
	line-height: 1.5;
}

.wpps-replace-media-meta-box .wpps-replace-meta-actions {
	margin: 0 0 12px;
}

.wpps-replace-media-meta-box .wpps-replace-revision-info {
	margin: 12px 0 0;
	padding-top: 12px;
	border-top: 1px solid #dcdcde;
	font-size: 12px;
	color: #646970;
	line-height: 1.5;
}

/* Modal */
.wpps-replace-media-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 200000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s, visibility 0.2s;
}

.wpps-replace-media-modal.is-open {
	opacity: 1;
	visibility: visible;
}

.wpps-replace-media-modal-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.6);
}

.wpps-replace-media-modal-content {
	position: relative;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
	max-width: 480px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	padding: 24px;
}

.wpps-replace-media-modal-content h2 {
	margin-top: 0;
	margin-bottom: 16px;
	font-size: 1.3em;
}

.wpps-replace-media-modal-content h3 {
	margin: 16px 0 8px;
	font-size: 1em;
	color: #1d2327;
}

.wpps-replace-current {
	margin-bottom: 20px;
}

.wpps-replace-preview {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	margin: 12px 0;
}

.wpps-replace-preview img,
.wpps-replace-preview .wpps-replace-file-icon {
	flex-shrink: 0;
	width: 80px;
	height: 80px;
	object-fit: contain;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
}

.wpps-replace-file-icon {
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
}

.wpps-replace-file-details {
	flex: 1;
	min-width: 0;
}

.wpps-replace-filename {
	margin: 0 0 4px;
	word-break: break-all;
}

.wpps-replace-meta {
	margin: 0;
	font-size: 12px;
	color: #646970;
}

.wpps-replace-upload {
	margin-bottom: 16px;
}

.wpps-replace-hint {
	font-size: 12px;
	color: #646970;
	margin-bottom: 8px;
}

.wpps-replace-file-input {
	position: absolute;
	width: 0.1px;
	height: 0.1px;
	opacity: 0;
	overflow: hidden;
	z-index: -1;
}

.wpps-replace-options {
	margin: 16px 0;
	padding: 12px;
	background: #f6f7f7;
	border-radius: 4px;
}

.wpps-replace-options label {
	display: block;
	margin-bottom: 8px;
}

.wpps-replace-options label:last-of-type {
	margin-bottom: 0;
}

.wpps-replace-options .description {
	margin: 4px 0 8px;
	font-size: 12px;
	color: #646970;
}

.wpps-replace-progress {
	margin: 16px 0;
}

.wpps-replace-progress progress {
	width: 100%;
	height: 24px;
	margin: 8px 0;
}

.wpps-replace-progress p {
	margin: 4px 0;
	font-size: 13px;
}

.wpps-replace-result {
	margin: 16px 0;
	padding: 12px;
	border-radius: 4px;
	font-size: 13px;
}

.wpps-replace-result.success {
	background: #edfaef;
	border-left: 4px solid #00a32a;
}

.wpps-replace-result.error {
	background: #fcf0f1;
	border-left: 4px solid #d63638;
}

.wpps-replace-actions {
	margin-top: 20px;
}

.wpps-replace-actions .button {
	margin-right: 8px;
}

body.modal-open {
	overflow: hidden;
}
