.ai-panel {
	background: var(--bg-darker);
	border-top: 1px solid var(--border-color);
	display: flex;
	flex-direction: column;
	position: relative;
	transition: height 0.2s ease;
}

.ai-panel.maximized {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 100;
}

.ai-panel.minimized {
	height: 36px !important;
}

.resize-handle {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	cursor: ns-resize;
	background: transparent;
	z-index: 10;
}

.resize-handle:hover {
	background: var(--primary-color);
}

.ai-panel-header {
	height: 36px;
	min-height: 36px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 var(--spacing-md);
	background: var(--bg-sidebar);
	border-bottom: 1px solid var(--border-color);
}

.ai-panel-title {
	font-size: 12px;
	font-weight: 500;
	color: var(--text-secondary);
}

.ai-panel-controls {
	display: flex;
	gap: var(--spacing-xs);
}

.panel-control-btn {
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--text-muted);
	border-radius: 4px;
	transition: all 0.15s;
}

.panel-control-btn:hover {
	background: rgba(255, 255, 255, 0.1);
	color: var(--text-primary);
}

.ai-panel-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.ai-messages {
	flex: 1;
	overflow-y: auto;
	padding: var(--spacing-md);
	display: flex;
	flex-direction: column;
	gap: var(--spacing-md);
}

.ai-message {
	display: flex;
	gap: var(--spacing-sm);
	align-items: flex-start;
}

.ai-message.user {
	flex-direction: row-reverse;
}

.message-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--bg-sidebar);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	flex-shrink: 0;
}

.message-content {
	max-width: 80%;
	padding: var(--spacing-sm) var(--spacing-md);
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-word;
}

.ai-message.ai .message-content {
	background: var(--bg-sidebar);
	color: var(--text-primary);
}

.ai-message.user .message-content {
	background: var(--primary-color);
	color: white;
}

.message-content.loading {
	display: flex;
	gap: 4px;
	padding: var(--spacing-md);
}

.loading-dot {
	width: 8px;
	height: 8px;
	background: var(--text-muted);
	border-radius: 50%;
	animation: loadingBounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
	animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
	animation-delay: -0.16s;
}

@keyframes loadingBounce {

	0%,
	80%,
	100% {
		transform: scale(0);
	}

	40% {
		transform: scale(1);
	}
}

.ai-input-area {
	display: flex;
	gap: var(--spacing-sm);
	padding: var(--spacing-sm) var(--spacing-md);
	border-top: 1px solid var(--border-color);
}

.ai-input {
	flex: 1;
	resize: none;
	min-height: 40px;
	max-height: 100px;
}

.ai-send-btn {
	padding: var(--spacing-sm) var(--spacing-md);
	background: var(--primary-color);
	color: white;
	border-radius: 4px;
	font-weight: 500;
	transition: all 0.15s;
	align-self: flex-end;
}

.ai-send-btn:hover:not(:disabled) {
	background: var(--primary-hover);
}

.ai-send-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
