/* MRM chatbot widget */
#mrm-cb {
	--cb-navy: #0B1F3A;
	--cb-cyan: #00B4D8;
	position: fixed;
	bottom: 22px;
	left: 22px;
	z-index: 99990;
	direction: rtl;
	font-family: inherit;
}

#mrm-cb-fab {
	position: relative;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	border: 0;
	background: var(--cb-navy);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(11, 31, 58, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease;
}

#mrm-cb-fab:hover {
	transform: scale(1.06);
}

#mrm-cb-fab-badge {
	position: absolute;
	top: -2px;
	right: -2px;
	background: #ef4444;
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

#mrm-cb-panel[hidden] {
	display: none !important;
}

#mrm-cb-panel {
	position: absolute;
	bottom: 72px;
	left: 0;
	width: 360px;
	max-width: calc(100vw - 34px);
	height: 520px;
	max-height: calc(100vh - 130px);
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 16px 48px rgba(11, 31, 58, 0.25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

#mrm-cb-head {
	background: var(--cb-navy);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

#mrm-cb-head strong {
	display: block;
	font-size: 15px;
}

#mrm-cb-status {
	font-size: 11px;
	color: #7ee0a3;
}

#mrm-cb-close {
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 16px;
	cursor: pointer;
	padding: 4px 8px;
}

#mrm-cb-msgs {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f4f7fb;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.mrm-cb-msg {
	max-width: 85%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.8;
	text-align: right;
	word-break: break-word;
	white-space: normal;
}

.mrm-cb-msg--bot {
	background: #fff;
	border: 1px solid #e5eaf0;
	align-self: flex-start;
	border-bottom-right-radius: 4px;
}

.mrm-cb-msg--user {
	background: var(--cb-cyan);
	color: #fff;
	align-self: flex-end;
	border-bottom-left-radius: 4px;
}

.mrm-cb-msg a {
	color: #0369a1;
	text-decoration: underline;
	direction: ltr;
	display: inline-block;
	unicode-bidi: isolate;
	word-break: break-all;
}

.mrm-cb-dots i {
	display: inline-block;
	width: 6px;
	height: 6px;
	margin: 0 2px;
	border-radius: 50%;
	background: #94a3b8;
	animation: mrm-cb-blink 1.2s infinite;
}

.mrm-cb-dots i:nth-child(2) { animation-delay: 0.2s; }
.mrm-cb-dots i:nth-child(3) { animation-delay: 0.4s; }

@keyframes mrm-cb-blink {
	0%, 80%, 100% { opacity: 0.25; }
	40% { opacity: 1; }
}

#mrm-cb-quick {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 8px 12px;
	background: #f4f7fb;
	border-top: 1px solid #e8edf3;
}

.mrm-cb-chip {
	border: 1px solid var(--cb-cyan);
	background: #fff;
	color: var(--cb-navy);
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
}

.mrm-cb-chip:hover {
	background: var(--cb-cyan);
	color: #fff;
}

#mrm-cb-form {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	background: #fff;
	border-top: 1px solid #e8edf3;
}

#mrm-cb-input {
	flex: 1;
	border: 1px solid #d7e0ea;
	border-radius: 999px;
	padding: 9px 15px;
	font-size: 13.5px;
	font-family: inherit;
	outline: none;
}

#mrm-cb-input:focus {
	border-color: var(--cb-cyan);
}

#mrm-cb-send {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 0;
	background: var(--cb-cyan);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
}

/* Admin-selected position: right side of the screen. */
#mrm-cb.mrm-cb--right {
	left: auto;
	right: 22px;
}

#mrm-cb.mrm-cb--right #mrm-cb-panel {
	left: auto;
	right: 0;
}

@media (max-width: 480px) {
	#mrm-cb {
		bottom: 14px;
		left: 14px;
	}
	#mrm-cb.mrm-cb--right {
		left: auto;
		right: 14px;
	}
	#mrm-cb-panel {
		width: calc(100vw - 28px);
		height: min(520px, calc(100vh - 110px));
	}
}

/* Hybrid tabs + filter chips */
#mrm-cb-tabs,
.mrm-cb-row--chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 8px 10px 0;
	background: #f8fafc;
	border-bottom: 1px solid #eef2f7;
}

.mrm-cb-row--chips {
	padding-top: 6px;
	padding-bottom: 6px;
	border-bottom: 0;
}

#mrm-cb-filters {
	background: #f8fafc;
	border-bottom: 1px solid #eef2f7;
	max-height: 140px;
	overflow-y: auto;
}

.mrm-cb-tab,
.mrm-cb-fchip {
	border: 1px solid #dbe3ef;
	background: #fff;
	color: #1e293b;
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	line-height: 1.3;
}

.mrm-cb-tab.is-active,
.mrm-cb-fchip.is-active {
	background: var(--cb-cyan, #002efe);
	border-color: var(--cb-cyan, #002efe);
	color: #fff;
}

#mrm-cb-panel {
	height: 580px;
}


/* Hybrid tabs + filter chips */
#mrm-cb-tabs,
.mrm-cb-row--chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 8px 10px 0;
	background: #f8fafc;
	border-bottom: 1px solid #eef2f7;
}

.mrm-cb-row--chips {
	padding-top: 6px;
	padding-bottom: 6px;
	border-bottom: 0;
}

#mrm-cb-filters {
	background: #f8fafc;
	border-bottom: 1px solid #eef2f7;
	max-height: 120px;
	overflow-y: auto;
}

.mrm-cb-tab,
.mrm-cb-fchip {
	border: 1px solid #dbe3ee;
	background: #fff;
	color: #334155;
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	line-height: 1.3;
}

.mrm-cb-tab.is-active,
.mrm-cb-fchip.is-active {
	background: var(--cb-cyan);
	border-color: var(--cb-cyan);
	color: #fff;
}

#mrm-cb-panel {
	height: 560px;
}

