.mhgc-wrapper {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 6px;
}

.mhgc-btn {
	align-self: flex-start;
	padding: 5px 12px;
	font-size: 13px;
	cursor: pointer;
	border: 1px solid #2271b1;
	border-radius: 3px;
	background: #f6f7f7;
	color: #2271b1;
	transition: background 0.15s, color 0.15s;
}

.mhgc-btn:hover:not(:disabled) {
	background: #2271b1;
	color: #fff;
}

.mhgc-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.mhgc-results {
	font-size: 13px;
	line-height: 1.5;
}

.mhgc-ok {
	color: #2ea04f;
	margin: 0;
}

.mhgc-warn,
.mhgc-error {
	color: #c0392b;
	margin: 0;
}

.mhgc-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.mhgc-item {
	background: #fff8e1;
	border-left: 3px solid #f0ad00;
	padding: 6px 10px;
	border-radius: 0 3px 3px 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.mhgc-header {
	display: flex;
	align-items: flex-start;
	gap: 6px;
}

.mhgc-msg {
	font-weight: 600;
	color: #333;
	flex: 1;
	min-width: 0;
}

.mhgc-ctx {
	font-family: monospace;
	color: #555;
}

.mhgc-ctx mark {
	background: #ffe08a;
	color: inherit;
	border-radius: 2px;
	padding: 0 2px;
}

.mhgc-suggestions {
	color: #555;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	margin-top: 3px;
	padding-top: 6px;
}

.mhgc-suggestion-btn {
	background: #f0f0f1;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	color: #2271b1;
	cursor: pointer;
	font-family: inherit;
	font-size: 12px;
	padding: 2px 8px;
	transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.mhgc-suggestion-btn:hover {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.mhgc-scroll-link {
	flex-shrink: 0;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(34, 113, 177, 0.07);
	border: 1px solid rgba(34, 113, 177, 0.3);
	border-radius: 5px;
	color: #2271b1;
	cursor: pointer;
	padding: 0;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.mhgc-scroll-link:hover {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.mhgc-scroll-link:active {
	background: #135e96;
	border-color: #135e96;
}

/* Flash animation for Gutenberg inline annotation marks */
@keyframes mhgc-flash {
	0%   { background-color: #ffe08a; }
	40%  { background-color: #ff8c00; color: #fff; }
	100% { background-color: #ffe08a; }
}

.annotation-text-mhgc.mhgc-flashing {
	animation: mhgc-flash 0.55s ease 2;
}

/* Flash animation for classic textarea fields */
@keyframes mhgc-field-flash {
	0%   { box-shadow: 0 0 0 2px transparent; }
	40%  { box-shadow: 0 0 0 3px #f0ad00; }
	100% { box-shadow: 0 0 0 2px transparent; }
}

.mhgc-field-flashing {
	animation: mhgc-field-flash 0.55s ease 2 !important;
}

/* -----------------------------------------------------------------------
   Gutenberg — inline annotations
   Gutenberg wraps annotated text in <mark class="annotation-text-{source}">
   --------------------------------------------------------------------- */

.annotation-text-mhgc {
	text-decoration: underline wavy #e53935;
	text-decoration-skip-ink: none;
	background: transparent;
	color: inherit;
	border-radius: 0;
}

/* -----------------------------------------------------------------------
   Gutenberg sidebar
   --------------------------------------------------------------------- */

.mhgc-sidebar-panel {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.mhgc-sidebar-btn.components-button {
	width: 100%;
	justify-content: center;
}

.mhgc-sidebar-loading {
	display: flex;
	align-items: center;
	gap: 8px;
	color: #555;
	font-size: 13px;
}

.mhgc-sidebar-ok {
	color: #2ea04f;
	margin: 0;
	font-size: 13px;
}

.mhgc-sidebar-warn,
.mhgc-sidebar-error {
	color: #c0392b;
	margin: 0;
	font-size: 13px;
}

.mhgc-sidebar-count {
	color: #555;
	margin: 0;
	font-size: 13px;
}

.mhgc-sidebar-actions {
	display: flex;
	gap: 8px;
	align-items: center;
}

/* -----------------------------------------------------------------------
   Tab navigation
   --------------------------------------------------------------------- */

.mhgc-tabs {
	display: flex;
	border-bottom: 1px solid #ddd;
	margin-bottom: 4px;
}

.mhgc-tab {
	flex: 1;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	padding: 8px 4px;
	font-size: 12px;
	font-weight: 500;
	color: #757575;
	cursor: pointer;
	transition: color 0.15s, border-color 0.15s;
	margin-bottom: -1px;
}

.mhgc-tab:hover {
	color: #2271b1;
}

.mhgc-tab.is-active {
	color: #2271b1;
	border-bottom-color: #2271b1;
}

/* -----------------------------------------------------------------------
   Check panel
   --------------------------------------------------------------------- */

.mhgc-check-panel {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Per-match "add to dictionary" action */

.mhgc-item-actions {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	margin-top: 2px;
	padding-top: 4px;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.mhgc-add-dict-btn {
	background: none;
	border: none;
	padding: 0;
	font-size: 11px;
	color: #2271b1;
	cursor: pointer;
	opacity: 0.75;
	transition: opacity 0.12s;
	font-family: inherit;
}

.mhgc-add-dict-btn:hover:not(:disabled) {
	opacity: 1;
	text-decoration: underline;
}

.mhgc-add-dict-btn:disabled {
	opacity: 0.5;
	cursor: default;
}

.mhgc-add-dict-error {
	font-size: 11px;
	color: #c0392b;
}

/* -----------------------------------------------------------------------
   Dictionary panel
   --------------------------------------------------------------------- */

.mhgc-dict-panel {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.mhgc-dict-add-form {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.mhgc-dict-add-form .components-base-control {
	margin-bottom: 0;
}

.mhgc-dict-add-form .components-text-control__input {
	font-size: 13px;
}

.mhgc-dict-input-error {
	margin: 2px 0 0;
	font-size: 12px;
}

.mhgc-dict-add-actions {
	display: flex;
	gap: 6px;
	align-items: center;
	margin-top: 2px;
}

.mhgc-dict-divider {
	border: none;
	border-top: 1px solid #ddd;
	margin: 4px 0;
}

.mhgc-dict-list-label {
	margin: 0;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #757575;
}

.mhgc-dict-loading {
	display: flex;
	align-items: center;
	gap: 8px;
	color: #555;
	font-size: 13px;
}

.mhgc-dict-empty {
	margin: 0;
	font-size: 13px;
	color: #757575;
	font-style: italic;
}

.mhgc-dict-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.mhgc-dict-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 5px 8px;
	border-radius: 3px;
	background: #f6f7f7;
	font-size: 13px;
}

.mhgc-dict-item:hover {
	background: #f0f0f1;
}

.mhgc-dict-word {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: #333;
}

.mhgc-dict-delete-btn {
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: 1px solid transparent;
	border-radius: 3px;
	color: #757575;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	padding: 0;
	transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.mhgc-dict-delete-btn:hover:not(:disabled) {
	background: #fce8e8;
	border-color: #e53935;
	color: #c0392b;
}

.mhgc-dict-delete-btn:disabled {
	opacity: 0.5;
	cursor: default;
}

.mhgc-dict-delete-btn .components-spinner {
	width: 14px;
	height: 14px;
	margin: 0;
}
