.chathearth-root {
	--chathearth-icon-bg: #0f172a;
	--chathearth-icon-border: #1e293b;
	--chathearth-icon-color: #ffffff;
	--chathearth-icon-size: 56px;
	--chathearth-user-bubble: #0f172a;
	--chathearth-assistant-bubble: #e2e8f0;
	position: fixed;
	z-index: 99999;
	font-family: "Segoe UI", system-ui, sans-serif;
	font-size: 14px;
	line-height: 1.45;
	color: #0f172a;
}

.chathearth-root.chathearth-pos-bottom-right {
	right: 20px;
	bottom: 20px;
}

.chathearth-root.chathearth-pos-bottom-left {
	left: 20px;
	bottom: 20px;
}

/* WoodMart and similar themes style every plugin <button>. Reset first. */
body .chathearth-root button {
	appearance: none !important;
	-webkit-appearance: none !important;
	box-sizing: border-box !important;
	font-family: inherit !important;
	font-weight: 500 !important;
	letter-spacing: normal !important;
	line-height: 1.2 !important;
	text-transform: none !important;
	text-decoration: none !important;
	text-shadow: none !important;
	background-image: none !important;
	box-shadow: none !important;
	min-height: 0 !important;
	min-width: 0 !important;
	margin: 0 !important;
}

body .chathearth-root button.chathearth-launcher {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--chathearth-icon-size) !important;
	height: var(--chathearth-icon-size) !important;
	padding: 5px !important;
	border: 2px solid var(--chathearth-icon-border) !important;
	background: var(--chathearth-icon-bg) !important;
	background-color: var(--chathearth-icon-bg) !important;
	background-image: none !important;
	color: var(--chathearth-icon-color) !important;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25) !important;
	font-size: inherit !important;
	line-height: 1 !important;
}

body .chathearth-root.chathearth-shape-circle button.chathearth-launcher {
	border-radius: 50% !important;
}

body .chathearth-root.chathearth-shape-square button.chathearth-launcher {
	border-radius: 12px !important;
}

.chathearth-launcher-icon {
	width: 55%;
	height: 55%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.chathearth-launcher-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.chathearth-panel {
	--chathearth-panel-w: 340px;
	--chathearth-panel-h: 460px;
	position: absolute;
	bottom: calc(var(--chathearth-icon-size) + 12px);
	width: var(--chathearth-panel-w);
	max-width: calc(100vw - 40px);
	height: var(--chathearth-panel-h);
	max-height: calc(100vh - 100px);
	background: #fff;
	border: 1px solid #cbd5e1;
	border-radius: 16px;
	box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
	display: none;
	flex-direction: column;
	overflow: hidden;
	transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
		height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
		max-width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
		max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.chathearth-panel.is-open {
	display: flex;
}

.chathearth-root.chathearth-pos-bottom-right .chathearth-panel {
	right: 0;
}

.chathearth-root.chathearth-pos-bottom-left .chathearth-panel {
	left: 0;
}

.chathearth-root.chathearth-popup-small .chathearth-panel {
	--chathearth-panel-w: 300px;
	--chathearth-panel-h: 400px;
}

.chathearth-root.chathearth-popup-large .chathearth-panel {
	--chathearth-panel-w: 400px;
	--chathearth-panel-h: 560px;
}

.chathearth-root.is-expanded .chathearth-panel {
	width: calc(var(--chathearth-panel-w) * 2);
	height: calc(var(--chathearth-panel-h) * 2);
	max-width: calc(100vw - 24px);
	max-height: calc(100vh - 80px);
}

@media (prefers-reduced-motion: reduce) {
	.chathearth-panel {
		transition: none;
	}
}

.chathearth-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 14px;
	background: #0f172a;
	color: #fff;
}

.chathearth-title {
	font-weight: 600;
}

.chathearth-header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	position: relative;
	z-index: 30;
}

body .chathearth-root button.chathearth-clear,
body .chathearth-root button.chathearth-expand,
body .chathearth-root button.chathearth-restore,
body .chathearth-root button.chathearth-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 8px !important;
	border: 0 !important;
	border-radius: 6px !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	color: #e2e8f0 !important;
	cursor: pointer;
	font-size: 12px !important;
	line-height: 1.2 !important;
}

body .chathearth-root button.chathearth-expand,
body .chathearth-root button.chathearth-restore,
body .chathearth-root button.chathearth-close {
	width: 28px !important;
	height: 28px !important;
	padding: 5px !important;
}

body .chathearth-root button.chathearth-clear:hover,
body .chathearth-root button.chathearth-expand:hover,
body .chathearth-root button.chathearth-restore:hover,
body .chathearth-root button.chathearth-close:hover {
	background: rgba(255, 255, 255, 0.12) !important;
	background-color: rgba(255, 255, 255, 0.12) !important;
	color: #fff !important;
}

.chathearth-expand svg,
.chathearth-restore svg {
	display: block;
}

.chathearth-expand[hidden],
.chathearth-restore[hidden] {
	display: none !important;
}

body .chathearth-root button.chathearth-close {
	font-size: 20px !important;
	line-height: 1 !important;
}

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

.chathearth-msg {
	display: flex;
}

.chathearth-msg-user {
	justify-content: flex-end;
}

.chathearth-msg-assistant {
	flex-direction: column;
	align-items: flex-start;
	align-self: stretch;
}

.chathearth-bubble-md .chathearth-md-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0.4em 0 0.65em;
	font-size: 0.92em;
}

.chathearth-bubble-md .chathearth-md-table th,
.chathearth-bubble-md .chathearth-md-table td {
	border: 1px solid rgba(15, 23, 42, 0.15);
	padding: 4px 6px;
	text-align: left;
}

.chathearth-sources {
	max-width: 92%;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 6px;
}

.chathearth-products {
	width: 100%;
	max-width: 100%;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 8px;
	align-self: stretch;
}

.chathearth-product-scroller {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	gap: 10px;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x proximity;
	padding: 2px 2px 8px;
	scrollbar-width: thin;
}

.chathearth-product-scroller::-webkit-scrollbar {
	height: 6px;
}

.chathearth-product-scroller::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 999px;
}

.chathearth-sources-label {
	font-size: 11px;
	color: #64748b;
	width: 100%;
}

.chathearth-source-chip,
.chathearth-compare {
	border: 1px solid #cbd5e1;
	background: #fff;
	border-radius: 999px;
	padding: 4px 8px;
	font-size: 12px;
	cursor: pointer;
	color: #0f172a;
	text-decoration: none;
}

.chathearth-product {
	flex: 0 0 152px;
	width: 152px;
	scroll-snap-align: start;
	border: 1px solid #e2e8f0;
	background: #fff;
	border-radius: 4px;
	padding: 0 0 10px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	overflow: hidden;
}

.chathearth-product-media {
	display: block;
	aspect-ratio: 1 / 1;
	background: #f1f5f9;
	overflow: hidden;
}

.chathearth-product-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.chathearth-product-media.is-empty {
	background: repeating-linear-gradient(
		45deg,
		#f1f5f9,
		#f1f5f9 8px,
		#e2e8f0 8px,
		#e2e8f0 16px
	);
}

.chathearth-product-name {
	padding: 0 10px;
	color: inherit;
	text-decoration: none;
	font-weight: 600;
	font-size: 13px;
	line-height: 1.3;
	text-align: center;
}

.chathearth-product-name:hover {
	text-decoration: underline;
}

.chathearth-product-price {
	padding: 0 10px;
	font-size: 13px;
	color: #111;
	text-align: center;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.35em;
	align-items: baseline;
}

.chathearth-price-regular {
	color: #767676;
	text-decoration: line-through;
}

.chathearth-price-current {
	text-decoration: none;
	font-weight: 600;
}

.chathearth-product .chathearth-add-cart {
	margin: 0 10px;
	width: calc(100% - 20px);
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.65rem 1rem;
	border: 0;
	border-radius: 0;
	background: var(--wp--preset--color--contrast, #111111);
	color: var(--wp--preset--color--base, #ffffff);
	font-size: var(--wp--preset--font-size--small, 0.875rem);
	font-weight: 500;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.chathearth-product .chathearth-add-cart:hover,
.chathearth-product .chathearth-add-cart:focus {
	background: color-mix(in srgb, var(--wp--preset--color--contrast, #111111) 85%, transparent);
	color: var(--wp--preset--color--base, #ffffff);
}

.chathearth-product .chathearth-add-cart:disabled {
	opacity: 0.65;
	cursor: wait;
}

.chathearth-cart-note {
	width: 100%;
	font-size: 12px;
	margin: 4px 0 0;
}

.chathearth-compare {
	align-self: flex-start;
	border-radius: 10px;
}

.chathearth-bubble {
	max-width: 85%;
	padding: 10px 12px;
	border-radius: 14px;
	white-space: pre-wrap;
	word-break: break-word;
}

.chathearth-bubble-md {
	white-space: normal;
}

.chathearth-bubble-md .chathearth-md-p {
	margin: 0 0 0.65em;
}

.chathearth-bubble-md .chathearth-md-p:last-child {
	margin-bottom: 0;
}

.chathearth-bubble-md .chathearth-md-h {
	margin: 0.4em 0 0.35em;
	font-size: 1em;
	font-weight: 700;
	line-height: 1.3;
}

.chathearth-bubble-md .chathearth-md-list {
	margin: 0.35em 0 0.65em;
	padding-left: 1.25em;
	list-style-position: outside;
}

.chathearth-bubble-md ol.chathearth-md-list {
	list-style-type: decimal;
}

.chathearth-bubble-md ul.chathearth-md-list {
	list-style-type: disc;
}

.chathearth-bubble-md .chathearth-md-list li {
	margin: 0.2em 0;
	display: list-item;
}

.chathearth-bubble-md strong {
	font-weight: 700;
}

.chathearth-bubble-md em {
	font-style: italic;
}

.chathearth-bubble-md a {
	color: inherit;
	text-decoration: underline;
}

.chathearth-bubble-md .chathearth-md-code,
.chathearth-bubble-md .chathearth-md-pre {
	font-family: Consolas, "Courier New", monospace;
	font-size: 0.92em;
}

.chathearth-bubble-md .chathearth-md-code {
	padding: 0.1em 0.35em;
	border-radius: 4px;
	background: rgba(15, 23, 42, 0.08);
}

.chathearth-bubble-md .chathearth-md-pre {
	margin: 0.5em 0;
	padding: 0.65em 0.75em;
	border-radius: 8px;
	overflow-x: auto;
	background: rgba(15, 23, 42, 0.08);
	white-space: pre-wrap;
}

.chathearth-msg-user .chathearth-bubble {
	background: var(--chathearth-user-bubble);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.chathearth-msg-assistant .chathearth-bubble {
	background: var(--chathearth-assistant-bubble);
	color: #0f172a;
	border-bottom-left-radius: 4px;
}

.chathearth-starters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 14px 10px;
	background: #f8fafc;
}

.chathearth-recaptcha-overlay {
	position: absolute;
	inset: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.72);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.chathearth-recaptcha-overlay[hidden] {
	display: none;
}

.chathearth-recaptcha-card {
	max-width: 260px;
	text-align: center;
	color: #0f172a;
}

.chathearth-recaptcha-prompt {
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 600;
}

.chathearth-recaptcha-status {
	margin: 0 0 12px;
	min-height: 1.2em;
	font-size: 12px;
	color: #475569;
}

body .chathearth-root button.chathearth-recaptcha-continue {
	border: 0 !important;
	border-radius: 999px !important;
	padding: 10px 18px !important;
	background: #0f172a !important;
	background-color: #0f172a !important;
	color: #fff !important;
	font-size: 13px !important;
	cursor: pointer;
}

.chathearth-recaptcha-continue:disabled {
	opacity: 0.6;
	cursor: wait;
}

.chathearth-recaptcha-legal {
	margin: 14px 0 0;
	font-size: 11px;
	line-height: 1.4;
	color: #64748b;
}

.chathearth-recaptcha-legal a {
	color: #334155;
}

.chathearth-starters[hidden] {
	display: none;
}

body .chathearth-root button.chathearth-chip {
	border: 1px solid #cbd5e1 !important;
	background: #fff !important;
	background-color: #fff !important;
	border-radius: 999px !important;
	padding: 6px 10px !important;
	cursor: pointer;
	font-size: 12px !important;
	color: #0f172a !important;
}

body .chathearth-root button.chathearth-chip:hover {
	border-color: #94a3b8 !important;
}

.chathearth-composer {
	display: flex;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid #e2e8f0;
	background: #fff;
}

.chathearth-input {
	flex: 1;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	padding: 10px 12px;
}

body .chathearth-root button.chathearth-send {
	border: 0 !important;
	border-radius: 10px !important;
	background: #0f172a !important;
	background-color: #0f172a !important;
	color: #fff !important;
	padding: 0 14px !important;
	cursor: pointer;
	font-size: 14px !important;
}

.chathearth-dots {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	height: 1em;
}

.chathearth-dots i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #64748b;
	display: block;
	animation: chathearth-bounce 1.2s infinite ease-in-out;
}

.chathearth-dots i:nth-child(2) {
	animation-delay: 0.15s;
}

.chathearth-dots i:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes chathearth-bounce {
	0%,
	80%,
	100% {
		opacity: 0.35;
		transform: translateY(0);
	}
	40% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

@media (max-width: 480px) {
	.chathearth-panel {
		--chathearth-panel-w: calc(100vw - 24px);
		--chathearth-panel-h: min(70vh, 520px);
		width: var(--chathearth-panel-w);
		height: var(--chathearth-panel-h);
	}
}
