.dac-widget {
	--dac-color: #1a56db;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}
.dac-widget * {
	box-sizing: border-box;
}

/* Bubble positioning */
.dac-bubble-widget {
	position: fixed;
	z-index: 999999;
	bottom: 24px;
}
.dac-position-bottom-right { right: 24px; }
.dac-position-bottom-left { left: 24px; }

.dac-toggle-btn {
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: var(--dac-color);
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0,0,0,0.25);
	transition: transform 0.15s ease;
}
.dac-toggle-btn:hover {
	transform: scale(1.06);
}

/* Chat panel */
.dac-chat-panel {
	width: 340px;
	max-width: 90vw;
	height: 460px;
	max-height: 70vh;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba(0,0,0,0.2);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	position: absolute;
	bottom: 70px;
	right: 0;
}
.dac-position-bottom-left .dac-chat-panel {
	right: auto;
	left: 0;
}
.dac-inline-widget .dac-chat-panel {
	position: relative;
	bottom: auto;
	width: 100%;
	max-width: 480px;
	height: 500px;
}
.dac-hidden {
	display: none !important;
}

.dac-chat-header {
	background: var(--dac-color);
	color: #fff;
	padding: 14px 16px;
	font-weight: 600;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 15px;
}
.dac-close-btn {
	background: none;
	border: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}

.dac-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f7f8fa;
}

.dac-msg {
	max-width: 82%;
	padding: 9px 12px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.dac-msg-bot {
	background: #fff;
	color: #222;
	border: 1px solid #e5e7eb;
	align-self: flex-start;
	border-bottom-left-radius: 2px;
}
.dac-msg-user {
	background: var(--dac-color);
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: 2px;
}
.dac-msg-error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
	align-self: flex-start;
}
.dac-msg-sources {
	font-size: 12px;
	margin-top: 6px;
	opacity: 0.75;
}
.dac-msg-sources a {
	color: inherit;
}

.dac-typing {
	display: inline-flex;
	gap: 3px;
	align-self: flex-start;
	background: #fff;
	border: 1px solid #e5e7eb;
	padding: 10px 12px;
	border-radius: 12px;
}
.dac-typing span {
	width: 6px;
	height: 6px;
	background: #9ca3af;
	border-radius: 50%;
	animation: dac-bounce 1.2s infinite ease-in-out;
}
.dac-typing span:nth-child(2) { animation-delay: 0.15s; }
.dac-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dac-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
	30% { transform: translateY(-4px); opacity: 1; }
}

.dac-chat-input-row {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e5e7eb;
	background: #fff;
}
.dac-chat-input {
	flex: 1;
	border: 1px solid #d1d5db;
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 14px;
	outline: none;
}
.dac-chat-input:focus {
	border-color: var(--dac-color);
}
.dac-send-btn {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--dac-color);
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.dac-send-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
