/* AI-Chat-Olive widget styles */
#aco-chat-root {
	--aco-color: #2e7d32;
	--aco-text: #ffffff;
	position: fixed;
	z-index: 999999;
	bottom: 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
#aco-chat-root[data-position="bottom-right"] { right: 20px; }
#aco-chat-root[data-position="bottom-left"] { left: 20px; }

.aco-launcher {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	background: var(--aco-color);
	color: var(--aco-text);
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.18s ease;
}
.aco-launcher:hover { transform: scale(1.06); }
#aco-chat-root.aco-active .aco-launcher { transform: scale(0); opacity: 0; }
#aco-chat-root.aco-has-unread .aco-launcher::after {
	content: "";
	position: absolute;
	top: 2px;
	right: 2px;
	width: 14px;
	height: 14px;
	background: #d63638;
	border: 2px solid #fff;
	border-radius: 50%;
}
.aco-launcher { position: relative; }

.aco-panel {
	position: absolute;
	bottom: 0;
	width: 360px;
	max-width: calc(100vw - 40px);
	height: 520px;
	max-height: calc(100vh - 40px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(20px) scale(0.96);
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}
#aco-chat-root[data-position="bottom-right"] .aco-panel { right: 0; }
#aco-chat-root[data-position="bottom-left"] .aco-panel { left: 0; }
#aco-chat-root.aco-active .aco-panel {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.aco-header {
	background: var(--aco-color);
	color: var(--aco-text);
	padding: 16px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.aco-title { font-weight: 600; font-size: 16px; }
.aco-subtitle { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.aco-close {
	background: transparent;
	border: none;
	color: var(--aco-text);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.85;
}
.aco-close:hover { opacity: 1; }

.aco-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: #f5f6f8;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.aco-msg { max-width: 80%; display: flex; flex-direction: column; }
.aco-them { align-self: flex-start; }
.aco-mine { align-self: flex-end; align-items: flex-end; }
.aco-name { font-size: 11px; color: #888; margin: 0 0 3px 4px; }
.aco-bubble {
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.45;
	word-wrap: break-word;
}
.aco-them .aco-bubble { background: #fff; color: #1a1a1a; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.aco-mine .aco-bubble { background: var(--aco-color); color: var(--aco-text); border-bottom-right-radius: 4px; }
.aco-bubble a { color: inherit; text-decoration: underline; }

.aco-typing {
	display: flex;
	gap: 4px;
	padding: 0 20px 6px;
	background: #f5f6f8;
}
.aco-typing span {
	width: 7px; height: 7px; border-radius: 50%;
	background: #bbb; animation: aco-bounce 1.2s infinite;
}
.aco-typing span:nth-child(2) { animation-delay: 0.2s; }
.aco-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aco-bounce { 0%,60%,100%{transform:translateY(0);opacity:.5} 30%{transform:translateY(-5px);opacity:1} }

.aco-deptbar {
	padding: 8px 12px 0;
	background: #fff;
}
.aco-deptbar .aco-dept {
	width: 100%;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 7px 10px;
	font-size: 13px;
	outline: none;
	box-sizing: border-box;
}
.aco-inputrow {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid #eee;
	background: #fff;
}
.aco-input {
	flex: 1;
	border: 1px solid #ddd;
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 14px;
	resize: none;
	outline: none;
	max-height: 120px;
	font-family: inherit;
}
.aco-input:focus { border-color: var(--aco-color); }
.aco-send {
	width: 40px; height: 40px;
	border-radius: 50%;
	border: none;
	background: var(--aco-color);
	color: var(--aco-text);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.aco-footer {
	text-align: center;
	font-size: 11px;
	color: #aaa;
	padding: 6px;
	background: #fff;
}
.aco-footer b { color: #888; }
.aco-leave { color: var(--aco-color); text-decoration: none; font-weight: 600; }
.aco-leave:hover { text-decoration: underline; }

/* Leave-a-message form */
.aco-form {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: #f5f6f8;
	flex-direction: column;
	gap: 10px;
}
.aco-form-title { font-weight: 600; font-size: 15px; color: #333; }
.aco-form input,
.aco-form textarea {
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	font-family: inherit;
	outline: none;
}
.aco-form input:focus,
.aco-form textarea:focus { border-color: var(--aco-color); }
.aco-f-send {
	background: var(--aco-color);
	color: var(--aco-text);
	border: none;
	border-radius: 8px;
	padding: 11px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.aco-f-status { font-size: 12px; color: #c0392b; min-height: 16px; }

/* Header help button */
.aco-help {
	background: transparent;
	border: none;
	color: var(--aco-text);
	cursor: pointer;
	opacity: 0.85;
	margin-right: 6px;
	display: flex;
	align-items: center;
}
.aco-help:hover, .aco-help.active { opacity: 1; }
.aco-header { gap: 6px; }
.aco-header-info { flex: 1; }

/* Knowledge base */
.aco-kb {
	flex: 1;
	overflow-y: auto;
	background: #fff;
	flex-direction: column;
}
.aco-kb-search { padding: 12px; border-bottom: 1px solid #eee; }
.aco-kb-q { width: 100%; border: 1px solid #ddd; border-radius: 20px; padding: 9px 14px; font-size: 14px; outline: none; box-sizing: border-box; }
.aco-kb-q:focus { border-color: var(--aco-color); }
.aco-kb-results { padding: 6px 0; }
.aco-kb-item { padding: 12px 16px; border-bottom: 1px solid #f2f2f2; cursor: pointer; }
.aco-kb-item:hover { background: #f7f7f7; }
.aco-kb-t { font-weight: 600; font-size: 14px; color: #222; }
.aco-kb-e { font-size: 12px; color: #777; margin-top: 3px; }
.aco-kb-empty { padding: 24px 16px; text-align: center; color: #999; font-size: 13px; }
.aco-kb-article { padding: 16px; }
.aco-kb-back { color: var(--aco-color); text-decoration: none; font-size: 13px; }
.aco-kb-title { margin: 10px 0; font-size: 17px; color: #1a1a1a; }
.aco-kb-content { font-size: 14px; line-height: 1.6; color: #333; }
.aco-kb-content img { max-width: 100%; height: auto; }
.aco-kb-vote { margin-top: 18px; padding-top: 12px; border-top: 1px solid #eee; font-size: 13px; color: #555; }
.aco-kb-vote button { border: 1px solid #ccc; background: #fff; border-radius: 14px; padding: 3px 12px; cursor: pointer; margin-left: 4px; }
.aco-kb-vote button:hover { border-color: var(--aco-color); color: var(--aco-color); }
