/* MentoCode Live Chat — visitor widget. Scoped under #mcc. */
#mcc {
	--mcc-accent: #0c7b78;
	--mcc-ink: #11223f;
	--mcc-body: #475569;
	--mcc-muted: #64748b;
	--mcc-line: #e2e8f0;
	--mcc-soft: #f4f8fa;
	--mcc-radius: 18px;
	position: fixed;
	bottom: 20px;
	z-index: 99990;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--mcc-body);
}

#mcc,
#mcc * {
	box-sizing: border-box;
}

#mcc.mcc--right {
	right: 20px;
}

#mcc.mcc--left {
	left: 20px;
}

#mcc [hidden] {
	display: none !important;
}

#mcc button,
#mcc input,
#mcc textarea {
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
}

/* Launcher */
#mcc .mcc-launcher {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	height: 60px;
	min-width: 60px;
	margin-left: auto;
	padding: 0 18px;
	color: #fff;
	background: var(--mcc-accent);
	border: 0;
	border-radius: 999px;
	box-shadow: 0 12px 30px -8px rgba(17, 34, 63, 0.45);
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#mcc.mcc--left .mcc-launcher {
	margin-left: 0;
}

#mcc .mcc-launcher:hover {
	transform: translateY(-2px);
	box-shadow: 0 16px 34px -8px rgba(17, 34, 63, 0.5);
}

#mcc .mcc-launcher:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--mcc-accent) 45%, transparent);
	outline-offset: 3px;
}

#mcc .mcc-launcher__icon {
	display: inline-grid;
	place-items: center;
}

#mcc .mcc-launcher__label {
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
}

/* Once the chat has been opened, collapse the launcher to a round button. */
#mcc.was-opened .mcc-launcher__label,
#mcc.is-open .mcc-launcher__label {
	display: none;
}

#mcc.was-opened .mcc-launcher,
#mcc.is-open .mcc-launcher {
	justify-content: center;
	width: 60px;
	padding: 0;
}

#mcc .mcc-launcher__icon--close,
#mcc.is-open .mcc-launcher__icon--chat {
	display: none;
}

#mcc.is-open .mcc-launcher__icon--close {
	display: inline-grid;
}

#mcc .mcc-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	font-size: 12px;
	font-weight: 700;
	line-height: 22px;
	text-align: center;
	color: #fff;
	background: #e11d48;
	border: 2px solid #fff;
	border-radius: 999px;
	animation: mcc-pop 0.3s ease;
}

/* Panel */
#mcc .mcc-panel {
	position: absolute;
	bottom: 76px;
	display: flex;
	flex-direction: column;
	width: 380px;
	height: min(620px, calc(100vh - 120px));
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--mcc-line);
	border-radius: var(--mcc-radius);
	box-shadow: 0 30px 60px -20px rgba(17, 34, 63, 0.4);
	animation: mcc-in 0.22s ease;
}

#mcc.mcc--right .mcc-panel {
	right: 0;
}

#mcc.mcc--left .mcc-panel {
	left: 0;
}

/* Header */
#mcc .mcc-head {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: 12px;
	padding: 16px 16px 16px 18px;
	color: #fff;
	background: linear-gradient(135deg, var(--mcc-accent), color-mix(in srgb, var(--mcc-accent) 55%, #11223f));
}

#mcc .mcc-avatar {
	position: relative;
	display: grid;
	flex-shrink: 0;
	place-items: center;
	width: 44px;
	height: 44px;
	background: #fff;
	border-radius: 50%;
}

#mcc .mcc-avatar img {
	width: 32px;
	height: 32px;
	object-fit: contain;
}

#mcc .mcc-avatar--text {
	font-size: 18px;
	font-weight: 800;
	color: var(--mcc-accent);
}

#mcc .mcc-dot {
	position: absolute;
	right: 0;
	bottom: 1px;
	width: 12px;
	height: 12px;
	background: #94a3b8;
	border: 2px solid #fff;
	border-radius: 50%;
}

#mcc.is-online .mcc-dot {
	background: #22c55e;
}

#mcc .mcc-head__text {
	display: grid;
	flex: 1;
	min-width: 0;
	line-height: 1.3;
}

#mcc .mcc-head__text strong {
	font-size: 16px;
	color: #fff;
}

#mcc .mcc-head__status {
	font-size: 13px;
	opacity: 0.9;
}

#mcc .mcc-head__close {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	color: #fff;
	background: rgba(255, 255, 255, 0.14);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

#mcc .mcc-head__close:hover {
	background: rgba(255, 255, 255, 0.26);
}

#mcc .mcc-notice {
	flex-shrink: 0;
	margin: 0;
	padding: 8px 16px;
	font-size: 13px;
	color: #9a3412;
	background: #fff7ed;
	border-bottom: 1px solid #fed7aa;
}

/* Thread */
#mcc .mcc-body {
	flex: 1;
	min-height: 0;
	padding: 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--mcc-soft);
}

#mcc .mcc-thread {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

#mcc .mcc-msg {
	display: grid;
	justify-items: start;
	max-width: 85%;
	margin: 0;
	animation: mcc-msg 0.2s ease;
}

#mcc .mcc-msg--me {
	justify-items: end;
	justify-self: end;
}

#mcc .mcc-msg__author {
	margin: 8px 0 2px 4px;
	font-size: 12px;
	font-weight: 600;
	color: var(--mcc-muted);
}

#mcc .mcc-bubble {
	padding: 10px 14px;
	font-size: 14.5px;
	line-height: 1.5;
	color: var(--mcc-ink);
	overflow-wrap: anywhere;
	background: #fff;
	border: 1px solid var(--mcc-line);
	border-radius: 16px 16px 16px 4px;
}

#mcc .mcc-msg--me .mcc-bubble {
	color: #fff;
	background: var(--mcc-accent);
	border-color: transparent;
	border-radius: 16px 16px 4px 16px;
}

#mcc .mcc-bubble a {
	color: inherit;
	text-decoration: underline;
	word-break: break-all;
}

#mcc .mcc-msg__meta {
	display: flex;
	gap: 4px;
	margin: 2px 6px 0;
	font-size: 11px;
	color: var(--mcc-muted);
}

/* Typing dots */
#mcc .mcc-typing {
	display: inline-flex;
	gap: 4px;
	margin-top: 8px;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid var(--mcc-line);
	border-radius: 16px 16px 16px 4px;
}

#mcc .mcc-typing span {
	width: 7px;
	height: 7px;
	background: var(--mcc-muted);
	border-radius: 50%;
	animation: mcc-dot 1.2s infinite ease-in-out;
}

#mcc .mcc-typing span:nth-child(2) {
	animation-delay: 0.15s;
}

#mcc .mcc-typing span:nth-child(3) {
	animation-delay: 0.3s;
}

/* Quick replies */
#mcc .mcc-quick {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 12px;
}

#mcc .mcc-chip {
	padding: 7px 12px;
	font-size: 13px;
	font-weight: 600;
	color: var(--mcc-accent);
	background: #fff;
	border: 1px solid color-mix(in srgb, var(--mcc-accent) 40%, #fff);
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

#mcc .mcc-chip:hover {
	color: #fff;
	background: var(--mcc-accent);
}

/* Ask-email card */
#mcc .mcc-askemail {
	margin-top: 12px;
	padding: 12px;
	background: #fff;
	border: 1px dashed color-mix(in srgb, var(--mcc-accent) 50%, #fff);
	border-radius: 12px;
}

#mcc .mcc-askemail p {
	margin: 0 0 8px;
	font-size: 13px;
	color: var(--mcc-ink);
}

#mcc .mcc-askemail__row {
	display: flex;
	gap: 6px;
}

#mcc .mcc-askemail input {
	flex: 1;
	min-width: 0;
}

/* Form */
#mcc .mcc-form {
	display: grid;
	flex-shrink: 0;
	gap: 10px;
	max-height: 62%;
	padding: 14px 16px 16px;
	overflow-y: auto;
	background: #fff;
	border-top: 1px solid var(--mcc-line);
}

#mcc .mcc-field {
	display: grid;
	gap: 4px;
}

#mcc .mcc-field label {
	font-size: 13px;
	font-weight: 600;
	color: var(--mcc-ink);
}

#mcc input[type="text"],
#mcc input[type="email"],
#mcc textarea {
	width: 100%;
	margin: 0;
	padding: 10px 12px;
	font-size: 15px;
	color: var(--mcc-ink);
	background: #fff;
	border: 1px solid var(--mcc-line);
	border-radius: 10px;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#mcc .mcc-form textarea {
	height: 76px;
	min-height: 0;
	resize: none;
}

#mcc .mcc-compose__input {
	min-height: 0;
	height: 44px;
}

#mcc input:focus,
#mcc textarea:focus {
	border-color: var(--mcc-accent);
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--mcc-accent) 18%, transparent);
}

#mcc .mcc-field--check label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 12px;
	font-weight: 400;
	color: var(--mcc-muted);
}

#mcc .mcc-field--check input {
	flex-shrink: 0;
	margin-top: 2px;
	accent-color: var(--mcc-accent);
}

#mcc .mcc-field--check a {
	color: var(--mcc-accent);
}

#mcc .mcc-field__error,
#mcc .mcc-form__error {
	margin: 0;
	font-size: 12px;
	color: #be123c;
}

#mcc .mcc-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
}

#mcc .mcc-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 18px;
	font-size: 15px;
	font-weight: 700;
	color: #fff;
	background: var(--mcc-accent);
	border: 0;
	border-radius: 10px;
	cursor: pointer;
	transition: filter 0.15s ease;
}

#mcc .mcc-button:hover {
	filter: brightness(1.08);
}

#mcc .mcc-button:disabled {
	cursor: wait;
	opacity: 0.7;
}

#mcc .mcc-button--sm {
	min-height: 42px;
	padding: 0 14px;
	font-size: 14px;
}

/* Composer */
#mcc .mcc-compose {
	display: flex;
	flex-shrink: 0;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 10px 10px 14px;
	background: #fff;
	border-top: 1px solid var(--mcc-line);
}

#mcc .mcc-compose__input {
	flex: 1;
	max-height: 120px;
	padding: 10px 4px;
	resize: none;
	border: 0;
	box-shadow: none;
}

#mcc .mcc-compose__input:focus {
	box-shadow: none;
}

#mcc .mcc-compose__send {
	display: grid;
	flex-shrink: 0;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: #fff;
	background: var(--mcc-accent);
	border: 0;
	border-radius: 12px;
	cursor: pointer;
}

/* Phones: full screen */
@media (max-width: 480px) {
	#mcc {
		bottom: 16px;
	}

	#mcc.mcc--right {
		right: 16px;
	}

	#mcc.mcc--left {
		left: 16px;
	}

	#mcc .mcc-launcher__label {
		display: none;
	}

	#mcc .mcc-launcher {
		justify-content: center;
		width: 56px;
		height: 56px;
		min-width: 56px;
		padding: 0;
	}

	#mcc .mcc-panel {
		position: fixed;
		inset: 0;
		width: auto;
		height: 100%;
		height: 100dvh;
		border: 0;
		border-radius: 0;
	}

	#mcc.is-open .mcc-launcher {
		display: none;
	}

	#mcc.mcc--hide-mobile {
		display: none;
	}

	html.mcc-lock,
	html.mcc-lock body {
		overflow: hidden;
	}
}

@keyframes mcc-in {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
}

@keyframes mcc-msg {
	from { opacity: 0; transform: translateY(4px); }
}

@keyframes mcc-pop {
	from { transform: scale(0.4); }
}

@keyframes mcc-dot {
	0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
	30% { opacity: 1; transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
	#mcc *,
	#mcc {
		animation: none !important;
		transition: none !important;
	}
}
