/* Small floating Edit button next to the selection. */
.microedit-action {
	position: absolute;
	z-index: 1000;
	margin: 0;
	padding: 0.35rem 0.65rem;
	border: 1px solid #666;
	border-radius: 0.35rem;
	background: #fff;
	color: #111;
	box-shadow: 0 2px 12px rgb(0 0 0 / 16%);
	font: 600 0.875rem/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
}
.microedit-action:hover,
.microedit-action:focus {
	background: #f0f5ff;
}

/* On-page preview of the whole editable block while the Edit button is shown.
 * Only paints the text; the underlying HTML is never modified. */
::highlight(microedit-target-block) {
	background-color: #f0f0f0;
	color: inherit;
}
.microedit-body .microedit-target-block-fallback {
	background-color: #f0f0f0;
}

/* The saved passage after reload. */
::highlight(microedit-recent) {
	background-color: #fff2a0;
	color: inherit;
}

/* Modal. Stays below TinyMCE's floating menus (z-index 65535) and the
 * WordPress link dialog (100100), which are appended to <body>. */
html.microedit-open {
	overflow: hidden;
}
.microedit-overlay {
	position: fixed;
	inset: 0;
	z-index: 60000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 48px 12px 12px;
	background: rgb(0 0 0 / 45%);
	overflow-y: auto;
	box-sizing: border-box;
}
.microedit-modal {
	position: relative;
	width: 100%;
	max-width: 740px;
	padding: 40px 20px 20px;
	border-radius: 6px;
	background: #fff;
	color: #1e1e1e;
	box-shadow: 0 10px 40px rgb(0 0 0 / 30%);
	box-sizing: border-box;
	font: 400 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	letter-spacing: normal;
}
.microedit-modal:focus {
	outline: none;
}
.microedit-close {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: #555;
	font-size: 24px;
	line-height: 32px;
	cursor: pointer;
}
.microedit-close:hover,
.microedit-close:focus {
	background: #f0f0f0;
	color: #000;
}
.microedit-loading {
	padding: 40px 0;
	color: #757575;
	text-align: center;
}
.microedit-message {
	margin: 0 0 12px;
	padding: 8px 12px;
	border-left: 4px solid #d63638;
	background: #fcf0f1;
	color: #1e1e1e;
}
.microedit-message[hidden] {
	display: none;
}
.microedit-dialog .wp-editor-wrap {
	max-width: 100%;
}
.microedit-dialog .wp-editor-tabs {
	float: right;
}
.microedit-dialog .wp-editor-container {
	clear: both;
}
.microedit-textarea {
	display: block;
	width: 100%;
	min-height: 180px;
	box-sizing: border-box;
	font: 13px/1.5 Consolas, Monaco, monospace;
}
.microedit-actions {
	display: flex;
	gap: 8px;
	margin-top: 16px;
}
.microedit-actions button {
	min-height: 36px;
	padding: 0 16px;
	border: 1px solid #2271b1;
	border-radius: 3px;
	font: 600 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
}
.microedit-save {
	background: #2271b1;
	color: #fff;
}
.microedit-save:hover:not(:disabled),
.microedit-save:focus:not(:disabled) {
	background: #135e96;
}
.microedit-save:disabled {
	opacity: 0.6;
	cursor: default;
}
.microedit-save.is-busy {
	cursor: progress;
}
.microedit-cancel {
	background: #fff;
	color: #2271b1;
}
.microedit-cancel:hover,
.microedit-cancel:focus {
	background: #f6f7f7;
}

/* Theme rules for buttons and textareas must not leak into the editor UI. */
.microedit-modal .wp-editor-wrap button.wp-switch-editor {
	margin: 5px 0 0 5px;
	padding: 3px 8px 4px;
	border: 1px solid #dcdcde;
	border-radius: 0;
	background: #f6f7f7;
	color: #50575e;
	font: 13px/1.3846 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	letter-spacing: normal;
	text-transform: none;
}
.microedit-modal .html-active button.switch-html,
.microedit-modal .tmce-active button.switch-tmce {
	border-bottom-color: #f6f7f7;
	background: #f6f7f7;
	color: #1e1e1e;
}
.microedit-modal .mce-toolbar .mce-btn button,
.microedit-modal .quicktags-toolbar input.button {
	letter-spacing: normal;
	text-transform: none;
	box-shadow: none;
}
.microedit-modal .quicktags-toolbar input.button {
	min-height: 26px;
	margin: 2px;
	padding: 0 8px;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	background: #f6f7f7;
	color: #2c3338;
	font-size: 13px;
}
