/* Keep WordPress/TinyMCE controls usable inside the theme's styled forms. */
#bbpress-forums .form-allowed-tags { display: none; }
#bbpress-forums .wp-editor-wrap { min-width: 0; width: 100%; }
#bbpress-forums .wp-editor-container {
	border: 1px solid #94a3b8;
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
}
#bbpress-forums .mce-tinymce { width: 100% !important; box-sizing: border-box; border: 0; box-shadow: none; }
#bbpress-forums .mce-toolbar-grp { padding: 5px; background: #f1f5f9; border-bottom: 1px solid #cbd5e1; }
#bbpress-forums .mce-toolbar-grp .mce-flow-layout { display: flex; flex-wrap: wrap; gap: 3px; white-space: normal; }
#bbpress-forums .mce-toolbar-grp .mce-btn-group { margin: 0; padding: 0; border: 0; }
#bbpress-forums .mce-toolbar .mce-btn { margin: 0; background: transparent; border: 1px solid transparent; border-radius: 4px; }
#bbpress-forums .mce-toolbar .mce-btn button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 36px !important;
	min-width: 36px !important;
	height: 36px !important;
	min-height: 36px !important;
	margin: 0 !important;
	padding: 6px !important;
	color: #1e293b !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 4px !important;
	box-shadow: none !important;
	text-shadow: none !important;
	transform: none !important;
}
#bbpress-forums .mce-toolbar .mce-ico { color: inherit; }
#bbpress-forums .mce-toolbar .mce-btn:hover,
#bbpress-forums .mce-toolbar .mce-btn:focus-within { background: #dbeafe; border-color: #2563eb; }
#bbpress-forums .mce-toolbar .mce-btn.mce-active { background: #bfdbfe; border-color: #164e91; }
#bbpress-forums .mce-toolbar .mce-btn button:focus-visible { outline: 2px solid #164e91; outline-offset: -2px; }
#bbpress-forums .mce-statusbar { background: #f8fafc; border-color: #cbd5e1; }
#bbpress-forums .mce-edit-area iframe { display: block; width: 100% !important; min-height: 240px; }
#bbpress-forums .wp-editor-tools { margin-bottom: 8px; }
#bbpress-forums .wp-editor-tools .button { min-height: 40px; }
body.spek-bbp-editor-active .mce-window .mce-btn button {
	width: auto !important;
	min-width: 0 !important;
	min-height: 36px !important;
	margin: 0 !important;
	padding: 6px 12px !important;
	color: #1e293b !important;
	background: #f1f5f9 !important;
	border: 0 !important;
	border-radius: 3px !important;
	box-shadow: none !important;
	text-shadow: none !important;
	font: 14px/1.4 Arial, sans-serif !important;
	text-transform: none !important;
	transform: none !important;
}
body.spek-bbp-editor-active .mce-window .mce-primary button {
	color: #fff !important;
	background: #164e91 !important;
}
body.spek-bbp-editor-active .mce-window input.mce-textbox {
	box-sizing: border-box;
	color: #1e293b !important;
	background: #fff !important;
	font-size: 16px !important;
	box-shadow: none;
}
body.spek-bbp-editor-active .mce-window button.mce-close {
	width: 40px !important;
	min-width: 40px !important;
	height: 40px !important;
	min-height: 40px !important;
	margin: 0 !important;
	padding: 0 !important;
	color: #1e293b !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	text-shadow: none !important;
	transform: none !important;
}
@media (max-width: 767px) {
	#bbpress-forums .mce-toolbar .mce-btn button {
		width: 40px !important;
		min-width: 40px !important;
		height: 40px !important;
		min-height: 40px !important;
	}
	#bbpress-forums .mce-toolbar-grp .mce-btn-group > div { display: flex; flex-wrap: wrap; }
}

/* TinyMCE 4 positions dialogs and fields in pixels; flow their controls on phones. */
@media (max-width: 600px) {
	body.spek-bbp-editor-active .mce-window {
		box-sizing: border-box;
		position: fixed !important;
		top: 8px !important;
		left: 8px !important;
		width: calc(100% - 16px) !important;
		max-width: calc(100% - 16px);
		height: auto !important;
		max-height: calc(100vh - 16px);
		max-height: calc(100dvh - 16px);
		margin: 0 !important;
		overflow: auto;
	}
	body.spek-bbp-editor-active .mce-window .mce-window-body,
	body.spek-bbp-editor-active .mce-window .mce-container-body,
	body.spek-bbp-editor-active .mce-window .mce-form,
	body.spek-bbp-editor-active .mce-window .mce-formitem,
	body.spek-bbp-editor-active .mce-window .mce-foot {
		position: static !important;
		box-sizing: border-box;
		width: auto !important;
		max-width: 100%;
		height: auto !important;
		min-width: 0 !important;
	}
	body.spek-bbp-editor-active .mce-window .mce-form { padding: 12px; }
	body.spek-bbp-editor-active .mce-window .mce-formitem { margin-bottom: 12px; }
	body.spek-bbp-editor-active .mce-window .mce-formitem > .mce-container-body {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 6px;
	}
	body.spek-bbp-editor-active .mce-window .mce-formitem .mce-label {
		position: static !important;
		width: 100% !important;
		height: auto !important;
		font-size: 14px;
		white-space: normal;
	}
	body.spek-bbp-editor-active .mce-window .mce-formitem .mce-textbox {
		position: static !important;
		width: 100% !important;
		height: 44px !important;
		min-height: 44px;
		padding: 8px;
	}
	body.spek-bbp-editor-active .mce-window .mce-formitem .mce-container { position: static !important; height: auto !important; }
	body.spek-bbp-editor-active .mce-window .mce-formitem .mce-combobox {
		position: static !important;
		box-sizing: border-box;
		width: 100% !important;
		height: auto !important;
	}
	body.spek-bbp-editor-active .mce-window .mce-formitem .mce-checkbox { position: static !important; margin-top: 8px; }
	body.spek-bbp-editor-active .mce-window .mce-foot > .mce-container-body {
		display: flex;
		flex-wrap: wrap;
		justify-content: flex-end;
		gap: 8px;
		padding: 10px;
	}
	body.spek-bbp-editor-active .mce-window .mce-foot .mce-btn { position: static !important; width: auto !important; height: auto !important; }
	body.spek-bbp-editor-active .mce-window .mce-foot .mce-btn button { min-height: 44px !important; }
}
