/* Fidelity palette */
:root {
	--cwi-blue: #11237D;
	--cwi-green: #4DC247;
	--cwi-white: #e8e8e8;
	--cwi-deep-blue: #0b1a5a;
	--cwi-muted: #f5f7fb;
	--cwi-text: #0e1222;
	--cwi-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.cwi-launcher {
	position: fixed;
	right: 22px;
	bottom: 22px;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--cwi-blue), var(--cwi-green));
	box-shadow: var(--cwi-shadow);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--cwi-white);
	cursor: pointer;
	z-index: 99998;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cwi-launcher:hover {
	transform: translateY(-1px) scale(1.02);
	box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
}

.cwi-launcher-image {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	object-fit: cover;
	transition: transform 0.2s ease;
}

.cwi-launcher-badge {
	position: absolute;
	bottom: 64px;
	background: var(--cwi-blue);
	color: var(--cwi-white);
	font-size: 12px;
	padding: 6px 8px;
	border-radius: 6px;
	box-shadow: var(--cwi-shadow);
	pointer-events: none;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.cwi-launcher:hover .cwi-launcher-badge {
	opacity: 1;
	transform: translateY(0);
}

.cwi-chat {
	position: fixed;
	right: 22px;
	bottom: 100px;
	width: min(480px, calc(100vw - 32px));
	height: 520px;
	background: var(--cwi-white);
	border-radius: 16px;
	box-shadow: var(--cwi-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	z-index: 99999;
}

@media (max-width: 580px) {
	.cwi-chat {
		bottom: 88px;
		right: 12px;
		height: 440px;
		border-radius: 14px;
		/* width: min(380px, calc(100vw - 32px)); */
	}
}

.cwi-header {
	background: linear-gradient(90deg, var(--cwi-blue), var(--cwi-deep-blue));
	color: var(--cwi-white);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	border-bottom: 3px solid var(--cwi-green);
}

.cwi-header-brand {
	display: flex;
	align-items: center;
	gap: 10px;
}

.cwi-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.cwi-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.cwi-title-group {
	display: flex;
	flex-direction: column;
	line-height: 1.15;
}

.cwi-title {
	font-weight: 700;
	font-size: 15px;
}

.cwi-subtitle {
	opacity: 0.8;
	font-size: 12px;
}

.cwi-header-actions {
	display: flex;
	align-items: center;
	gap: 6px;
}

.cwi-btn {
	background: transparent;
	border: 1px solid rgba(255,255,255,0.4);
	color: var(--cwi-white);
	border-radius: 8px;
	padding: 6px 8px;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.1s ease;
}

.cwi-btn:hover {
	background: rgba(255,255,255,0.1);
	transform: translateY(-1px);
}

.cwi-suggested {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 6px;
	padding: 8px 10px 10px 10px;
	background: var(--cwi-muted);
	border-top: 1px solid #e6e9f2;
}

.cwi-suggested .cwi-chip {
	background: var(--cwi-white);
	border: 1px solid #e6e9f2;
	border-left: 3px solid var(--cwi-green);
	color: var(--cwi-text);
	padding: 6px 8px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 11px;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.cwi-suggested .cwi-chip:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.cwi-messages {
	flex: 1;
	padding: 14px 12px;
	background: linear-gradient(180deg, #ffffff, #f9fbff);
	overflow-y: auto;
}

/* Embedded iframe container */
.cwi-embed {
	flex: 1;
	width: 100%;
	background: #ffffff;
}

.cwi-embed-frame {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* Typing indicator */
.cwi-msg.cwi-typing {
	background: #eef6ff;
	color: #0e2a5e;
	border-left: 3px solid var(--cwi-green);
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.cwi-typing-text {
	font-size: 12px;
	opacity: 0.8;
}

.cwi-dot {
	width: 6px;
	height: 6px;
	background: #0e2a5e;
	border-radius: 50%;
	display: inline-block;
	opacity: 0.5;
	animation: cwi-bounce 1s infinite ease-in-out;
}

.cwi-typing .cwi-dot:nth-of-type(1) { animation-delay: 0s; }
.cwi-typing .cwi-dot:nth-of-type(2) { animation-delay: 0.15s; }
.cwi-typing .cwi-dot:nth-of-type(3) { animation-delay: 0.3s; }

@keyframes cwi-bounce {
	0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
	40% { transform: scale(1); opacity: 1; }
}

.cwi-msg {
	display: inline-flex;
	max-width: 88%;
	margin: 6px 0;
	padding: 10px 12px;
	border-radius: 14px;
	line-height: 1.35;
	font-size: 14px;
	box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}

.cwi-msg.user {
	background: var(--cwi-blue);
	color: var(--cwi-white);
	border-bottom-right-radius: 4px;
	margin-left: auto;
	float: right;
}

.cwi-msg.bot {
	background: #eef6ff;
	color: #0e2a5e;
	border-left: 3px solid var(--cwi-green);
	border-bottom-left-radius: 4px;
}

.cwi-input {
	display: flex;
	gap: 8px;
	padding: 10px 12px 12px 12px;
	border-top: 1px solid #e6e9f2;
	background: #fafcff;
}

.cwi-text {
	flex: 1;
	border: 1px solid #e1e6f2;
	border-radius: 12px;
	padding: 12px 14px;
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cwi-text:focus {
	border-color: var(--cwi-green);
	box-shadow: 0 0 0 3px rgba(77, 194, 71, 0.18);
}

.cwi-send {
	background: var(--cwi-green);
	color: var(--cwi-white);
	border: none;
	border-radius: 12px;
	padding: 0 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.2s ease, transform 0.1s ease;
	cursor: pointer;
}

.cwi-send:hover { opacity: 0.9; transform: translateY(-1px); }
.cwi-send:active { transform: translateY(0); }

/* Visibility helpers */
.cwi-hidden { display: none !important; }
.cwi-chat[hidden] { display: none !important; }
.cwi-chat.cwi-hidden { display: none !important; }


