/* MeerkatRelay widget — scoped under #mr-widget-root to avoid theme bleed. */

#mr-widget-root,
#mr-widget-root * {
	box-sizing: border-box;
}

.mr-bubble {
	position: fixed;
	right: 20px;
	bottom: 20px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #6b4a2b;
	color: #fff;
	border: 0;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
	z-index: 999998;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	font: inherit;
}
.mr-bubble:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22); }
.mr-bubble:focus-visible { outline: 3px solid #c9b89c; outline-offset: 2px; }
.mr-bubble svg { width: 24px; height: 24px; fill: currentColor; }

.mr-panel {
	position: fixed;
	right: 20px;
	bottom: 88px;
	width: 340px;
	max-width: calc(100vw - 40px);
	height: 480px;
	max-height: calc(100vh - 120px);
	background: #ffffff;
	color: #222;
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	z-index: 999999;
	font: 14px / 1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.mr-header {
	padding: 12px 14px;
	background: #6b4a2b;
	color: #fff;
	display: flex;
	align-items: center;
	gap: 8px;
}
.mr-header strong { flex: 1; font-size: 14px; }
.mr-header .mr-close {
	background: transparent;
	color: inherit;
	border: 0;
	padding: 4px 8px;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
}
.mr-header .mr-close:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.mr-body {
	flex: 1;
	overflow-y: auto;
	padding: 12px;
	background: #faf7f2;
}

.mr-intake { display: flex; flex-direction: column; gap: 8px; }
.mr-intake label { font-size: 12px; color: #555; }
.mr-intake input[type="text"],
.mr-intake input[type="email"] {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #d8d2c4;
	border-radius: 6px;
	font: inherit;
	background: #fff;
}
.mr-intake .mr-hp {
	position: absolute;
	left: -9999px;
	width: 1px; height: 1px;
	opacity: 0;
}
.mr-intake .mr-start {
	margin-top: 6px;
	padding: 9px 14px;
	background: #6b4a2b;
	color: #fff;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
}
.mr-intake .mr-start:disabled { opacity: 0.6; cursor: wait; }
.mr-intake .mr-err { color: #b32d2e; font-size: 12px; }

.mr-thread { display: flex; flex-direction: column; gap: 6px; }
.mr-msg {
	max-width: 80%;
	padding: 8px 10px;
	border-radius: 10px;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.mr-msg-visitor { background: #6b4a2b; color: #fff; align-self: flex-end; }
.mr-msg-owner   { background: #fff; color: #222; border: 1px solid #ece4d2; align-self: flex-start; }
.mr-msg-system  { background: transparent; color: #777; align-self: center; font-style: italic; font-size: 12px; max-width: 100%; text-align: center; }

.mr-statusline {
	padding: 6px 12px;
	font-size: 12px;
	color: #666;
	background: #fff;
	border-top: 1px solid #ece4d2;
	display: flex;
	align-items: center;
	gap: 8px;
}
.mr-statusline .mr-ticket {
	margin-left: auto;
	background: transparent;
	border: 0;
	color: #6b4a2b;
	text-decoration: underline;
	cursor: pointer;
	font: inherit;
	padding: 0;
}

.mr-composer {
	display: flex;
	gap: 6px;
	padding: 8px;
	background: #fff;
	border-top: 1px solid #ece4d2;
}
.mr-composer textarea {
	flex: 1;
	min-height: 36px;
	max-height: 110px;
	resize: none;
	border: 1px solid #d8d2c4;
	border-radius: 6px;
	padding: 6px 8px;
	font: inherit;
}
.mr-composer button {
	background: #6b4a2b;
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 0 12px;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
}
.mr-composer button:disabled { opacity: 0.6; cursor: wait; }

@media (prefers-reduced-motion: reduce) {
	.mr-bubble { transition: none; }
}

@media (max-width: 480px) {
	.mr-panel {
		right: 8px;
		left: 8px;
		bottom: 76px;
		width: auto;
	}
}
