.wsd-ai-widget {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	z-index: 9999;
	font-family: inherit;
}

/* Toggle bubble */
.wsd-ai-bubble {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3.25rem;
	height: 3.25rem;
	border-radius: 9999px;
	background: #4f46e5;
	color: #fff;
	box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
	cursor: pointer;
	transition: background-color 0.15s, transform 0.15s;
	border: none;
}

.wsd-ai-bubble:hover {
	background: #4338ca;
	transform: scale(1.05);
}

.wsd-ai-bubble-icon {
	width: 1.5rem;
	height: 1.5rem;
}

/* Panel */
.wsd-ai-panel {
	width: 22rem;
	height: 28rem;
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 1rem;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
	overflow: hidden;
	border: 1px solid #e5e7eb;
}

/* Header */
.wsd-ai-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 1rem;
	background: #4f46e5;
	color: #fff;
	flex-shrink: 0;
}

.wsd-ai-header-title {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	font-size: 0.875rem;
	font-weight: 600;
}

.wsd-ai-header-icon {
	width: 1rem;
	height: 1rem;
	opacity: 0.9;
}

.wsd-ai-mock-badge {
	font-size: 0.625rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background: rgba(255, 255, 255, 0.2);
	padding: 0.125rem 0.375rem;
	border-radius: 9999px;
}

.wsd-ai-header-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.25rem;
	border-radius: 0.375rem;
	color: rgba(255, 255, 255, 0.8);
	background: transparent;
	border: none;
	cursor: pointer;
	transition: color 0.15s, background-color 0.15s;
}

.wsd-ai-header-btn:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.15);
}

/* Messages */
.wsd-ai-messages {
	flex: 1;
	overflow-y: auto;
	padding: 0.75rem;
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
}

.wsd-ai-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	font-size: 0.875rem;
	color: #6b7280;
	text-align: center;
	padding: 1rem;
}

.wsd-ai-message {
	display: flex;
}

.wsd-ai-message--user {
	justify-content: flex-end;
}

.wsd-ai-message--assistant {
	justify-content: flex-start;
}

.wsd-ai-bubble-msg {
	max-width: 85%;
	padding: 0.5rem 0.75rem;
	border-radius: 0.75rem;
	font-size: 0.8125rem;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-word;
}

.wsd-ai-message--user .wsd-ai-bubble-msg {
	background: #4f46e5;
	color: #fff;
	border-bottom-right-radius: 0.125rem;
}

.wsd-ai-message--assistant .wsd-ai-bubble-msg {
	background: #f3f4f6;
	color: #1f2937;
	border-bottom-left-radius: 0.125rem;
}

/* Input */
.wsd-ai-input-area {
	padding: 0.625rem;
	border-top: 1px solid #e5e7eb;
	flex-shrink: 0;
	background: #fff;
}

.wsd-ai-form {
	display: flex;
	gap: 0.5rem;
	align-items: flex-end;
}

.wsd-ai-textarea {
	flex: 1;
	resize: none;
	border: 1px solid #d1d5db;
	border-radius: 0.5rem;
	padding: 0.5rem 0.625rem;
	font-size: 0.8125rem;
	line-height: 1.4;
	font-family: inherit;
	background: #fff;
	color: #111827;
	outline: none;
	transition: border-color 0.15s;
}

.wsd-ai-textarea:focus {
	border-color: #4f46e5;
	box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.wsd-ai-textarea:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.wsd-ai-send {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	flex-shrink: 0;
	border-radius: 0.5rem;
	background: #4f46e5;
	color: #fff;
	border: none;
	cursor: pointer;
	transition: background-color 0.15s, opacity 0.15s;
}

.wsd-ai-send:hover:not(:disabled) {
	background: #4338ca;
}

.wsd-ai-send:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

@media (max-width: 480px) {
	.wsd-ai-panel {
		width: calc(100vw - 2rem);
	}
}
