.pgai-root {
	--pgai-brand: #5b2f1c;
	--pgai-cream: #fbf7f1;
	--pgai-border: #e5d8ca;
	--pgai-text: #2d211c;
	color: var(--pgai-text);
	font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pgai-root *,
.pgai-root *::before,
.pgai-root *::after {
	box-sizing: border-box;
}

.pgai-launcher {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99998;
	display: flex;
	gap: 8px;
	align-items: center;
	min-height: 48px;
	padding: 10px 16px;
	border: 0;
	border-radius: 999px;
	background: var(--pgai-brand);
	color: #fff;
	font-weight: 700;
	box-shadow: 0 12px 35px rgba(49, 25, 15, .25);
	cursor: pointer;
}

.pgai-launcher-icon {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .16);
}

.pgai-panel {
	display: flex;
	flex-direction: column;
	width: min(390px, calc(100vw - 24px));
	height: min(660px, calc(100vh - 110px));
	overflow: hidden;
	border: 1px solid var(--pgai-border);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 20px 60px rgba(49, 25, 15, .23);
}

.pgai-panel[hidden] {
	display: none !important;
}

.pgai-floating .pgai-panel {
	position: fixed;
	right: 20px;
	bottom: 82px;
	z-index: 99999;
}

.pgai-inline .pgai-panel {
	width: 100%;
	max-width: 720px;
	height: 680px;
	margin: 20px auto;
}

.pgai-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: var(--pgai-brand);
	color: #fff;
}

.pgai-header strong,
.pgai-header small {
	display: block;
}

.pgai-header small {
	margin-top: 2px;
	opacity: .78;
}

.pgai-close {
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .13);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.pgai-messages {
	flex: 1 1 auto;
	overflow: auto;
	padding: 14px;
	background: var(--pgai-cream);
}

.pgai-message {
	width: fit-content;
	max-width: 88%;
	margin: 0 0 10px;
	padding: 10px 12px;
	border-radius: 13px;
	white-space: pre-line;
}

.pgai-assistant {
	border: 1px solid var(--pgai-border);
	border-bottom-left-radius: 4px;
	background: #fff;
}

.pgai-user {
	margin-left: auto;
	border-bottom-right-radius: 4px;
	background: var(--pgai-brand);
	color: #fff;
}

.pgai-muted {
	opacity: .65;
}

.pgai-products {
	flex: 0 0 auto;
	max-height: 245px;
	overflow: auto;
	padding: 9px;
	border-top: 1px solid var(--pgai-border);
	background: #fff;
}

.pgai-product {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr);
	gap: 10px;
	padding: 8px;
	border-radius: 10px;
}

.pgai-product + .pgai-product {
	border-top: 1px solid #eee6de;
}

.pgai-product-image img {
	display: block;
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 8px;
	background: #f5f1ed;
}

.pgai-product-title {
	display: block;
	overflow: hidden;
	color: var(--pgai-text);
	font-weight: 700;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pgai-product-meta {
	overflow: hidden;
	margin: 2px 0;
	color: #75655c;
	font-size: 11px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pgai-product-price {
	display: block;
	margin: 2px 0 5px;
	color: var(--pgai-brand);
}

.pgai-product-controls,
.pgai-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.pgai-select-label {
	font-size: 11px;
	cursor: pointer;
}

.pgai-detail,
.pgai-add-cart,
.pgai-secondary,
.pgai-whatsapp,
.pgai-quiz-option {
	min-height: 30px;
	padding: 5px 9px;
	border: 1px solid var(--pgai-border);
	border-radius: 7px;
	background: #fff;
	color: var(--pgai-text);
	font: inherit;
	font-size: 12px;
	text-decoration: none;
	cursor: pointer;
}

.pgai-add-cart,
.pgai-send {
	border-color: var(--pgai-brand);
	background: var(--pgai-brand);
	color: #fff;
}

.pgai-actions {
	flex: 0 0 auto;
	padding: 8px 10px;
	border-top: 1px solid var(--pgai-border);
	background: #fff;
}

.pgai-whatsapp {
	border-color: #128c57;
	background: #128c57;
	color: #fff;
}

.pgai-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid var(--pgai-border);
	background: #fff;
}

.pgai-input {
	width: 100%;
	height: 42px;
	padding: 0 12px;
	border: 1px solid #ccbcae;
	border-radius: 9px;
	background: #fff;
	font: inherit;
}

.pgai-input:focus {
	outline: 2px solid color-mix(in srgb, var(--pgai-brand), transparent 70%);
	border-color: var(--pgai-brand);
}

.pgai-send {
	min-width: 72px;
	border: 0;
	border-radius: 9px;
	font-weight: 700;
	cursor: pointer;
}

.pgai-send:disabled,
.pgai-root button:disabled {
	opacity: .55;
	cursor: not-allowed;
}

.pgai-root footer {
	padding: 0 10px 8px;
	background: #fff;
	color: #8a7c73;
	font-size: 10px;
	text-align: center;
}

.pgai-quiz-card,
.pgai-comparison {
	margin: 0 0 10px;
	padding: 12px;
	border: 1px solid var(--pgai-border);
	border-radius: 12px;
	background: #fff;
}

.pgai-quiz-options {
	display: grid;
	gap: 6px;
	margin-top: 9px;
}

.pgai-quiz-option {
	width: 100%;
	text-align: left;
}

.pgai-quiz-option:hover {
	border-color: var(--pgai-brand);
	background: var(--pgai-cream);
}

.pgai-comparison-title {
	display: block;
	margin-bottom: 8px;
}

.pgai-table-scroll {
	overflow-x: auto;
}

.pgai-comparison table {
	width: 100%;
	min-width: 420px;
	border-collapse: collapse;
	font-size: 11px;
}

.pgai-comparison th,
.pgai-comparison td {
	padding: 6px;
	border: 1px solid var(--pgai-border);
	text-align: left;
	vertical-align: top;
}

.pgai-comparison th {
	width: 72px;
	background: var(--pgai-cream);
}

@media (max-width: 520px) {
	.pgai-launcher {
		right: 12px;
		bottom: 12px;
	}

	.pgai-floating .pgai-panel {
		right: 6px;
		bottom: 70px;
		width: calc(100vw - 12px);
		height: calc(100dvh - 82px);
		border-radius: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pgai-root *,
	.pgai-root *::before,
	.pgai-root *::after {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}

