/* ShopMate Chat Widget */
.shopmate-chat {
	--sp-bg: #ffffff;
	--sp-text: #0f172a;
	--sp-muted: #64748b;
	--sp-border: #e2e8f0;
	--sp-primary: #0d9488;
	--sp-primary-rgb: 13, 148, 136;
	position: fixed;
	bottom: 24px;
	z-index: 999999;
	font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: var(--sp-font-size, 14px);
	line-height: 1.5;
	color: var(--sp-text);
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;
}

.shopmate-chat *,
.shopmate-chat *::before,
.shopmate-chat *::after {
	box-sizing: border-box;
}

/* Isolate controls from theme button/input styles */
.shopmate-chat button,
.shopmate-chat input,
.shopmate-chat textarea,
.shopmate-chat select {
	appearance: none !important;
	-webkit-appearance: none !important;
	font-family: inherit;
	line-height: inherit;
	margin: 0;
	text-transform: none;
	letter-spacing: normal;
	text-shadow: none;
	outline: none;
}

#shopmate-chat .shopmate-chat-toggle,
#shopmate-chat .shopmate-chat-close,
#shopmate-chat .shopmate-chat-tool,
#shopmate-chat .shopmate-chat-send,
#shopmate-chat .shopmate-chat-side-close,
#shopmate-chat .shopmate-lead-submit,
#shopmate-chat .shopmate-chat-history-btn,
#shopmate-chat .shopmate-product-card-atc,
#shopmate-chat .shopmate-coupon-card-apply {
	background-image: none;
}

#shopmate-chat .shopmate-chat-toggle {
	border: none !important;
	background-color: transparent;
	background-image: linear-gradient(145deg, #14b8a6 0%, var(--sp-primary, #0d9488) 55%, #0f766e 100%) !important;
	color: #fff !important;
	border-radius: 50% !important;
	width: 60px !important;
	height: 60px !important;
	min-width: 60px;
	min-height: 60px;
	padding: 0 !important;
}

#shopmate-chat .shopmate-chat-close {
	border: none !important;
	background: rgba(255, 255, 255, 0.12) !important;
	color: inherit !important;
	border-radius: 10px !important;
	width: 32px !important;
	height: 32px !important;
	min-width: 0;
	padding: 0 !important;
}

#shopmate-chat .shopmate-chat-tool {
	border: 1px solid #e2e8f0 !important;
	background: #f8fafc !important;
	color: #475569 !important;
	border-radius: 999px !important;
	box-shadow: none !important;
	min-height: 0;
	padding: 7px 12px !important;
}

#shopmate-chat .shopmate-chat-tool:hover,
#shopmate-chat .shopmate-chat-tool:focus-visible,
#shopmate-chat .shopmate-chat-tool[aria-pressed="true"] {
	border-color: #99f6e4 !important;
	color: var(--sp-primary, #0d9488) !important;
	background: #f0fdfa !important;
}

#shopmate-chat .shopmate-chat-tool[aria-pressed="true"] {
	border-color: #5eead4 !important;
	background: #ccfbf1 !important;
}

#shopmate-chat .shopmate-chat-tool--listening {
	border-color: #fca5a5 !important;
	color: #dc2626 !important;
	background: #fef2f2 !important;
}

#shopmate-chat .shopmate-chat-send {
	border: none !important;
	background: var(--sp-primary, #0d9488) !important;
	color: #fff !important;
	border-radius: 50% !important;
	width: 40px !important;
	height: 40px !important;
	min-width: 40px;
	min-height: 40px;
	padding: 0 !important;
}

#shopmate-chat .shopmate-chat-input {
	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
	border-radius: 0 !important;
}

.shopmate-chat--bottom-right {
	right: 24px;
	left: auto;
}

.shopmate-chat--bottom-left {
	left: 24px;
	right: auto;
}

/* ── Floating toggle ── */
.shopmate-chat-toggle {
	width: 60px;
	height: 60px;
	padding: 0;
	border-radius: 50%;
	border: none;
	background: linear-gradient(145deg, #14b8a6 0%, var(--sp-primary, #0d9488) 55%, #0f766e 100%);
	color: #fff;
	cursor: pointer;
	box-shadow:
		0 4px 16px rgba(var(--sp-primary-rgb, 13, 148, 136), 0.4),
		0 0 0 0 rgba(var(--sp-primary-rgb, 13, 148, 136), 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.22s ease, box-shadow 0.22s ease;
	animation: shopmate-fab-pulse 2.8s ease-in-out infinite;
}

.shopmate-chat-toggle:hover,
.shopmate-chat-toggle:focus-visible {
	transform: scale(1.06);
	box-shadow: 0 8px 28px rgba(var(--sp-primary-rgb, 13, 148, 136), 0.5);
	animation: none;
	outline: none;
}

.shopmate-chat-toggle:focus-visible {
	box-shadow:
		0 8px 28px rgba(var(--sp-primary-rgb, 13, 148, 136), 0.5),
		0 0 0 3px #fff,
		0 0 0 5px rgba(var(--sp-primary-rgb, 13, 148, 136), 0.55);
}

@keyframes shopmate-fab-pulse {
	0%, 100% {
		box-shadow:
			0 4px 16px rgba(var(--sp-primary-rgb, 13, 148, 136), 0.4),
			0 0 0 0 rgba(var(--sp-primary-rgb, 13, 148, 136), 0.25);
	}
	50% {
		box-shadow:
			0 4px 16px rgba(var(--sp-primary-rgb, 13, 148, 136), 0.4),
			0 0 0 12px rgba(var(--sp-primary-rgb, 13, 148, 136), 0);
	}
}

.shopmate-chat-toggle-icon {
	font-size: 26px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.shopmate-chat-toggle-svg {
	display: block;
	width: 28px;
	height: 28px;
	color: #fff;
}

.shopmate-chat-toggle-svg circle {
	fill: rgba(15, 118, 110, 0.85);
}

.shopmate-chat--open .shopmate-chat-toggle {
	display: none;
}

/* ── Panel ── */
.shopmate-chat-panel {
	position: absolute;
	bottom: 0;
	width: var(--sp-panel-width, 380px);
	max-width: calc(100vw - 32px);
	height: var(--sp-panel-height, 540px);
	max-height: calc(100vh - 48px);
	background: var(--sp-bg);
	border-radius: var(--sp-radius, 18px);
	box-shadow:
		0 4px 6px rgba(15, 23, 42, 0.04),
		0 20px 48px rgba(15, 23, 42, 0.16);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--sp-border);
	animation: shopmate-panel-in 0.28s ease;
}

@keyframes shopmate-panel-in {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.shopmate-chat--bottom-right .shopmate-chat-panel {
	right: 0;
}

.shopmate-chat--bottom-left .shopmate-chat-panel {
	left: 0;
}

/* ── Header ── */
.shopmate-chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 18px 16px 20px;
	background:
		radial-gradient(ellipse 90% 140% at 100% 0%, rgba(255, 255, 255, 0.2), transparent 52%),
		linear-gradient(110deg, #0f766e 0%, var(--sp-primary, #0d9488) 48%, #0284c7 100%);
	color: var(--sp-header-text, #fff);
	flex-shrink: 0;
}

.shopmate-chat-header-info {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.shopmate-chat-bot-name {
	font-size: calc(var(--sp-font-size, 14px) + 2px);
	font-weight: 600;
	letter-spacing: -0.01em;
}

.shopmate-chat-status {
	font-size: calc(var(--sp-font-size, 14px) - 2px);
	opacity: 0.92;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.shopmate-chat-status::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #4ade80;
	box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.28);
	flex-shrink: 0;
}

.shopmate-chat-close {
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.12);
	color: inherit;
	font-size: 22px;
	font-weight: 400;
	cursor: pointer;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0.9;
	transition: background 0.15s, opacity 0.15s;
	flex-shrink: 0;
}

.shopmate-chat-close:hover,
.shopmate-chat-close:focus-visible {
	opacity: 1;
	background: rgba(255, 255, 255, 0.22);
	outline: none;
}

/* ── Messages ── */
.shopmate-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 18px 16px 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background:
		radial-gradient(ellipse 70% 40% at 50% 0%, rgba(var(--sp-primary-rgb, 13, 148, 136), 0.06), transparent 60%),
		#f8fafc;
	scroll-behavior: smooth;
}

.shopmate-chat-message {
	max-width: 82%;
	padding: 11px 15px;
	border-radius: 18px;
	font-size: var(--sp-font-size, 14px);
	line-height: 1.55;
	word-wrap: break-word;
	white-space: pre-wrap;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
	animation: shopmate-msg-in 0.22s ease;
}

@keyframes shopmate-msg-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

.shopmate-chat-message--bot {
	align-self: flex-start;
	background: #ffffff;
	color: var(--sp-text);
	border: 1px solid #e8eef3;
	border-bottom-left-radius: 6px;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.shopmate-chat-message--user {
	align-self: flex-end;
	background: var(--sp-user-bg, #0d9488);
	color: var(--sp-user-text, #fff);
	border: none;
	border-bottom-right-radius: 6px;
	box-shadow: 0 4px 14px rgba(var(--sp-primary-rgb, 13, 148, 136), 0.28);
}

.shopmate-chat-message--has-image {
	padding: 6px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-width: 72%;
}

.shopmate-chat-message-image {
	display: block;
	width: 100%;
	max-width: 220px;
	max-height: 220px;
	object-fit: cover;
	border-radius: 12px;
	background: rgba(15, 23, 42, 0.08);
}

.shopmate-chat-message--has-image .shopmate-chat-message-text {
	padding: 2px 8px 6px;
}

.shopmate-chat--drop-photo .shopmate-chat-composer-box {
	border-color: var(--sp-primary, #0d9488);
	background: rgba(var(--sp-primary-rgb, 13, 148, 136), 0.08);
}

.shopmate-chat-message--agent {
	align-self: flex-start;
	background: #0f172a;
	color: #f8fafc;
	border: none;
	border-bottom-left-radius: 6px;
	box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
}

.shopmate-chat-message--agent::before {
	content: attr(data-label);
	display: block;
	font-size: 11px;
	font-weight: 600;
	opacity: 0.75;
	margin-bottom: 4px;
	letter-spacing: 0.02em;
}

.shopmate-chat--handoff .shopmate-chat-panel {
	box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12);
}

.shopmate-chat-handoff-banner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 12px;
	background: #0f172a;
	color: #f8fafc;
	font-size: 12px;
	line-height: 1.4;
}

.shopmate-chat-handoff-banner[hidden] {
	display: none !important;
}

.shopmate-chat-handoff-banner button {
	border: 1px solid rgba(248, 250, 252, 0.35);
	background: transparent;
	color: inherit;
	border-radius: 999px;
	padding: 4px 10px;
	font-size: 11px;
	cursor: pointer;
}

.shopmate-chat-message--streaming::after {
	content: "▋";
	animation: shopmate-blink 1s step-end infinite;
	margin-left: 2px;
	opacity: 0.7;
}

.shopmate-chat-bot-block {
	align-self: flex-start;
	max-width: 100%;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.shopmate-chat-bot-block .shopmate-chat-message--bot {
	max-width: 88%;
}

.shopmate-product-cards {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
	max-width: 100%;
}

.shopmate-product-card {
	display: flex;
	gap: 10px;
	align-items: stretch;
	background: #fff;
	border: 1px solid var(--sp-border);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.shopmate-product-card img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	flex-shrink: 0;
	background: #f8fafc;
}

.shopmate-product-card-body {
	flex: 1;
	min-width: 0;
	padding: 8px 10px 8px 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.shopmate-product-card-title {
	font-size: 13px;
	font-weight: 600;
	color: var(--sp-text);
	text-decoration: none;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.shopmate-product-card-title:hover {
	color: var(--sp-primary, #0d9488);
}

.shopmate-product-card-price {
	font-size: 13px;
	font-weight: 600;
	color: var(--sp-text);
}

.shopmate-product-card-price del {
	opacity: 0.6;
	font-weight: 400;
	margin-right: 4px;
}

.shopmate-product-card-actions {
	display: flex;
	gap: 6px;
	align-items: center;
	margin-top: 2px;
}

.shopmate-product-card-atc,
.shopmate-product-card-view {
	border: none;
	border-radius: 999px;
	padding: 5px 10px;
	font-size: 11px;
	font-family: inherit;
	cursor: pointer;
	text-decoration: none;
	line-height: 1.2;
}

.shopmate-product-card-atc {
	background: var(--sp-primary, #0d9488);
	color: #fff;
}

.shopmate-product-card-atc:disabled {
	opacity: 0.7;
	cursor: wait;
}

.shopmate-product-card-view {
	background: #f1f5f9;
	color: var(--sp-text);
}

.shopmate-product-card-stock {
	font-size: 11px;
	color: #b91c1c;
}

.shopmate-coupon-cards {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
	max-width: 100%;
}

.shopmate-coupon-card {
	display: flex;
	gap: 10px;
	align-items: stretch;
	background: #fff;
	border: 1px dashed var(--sp-primary, #0d9488);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.shopmate-coupon-card-code {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 84px;
	padding: 8px;
	background: rgba(var(--sp-primary-rgb, 13, 148, 136), 0.12);
	color: var(--sp-primary, #0d9488);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-align: center;
	word-break: break-all;
}

.shopmate-coupon-card-body {
	flex: 1;
	min-width: 0;
	padding: 8px 10px 8px 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.shopmate-coupon-card-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--sp-text);
	line-height: 1.35;
}

.shopmate-coupon-card-meta,
.shopmate-coupon-card-desc {
	font-size: 11px;
	color: var(--sp-muted, #64748b);
	line-height: 1.35;
}

.shopmate-coupon-card-desc {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.shopmate-coupon-card-actions {
	display: flex;
	gap: 6px;
	align-items: center;
	margin-top: 2px;
}

.shopmate-coupon-card-apply {
	border: none;
	border-radius: 999px;
	padding: 5px 10px;
	font-size: 11px;
	font-family: inherit;
	cursor: pointer;
	background: var(--sp-primary, #0d9488);
	color: #fff;
	line-height: 1.2;
}

.shopmate-coupon-card-apply:disabled {
	opacity: 0.7;
	cursor: wait;
}

@keyframes shopmate-blink {
	50% { opacity: 0; }
}

.shopmate-chat-typing {
	display: flex;
	gap: 5px;
	padding: 12px 16px;
	align-self: flex-start;
	background: #fff;
	border: 1px solid #e8eef3;
	border-radius: 18px;
	border-bottom-left-radius: 6px;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
	margin: 0 16px 8px;
}

.shopmate-chat-typing span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--sp-muted);
	animation: shopmate-bounce 1.2s infinite;
}

.shopmate-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.shopmate-chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes shopmate-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
	30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Composer ── */
.shopmate-chat-composer {
	border-top: 1px solid rgba(226, 232, 240, 0.9);
	background: #ffffff;
	padding: 12px 14px 14px;
	box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.04);
	flex-shrink: 0;
}

.shopmate-chat-toolbar {
	display: flex;
	gap: 8px;
	margin-bottom: 10px;
	flex-wrap: wrap;
}

.shopmate-chat-tool {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 1px solid #e2e8f0;
	background: #f8fafc;
	color: #475569;
	border-radius: 999px;
	padding: 7px 12px;
	font-size: 12px;
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	line-height: 1;
	transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.shopmate-chat-tool svg {
	flex-shrink: 0;
	display: block;
}

.shopmate-chat-tool:hover,
.shopmate-chat-tool:focus-visible {
	border-color: #99f6e4;
	color: var(--sp-primary, #0d9488);
	background: #f0fdfa;
	box-shadow: 0 1px 3px rgba(var(--sp-primary-rgb, 13, 148, 136), 0.12);
	outline: none;
}

.shopmate-chat-tool[aria-pressed="true"] {
	border-color: #5eead4;
	color: var(--sp-primary, #0d9488);
	background: #ccfbf1;
	box-shadow: 0 1px 3px rgba(var(--sp-primary-rgb, 13, 148, 136), 0.14);
}

.shopmate-chat-tool--listening {
	border-color: #fca5a5;
	color: #dc2626;
	background: #fef2f2;
	animation: shopmate-pulse 1.2s ease-in-out infinite;
}

.shopmate-chat-tool--locked,
.shopmate-chat-tool:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	color: #94a3b8;
	background: #f1f5f9;
	border-color: #e2e8f0;
	box-shadow: none;
}

.shopmate-chat-tool--locked:hover,
.shopmate-chat-tool--locked:focus-visible,
.shopmate-chat-tool:disabled:hover,
.shopmate-chat-tool:disabled:focus-visible {
	opacity: 0.55;
	cursor: not-allowed;
	color: #94a3b8;
	background: #f1f5f9;
	border-color: #e2e8f0;
	box-shadow: none;
}

.shopmate-chat-tool-badge {
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 1px 5px;
	border-radius: 999px;
	font-style: normal;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.2;
	text-transform: uppercase;
	color: #92400e;
	background: #fef3c7;
	border: 1px solid #fcd34d;
}

@keyframes shopmate-pulse {
	50% { opacity: 0.7; }
}

.shopmate-chat-form {
	margin: 0;
	padding: 0;
	border: none;
	background: none;
}

.shopmate-chat-composer-box {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	background: #f1f5f9;
	border: 1.5px solid transparent;
	border-radius: 24px;
	padding: 6px 6px 6px 16px;
	transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
	min-height: 48px;
}

.shopmate-chat-composer-box:focus-within {
	background: #ffffff;
	border-color: var(--sp-primary, #0d9488);
	box-shadow:
		0 0 0 4px rgba(var(--sp-primary-rgb, 13, 148, 136), 0.14),
		0 4px 16px rgba(15, 23, 42, 0.06);
}

.shopmate-chat-input {
	flex: 1;
	border: none;
	background: transparent;
	resize: none;
	font-size: var(--sp-font-size, 14px);
	line-height: 1.5;
	font-family: inherit;
	color: var(--sp-text);
	outline: none;
	min-height: 28px;
	max-height: 120px;
	padding: 8px 0;
	align-self: center;
	width: 100%;
	box-shadow: none;
}

.shopmate-chat-input::placeholder {
	color: #94a3b8;
}

.shopmate-chat-send {
	width: 40px;
	height: 40px;
	padding: 0;
	border-radius: 50%;
	border: none;
	background: var(--sp-primary, #0d9488);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-shadow: 0 4px 12px rgba(var(--sp-primary-rgb, 13, 148, 136), 0.35);
	transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s, background 0.15s;
}

.shopmate-chat-send svg {
	display: block;
}

.shopmate-chat-send:hover:not(:disabled),
.shopmate-chat-send:focus-visible:not(:disabled) {
	opacity: 1;
	transform: scale(1.06);
	box-shadow: 0 6px 18px rgba(var(--sp-primary-rgb, 13, 148, 136), 0.45);
	outline: none;
}

.shopmate-chat-send:disabled,
.shopmate-chat-input:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	box-shadow: none;
}

.shopmate-chat-composer-hint {
	margin: 8px 6px 0;
	font-size: 11px;
	color: #94a3b8;
	text-align: center;
	letter-spacing: 0.01em;
}

/* ── Side panels ── */
.shopmate-chat-side-panel {
	border-top: 1px solid var(--sp-border);
	background: #fff;
	padding: 12px 14px;
	max-height: 240px;
	overflow-y: auto;
}

.shopmate-chat-side-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}

.shopmate-chat-panel-hint {
	margin: 0 0 10px;
	font-size: 12px;
	line-height: 1.45;
	color: var(--sp-muted);
}

.shopmate-chat-side-close {
	width: 28px;
	height: 28px;
	padding: 0;
	border: none;
	border-radius: 8px;
	background: #f1f5f9;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	color: var(--sp-muted);
	display: flex;
	align-items: center;
	justify-content: center;
}

.shopmate-chat-side-close:hover {
	background: #e2e8f0;
	color: var(--sp-text);
}

.shopmate-lead-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
}

.shopmate-lead-form label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 12px;
	color: var(--sp-muted);
}

.shopmate-lead-form input,
.shopmate-lead-form textarea {
	border: 1px solid var(--sp-border);
	border-radius: 8px;
	padding: 8px 10px;
	font: inherit;
	color: var(--sp-text);
	background: #fff;
	width: 100%;
}

.shopmate-lead-form input:focus,
.shopmate-lead-form textarea:focus {
	border-color: var(--sp-primary, #0d9488);
	outline: none;
	box-shadow: 0 0 0 3px rgba(var(--sp-primary-rgb, 13, 148, 136), 0.15);
}

.shopmate-lead-submit {
	border: none;
	border-radius: 8px;
	background: var(--sp-primary, #0d9488);
	color: #fff;
	padding: 9px 12px;
	font: inherit;
	cursor: pointer;
	margin-top: 4px;
}

.shopmate-lead-submit:hover {
	filter: brightness(0.95);
}

.shopmate-chat-history-actions {
	display: flex;
	gap: 8px;
	margin-bottom: 10px;
}

.shopmate-chat-history-btn {
	border: 1px solid var(--sp-border);
	background: #fff;
	border-radius: 8px;
	padding: 6px 10px;
	font-size: 12px;
	cursor: pointer;
	font-family: inherit;
	color: var(--sp-text);
}

.shopmate-chat-history-btn:hover {
	background: #f8fafc;
}

.shopmate-chat-history-btn--danger {
	color: #b91c1c;
	border-color: #fecaca;
}

.shopmate-chat-history-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.shopmate-chat-history-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	border: 1px solid var(--sp-border);
	border-radius: 8px;
	padding: 8px 10px;
	background: #f8fafc;
}

.shopmate-chat-history-item-meta {
	min-width: 0;
}

.shopmate-chat-history-item-meta strong {
	display: block;
	font-size: 12px;
	color: var(--sp-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.shopmate-chat-history-item-meta span {
	font-size: 11px;
	color: var(--sp-muted);
}

.shopmate-chat-history-empty {
	font-size: 12px;
	color: var(--sp-muted);
	margin: 0;
}

.shopmate-kb-sources {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 6px 12px 10px;
	font-size: 11px;
	color: var(--sp-muted);
}

.shopmate-kb-sources-label {
	font-weight: 600;
}

.shopmate-kb-source-chip {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	background: rgba(13, 148, 136, 0.12);
	color: #0f766e;
	max-width: 180px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

@media (max-width: 480px) {
	.shopmate-chat--bottom-right,
	.shopmate-chat--bottom-left {
		bottom: 16px;
		right: 16px;
		left: 16px;
	}

	.shopmate-chat-panel {
		width: calc(100vw - 32px);
		height: calc(100vh - 32px);
		max-height: none;
		left: 0 !important;
		right: 0 !important;
	}

	.shopmate-chat-tool span {
		display: none;
	}

	.shopmate-chat-tool {
		padding: 8px;
	}
}
