.greenleaf-ai-panel[hidden],
.greenleaf-chat-panel[hidden] {
	display: none !important;
}

.gl-search-shell {
	position: relative;
}

.gl-search-modes .greenleaf-ai-toggle {
	cursor: pointer;
	opacity: 1;
}

.gl-search-modes .greenleaf-ai-toggle[aria-expanded="true"] {
	background: #c68b22;
	color: #fff;
}

.greenleaf-ai-panel {
	position: absolute;
	z-index: 1050;
	top: calc(100% + 10px);
	right: 0;
	width: min(620px, 100%);
	padding: 18px;
	border: 1px solid #d9e4d6;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 16px 42px rgba(20, 58, 30, .2);
}

.greenleaf-ai-form label,
.greenleaf-chat-form label {
	display: block;
	margin-bottom: 8px;
	color: #173d21;
	font-size: 14px;
	font-weight: 800;
}

.greenleaf-ai-form > div {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
}

.greenleaf-ai-form input,
.greenleaf-chat-form textarea {
	width: 100%;
	border: 1px solid #bfcfbc;
	border-radius: 9px;
	background: #fff;
	color: #16261b;
	font: inherit;
}

.greenleaf-ai-form input {
	min-height: 44px;
	padding: 10px 12px;
}

.greenleaf-ai-form button,
.greenleaf-chat-form > button {
	border: 0;
	border-radius: 9px;
	background: #238133;
	color: #fff;
	font-weight: 800;
	padding: 10px 18px;
}

.greenleaf-ai-form button:disabled,
.greenleaf-chat-form > button:disabled {
	cursor: wait;
	opacity: .65;
}

.greenleaf-ai-result,
.greenleaf-chat-result {
	color: #28372d;
	font-size: 14px;
	line-height: 1.5;
}

.greenleaf-ai-result:not(:empty),
.greenleaf-chat-result:not(:empty) {
	margin-top: 14px;
}

.greenleaf-ai-answer {
	margin: 0 0 12px;
	white-space: pre-line;
}

.greenleaf-ai-products {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.greenleaf-ai-products a {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 14px;
	padding: 9px 11px;
	border-radius: 8px;
	background: #f1f7ef;
	color: #175c26;
	font-weight: 700;
	text-decoration: none;
}

.greenleaf-ai-products small {
	flex: 0 0 auto;
	color: #7a5a1c;
}

.greenleaf-chat .greenleaf-contact-fab {
	border: 0;
	background: transparent;
	font-family: inherit;
	text-align: left;
}

.greenleaf-chat-panel {
	position: fixed;
	right: 24px;
	bottom: 130px;
	z-index: 1051;
	width: min(370px, calc(100vw - 28px));
	max-height: min(630px, calc(100vh - 170px));
	overflow: auto;
	border: 1px solid #d9e4d6;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 18px 52px rgba(15, 54, 25, .24);
}

.greenleaf-chat-panel > header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 15px;
	padding: 16px 18px;
	background: #238133;
	color: #fff;
}

.greenleaf-chat-panel > header strong,
.greenleaf-chat-panel > header span {
	display: block;
}

.greenleaf-chat-panel > header strong {
	font-size: 17px;
}

.greenleaf-chat-panel > header span {
	margin-top: 2px;
	font-size: 12px;
	opacity: .88;
}

.greenleaf-chat-close {
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 27px;
	line-height: 1;
}

.greenleaf-chat-channels {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	padding: 14px 16px;
	border-bottom: 1px solid #e5ece3;
}

.greenleaf-chat-channels a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 10px;
	border: 1px solid #dbe7d8;
	border-radius: 9px;
	background: #f5faf3;
	color: #185e27;
	font-size: 13px;
	font-weight: 750;
	text-decoration: none;
}

.greenleaf-chat-form {
	padding: 14px 16px;
}

.greenleaf-chat-form textarea {
	display: block;
	height: 76px;
	padding: 9px 10px;
	resize: vertical;
}

.greenleaf-chat-form > button {
	width: 100%;
	margin-top: 8px;
}

.greenleaf-chat-result {
	padding: 0 16px 16px;
}

@media (max-width: 991px) {
	.greenleaf-ai-panel {
		left: 0;
		right: auto;
		width: 100%;
	}
}

@media (max-width: 767px) {
	.greenleaf-chat-panel {
		right: 14px;
		bottom: 158px;
		max-height: calc(100vh - 180px);
	}

	.greenleaf-ai-panel {
		padding: 14px;
	}

	.greenleaf-ai-form > div {
		grid-template-columns: 1fr;
	}

	.greenleaf-ai-form button {
		min-height: 42px;
	}
}
