.qcw_widget,
.qcw_dialog {
	--qcw_brand: #134e61;
	--qcw_contrast: #fff;
	--qcw_ink: #172230;
	--qcw_surface: #fff;
	--qcw_border: #dce3e8;
	--qcw_shadow: 0 4px 18px rgb(14 29 45 / 18%);
	color: var(--qcw_ink);
	font: 400 16px/1.45 system-ui, sans-serif;
	direction: ltr;
}

.qcw_widget,
.qcw_widget *,
.qcw_dialog,
.qcw_dialog * {
	box-sizing: border-box;
}

.qcw_widget [hidden],
.qcw_widget[hidden],
.qcw_dialog [hidden],
.qcw_dialog:not([open]) {
	display: none !important;
}

.qcw_widget {
	--qcw_button: 56px;
	--qcw_action: 48px;
	--qcw_offset_x: 20px;
	--qcw_offset_y: 20px;
	--qcw_bottom: calc(var(--qcw_offset_y) + env(safe-area-inset-bottom, 0px));
	--qcw_side: var(--qcw_offset_x);
	position: fixed;
	bottom: var(--qcw_bottom);
	right: calc(var(--qcw_side) + env(safe-area-inset-right, 0px));
	z-index: 99990;
	width: var(--qcw_button);
	height: var(--qcw_button);
}

.qcw_widget.qcw_has_label {
	width: auto;
}

.qcw_widget.qcw_left {
	right: auto;
	left: calc(var(--qcw_side) + env(safe-area-inset-left, 0px));
}

.qcw_widget.qcw_small {
	--qcw_button: 48px;
	--qcw_action: 44px;
}

.qcw_widget.qcw_large {
	--qcw_button: 64px;
	--qcw_action: 54px;
}

.qcw_widget .qcw_control,
.qcw_dialog .qcw_control {
	appearance: none;
	display: inline-grid;
	place-items: center;
	margin: 0;
	padding: 0;
	min-width: 0;
	min-height: 0;
	border: 0;
	border-radius: 50%;
	background: var(--qcw_surface);
	color: var(--qcw_ink);
	box-shadow: none;
	font: inherit;
	letter-spacing: normal;
	line-height: 1;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
}

.qcw_widget .qcw_control:focus-visible,
.qcw_dialog .qcw_control:focus-visible,
.qcw_dialog input:focus-visible,
.qcw_dialog textarea:focus-visible {
	outline: 2px solid #2167bc;
	outline-offset: 2px;
}

.qcw_widget .qcw_control svg,
.qcw_dialog .qcw_control svg {
	display: block;
	width: 24px;
	height: 24px;
	max-width: none;
}

.qcw_widget .qcw_launcher {
	position: relative;
	width: var(--qcw_button);
	height: var(--qcw_button);
	background: var(--qcw_brand);
	color: var(--qcw_contrast);
	box-shadow: var(--qcw_shadow);
}

.qcw_widget.qcw_has_label .qcw_launcher {
	width: auto;
	min-width: var(--qcw_button);
	padding-inline: calc(var(--qcw_button) * 0.3);
}

.qcw_launcher > span {
	grid-area: 1 / 1;
	transition: opacity 160ms ease, transform 160ms ease;
}

.qcw_launcher_idle {
	display: inline-flex;
	align-items: center;
	gap: 9px;
}

.qcw_right .qcw_launcher_idle {
	flex-direction: row-reverse;
}

.qcw_launcher_text {
	max-width: 220px;
	overflow: hidden;
	font-size: 15px;
	font-weight: 650;
	line-height: 1.2;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* Shapes: a circle grows into a pill when the launcher has a label. */
.qcw_widget.qcw_shape_circle .qcw_launcher,
.qcw_widget.qcw_shape_circle .qcw_channel {
	border-radius: 999px;
}

.qcw_widget.qcw_shape_rounded .qcw_launcher {
	border-radius: calc(var(--qcw_button) * 0.3);
}

.qcw_widget.qcw_shape_rounded .qcw_channel {
	border-radius: calc(var(--qcw_action) * 0.3);
}

.qcw_widget.qcw_shape_square .qcw_launcher,
.qcw_widget.qcw_shape_square .qcw_channel {
	border-radius: 6px;
}

.qcw_launcher .qcw_launcher_close,
.qcw_expanded .qcw_launcher_idle {
	opacity: 0;
	transform: scale(0.75);
}

.qcw_expanded .qcw_launcher_close {
	opacity: 1;
	transform: scale(1);
}

.qcw_anim_pulse.qcw_animate .qcw_launcher::after {
	content: "";
	position: absolute;
	inset: 0;
	border: 2px solid var(--qcw_brand);
	border-radius: inherit;
	opacity: 0;
	pointer-events: none;
	animation: qcw_pulse 1.8s 0.6s 3;
}

@keyframes qcw_pulse {
	0% { opacity: 0; transform: scale(1); }
	18% { opacity: 0.4; }
	90%, 100% { opacity: 0; transform: scale(1.33); }
}

.qcw_anim_bounce.qcw_animate .qcw_launcher {
	animation: qcw_bounce 1.6s 0.6s 3;
}

@keyframes qcw_bounce {
	0%, 45%, 100% { transform: translateY(0); }
	12% { transform: translateY(-10px); }
	24% { transform: translateY(0); }
	34% { transform: translateY(-4px); }
}

.qcw_bubble {
	position: absolute;
	top: 50%;
	right: calc(100% + 12px);
	display: grid;
	justify-items: end;
	gap: 6px;
	transform: translateY(-50%);
	pointer-events: none;
}

.qcw_left .qcw_bubble {
	right: auto;
	left: calc(100% + 12px);
	justify-items: start;
}

.qcw_greeting,
.qcw_badge,
.qcw_tooltip {
	width: max-content;
	max-width: min(190px, calc(100vw - 145px));
	padding: 6px 10px;
	border: 1px solid var(--qcw_border);
	border-radius: 11px;
	background: var(--qcw_surface);
	color: var(--qcw_ink);
	box-shadow: var(--qcw_shadow);
	font-size: 13px;
	font-weight: 600;
	overflow-wrap: anywhere;
}

.qcw_badge {
	font-size: 12px;
}

.qcw_badge::before {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	margin-right: 5px;
	border-radius: 50%;
	background: #677484;
}

.qcw_badge.qcw_online::before {
	background: #168048;
}

.qcw_expanded .qcw_greeting {
	display: none;
}

.qcw_widget .qcw_menu {
	position: absolute;
	right: -6px;
	bottom: calc(100% + 6px);
	display: grid;
	gap: 8px;
	width: min(270px, calc(100vw - 2 * var(--qcw_side)));
	max-height: calc(100vh - var(--qcw_button) - var(--qcw_bottom) - 20px);
	max-height: calc(100dvh - var(--qcw_button) - var(--qcw_bottom) - 20px);
	margin: 0;
	padding: 8px 6px;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	list-style: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	pointer-events: none;
	transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
}

.qcw_left .qcw_menu {
	left: -6px;
	right: auto;
}

.qcw_expanded .qcw_menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition-delay: 0s;
}

.qcw_menu li {
	display: flex;
	justify-content: flex-end;
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.qcw_left .qcw_menu li {
	justify-content: flex-start;
}

.qcw_menu li::before,
.qcw_menu li::marker {
	content: none;
}

.qcw_widget .qcw_channel {
	position: relative;
	width: var(--qcw_action);
	height: var(--qcw_action);
	margin-inline: calc((var(--qcw_button) - var(--qcw_action)) / 2);
	border: 1px solid var(--qcw_border);
	box-shadow: var(--qcw_shadow);
	transition: transform 150ms ease, background-color 150ms ease, color 150ms ease;
}

.qcw_widget.qcw_channels_brand .qcw_channel {
	border-color: transparent;
	background: var(--qcw_brand);
	color: var(--qcw_contrast);
}

.qcw_widget .qcw_channel:hover {
	transform: scale(1.06);
}

/* White buttons: app logos keep their own colors until hovered. */
.qcw_widget.qcw_channels_light .qcw_ch_whatsapp:not(:hover):not(:focus-visible) { color: #1fa855; }
.qcw_widget.qcw_channels_light .qcw_ch_messenger:not(:hover):not(:focus-visible) { color: #0866ff; }
.qcw_widget.qcw_channels_light .qcw_ch_instagram:not(:hover):not(:focus-visible) { color: #d62976; }
.qcw_widget.qcw_channels_light .qcw_ch_telegram:not(:hover):not(:focus-visible) { color: #229ed9; }

/* Real app colors: each button uses its service's color with a white icon. */
.qcw_widget.qcw_channels_real .qcw_channel {
	--qcw_app: var(--qcw_brand);
	border-color: transparent;
	background: var(--qcw_app);
	color: #fff;
}

.qcw_widget.qcw_channels_real .qcw_channel.qcw_ch_whatsapp { --qcw_app: #25d366; }
.qcw_widget.qcw_channels_real .qcw_channel.qcw_ch_messenger { --qcw_app: #0866ff; }
.qcw_widget.qcw_channels_real .qcw_channel.qcw_ch_telegram { --qcw_app: #229ed9; }
.qcw_widget.qcw_channels_real .qcw_channel.qcw_ch_phone { --qcw_app: #16a34a; }
.qcw_widget.qcw_channels_real .qcw_channel.qcw_ch_sms { --qcw_app: #2563eb; }
.qcw_widget.qcw_channels_real .qcw_channel.qcw_ch_email { --qcw_app: #ea4335; }
.qcw_widget.qcw_channels_real .qcw_channel.qcw_ch_form { --qcw_app: #475569; }

.qcw_widget.qcw_channels_real .qcw_channel.qcw_ch_instagram {
	background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}

.qcw_widget.qcw_flat .qcw_launcher,
.qcw_widget.qcw_flat .qcw_channel {
	box-shadow: none;
}

.qcw_expanded .qcw_channel {
	pointer-events: auto;
}

.qcw_widget:not(.qcw_channels_real) .qcw_channel:hover,
.qcw_widget:not(.qcw_channels_real) .qcw_channel:focus-visible {
	background: var(--qcw_brand);
	color: var(--qcw_contrast);
}

.qcw_tooltip {
	position: absolute;
	top: 50%;
	right: calc(100% + 8px);
	transform: translateY(-50%);
	text-align: left;
	opacity: 0;
	pointer-events: none;
	transition: opacity 150ms ease;
}

.qcw_left .qcw_tooltip {
	right: auto;
	left: calc(100% + 8px);
}

.qcw_channel:hover .qcw_tooltip,
.qcw_channel:focus .qcw_tooltip {
	opacity: 1;
}

.qcw_dialog {
	position: fixed;
	inset: 0;
	width: min(460px, calc(100vw - 28px));
	max-width: none;
	max-height: calc(100vh - 28px);
	max-height: calc(100dvh - 28px);
	margin: auto;
	padding: clamp(16px, 4vw, 24px);
	overflow: auto;
	overscroll-behavior: contain;
	border: 1px solid var(--qcw_border);
	border-radius: 18px;
	background: var(--qcw_surface);
	box-shadow: var(--qcw_shadow);
	text-align: start;
}

.qcw_dialog::backdrop {
	background: rgb(15 24 35 / 56%);
}

.qcw_dialog_header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 12px;
}

.qcw_dialog .qcw_dialog_header h2 {
	margin: 0;
	color: var(--qcw_ink);
	font: 700 1.25rem/1.3 system-ui, sans-serif;
	letter-spacing: normal;
	text-transform: none;
}

.qcw_dialog .qcw_dismiss {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	background: #eef2f6;
}

.qcw_dialog .qcw_form {
	display: grid;
	gap: 8px;
	margin: 0;
}

.qcw_form label {
	margin: 0;
	color: inherit;
	font: 600 0.875rem/1.4 system-ui, sans-serif;
}

.qcw_dialog .qcw_form input,
.qcw_dialog .qcw_form textarea {
	width: 100%;
	min-width: 0;
	min-height: 44px;
	height: auto;
	margin: 0 0 4px;
	padding: 9px 11px;
	border: 1px solid #788698;
	border-radius: 8px;
	background: var(--qcw_surface);
	color: var(--qcw_ink);
	box-shadow: none;
	font: inherit;
}

.qcw_form textarea {
	resize: vertical;
}

.qcw_status {
	margin: 0;
	font-size: 14px;
}

.qcw_status.qcw_error {
	color: #a62222;
}

.qcw_dialog .qcw_submit {
	justify-self: start;
	min-height: 44px;
	padding: 10px 17px;
	border-radius: 9px;
	background: var(--qcw_brand);
	color: var(--qcw_contrast);
	font-weight: 650;
}

.qcw_submit[aria-disabled="true"] {
	opacity: 0.72;
	cursor: wait;
}

@media (max-width: 767px) {
	.qcw_widget {
		--qcw_side: calc(var(--qcw_offset_x) * 0.7);
		--qcw_bottom: calc(var(--qcw_offset_y) * 0.7 + env(safe-area-inset-bottom, 0px));
		--qcw_button: 52px;
		--qcw_action: 46px;
	}

	.qcw_widget.qcw_large {
		--qcw_button: 60px;
		--qcw_action: 50px;
	}
}

@media (hover: none) {
	.qcw_tooltip {
		opacity: 1;
	}
}

@media (max-height: 630px) {
	.qcw_expanded .qcw_menu {
		pointer-events: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.qcw_widget *,
	.qcw_widget *::after {
		animation: none;
		transition: none;
	}
}
