/* iWebb Chatbot widget */
#iwcb-root {
	--iwcb-brand: #0cb5c4;
	--iwcb-on-brand: #062a2e;
	--iwcb-ink: #102a2d;
	--iwcb-muted: #5b7073;
	--iwcb-surface: #ffffff;
	--iwcb-bot-bg: #eef6f7;
	--iwcb-line: #d7e6e8;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 2147483000;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
	color: var(--iwcb-ink);
	-webkit-font-smoothing: antialiased;
}
#iwcb-root *,
#iwcb-root *::before,
#iwcb-root *::after {
	box-sizing: border-box;
}
#iwcb-root button {
	font: inherit;
	cursor: pointer;
	margin: 0;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
}
#iwcb-root [hidden] {
	display: none !important;
}
#iwcb-root :focus-visible {
	outline: 2px solid var(--iwcb-ink);
	outline-offset: 2px;
}

/* Launcher */
#iwcb-root .iwcb-launcher {
	position: relative;
	width: 58px;
	height: 58px;
	border: 0;
	border-radius: 50%;
	padding: 0;
	display: grid;
	place-items: center;
	background: var(--iwcb-brand);
	color: var(--iwcb-on-brand);
	box-shadow: 0 6px 18px rgba(6, 42, 46, 0.28);
	transition: transform 0.15s ease;
	margin-left: auto;
}
#iwcb-root .iwcb-launcher:hover {
	transform: scale(1.06);
}
#iwcb-root.iwcb-open .iwcb-launcher svg {
	display: none;
}
#iwcb-root.iwcb-open .iwcb-launcher::before {
	content: "";
	width: 18px;
	height: 18px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.4 5 12 10.6 17.6 5 19 6.4 13.4 12l5.6 5.6-1.4 1.4-5.6-5.6L6.4 19 5 17.6 10.6 12 5 6.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.4 5 12 10.6 17.6 5 19 6.4 13.4 12l5.6 5.6-1.4 1.4-5.6-5.6L6.4 19 5 17.6 10.6 12 5 6.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Teaser (the auto pop-up) */
#iwcb-root .iwcb-teaser {
	position: absolute;
	right: 0;
	bottom: 72px;
	width: 270px;
	display: none;
	align-items: flex-start;
	gap: 4px;
	padding: 12px 8px 12px 14px;
	background: var(--iwcb-surface);
	border: 1px solid var(--iwcb-line);
	border-left: 4px solid var(--iwcb-brand);
	border-radius: 12px 12px 4px 12px;
	box-shadow: 0 10px 28px rgba(6, 42, 46, 0.16);
}
#iwcb-root .iwcb-teaser.iwcb-show {
	display: flex;
	animation: iwcb-rise 0.35s ease-out;
}
#iwcb-root .iwcb-teaser-text {
	flex: 1;
	background: none;
	border: 0;
	padding: 0;
	text-align: left;
	color: var(--iwcb-ink);
	font-size: 14.5px;
}
#iwcb-root .iwcb-teaser-close {
	background: none;
	border: 0;
	padding: 2px;
	color: var(--iwcb-muted);
	line-height: 0;
	border-radius: 4px;
}

/* Panel */
#iwcb-root .iwcb-panel {
	position: absolute;
	right: 0;
	bottom: 72px;
	width: 370px;
	height: min(560px, calc(100vh - 110px));
	display: flex;
	flex-direction: column;
	background: var(--iwcb-surface);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 18px 50px rgba(6, 42, 46, 0.25);
	animation: iwcb-rise 0.2s ease-out;
}
#iwcb-root .iwcb-head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 12px 14px 18px;
	background: var(--iwcb-brand);
	color: var(--iwcb-on-brand);
}
#iwcb-root .iwcb-head-text {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
}
#iwcb-root .iwcb-title {
	font-size: 16px;
	font-weight: 700;
	color: inherit;
}
#iwcb-root .iwcb-sub {
	font-size: 12.5px;
	opacity: 0.85;
}
#iwcb-root .iwcb-end {
	background: transparent;
	color: inherit;
	border: 1.5px solid currentColor;
	border-radius: 999px;
	padding: 4px 12px;
	font-size: 13px;
	font-weight: 600;
}
#iwcb-root .iwcb-min {
	background: transparent;
	color: inherit;
	border: 0;
	padding: 6px;
	line-height: 0;
	border-radius: 6px;
}

#iwcb-root .iwcb-list {
	flex: 1;
	overflow-y: auto;
	padding: 16px 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	overscroll-behavior: contain;
}
#iwcb-root .iwcb-msg {
	max-width: 84%;
	padding: 9px 13px;
	border-radius: 14px;
	white-space: pre-wrap;
	word-wrap: break-word;
	font-size: 14.5px;
}
#iwcb-root .iwcb-bot {
	align-self: flex-start;
	background: var(--iwcb-bot-bg);
	color: var(--iwcb-ink);
	border-bottom-left-radius: 4px;
}
#iwcb-root .iwcb-user {
	align-self: flex-end;
	background: var(--iwcb-brand);
	color: var(--iwcb-on-brand);
	border-bottom-right-radius: 4px;
}
#iwcb-root .iwcb-note {
	align-self: center;
	text-align: center;
	font-size: 13px;
	color: var(--iwcb-muted);
	padding: 6px 10px;
}
#iwcb-root .iwcb-typing {
	display: flex;
	gap: 4px;
	padding: 13px 14px;
}
#iwcb-root .iwcb-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--iwcb-muted);
	animation: iwcb-dot 1.1s infinite ease-in-out;
}
#iwcb-root .iwcb-typing span:nth-child(2) { animation-delay: 0.15s; }
#iwcb-root .iwcb-typing span:nth-child(3) { animation-delay: 0.3s; }

#iwcb-root .iwcb-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 10px 12px 14px;
	border-top: 1px solid var(--iwcb-line);
}
#iwcb-root .iwcb-input {
	flex: 1;
	resize: none;
	border: 1px solid var(--iwcb-line);
	border-radius: 12px;
	padding: 9px 12px;
	font: inherit;
	font-size: 15px;
	color: var(--iwcb-ink);
	background: #fff;
	max-height: 110px;
	min-height: 40px;
	margin: 0;
	box-shadow: none;
}
#iwcb-root .iwcb-input:focus {
	outline: none;
	border-color: var(--iwcb-brand);
}
#iwcb-root .iwcb-send {
	width: 40px;
	height: 40px;
	flex: none;
	border: 0;
	border-radius: 50%;
	padding: 0;
	display: grid;
	place-items: center;
	background: var(--iwcb-brand);
	color: var(--iwcb-on-brand);
}
#iwcb-root .iwcb-send:disabled {
	opacity: 0.5;
	cursor: default;
}

@keyframes iwcb-rise {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}
@keyframes iwcb-dot {
	0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
	40% { transform: translateY(-4px); opacity: 1; }
}

/* Mobile: panel goes full-screen */
@media (max-width: 640px) {
	#iwcb-root {
		right: 14px;
		bottom: 14px;
	}
	#iwcb-root .iwcb-teaser {
		width: calc(100vw - 28px);
		max-width: 320px;
	}
	#iwcb-root .iwcb-panel {
		position: fixed;
		inset: 0;
		width: 100%;
		height: 100%;
		border-radius: 0;
	}
	#iwcb-root.iwcb-open .iwcb-launcher {
		display: none;
	}
	#iwcb-root .iwcb-input {
		font-size: 16px; /* prevents iOS zoom */
	}
}

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