/* Smart Interactive Chatbot - frontend. Everything is scoped to .sic-root and driven by CSS variables. */
.sic-root,
.sic-root *,
.sic-root *::before,
.sic-root *::after {
	box-sizing: border-box;
}

.sic-root {
	--sic-header-bg: #1f2a44;
	--sic-header-text: #fff;
	--sic-body-bg: #f5f6f8;
	--sic-bot-bg: #fff;
	--sic-bot-text: #1d2433;
	--sic-user-bg: #1f2a44;
	--sic-user-text: #fff;
	--sic-btn-bg: #fff;
	--sic-btn-text: #1f2a44;
	--sic-btn-border: #1f2a44;
	--sic-send-bg: #1f2a44;
	--sic-send-text: #fff;
	--sic-launcher-bg: #1f2a44;
	--sic-launcher-icon: #fff;
	--sic-input-bg: #fff;
	--sic-input-text: #1d2433;
	--sic-width: 380px;
	--sic-height: 600px;
	--sic-max-h: 85vh;
	--sic-header-h: 68px;
	--sic-radius: 16px;
	--sic-bubble-r: 16px;
	--sic-btn-r: 20px;
	--sic-input-r: 22px;
	--sic-font: inherit;
	--sic-fs: 14px;
	--sic-fs-m: 15px;
	--sic-gap: 10px;
	--sic-shadow: 0 12px 40px rgba(15, 23, 42, .22);
	--sic-launcher: 60px;
	--sic-launcher-m: 54px;
	--sic-x: 20px;
	--sic-y: 20px;
	font-family: var(--sic-font);
	font-size: var(--sic-fs);
	line-height: 1.45;
	color: var(--sic-bot-text);
	text-align: left;
	-webkit-text-size-adjust: 100%;
}

.sic-root button,
.sic-root textarea,
.sic-root select,
.sic-root input {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	letter-spacing: normal;
	text-transform: none;
	margin: 0;
	min-height: 0;
	min-width: 0;
	box-shadow: none;
	text-shadow: none;
	width: auto;
	height: auto;
	float: none;
}

.sic-root button {
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	background-image: none;
	font-weight: 500;
	text-decoration: none;
}

.sic-root svg {
	display: block;
	fill: currentColor;
	width: 100%;
	height: 100%;
}

.sic-root img {
	max-width: 100%;
	height: auto;
	border: 0;
}

/* ---------- Floating container ---------- */
.sic-floating {
	position: fixed;
	z-index: 999990;
	bottom: var(--sic-y);
	right: var(--sic-x);
	left: auto;
}

.sic-floating.sic-left {
	left: var(--sic-x);
	right: auto;
}

/* ---------- Launcher ---------- */
.sic-root .sic-launcher {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--sic-launcher);
	height: var(--sic-launcher);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--sic-launcher-bg);
	color: var(--sic-launcher-icon);
	box-shadow: 0 6px 20px rgba(15, 23, 42, .28);
	transition: transform .2s ease, box-shadow .2s ease;
	overflow: visible;
}

.sic-root .sic-launcher.sic-rounded {
	border-radius: 28%;
}

.sic-root .sic-launcher:hover,
.sic-root .sic-launcher:focus-visible {
	transform: scale(1.06);
	background: var(--sic-launcher-bg);
	color: var(--sic-launcher-icon);
	box-shadow: 0 8px 26px rgba(15, 23, 42, .34);
}

.sic-root .sic-launcher:focus-visible,
.sic-root .sic-hbtn:focus-visible,
.sic-root .sic-qr:focus-visible,
.sic-root .sic-send:focus-visible {
	outline: 2px solid var(--sic-btn-border);
	outline-offset: 2px;
}

.sic-root .sic-launcher-icon {
	display: block;
	width: 48%;
	height: 48%;
	transition: transform .25s ease, opacity .2s ease;
}

.sic-root .sic-launcher-icon.sic-icon-close {
	position: absolute;
	width: 38%;
	height: 38%;
	opacity: 0;
	transform: rotate(-90deg) scale(.6);
}

.sic-root .sic-launcher img.sic-launcher-icon {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
}

.sic-open .sic-launcher .sic-icon-main {
	opacity: 0;
	transform: rotate(90deg) scale(.6);
}

.sic-open .sic-launcher .sic-icon-close {
	opacity: 1;
	transform: none;
}

.sic-root .sic-dot {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 13px;
	height: 13px;
	border-radius: 50%;
	background: #ef4444;
	border: 2px solid #fff;
}

.sic-open .sic-dot,
.sic-seen .sic-dot {
	display: none;
}

.sic-root .sic-nudge {
	position: absolute;
	bottom: calc(var(--sic-launcher) + 12px);
	right: 0;
	max-width: 240px;
	width: max-content;
	padding: 10px 30px 10px 14px;
	border-radius: 14px;
	background: var(--sic-bot-bg);
	color: var(--sic-bot-text);
	box-shadow: 0 6px 24px rgba(15, 23, 42, .18);
	cursor: pointer;
	animation: sic-pop .25s ease both;
}

.sic-left .sic-nudge {
	right: auto;
	left: 0;
}

.sic-root .sic-nudge-close {
	position: absolute;
	top: 4px;
	right: 6px;
	width: 20px;
	height: 20px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	opacity: .55;
	font-size: 16px;
	line-height: 20px;
}

.sic-open .sic-nudge {
	display: none;
}

/* ---------- Panel ---------- */
.sic-root .sic-panel {
	display: flex;
	flex-direction: column;
	width: var(--sic-width);
	max-width: calc(100vw - 24px);
	height: var(--sic-height);
	max-height: var(--sic-max-h);
	background: var(--sic-body-bg);
	border-radius: var(--sic-radius);
	box-shadow: var(--sic-shadow);
	overflow: hidden;
}

.sic-floating .sic-panel {
	position: absolute;
	bottom: calc(var(--sic-launcher) + 14px);
	right: 0;
	max-height: min(var(--sic-max-h), calc(100vh - var(--sic-launcher) - var(--sic-y) - 30px));
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px) scale(.97);
	transform-origin: bottom right;
	transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}

.sic-floating.sic-left .sic-panel {
	right: auto;
	left: 0;
	transform-origin: bottom left;
}

.sic-floating.sic-open .sic-panel {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .22s ease, transform .22s ease;
}

.sic-inline .sic-panel {
	width: 100%;
	max-width: var(--sic-width);
	margin: 0 auto;
}

/* ---------- Header ---------- */
.sic-root .sic-header {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
	min-height: var(--sic-header-h);
	padding: 8px 10px 8px 16px;
	background: var(--sic-header-bg);
	color: var(--sic-header-text);
}

.sic-root .sic-avatar {
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	object-fit: cover;
	background: rgba(255, 255, 255, .15);
}

.sic-root .sic-titles {
	flex: 1 1 auto;
	min-width: 0;
}

.sic-root .sic-name {
	font-size: 1.1em;
	font-weight: 600;
	line-height: 1.25;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sic-root .sic-sub {
	font-size: .88em;
	opacity: .85;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sic-root .sic-hbtn {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	padding: 8px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--sic-header-text);
	opacity: .85;
	transition: background .15s ease, opacity .15s ease;
}

.sic-root .sic-hbtn:hover {
	background: rgba(255, 255, 255, .16);
	color: var(--sic-header-text);
	opacity: 1;
}

.sic-inline .sic-hbtn.sic-close,
.sic-inline .sic-hbtn.sic-min {
	display: none;
}

.sic-root .sic-progress {
	flex: 0 0 auto;
	padding: 6px 16px;
	font-size: .82em;
	color: var(--sic-bot-text);
	background: var(--sic-bot-bg);
	border-bottom: 1px solid rgba(15, 23, 42, .08);
}

.sic-root .sic-progress-bar {
	height: 4px;
	margin-top: 4px;
	border-radius: 2px;
	background: rgba(15, 23, 42, .1);
	overflow: hidden;
}

.sic-root .sic-progress-bar span {
	display: block;
	height: 100%;
	background: var(--sic-user-bg);
	transition: width .3s ease;
}

/* ---------- Messages ---------- */
.sic-root .sic-body {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px 14px 8px;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
}

.sic-root .sic-msg {
	display: flex;
	margin: 0 0 var(--sic-gap);
	animation: sic-in .25s ease both;
}

.sic-root .sic-msg.sic-user {
	justify-content: flex-end;
}

.sic-root .sic-bubble {
	max-width: 86%;
	padding: 10px 14px;
	border-radius: var(--sic-bubble-r);
	border-bottom-left-radius: 4px;
	background: var(--sic-bot-bg);
	color: var(--sic-bot-text);
	box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
	overflow-wrap: anywhere;
	word-break: break-word;
}

.sic-root .sic-user .sic-bubble {
	border-radius: var(--sic-bubble-r);
	border-bottom-right-radius: 4px;
	background: var(--sic-user-bg);
	color: var(--sic-user-text);
	white-space: pre-wrap;
}

.sic-root .sic-bubble a {
	color: inherit;
	text-decoration: underline;
}

.sic-root .sic-bubble ul,
.sic-root .sic-bubble ol {
	margin: 4px 0 6px;
	padding: 0 0 0 20px;
	list-style-position: outside;
}

.sic-root .sic-bubble ul {
	list-style-type: disc;
}

.sic-root .sic-bubble ol {
	list-style-type: decimal;
}

.sic-root .sic-bubble li {
	margin: 2px 0;
	padding: 0;
	list-style: inherit;
}

.sic-root .sic-bubble li::before {
	content: none;
}

.sic-root .sic-bubble strong,
.sic-root .sic-bubble b {
	font-weight: 600;
}

.sic-root .sic-bubble small {
	font-size: .88em;
	opacity: .8;
}

.sic-root .sic-bubble.sic-image {
	padding: 4px;
}

.sic-root .sic-bubble.sic-image img {
	display: block;
	max-height: 200px;
	width: auto;
	border-radius: calc(var(--sic-bubble-r) - 4px);
}

.sic-root .sic-typing {
	display: inline-flex;
	gap: 4px;
	padding: 4px 2px;
}

.sic-root .sic-typing i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	opacity: .35;
	animation: sic-blink 1.1s infinite both;
}

.sic-root .sic-typing i:nth-child(2) {
	animation-delay: .18s;
}

.sic-root .sic-typing i:nth-child(3) {
	animation-delay: .36s;
}

/* ---------- Quick replies ---------- */
.sic-root .sic-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 2px 0 var(--sic-gap);
	animation: sic-in .25s ease both;
}

.sic-root .sic-qr {
	max-width: 100%;
	padding: 8px 14px;
	border: 1px solid var(--sic-btn-border);
	border-radius: var(--sic-btn-r);
	background: var(--sic-btn-bg);
	color: var(--sic-btn-text);
	text-align: left;
	white-space: normal;
	transition: background .15s ease, color .15s ease, transform .1s ease;
}

.sic-root .sic-qr:hover {
	background: var(--sic-btn-border);
	border-color: var(--sic-btn-border);
	color: var(--sic-btn-bg);
}

.sic-root .sic-qr:active {
	transform: scale(.97);
}

.sic-root .sic-qr.sic-ghost {
	border-style: dashed;
	opacity: .85;
}

.sic-root .sic-qr[disabled] {
	opacity: .5;
	cursor: default;
}

/* ---------- Choice widgets ---------- */
.sic-root .sic-widget {
	margin: 2px 0 var(--sic-gap);
	padding: 12px;
	border-radius: var(--sic-bubble-r);
	background: var(--sic-bot-bg);
	color: var(--sic-bot-text);
	box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
	animation: sic-in .25s ease both;
}

.sic-root .sic-check {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 6px 2px;
	cursor: pointer;
	font-weight: 400;
	margin: 0;
}

.sic-root .sic-check input {
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
	margin: 2px 0 0;
	accent-color: var(--sic-user-bg);
	-webkit-appearance: auto;
	appearance: auto;
	opacity: 1;
	position: static;
}

.sic-root .sic-widget select {
	display: block;
	width: 100%;
	padding: 9px 10px;
	border: 1px solid rgba(15, 23, 42, .2);
	border-radius: 8px;
	background: var(--sic-input-bg);
	color: var(--sic-input-text);
	-webkit-appearance: auto;
	appearance: auto;
}

.sic-root .sic-widget .sic-qr {
	margin-top: 10px;
	background: var(--sic-send-bg);
	border-color: var(--sic-send-bg);
	color: var(--sic-send-text);
}

/* ---------- Footer / input ---------- */
.sic-root .sic-footer {
	flex: 0 0 auto;
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin: 0;
	padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
	background: var(--sic-body-bg);
	border-top: 1px solid rgba(15, 23, 42, .08);
}

.sic-root .sic-input {
	flex: 1 1 auto;
	display: block;
	width: 100%;
	max-height: 96px;
	padding: 10px 14px;
	border: 1px solid rgba(15, 23, 42, .16);
	border-radius: var(--sic-input-r);
	background: var(--sic-input-bg);
	color: var(--sic-input-text);
	font-size: max(16px, var(--sic-fs));
	resize: none;
	outline: 0;
	overflow-y: auto;
}

@media (min-width: 601px) {
	.sic-root .sic-input {
		font-size: var(--sic-fs);
	}
}

.sic-root .sic-input:focus {
	border-color: var(--sic-send-bg);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--sic-send-bg) 22%, transparent);
}

.sic-root .sic-input::placeholder {
	color: var(--sic-input-text);
	opacity: .5;
}

.sic-root .sic-send {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	padding: 11px;
	border: 0;
	border-radius: 50%;
	background: var(--sic-send-bg);
	color: var(--sic-send-text);
	transition: transform .12s ease, opacity .15s ease;
}

.sic-root .sic-send:hover {
	background: var(--sic-send-bg);
	color: var(--sic-send-text);
	transform: scale(1.06);
}

.sic-root .sic-send[disabled] {
	opacity: .45;
	cursor: default;
	transform: none;
}

.sic-root .sic-footer {
	padding-bottom: 8px;
}

.sic-root .sic-credit {
	flex: 0 0 auto;
	padding: 0 12px calc(8px + env(safe-area-inset-bottom, 0px));
	background: var(--sic-body-bg);
	color: var(--sic-bot-text);
	font-size: 11px;
	line-height: 1.4;
	text-align: center;
	opacity: .75;
}

.sic-root .sic-credit a {
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
}

.sic-root .sic-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none;
}

/* ---------- Trigger button (shortcode / Elementor) ---------- */
.sic-trigger {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 22px;
	border: 0;
	border-radius: 999px;
	background: var(--sic-trigger-bg, #1f2a44);
	color: var(--sic-trigger-color, #fff);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: transform .15s ease, opacity .15s ease;
}

.sic-trigger:hover,
.sic-trigger:focus {
	opacity: .92;
	transform: translateY(-1px);
	background: var(--sic-trigger-bg, #1f2a44);
	color: var(--sic-trigger-color, #fff);
}

.sic-trigger svg,
.sic-trigger i {
	width: 1.15em;
	height: 1.15em;
	fill: currentColor;
}

.sic-trigger-wrap {
	display: block;
}

/* ---------- Animations ---------- */
@keyframes sic-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes sic-pop {
	from {
		opacity: 0;
		transform: translateY(8px) scale(.96);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes sic-blink {
	0%, 80%, 100% {
		opacity: .25;
		transform: translateY(0);
	}
	40% {
		opacity: .9;
		transform: translateY(-3px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.sic-root *,
	.sic-root *::before,
	.sic-root *::after {
		animation: none !important;
		transition: none !important;
	}
}

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
	.sic-floating .sic-panel {
		max-width: calc(100vw - 32px);
	}
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
	.sic-root {
		font-size: var(--sic-fs-m);
	}

	.sic-root .sic-launcher {
		width: var(--sic-launcher-m);
		height: var(--sic-launcher-m);
	}

	.sic-root .sic-nudge {
		bottom: calc(var(--sic-launcher-m) + 12px);
		max-width: min(240px, calc(100vw - 2 * var(--sic-x)));
	}

	.sic-floating .sic-panel {
		bottom: calc(var(--sic-launcher-m) + 12px);
		width: calc(100vw - 2 * min(var(--sic-x), 12px));
		max-width: none;
		max-height: calc(var(--sic-vh, 100vh) - var(--sic-launcher-m) - var(--sic-y) - 24px);
	}

	.sic-floating.sic-mfull.sic-open {
		inset: 0;
		z-index: 2147483000;
	}

	.sic-floating.sic-mfull.sic-open .sic-panel {
		position: fixed;
		top: var(--sic-vtop, 0);
		left: 0;
		right: 0;
		bottom: auto;
		width: 100%;
		height: var(--sic-vh, 100dvh);
		max-height: none;
		border-radius: 0;
	}

	.sic-floating.sic-mfull.sic-open .sic-launcher,
	.sic-floating.sic-mfull.sic-open .sic-nudge {
		display: none;
	}

	.sic-root .sic-bubble {
		max-width: 90%;
	}

	.sic-root .sic-qr {
		padding: 10px 14px;
	}

	.sic-inline .sic-panel {
		max-width: 100%;
	}
}

html.sic-lock,
html.sic-lock body {
	overflow: hidden !important;
}
