/* Defensive reset: this widget is injected into an arbitrary theme, so
   themes with their own global link/button hover effects can silently override
   our styles via higher-specificity or !important rules elsewhere on the site. */
#pbc-chatbot-root a,
#pbc-chatbot-root button {
	opacity: 1;
	box-sizing: border-box;
	line-height: normal;
	text-transform: none;
	letter-spacing: normal;
}

#pbc-chatbot-root a:hover,
#pbc-chatbot-root a:focus,
#pbc-chatbot-root a:visited,
#pbc-chatbot-root button:hover,
#pbc-chatbot-root button:focus {
	opacity: 1;
}

#pbc-chatbot-root *,
#pbc-chatbot-root *::before,
#pbc-chatbot-root *::after {
	box-sizing: border-box;
}

#pbc-chatbot-root {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--pbc-bubble: #2563eb;
	--pbc-bubble-dark: #1d4ed8;
	--pbc-bubble-text: #ffffff;
	--pbc-header: #2563eb;
	--pbc-header-dark: #1d4ed8;
	--pbc-header-text: #ffffff;
	--pbc-header-tint: #eef2ff;
	--pbc-text: #111827;
	--pbc-muted: #6b7280;
	--pbc-border: #e5e7eb;
	--pbc-bg: #f8fafc;
}

/* ─── Toggle button ────────────────────────────────────────────────────────── */

#pbc-chatbot-toggle {
	width: 56px;
	height: 56px;
	padding: 0;
	border-radius: 18px;
	background: var(--pbc-bubble) !important;
	background-image: linear-gradient(135deg, var(--pbc-bubble) 0%, var(--pbc-bubble-dark) 100%) !important;
	color: var(--pbc-bubble-text) !important;
	border: none;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0,0,0,0.28), 0 2px 6px rgba(0,0,0,0.14);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: visible;
	position: relative;
}

#pbc-chatbot-toggle:hover {
	transform: scale(1.06);
	box-shadow: 0 8px 24px rgba(0,0,0,0.32), 0 2px 8px rgba(0,0,0,0.16);
}

/* SVG icon swap: open icon visible by default, close icon hidden.
   Both always rendered so opacity/transform transitions fire. */
.pbc-toggle-icon-open {
	position: relative;
	transition: opacity 0.15s ease, transform 0.15s ease;
	opacity: 1;
	transform: scale(1);
}
.pbc-toggle-icon-close {
	position: absolute;
	transition: opacity 0.15s ease, transform 0.15s ease;
	opacity: 0;
	transform: scale(0.7);
	pointer-events: none;
}

#pbc-chatbot-toggle.pbc-chat-open .pbc-toggle-icon-open {
	opacity: 0;
	transform: scale(0.7);
	pointer-events: none;
}
#pbc-chatbot-toggle.pbc-chat-open .pbc-toggle-icon-close {
	opacity: 1;
	transform: scale(1);
	pointer-events: auto;
}

.pbc-chat-icon-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 18px;
	display: block;
}

/* Unread badge */
#pbc-chatbot-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #ef4444;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	display: none;
	align-items: center;
	justify-content: center;
	border: 2px solid #fff;
	line-height: 1;
}

#pbc-chatbot-toggle.pbc-has-unread #pbc-chatbot-badge {
	display: flex;
}

/* Pulse ring on toggle when there are unread messages */
#pbc-chatbot-toggle.pbc-has-unread::before {
	content: "";
	position: absolute;
	inset: -6px;
	border-radius: 22px;
	border: 2px solid var(--pbc-bubble);
	opacity: 0;
	animation: pbc-pulse 2s ease-out infinite;
}

@keyframes pbc-pulse {
	0% { transform: scale(0.9); opacity: 0.6; }
	70% { transform: scale(1.4); opacity: 0; }
	100% { transform: scale(1.4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	#pbc-chatbot-toggle.pbc-has-unread::before {
		animation: none;
		display: none;
	}
}

/* ─── Chat window ──────────────────────────────────────────────────────────── */

#pbc-chatbot-window {
	position: absolute;
	bottom: 70px;
	right: 0;
	width: min(360px, calc(100vw - 40px));
	max-height: 540px;
	background: #fff !important;
	border-radius: 20px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid rgba(0,0,0,0.06);
	transform-origin: bottom right;
	opacity: 1;
	transform: scale(1) translateY(0);
	transition: opacity 0.24s ease-out, transform 0.24s ease-out;
}

#pbc-chatbot-window.pbc-hidden {
	display: none;
}

#pbc-chatbot-window.pbc-minimized {
	opacity: 0;
	transform: scale(0.88) translateY(12px);
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	#pbc-chatbot-window {
		transition: none;
	}
}

/* ─── Mobile: full-screen sheet ────────────────────────────────────────────── */

@media (max-width: 480px) {
	#pbc-chatbot-window {
		position: fixed;
		inset: 0;
		width: 100%;
		max-height: 100%;
		border-radius: 0;
		z-index: 1000000;
	}
	#pbc-chatbot-toggle {
		z-index: 1000001;
	}
	#pbc-chatbot-root button,
	#pbc-chatbot-root a {
		min-height: 44px;
		min-width: 44px;
	}
	/* Allow smaller purely decorative elements to keep their natural size */
	.pbc-stepper-btn,
	.pbc-confirm-btn,
	#pbc-chatbot-close {
		min-height: unset;
		min-width: unset;
	}
}

/* ─── Header ───────────────────────────────────────────────────────────────── */

.pbc-chatbot-toolbar.pbc-hidden {
	display: none;
}

.pbc-chatbot-header {
	background: var(--pbc-header) !important;
	background-image: linear-gradient(135deg, var(--pbc-header) 0%, var(--pbc-header-dark) 100%) !important;
	color: var(--pbc-header-text) !important;
	padding: 13px 14px 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	font-weight: 600;
	font-size: 15px;
	flex-shrink: 0;
	position: relative;
	z-index: 2;
}

.pbc-header-left {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.pbc-header-info {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.pbc-bot-subtitle {
	font-size: 11px;
	font-weight: 400;
	opacity: 0.75;
	line-height: 1.2;
	display: flex;
	align-items: center;
	gap: 4px;
}

.pbc-bot-subtitle::before {
	content: '';
	width: 6px;
	height: 6px;
	background: #4ADE80;
	border-radius: 50%;
	flex-shrink: 0;
	display: inline-block;
}

/* Bot avatar in header */
.pbc-bot-avatar {
	width: 36px;
	height: 36px;
	border-radius: 11px;
	flex-shrink: 0;
	overflow: hidden;
	background: rgba(255,255,255,0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	font-weight: 700;
	color: var(--pbc-header-text) !important;
	border: 1.5px solid rgba(255,255,255,0.25);
	position: relative;
}

.pbc-bot-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 11px;
	display: block;
}

/* Online dot on avatar */
.pbc-bot-avatar::after {
	content: '';
	position: absolute;
	bottom: -2px;
	right: -2px;
	width: 9px;
	height: 9px;
	background: #4ADE80;
	border-radius: 50%;
	border: 2px solid var(--pbc-header);
}

.pbc-chatbot-header button {
	background: rgba(255,255,255,0.12) !important;
	border: none;
	color: var(--pbc-header-text) !important;
	width: 28px;
	height: 28px;
	min-width: unset;
	min-height: unset;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	line-height: 1;
	padding: 0;
	border-radius: 9px;
	opacity: 0.9;
	flex-shrink: 0;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.pbc-chatbot-header button svg {
	width: 16px;
	height: 16px;
}

.pbc-chatbot-header button:hover {
	background: rgba(255,255,255,0.25) !important;
	opacity: 1;
}

/* ─── Messages area ─────────────────────────────────────────────────────────── */

.pbc-chatbot-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 200px;
	background-color: #F4F4F8 !important;
	background-image: none !important;
}

/* ─── Bubbles ───────────────────────────────────────────────────────────────── */

.pbc-msg {
	max-width: 85%;
	padding: 10px 14px 6px;
	border-radius: 16px;
	font-size: 13.5px;
	line-height: 1.45;
	word-wrap: break-word;
	position: relative;
}

/* Timestamp inside bubble */
.pbc-msg-time {
	display: block;
	font-size: 10px;
	color: inherit;
	opacity: 0.55;
	text-align: right;
	margin-top: 4px;
	line-height: 1;
}

.pbc-msg-user {
	align-self: flex-end;
	background: var(--pbc-bubble) !important;
	background-image: linear-gradient(135deg, var(--pbc-bubble) 0%, var(--pbc-bubble-dark) 100%) !important;
	color: var(--pbc-bubble-text) !important;
	border-radius: 16px 16px 4px 16px;
}

/* Tail on user bubble */
.pbc-msg-user::after {
	content: "";
	position: absolute;
	bottom: 0;
	right: -6px;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 8px 0 0 8px;
	border-color: transparent transparent transparent var(--pbc-bubble);
}

.pbc-msg-bot {
	align-self: flex-start;
	background: #fff !important;
	color: var(--pbc-text) !important;
	border-radius: 4px 16px 16px 16px;
	border-left: none;
	box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.pbc-msg-bot.pbc-typing {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 12px 14px;
	border-left: none;
}

/* Typing indicator with avatar */
.pbc-typing-wrapper {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	align-self: flex-start;
}

.pbc-typing-avatar {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: rgba(0,0,0,0.08);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 700;
	color: var(--pbc-header) !important;
	flex-shrink: 0;
	overflow: hidden;
}

.pbc-typing-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.pbc-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--pbc-muted) !important;
	display: inline-block;
	animation: pbc-typing-bounce 1.2s infinite ease-in-out;
}

.pbc-dot:nth-child(2) {
	animation-delay: 0.15s;
}

.pbc-dot:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes pbc-typing-bounce {
	0%, 60%, 100% {
		transform: translateY(0);
		opacity: 0.5;
	}
	30% {
		transform: translateY(-4px);
		opacity: 1;
	}
}

/* ─── Quick-reply chips ─────────────────────────────────────────────────────── */

.pbc-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 2px 0 4px;
	align-self: flex-start;
	max-width: 100%;
}

.pbc-chip {
	border: 1px solid var(--pbc-header);
	opacity: 0.85;
	color: var(--pbc-header) !important;
	background: transparent !important;
	font-size: 12px;
	padding: 6px 14px;
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.12s ease, color 0.12s ease;
	white-space: nowrap;
	font-weight: 500;
}

.pbc-chip:hover,
.pbc-chip:focus {
	background: var(--pbc-header-tint) !important;
	opacity: 1;
	outline: none;
}

/* ─── Products ──────────────────────────────────────────────────────────────── */

.pbc-products {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 2px;
}

.pbc-product-card {
	display: flex;
	gap: 10px;
	background: #fff !important;
	border: 1px solid transparent;
	border-radius: 14px;
	padding: 10px;
	align-items: center;
	box-shadow: 0 1px 4px rgba(0,0,0,0.07);
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.pbc-product-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.12);
	/* color-mix() not supported in older browsers — fallback uses generic blue */
	border-color: var(--pbc-header);
	border-color: color-mix(in srgb, var(--pbc-header) 30%, transparent);
}

.pbc-product-img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 10px;
	flex-shrink: 0;
	background: var(--pbc-bg) !important;
}

.pbc-product-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.pbc-product-name {
	font-size: 14px;
	font-weight: 700;
	color: var(--pbc-text) !important;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	line-height: 1.3;
}

.pbc-product-name:hover {
	color: var(--pbc-text) !important;
	text-decoration: underline !important;
}

.pbc-product-price {
	font-size: 13px;
	color: var(--pbc-header) !important;
	font-weight: 600;
	white-space: nowrap;
}

.pbc-product-price del {
	opacity: 0.5;
	margin-right: 4px;
	color: var(--pbc-muted) !important;
	font-weight: 400;
}

.pbc-product-price ins {
	text-decoration: none;
	color: var(--pbc-header) !important;
	font-weight: 700;
}

.pbc-product-actions {
	flex-shrink: 0;
	display: flex;
	align-items: center;
}

.pbc-add-to-cart-btn {
	background: var(--pbc-header) !important;
	color: var(--pbc-header-text) !important;
	border: none;
	border-radius: 999px;
	padding: 0 16px;
	height: 32px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	min-width: 84px;
	transition: background 0.15s ease;
}

.pbc-add-to-cart-btn:hover:not(:disabled) {
	background: var(--pbc-header-dark) !important;
}

.pbc-add-to-cart-btn:disabled {
	background: #cbd5e1 !important;
	color: #64748b !important;
	cursor: default;
}

/* ─── Stepper ───────────────────────────────────────────────────────────────── */

.pbc-stepper-group {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
}

.pbc-stepper {
	display: flex;
	align-items: center;
	background: var(--pbc-header) !important;
	border-radius: 999px;
	overflow: hidden;
	height: 32px;
}

.pbc-stepper-btn {
	width: 28px;
	height: 100%;
	border: none;
	background: transparent !important;
	color: var(--pbc-header-text) !important;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	line-height: 1;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pbc-stepper-btn:hover:not(:disabled) {
	background: rgba(0,0,0,0.15) !important;
}

.pbc-stepper-btn:disabled {
	opacity: 0.5;
	cursor: default;
}

.pbc-stepper-count {
	min-width: 30px;
	text-align: center;
	font-size: 14px;
	font-weight: 700;
	color: var(--pbc-header-text) !important;
}

.pbc-view-cart-link {
	font-size: 11px;
	color: var(--pbc-text) !important;
	text-decoration: underline !important;
	opacity: 1 !important;
}

.pbc-view-cart-link:hover,
.pbc-view-cart-link:focus,
.pbc-view-cart-link:visited {
	color: var(--pbc-text) !important;
	text-decoration: underline !important;
	opacity: 0.75 !important;
}

/* ─── Orders ────────────────────────────────────────────────────────────────── */

.pbc-orders {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 2px;
}

.pbc-order-card {
	background: #fff !important;
	border-radius: 14px;
	padding: 10px;
	box-shadow: 0 1px 4px rgba(0,0,0,0.07);
	border-left: 4px solid #94a3b8; /* default: slate/pending */
}

.pbc-order-card.pbc-order-delivered {
	border-left-color: #16a34a;
}
.pbc-order-card.pbc-order-shipped {
	border-left-color: #2563eb;
}
.pbc-order-card.pbc-order-processing,
.pbc-order-card.pbc-order-confirmed {
	border-left-color: #d97706;
}
.pbc-order-card.pbc-order-pending {
	border-left-color: #94a3b8;
}
.pbc-order-card.pbc-order-cancelled,
.pbc-order-card.pbc-order-refunded {
	border-left-color: #dc2626;
}

.pbc-order-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding-bottom: 8px;
	margin-bottom: 8px;
	border-bottom: 1px solid var(--pbc-border);
}

.pbc-order-number {
	font-size: 13px;
	font-weight: 700;
	color: var(--pbc-text) !important;
}

.pbc-order-status {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--pbc-bg) !important;
	color: var(--pbc-muted) !important;
	white-space: nowrap;
}

.pbc-order-status-delivered {
	background: #dcfce7 !important;
	color: #166534 !important;
}

.pbc-order-status-shipped {
	background: #dbeafe !important;
	color: #1d4ed8 !important;
}

.pbc-order-status-processing,
.pbc-order-status-confirmed {
	background: #fef9c3 !important;
	color: #854d0e !important;
}

.pbc-order-status-pending {
	background: #f1f5f9 !important;
	color: #475569 !important;
}

.pbc-order-status-cancelled,
.pbc-order-status-refunded {
	background: #fee2e2 !important;
	color: #b91c1c !important;
}

.pbc-order-items {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.pbc-order-item {
	display: flex;
	gap: 10px;
	align-items: center;
}

.pbc-order-item-img {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 8px;
	flex-shrink: 0;
	background: var(--pbc-bg) !important;
}

.pbc-order-item-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.pbc-order-item-name {
	font-size: 13px;
	font-weight: 600;
	color: var(--pbc-text) !important;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	line-height: 1.3;
}

.pbc-order-item-qty {
	font-size: 12px;
	color: var(--pbc-muted) !important;
}

/* ─── Toolbar ───────────────────────────────────────────────────────────────── */

.pbc-chatbot-toolbar {
	flex-shrink: 0;
	display: flex;
}

#pbc-chatbot-new-chat {
	width: 100%;
	background: var(--pbc-header-tint, var(--pbc-bg)) !important;
	border: none;
	border-radius: 0;
	color: var(--pbc-header) !important;
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	padding: 8px 16px;
	opacity: 1 !important;
	transition: background 0.15s ease, color 0.15s ease;
}

#pbc-chatbot-new-chat svg {
	width: 13px;
	height: 13px;
	flex-shrink: 0;
}

#pbc-chatbot-new-chat:hover,
#pbc-chatbot-new-chat:focus {
	background: var(--pbc-header) !important;
	color: var(--pbc-header-text) !important;
	text-decoration: none !important;
	opacity: 1 !important;
}

/* ─── Char hint ─────────────────────────────────────────────────────────────── */

.pbc-char-hint {
	font-size: 11px;
	color: var(--pbc-muted);
	text-align: right;
	padding: 2px 14px 0;
	flex-shrink: 0;
	background: #fff !important;
}

.pbc-char-hint.pbc-char-warn {
	color: #ef4444;
}

.pbc-char-hint.pbc-hidden {
	display: none;
}

/* ─── Input form ────────────────────────────────────────────────────────────── */

#pbc-chatbot-form {
	display: flex;
	align-items: flex-end;
	border-top: 1px solid var(--pbc-border);
	padding: 10px 12px;
	gap: 8px;
	flex-shrink: 0;
	background: #fff !important;
}

#pbc-chatbot-input {
	flex: 1;
	box-sizing: border-box !important;
	min-height: 38px !important;
	max-height: 84px !important; /* ~3 lines */
	background: var(--pbc-bg) !important;
	border: 1px solid var(--pbc-border);
	border-radius: 20px !important;
	padding: 9px 16px !important;
	margin: 0 !important;
	line-height: 1.4 !important;
	font-size: 13px;
	min-width: 0;
	color: var(--pbc-text) !important;
	font-family: inherit;
	resize: none;
	overflow-y: hidden;
	display: block;
}

#pbc-chatbot-input:focus {
	outline: none;
	border-color: var(--pbc-header);
	background: #fff !important;
}

#pbc-chatbot-send {
	width: 38px !important;
	height: 38px !important;
	box-sizing: border-box !important;
	background: var(--pbc-header) !important;
	color: var(--pbc-header-text) !important;
	border: none;
	border-radius: 50% !important;
	padding: 0 !important;
	margin: 0 !important;
	line-height: normal !important;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background 0.15s ease;
}

#pbc-chatbot-send svg {
	width: 16px;
	height: 16px;
}

#pbc-chatbot-send:hover:not(:disabled) {
	background: var(--pbc-header-dark) !important;
}

#pbc-chatbot-send:disabled,
#pbc-chatbot-input:disabled {
	opacity: 0.6;
	cursor: default;
}

/* Mic show/hide based on input content */
#pbc-chatbot-mic {
	width: 36px !important;
	height: 36px !important;
	box-sizing: border-box !important;
	background: var(--pbc-bg) !important;
	color: var(--pbc-muted) !important;
	border: 1px solid var(--pbc-border);
	border-radius: 50% !important;
	padding: 0 !important;
	margin: 0 !important;
	line-height: normal !important;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	position: relative;
	transition: opacity 0.15s ease, width 0.15s ease, margin 0.15s ease;
	overflow: hidden;
}

#pbc-chatbot-mic.pbc-hidden {
	display: none;
}

#pbc-chatbot-mic svg {
	width: 16px;
	height: 16px;
}

#pbc-chatbot-mic:hover:not(:disabled) {
	border-color: var(--pbc-header) !important;
	color: var(--pbc-header) !important;
}

#pbc-chatbot-mic:disabled {
	opacity: 0.6;
	cursor: default;
}

/* Hide mic when user has typed something */
#pbc-chatbot-form.pbc-has-input #pbc-chatbot-mic {
	opacity: 0;
	pointer-events: none;
	width: 0 !important;
	margin: 0 !important;
	overflow: hidden;
}

#pbc-chatbot-mic.pbc-voice-active {
	background: var(--pbc-header) !important;
	border-color: var(--pbc-header) !important;
	color: var(--pbc-header-text) !important;
}

#pbc-chatbot-mic.pbc-voice-active::before {
	content: "";
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 2px solid var(--pbc-header);
	opacity: 0.55;
	animation: pbc-mic-pulse 1.4s infinite ease-out;
}

@keyframes pbc-mic-pulse {
	0% { transform: scale(0.75); opacity: 0.6; }
	100% { transform: scale(1.55); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	#pbc-chatbot-mic.pbc-voice-active::before {
		animation: none;
		display: none;
	}
}

#pbc-chatbot-mic.pbc-voice-blocked {
	color: var(--pbc-muted) !important;
	opacity: 0.55;
	cursor: not-allowed;
}

#pbc-chatbot-mic.pbc-voice-blocked:hover {
	border-color: var(--pbc-border) !important;
	color: var(--pbc-muted) !important;
}

#pbc-chatbot-mic.pbc-voice-blocked::after {
	content: "";
	position: absolute;
	top: -1px;
	right: -1px;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #dc4c3e;
	border: 2px solid #fff;
}

/* ─── Voice bar ─────────────────────────────────────────────────────────────── */

#pbc-voice-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-top: 1px solid var(--pbc-border);
	box-sizing: border-box;
}

#pbc-voice-bar.pbc-hidden {
	display: none;
}

#pbc-voice-bar .pbc-voice-cancel,
#pbc-voice-bar .pbc-voice-waveform,
#pbc-voice-bar .pbc-voice-spinner,
#pbc-voice-bar .pbc-voice-error-icon,
#pbc-voice-bar .pbc-voice-stop,
#pbc-voice-bar .pbc-voice-dismiss {
	display: none;
}

.pbc-voice-cancel,
.pbc-voice-dismiss {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	border: none;
	background: transparent !important;
	color: var(--pbc-muted) !important;
	cursor: pointer;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.pbc-voice-cancel:hover,
.pbc-voice-dismiss:hover {
	color: var(--pbc-text) !important;
}

.pbc-voice-cancel svg,
.pbc-voice-dismiss svg {
	width: 13px;
	height: 13px;
}

.pbc-voice-waveform {
	align-items: center;
	gap: 3px;
	height: 20px;
	flex: 1;
}

.pbc-voice-bar-line {
	width: 3px;
	border-radius: 2px;
	background: var(--pbc-header) !important;
	height: 6px;
	animation: pbc-voice-bounce 1s infinite ease-in-out;
}

.pbc-voice-bar-line:nth-child(1) { animation-delay: 0s; }
.pbc-voice-bar-line:nth-child(2) { animation-delay: 0.12s; }
.pbc-voice-bar-line:nth-child(3) { animation-delay: 0.24s; }
.pbc-voice-bar-line:nth-child(4) { animation-delay: 0.36s; }
.pbc-voice-bar-line:nth-child(5) { animation-delay: 0.48s; }

@keyframes pbc-voice-bounce {
	0%, 100% { height: 6px; }
	50% { height: 19px; }
}

.pbc-voice-spinner {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	border: 2px solid var(--pbc-border);
	border-top-color: var(--pbc-header);
	border-radius: 50%;
	animation: pbc-voice-spin 0.7s linear infinite;
}

@keyframes pbc-voice-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.pbc-voice-bar-line,
	.pbc-voice-spinner {
		animation: none;
	}
}

.pbc-voice-error-icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.pbc-voice-text {
	font-size: 12px;
	line-height: 1.4;
	flex: 1;
}

.pbc-voice-stop {
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	border: none;
	border-radius: 50%;
	background: #dc4c3e !important;
	color: #fff !important;
	cursor: pointer;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.pbc-voice-stop svg {
	width: 11px;
	height: 11px;
}

.pbc-voice-stop:hover {
	background: #c53a2d !important;
}

#pbc-voice-bar.pbc-voice-listening {
	background: var(--pbc-header-tint, var(--pbc-bg)) !important;
}

#pbc-voice-bar.pbc-voice-listening .pbc-voice-cancel,
#pbc-voice-bar.pbc-voice-listening .pbc-voice-waveform,
#pbc-voice-bar.pbc-voice-listening .pbc-voice-stop {
	display: flex;
}

#pbc-voice-bar.pbc-voice-listening .pbc-voice-text {
	font-weight: 600;
	color: var(--pbc-header-dark) !important;
}

#pbc-voice-bar.pbc-voice-processing {
	background: var(--pbc-bg) !important;
}

#pbc-voice-bar.pbc-voice-processing .pbc-voice-spinner {
	display: block;
}

#pbc-voice-bar.pbc-voice-processing .pbc-voice-text {
	font-weight: 600;
	color: var(--pbc-muted) !important;
}

#pbc-voice-bar.pbc-voice-blocked {
	background: #fdf0ee !important;
}

#pbc-voice-bar.pbc-voice-blocked .pbc-voice-error-icon,
#pbc-voice-bar.pbc-voice-blocked .pbc-voice-dismiss {
	display: flex;
}

#pbc-voice-bar.pbc-voice-blocked .pbc-voice-text,
#pbc-voice-bar.pbc-voice-blocked .pbc-voice-error-icon {
	color: #dc4c3e !important;
}

#pbc-voice-bar.pbc-voice-nospeech {
	background: #fff1e6 !important;
}

#pbc-voice-bar.pbc-voice-nospeech .pbc-voice-error-icon {
	display: flex;
}

#pbc-voice-bar.pbc-voice-nospeech .pbc-voice-text,
#pbc-voice-bar.pbc-voice-nospeech .pbc-voice-error-icon {
	color: #ea580c !important;
}

/* ─── Confirm overlay ───────────────────────────────────────────────────────── */

.pbc-confirm-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15,23,42,0.45) !important;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	z-index: 5;
}

.pbc-confirm-overlay.pbc-hidden {
	display: none;
}

.pbc-confirm-box {
	background: #fff !important;
	border-radius: 14px;
	padding: 18px;
	width: 100%;
	max-width: 280px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.pbc-confirm-message {
	margin: 0 0 16px;
	font-size: 13.5px;
	line-height: 1.45;
	color: var(--pbc-text) !important;
}

.pbc-confirm-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

.pbc-confirm-btn {
	border: none;
	border-radius: 999px;
	padding: 8px 16px;
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	opacity: 1 !important;
}

.pbc-confirm-cancel {
	background: var(--pbc-bg) !important;
	color: var(--pbc-text) !important;
}

.pbc-confirm-cancel:hover {
	background: var(--pbc-border) !important;
}

.pbc-confirm-ok {
	background: var(--pbc-header) !important;
	color: var(--pbc-header-text) !important;
}

.pbc-confirm-ok:hover {
	background: var(--pbc-header-dark) !important;
}
