#cci-chat-root {
	position: fixed;
	bottom: 20px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--cci-accent: #1a1a1a;
	--cci-panel-bg: #f4f3f1;
	--cci-bubble-bg: #ffffff;
	--cci-bubble-text: #1a1a1a;
}
#cci-chat-root.cci-pos-right { right: 20px; }
#cci-chat-root.cci-pos-left { left: 20px; }

/* Closed state: pill with icon + label, like a compact tab */
.cci-bubble {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--cci-bubble-bg);
	color: var(--cci-bubble-text);
	border: 1px solid rgba(0,0,0,0.08);
	border-radius: 999px;
	padding: 12px 20px;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0,0,0,0.12);
	font-size: 15px;
	font-weight: 600;
	transition: transform 0.15s ease;
}
.cci-bubble:hover { transform: scale(1.03); }
.cci-bubble svg { width: 20px; height: 20px; flex-shrink: 0; }

/* Open panel */
.cci-panel {
	display: none;
	flex-direction: column;
	width: 400px;
	max-width: calc(100vw - 40px);
	height: 600px;
	max-height: calc(100vh - 110px);
	background: var(--cci-panel-bg);
	border-radius: 20px;
	box-shadow: 0 10px 40px rgba(0,0,0,0.22);
	position: absolute;
	bottom: 0;
	overflow: hidden;
	transition: width 0.15s ease, height 0.15s ease;
}
#cci-chat-root.cci-pos-right .cci-panel { right: 0; }
#cci-chat-root.cci-pos-left .cci-panel { left: 0; }
.cci-panel.cci-open { display: flex; }
.cci-panel.cci-expanded { width: 520px; height: 720px; }

.cci-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px;
}
.cci-header-name {
	font-weight: 600;
	font-size: 14px;
	color: #333;
}
.cci-header-icons {
	display: flex;
	gap: 8px;
	margin-left: auto;
}
.cci-icon-btn {
	width: 34px;
	height: 34px;
	min-width: 34px;
	min-height: 34px;
	flex-shrink: 0;
	border-radius: 50%;
	background-color: #fff;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 16px 16px;
	border: none;
	box-shadow: 0 1px 3px rgba(0,0,0,0.15);
	margin: 0;
	padding: 0;
	font: inherit;
	line-height: 1;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.cci-icon-btn:hover { background-color: #fafafa; }

.cci-icon-btn.cci-btn-expand {
	background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%3E%3Cpath%20d%3D%27M9%203H3V9M15%203H21V9M9%2021H3V15M15%2021H21V15%27%20stroke%3D%27%231a1a1a%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27/%3E%3C/svg%3E");
}
.cci-icon-btn.cci-btn-minimize {
	background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%3E%3Cpath%20d%3D%27M5%2012H19%27%20stroke%3D%27%231a1a1a%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27/%3E%3C/svg%3E");
}

.cci-body {
	flex: 1;
	overflow-y: auto;
	padding: 0 24px;
	display: flex;
	flex-direction: column;
}

.cci-greeting {
	font-size: 28px;
	font-weight: 700;
	color: #333;
	margin: 8px 0 10px;
}
.cci-description {
	font-size: 16px;
	color: #333;
	line-height: 1.4;
	margin-bottom: 16px;
}

.cci-messages {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 12px;
}
.cci-messages:empty { margin: 0; }

.cci-msg {
	max-width: 82%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.4;
	white-space: pre-wrap;
}
.cci-msg.visitor {
	align-self: flex-end;
	background: var(--cci-accent);
	color: #fff;
	border-bottom-right-radius: 3px;
}
.cci-msg.bot, .cci-msg.agent {
	align-self: flex-start;
	background: #fff;
	color: #222;
	border-bottom-left-radius: 3px;
}
.cci-msg.system {
	align-self: center;
	font-size: 12px;
	color: #888;
	background: none;
	padding: 2px 0;
}

.cci-spacer { flex: 1; }

.cci-disclaimer {
	font-size: 12px;
	color: #8a8a8a;
	line-height: 1.4;
	margin-bottom: 14px;
}
.cci-disclaimer a { color: #8a8a8a; text-decoration: underline; }

.cci-quick-replies {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
}
.cci-quick-btn {
	background: #fff;
	border: 1px solid rgba(0,0,0,0.12);
	border-radius: 999px;
	padding: 10px 16px;
	font-size: 14px;
	font-family: inherit;
	color: #222;
	cursor: pointer;
	white-space: nowrap;
	margin: 0;
	-webkit-appearance: none;
	appearance: none;
}
.cci-quick-btn:hover { border-color: var(--cci-accent); }

.cci-footer {
	padding: 0 20px 20px;
}

.cci-input-row {
	display: flex;
	align-items: center;
	background: #fff;
	border: 2px solid #1a1a1a;
	border-radius: 999px;
	padding: 6px 8px 6px 18px;
	gap: 8px;
}
.cci-input-row input[type=text] {
	flex: 1;
	border: none;
	outline: none;
	font-size: 15px;
	padding: 8px 0;
	background: transparent;
}
.cci-send-btn {
	width: 38px;
	height: 38px;
	min-width: 38px;
	min-height: 38px;
	border-radius: 50%;
	background-color: var(--cci-accent);
	background-repeat: no-repeat;
	background-position: center;
	background-size: 16px 16px;
	background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%3E%3Cpath%20d%3D%27M4%2012H20M20%2012L14%206M20%2012L14%2018%27%20stroke%3D%27%23ffffff%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27/%3E%3C/svg%3E");
	border: none;
	flex-shrink: 0;
	margin: 0;
	padding: 0;
	font: inherit;
	line-height: 1;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.cci-send-btn:disabled { opacity: 0.4; cursor: default; }

.cci-precapture {
	display: none;
	flex-direction: column;
	gap: 8px;
	background: #fff;
	border-radius: 16px;
	padding: 16px;
	margin-bottom: 16px;
}
.cci-precapture-label {
	font-size: 13px;
	color: #555;
	margin-bottom: 2px;
}
.cci-precapture input {
	border: 1px solid #ddd;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
}
.cci-precapture button {
	background: var(--cci-accent);
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 10px;
	cursor: pointer;
	font-size: 14px;
	font-family: inherit;
	font-weight: 600;
	margin: 0;
	-webkit-appearance: none;
	appearance: none;
}

@media (max-width: 480px) {
	.cci-panel, .cci-panel.cci-expanded {
		width: calc(100vw - 24px);
		height: calc(100vh - 100px);
	}
}
