.mondochat-ui-widget-root {
	--mc-z-index: 99999;
	--mc-launcher-bg: #0e6273;
	--mc-launcher-icon: #ffffff;
	--mc-launcher-size: 56px;
	--mc-launcher-offset-x: 20px;
	--mc-launcher-offset-y: 20px;
	--mc-launcher-side: right;
	--mc-tooltip-bg: #fff9f2;
	--mc-tooltip-text: #1f2a37;
	--mc-tooltip-size: 14px;
	--mc-window-bg: #f2f4f7;
	--mc-header-bg: #0e6273;
	--mc-header-text: #ffffff;
	--mc-user-bg: #2ca8b8;
	--mc-user-text: #ffffff;
	--mc-bot-bg: #ffffff;
	--mc-bot-text: #1a3f5f;
	--mc-msg-radius: 12px;
	--mc-mobile-breakpoint: 768px;
	--mc-content-padding: 12px;
	position: relative;
	z-index: var(--mc-z-index);
	font-family: "Segoe UI", Tahoma, sans-serif;
}

.mondochat-ui-launcher {
	position: fixed;
	bottom: var(--mc-launcher-offset-y);
	width: var(--mc-launcher-size);
	height: var(--mc-launcher-size);
	border: 0;
	border-radius: 999px;
	background: var(--mc-launcher-bg);
	color: var(--mc-launcher-icon);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
	z-index: var(--mc-z-index);
}

.mondochat-ui-widget-root button.mondochat-ui-launcher {
	padding:0;
	min-width:var(--mc-launcher-size);
	min-height:var(--mc-launcher-size);
}

.mondochat-ui-widget-root .mondochat-ui-launcher img {
	display:block;
	flex:none;
	width: var(--mc-launcher-icon-size, 60%);
	height: var(--mc-launcher-icon-size, 60%);
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 0;
}

.mondochat-ui-widget-root.launcher-left .mondochat-ui-launcher {
	left: var(--mc-launcher-offset-x);
}

.mondochat-ui-widget-root.launcher-right .mondochat-ui-launcher {
	right: var(--mc-launcher-offset-x);
}

.mondochat-ui-tooltip {
	position: fixed;
	max-width: 280px;
	padding: 8px 10px;
	border-radius: 10px;
	background: var(--mc-tooltip-bg);
	color: var(--mc-tooltip-text);
	font-size: var(--mc-tooltip-size);
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
	bottom: calc(var(--mc-launcher-offset-y) + var(--mc-launcher-size) + 10px);
	z-index: calc(var(--mc-z-index) - 1);
}

.mondochat-ui-widget-root.launcher-left .mondochat-ui-tooltip {
	left: var(--mc-launcher-offset-x);
}

.mondochat-ui-widget-root.launcher-right .mondochat-ui-tooltip {
	right: var(--mc-launcher-offset-x);
}

.mondochat-ui-window {
	position: fixed;
	right: 20px;
	bottom: calc(var(--mc-launcher-offset-y) + var(--mc-launcher-size) + 16px);
	width: 360px;
	max-width: calc(100vw - 24px);
	height: 540px;
	max-height: calc(100vh - 24px);
	background: var(--mc-window-bg);
	border-radius: 16px;
	box-shadow: 0 18px 45px rgba(16, 24, 40, 0.25);
	overflow: hidden;
	display: none;
	flex-direction: column;
	z-index: var(--mc-z-index);
}

.mondochat-ui-header,
.mondochat-ui-welcome,
.mondochat-ui-footer,
.mondochat-ui-input-row {
	flex: 0 0 auto;
}

.mondochat-ui-widget-root.is-open .mondochat-ui-window,
.mondochat-ui-widget-root.mondochat-inline .mondochat-ui-window {
	display: flex;
}

.mondochat-ui-widget-root.mondochat-inline .mondochat-ui-window {
	position: relative;
	right: auto;
	bottom: auto;
	width: 100%;
	height: 560px;
	max-height: 70vh;
}

.mondochat-ui-widget-root.mondochat-inline .mondochat-ui-launcher,
.mondochat-ui-widget-root.mondochat-inline .mondochat-ui-tooltip {
	display: none !important;
}

.mondochat-ui-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	padding: 14px;
	background: var(--mc-header-bg);
	color: var(--mc-header-text);
}

.mondochat-ui-header-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding-top: 1px;
	padding-bottom: 1px;
}

.mondochat-ui-title {
	margin: 0;
	font-size: 16px;
	line-height: 1.25;
	color: var(--mc-header-text) !important;
}

.mondochat-ui-subtitle {
	margin: 0;
	font-size: 12px;
	line-height: 1.35;
	opacity: 0.9;
	color: var(--mc-header-text) !important;
}

.mondochat-ui-close {
	width: 30px;
	height: 30px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--mc-header-text);
	font-size: 26px;
	font-weight: 300;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	opacity: 0.9;
	transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.mondochat-ui-close:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.16);
}

.mondochat-ui-close:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.9);
	outline-offset: 2px;
	opacity: 1;
}

.mondochat-ui-close:active {
	transform: scale(0.95);
}

.mondochat-ui-welcome {
	padding: 14px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mondochat-ui-get-started {
	border: 0;
	border-radius: 8px;
	background: var(--mc-header-bg);
	color: var(--mc-header-text);
	padding: 8px 12px;
	cursor: pointer;
}

.mondochat-ui-messages {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: var(--mc-content-padding);
	display: flex;
	flex-direction: column;
	gap: 4px;
	scrollbar-gutter: stable both-edges;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.mondochat-ui-message {
	width: fit-content;
	max-width: 84%;
	padding: 10px 12px;
	border-radius: var(--mc-msg-radius);
	font-size: 14px;
	line-height: 1.7;
	word-break: break-word;
	margin-top: 4px;
}

.mondochat-ui-message.is-new-turn {
	margin-top: 12px;
}

.mondochat-ui-message-user {
	align-self: flex-end;
	margin-left: auto;
	margin-right: 0;
	background: var(--mc-user-bg);
	color: var(--mc-user-text);
	text-align: start;
}

.mondochat-ui-message-bot {
	align-self: flex-start;
	margin-right: auto;
	margin-left: 0;
	background: var(--mc-bot-bg);
	color: var(--mc-bot-text);
	text-align: start;
}

.mondochat-ui-rich-line {
	margin: 0;
}

.mondochat-ui-rich-space {
	height: 8px;
}

.mondochat-ui-rich-list {
	margin: 0;
	padding-inline-start: 20px;
}

.mondochat-ui-rich-list li {
	margin: 0 0 4px;
}

.mondochat-ui-message-bot a {
	color: inherit;
	text-decoration: underline;
}

.mondochat-ui-footer {
	margin-top: auto;
	padding: 4px 14px calc(9px + env(safe-area-inset-bottom, 0px));
	font-size: 10px;
	line-height: 1.5;
}

/* Scoped controls keep theme button/input defaults out of the chat composer. */
.mondochat-ui-widget-root .mondochat-ui-window {
	max-height: calc(100dvh - var(--mc-launcher-offset-y) - var(--mc-launcher-size) - 28px);
}
.mondochat-ui-widget-root .mondochat-ui-header { gap:12px; }
.mondochat-ui-widget-root .mondochat-ui-header-text { min-width:0; }
.mondochat-ui-widget-root .mondochat-ui-welcome {
	padding:24px 20px; border-bottom:0;
}
.mondochat-ui-widget-root .mondochat-ui-welcome-subtitle {
	margin:0 0 18px; color:#17343c; font-size:16px; font-weight:500;
	line-height:1.6; overflow-wrap:anywhere;
}
.mondochat-ui-widget-root button.mondochat-ui-get-started {
	display:inline-flex; align-items:center; justify-content:center;
	min-height:44px; max-width:100%; margin:0; padding:11px 18px;
	border:0; border-radius:9px; background:var(--mc-header-bg); color:var(--mc-header-text);
	font-family:inherit; font-size:14px; font-weight:600; line-height:1.5;
	text-transform:none; white-space:normal; cursor:pointer;
}
.mondochat-ui-widget-root button.mondochat-ui-get-started:hover { filter:brightness(.92); }
.mondochat-ui-widget-root button.mondochat-ui-get-started:focus-visible {
	outline:2px solid var(--mc-header-bg); outline-offset:3px;
}
.mondochat-ui-widget-root .mondochat-ui-close {
	flex:0 0 36px; width:36px; height:36px; min-height:36px; padding:0;
	border-radius:9px; background:rgba(255,255,255,.12); color:var(--mc-header-text);
}
.mondochat-ui-widget-root .mondochat-ui-input-row {
	align-items:center; gap:8px; padding:10px 12px 6px; background:#fff;
	border-top:1px solid #dce7e9;
}
.mondochat-ui-widget-root input.mondochat-ui-input {
	box-sizing:border-box; flex:1 1 0; width:0; min-width:0; height:44px; min-height:44px;
	margin:0; padding:10px 11px; border:1px solid #b6c9ce; border-radius:9px;
	background:#f8fafb; color:#17343c;
	font-family:inherit; font-size:16px; font-weight:400; line-height:1.4; box-shadow:none;
}
.mondochat-ui-widget-root input.mondochat-ui-input:focus {
	outline:2px solid var(--mc-header-bg); outline-offset:1px; background:#fff;
}
.mondochat-ui-widget-root button.mondochat-ui-send {
	position:relative; box-sizing:border-box; flex:0 0 auto; width:auto; min-width:62px;
	height:44px; min-height:44px; margin:0; padding:0 12px; border:0; border-radius:9px;
	background:var(--mc-header-bg); color:var(--mc-header-text);
	font-family:inherit; font-size:13px; font-weight:600; line-height:1; text-transform:none;
}
.mondochat-ui-widget-root button.mondochat-ui-send:hover { filter:brightness(.92); }
.mondochat-ui-widget-root button.mondochat-ui-send:focus-visible { outline:2px solid var(--mc-header-bg); outline-offset:2px; }
.mondochat-ui-widget-root button.mondochat-ui-send:disabled { cursor:wait; opacity:.8; }
.mondochat-ui-widget-root button.mondochat-ui-send.is-loading { color:transparent; }
.mondochat-ui-widget-root button.mondochat-ui-send.is-loading::after {
	content:''; position:absolute; inset:0; margin:auto; width:15px; height:15px;
	border:2px solid var(--mc-header-text); border-inline-end-color:transparent; border-radius:50%;
	animation:mondochat-send-spin .8s linear infinite;
}
.mondochat-ui-widget-root .mondochat-ui-footer,
.mondochat-ui-widget-root .mondochat-ui-footer a { font-size:10px; line-height:1.5; }
.mondochat-ui-widget-root .mondochat-ui-footer p { margin:0; }
.mondochat-ui-widget-root .mondochat-ui-footer-links { margin-top:3px; }
@keyframes mondochat-send-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce){
	.mondochat-ui-widget-root button.mondochat-ui-send.is-loading::after { animation:none; }
}

.mondochat-ui-footer-links {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-top: 6px;
	flex-wrap: wrap;
}

.mondochat-ui-input-row {
	display: flex;
	gap: 8px;
	padding: var(--mc-content-padding);
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	background: #fff;
}

.mondochat-ui-input-row.is-hidden {
	display: none;
}

.mondochat-ui-input {
	flex: 1;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	padding: 8px 10px;
}

.mondochat-ui-send {
	border: 0;
	border-radius: 8px;
	background: var(--mc-header-bg);
	color: var(--mc-header-text);
	padding: 8px 12px;
	cursor: pointer;
}

@media (max-width: 768px) {
	.mondochat-ui-widget-root.is-open .mondochat-ui-window {
		width: calc(100vw - 16px);
		right: 8px;
	}
}

.mondochat-ui-widget-root.is-mobile-fullscreen.is-open .mondochat-ui-window {
	border-radius: 0;
	inset: 0;
	margin: 0;
	width: 100dvw;
	max-width: 100dvw;
	height: 100dvh;
	max-height: 100dvh;
}

body.mondochat-ui-scroll-lock {
	overflow: hidden;
}

.mondochat-ui-widget-root.is-mobile-fullscreen.is-open .mondochat-ui-launcher,
.mondochat-ui-widget-root.is-mobile-fullscreen.is-open .mondochat-ui-tooltip {
	display: none !important;
}

@media (max-width: 768px) {
	.mondochat-ui-widget-root.is-mobile-fullscreen.is-open .mondochat-ui-header {
		padding-right: calc(14px + env(safe-area-inset-right, 0px) + 6px);
	}

	.mondochat-ui-widget-root.is-mobile-fullscreen.is-open .mondochat-ui-input-row {
		padding-right: calc(var(--mc-content-padding) + env(safe-area-inset-right, 0px) + 6px);
		padding-left: calc(var(--mc-content-padding) + env(safe-area-inset-left, 0px) + 2px);
	}

	.mondochat-ui-widget-root.is-mobile-fullscreen.is-open .mondochat-ui-send {
		min-width: 64px;
	}
}
