#mocs-ai-widget-root {
	direction: rtl;
	font-family: -apple-system, "Vazirmatn", "IRANSans", Tahoma, sans-serif;
}

.mocs-ai-launcher {
	position: fixed;
	bottom: 24px;
	z-index: 999999;
	width: 68px;
	height: 68px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}
.mocs-ai-unread-dot {
	position: absolute;
	top: 4px;
	left: 4px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #e53935;
	border: 2px solid #fff;
	animation: mocs-ai-pulse 1.6s infinite;
}
@keyframes mocs-ai-pulse {
	0% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.55); }
	70% { box-shadow: 0 0 0 8px rgba(229, 57, 53, 0); }
	100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); }
}
.mocs-ai-launcher:hover {
	transform: scale(1.06);
}
.mocs-ai-launcher.pos-right { right: 24px; }
.mocs-ai-launcher.pos-left { left: 24px; }

.mocs-ai-panel {
	position: fixed;
	bottom: 100px;
	z-index: 999999;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 140px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: mocs-ai-pop 0.18s ease;
}
.mocs-ai-panel.pos-right { right: 24px; }
.mocs-ai-panel.pos-left { left: 24px; }

@keyframes mocs-ai-pop {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: translateY(0); }
}

.mocs-ai-header {
	padding: 14px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	color: #fff;
}
.mocs-ai-header-title {
	font-weight: 700;
	font-size: 15px;
}
.mocs-ai-header-sub {
	font-size: 11px;
	opacity: 0.75;
	margin-top: 2px;
}
.mocs-ai-close-btn {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 26px;
	cursor: pointer;
	line-height: 1;
	opacity: 0.85;
}
.mocs-ai-close-btn:hover { opacity: 1; }

.mocs-ai-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f7f7f8;
}

.mocs-ai-bubble {
	max-width: 82%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.7;
	white-space: pre-wrap;
	word-break: break-word;
}
.mocs-ai-bubble.assistant {
	align-self: flex-start;
	background: #fff;
	color: #1a1a1a;
	border: 1px solid #eee;
	border-bottom-right-radius: 4px;
}
.mocs-ai-bubble.user {
	align-self: flex-end;
	color: #111;
	border-bottom-left-radius: 4px;
}
.mocs-ai-bubble.error {
	align-self: center;
	background: #fdecea;
	color: #b3261e;
	font-size: 12.5px;
}
.mocs-ai-bubble.system {
	align-self: center;
	background: #f1f1f1;
	color: #666;
	font-size: 11.5px;
	padding: 6px 12px;
	border-radius: 20px;
	max-width: 90%;
	text-align: center;
}

.mocs-ai-typing {
	align-self: flex-start;
	display: flex;
	gap: 4px;
	padding: 10px 14px;
}
.mocs-ai-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #bbb;
	animation: mocs-ai-blink 1.2s infinite ease-in-out;
}
.mocs-ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.mocs-ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes mocs-ai-blink {
	0%, 80%, 100% { opacity: 0.3; }
	40% { opacity: 1; }
}

.mocs-ai-input-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #eee;
	background: #fff;
}
.mocs-ai-attach-icon-btn {
	border: 1px solid #ddd;
	background: #f7f7f8;
	border-radius: 10px;
	width: 46px;
	height: 46px;
	flex-shrink: 0;
	cursor: pointer;
	font-size: 19px;
}
.mocs-ai-attach-icon-btn:hover {
	background: #eee;
}
.mocs-ai-attach-icon-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
.mocs-ai-attach-chip {
	margin: 0 10px 6px;
	padding: 6px 10px;
	background: #f1f1f1;
	border-radius: 8px;
	font-size: 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	color: #444;
}
.mocs-ai-attach-chip button {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 15px;
	color: #888;
	line-height: 1;
}
.mocs-ai-bubble-image {
	max-width: 200px;
	border-radius: 10px;
	display: block;
	margin-bottom: 4px;
}
.mocs-ai-bubble-file {
	display: block;
	color: inherit;
	text-decoration: underline;
	font-size: 12.5px;
	margin-bottom: 4px;
}

.mocs-ai-prechat {
	background: #f7f7f8;
	border-bottom: 1px solid #eee;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.mocs-ai-prechat-text {
	font-size: 12px;
	color: #555;
}
.mocs-ai-prechat-input {
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 13px;
	font-family: inherit;
	direction: rtl;
	outline: none;
}
.mocs-ai-prechat-input:focus {
	border-color: #999;
}
.mocs-ai-prechat-error {
	color: #d63638;
	font-size: 11px;
	margin-top: -4px;
}
.mocs-ai-prechat-actions {
	display: flex;
	gap: 8px;
	margin-top: 2px;
}
.mocs-ai-prechat-submit {
	flex: 1;
	background: var(--mocs-primary);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 12.5px;
	cursor: pointer;
}
.mocs-ai-prechat-skip {
	background: transparent;
	border: none;
	color: #888;
	font-size: 12px;
	cursor: pointer;
	text-decoration: underline;
}
.mocs-ai-textarea {
	flex: 1;
	resize: none;
	border: 1px solid #ddd;
	border-radius: 10px;
	padding: 9px 12px;
	font-size: 13.5px;
	font-family: inherit;
	max-height: 90px;
	outline: none;
	direction: rtl;
}
.mocs-ai-textarea:focus {
	border-color: #999;
}
.mocs-ai-send-btn {
	border: none;
	color: #fff;
	border-radius: 10px;
	width: 46px;
	height: 46px;
	flex-shrink: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.15s ease;
}
.mocs-ai-send-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

@media (max-width: 420px) {
	.mocs-ai-panel {
		width: calc(100vw - 20px);
		right: 10px !important;
		left: 10px !important;
	}
}
