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

#opsmind-cb[dir="ltr"] {
	direction: ltr;
}

#opsmind-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;
}

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

#opsmind-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;
}

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

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

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

#opsmind-cb-head strong {
	display: block;
	font-size: 14px;
	line-height: 1.35;
	max-width: 260px;
}

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

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

#opsmind-cb-msgs {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 12px;
	background: linear-gradient(180deg, #f7fafc 0%, #eef3f8 100%);
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.opsmind-cb-msg {
	max-width: 88%;
	padding: 9px 12px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.7;
	text-align: right;
	word-break: break-word;
	white-space: normal;
}

#opsmind-cb[dir="ltr"] .opsmind-cb-msg {
	text-align: left;
}

.opsmind-cb-msg--bot {
	background: #fff;
	border: 1px solid #e5eaf0;
	align-self: flex-start;
	border-bottom-right-radius: 4px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

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

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

.opsmind-cb-msg--user a {
	color: #e0f7ff;
}

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

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

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

#opsmind-cb-quick {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 8px 10px;
	background: #f8fafc;
	border-top: 1px solid #e8edf3;
	flex: 0 0 auto;
	max-height: 88px;
	overflow-y: auto;
}

.opsmind-cb-chip {
	border: 1px solid rgba(0, 180, 216, 0.55);
	background: #fff;
	color: var(--cb-navy);
	border-radius: 999px;
	padding: 5px 11px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	line-height: 1.3;
	transition: background 0.12s ease, color 0.12s ease;
}

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

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

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

#opsmind-cb-input:focus {
	border-color: var(--cb-cyan);
	box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}

#opsmind-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;
}

#opsmind-cb.opsmind-cb--right {
	left: auto;
	right: 22px;
}

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

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

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

#opsmind-cb-filters {
	background: #f8fafc;
	border-bottom: 1px solid #eef2f7;
	max-height: 96px;
	overflow-y: auto;
	flex: 0 0 auto;
}

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

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

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