/* Bharat AI Support Agent storefront widget. All selectors are plugin-scoped. */
.basa-chat-root,
.basa-chat-root * {
	box-sizing: border-box;
}

.basa-chat-root {
	--basa-accent: #5b46e8;
	--basa-text: #171722;
	--basa-muted: #6f7280;
	--basa-border: #e7e7ed;
	--basa-surface: #ffffff;
	--basa-soft: #f6f5fb;
	position: fixed;
	z-index: 2147481000;
	bottom: max(20px, env(safe-area-inset-bottom));
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.45;
	color: var(--basa-text);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	opacity: 0;
	visibility: hidden;
	transition: opacity .16s ease;
}

.basa-chat-root.basa-ready {
	opacity: 1;
	visibility: visible;
}

.basa-chat-root.basa-position-right {
	right: max(20px, env(safe-area-inset-right));
}

.basa-chat-root.basa-position-left {
	left: max(20px, env(safe-area-inset-left));
}

.basa-chat-root .screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	word-wrap: normal !important;
	border: 0;
}

.basa-launcher {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	border-radius: 999px;
	background: var(--basa-accent);
	color: #fff;
	min-width: 62px;
	height: 62px;
	padding: 0 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	margin-left: auto;
	font: inherit;
	font-weight: 700;
	letter-spacing: 0;
	cursor: pointer;
	box-shadow: 0 14px 38px rgba(25, 20, 70, .25), 0 5px 14px rgba(25, 20, 70, .18);
	position: relative;
	isolation: isolate;
	transition: transform .2s ease, box-shadow .2s ease, border-radius .2s ease;
}

.basa-position-left .basa-launcher {
	margin-left: 0;
	margin-right: auto;
}

.basa-launcher:hover {
	transform: translateY(-2px);
	box-shadow: 0 18px 46px rgba(25, 20, 70, .29), 0 7px 17px rgba(25, 20, 70, .19);
}

.basa-launcher:focus-visible,
.basa-panel button:focus-visible,
.basa-panel textarea:focus-visible,
.basa-panel select:focus-visible,
.basa-action-link:focus-visible {
	outline: 3px solid #c9c3ff;
	outline: 3px solid color-mix(in srgb, var(--basa-accent) 32%, white);
	outline-offset: 3px;
}

.basa-launcher-pulse {
	position: absolute;
	inset: -5px;
	z-index: -1;
	border-radius: inherit;
	border: 2px solid var(--basa-accent);
	opacity: 0;
	animation: basa-pulse 2.8s ease-out 1.2s infinite;
}

.basa-launcher .basa-icon {
	width: 27px;
	height: 27px;
	fill: currentColor;
	flex: 0 0 auto;
}

.basa-launcher .basa-icon-close {
	display: none;
	width: 25px;
	height: 25px;
}

.basa-launcher-label {
	font-size: 14px;
	white-space: nowrap;
}

.basa-panel {
	position: absolute;
	bottom: 76px;
	width: min(390px, calc(100vw - 32px));
	height: min(620px, calc(100vh - 120px));
	min-height: 480px;
	background: var(--basa-surface);
	border: 1px solid rgba(25, 22, 50, .08);
	border-radius: 22px;
	box-shadow: 0 28px 70px rgba(20, 18, 52, .22), 0 8px 22px rgba(20, 18, 52, .12);
	overflow: hidden;
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(15px) scale(.975);
	transform-origin: bottom right;
	transition: opacity .2s ease, transform .24s cubic-bezier(.2, .75, .2, 1), visibility .2s;
}

.basa-position-right .basa-panel {
	right: 0;
}

.basa-position-left .basa-panel {
	left: 0;
	transform-origin: bottom left;
}

.basa-chat-root[data-basa-state="open"] .basa-panel {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

.basa-chat-root[data-basa-state="open"] .basa-launcher {
	width: 52px;
	min-width: 52px;
	height: 52px;
	padding: 0;
	border-radius: 50%;
}

.basa-chat-root[data-basa-state="open"] .basa-launcher-label,
.basa-chat-root[data-basa-state="open"] .basa-icon-chat,
.basa-chat-root[data-basa-state="open"] .basa-launcher-pulse {
	display: none;
}

.basa-chat-root[data-basa-state="open"] .basa-icon-close {
	display: block;
}

.basa-header {
	min-height: 76px;
	padding: 14px 14px 14px 16px;
	background: var(--basa-accent);
	background: linear-gradient(135deg, var(--basa-accent), color-mix(in srgb, var(--basa-accent) 78%, #24203d));
	color: #fff;
	display: flex;
	align-items: center;
	gap: 11px;
	position: relative;
}

.basa-header::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: radial-gradient(circle at 92% -10%, rgba(255,255,255,.22), transparent 41%);
}

.basa-avatar {
	position: relative;
	z-index: 1;
	width: 44px;
	height: 44px;
	border-radius: 15px;
	background: rgba(255, 255, 255, .2);
	border: 1px solid rgba(255, 255, 255, .32);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 19px;
	font-weight: 800;
	box-shadow: inset 0 1px 0 rgba(255,255,255,.15);
	flex: 0 0 auto;
}

.basa-avatar span {
	position: absolute;
	right: -2px;
	bottom: -2px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #30d58a;
	border: 2px solid var(--basa-accent);
}

.basa-agent-meta {
	position: relative;
	z-index: 1;
	min-width: 0;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
}

.basa-agent-meta strong {
	font-size: 16px;
	line-height: 1.2;
	font-weight: 750;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.basa-agent-meta > span {
	margin-top: 4px;
	font-size: 11.5px;
	color: rgba(255,255,255,.82);
	display: flex;
	align-items: center;
	gap: 5px;
}

.basa-agent-meta i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #49e49f;
	box-shadow: 0 0 0 3px rgba(73,228,159,.16);
}

.basa-header-actions {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 4px;
	margin-left: auto;
}

.basa-language {
	appearance: auto;
	-webkit-appearance: auto;
	max-width: 88px;
	height: 33px;
	padding: 0 5px;
	margin: 0;
	border: 1px solid rgba(255,255,255,.26);
	border-radius: 9px;
	background: rgba(255,255,255,.13);
	color: #fff;
	font: inherit;
	font-size: 11px;
	line-height: 1;
	box-shadow: none;
	cursor: pointer;
}

.basa-language option {
	color: #171722;
	background: #fff;
}

.basa-icon-button {
	appearance: none;
	-webkit-appearance: none;
	width: 33px;
	height: 33px;
	padding: 7px;
	margin: 0;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: rgba(255,255,255,.9);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s ease;
}

.basa-icon-button:hover {
	background: rgba(255,255,255,.14);
}

.basa-icon-button svg {
	width: 19px;
	height: 19px;
	fill: currentColor;
}

.basa-messages {
	min-height: 0;
	padding: 18px 15px 10px;
	overflow-y: auto;
	overflow-x: hidden;
	background:
		radial-gradient(circle at 10% 10%, color-mix(in srgb, var(--basa-accent) 5%, transparent), transparent 25%),
		linear-gradient(180deg, #fbfbfd 0%, #fff 35%);
	scrollbar-width: thin;
	scrollbar-color: #d7d7df transparent;
	overscroll-behavior: contain;
}

.basa-messages::-webkit-scrollbar {
	width: 7px;
}

.basa-messages::-webkit-scrollbar-thumb {
	background: #d7d7df;
	border-radius: 20px;
}

.basa-message-row {
	display: flex;
	width: 100%;
	margin: 0 0 14px;
	animation: basa-message-in .24s ease both;
}

.basa-message-user {
	justify-content: flex-end;
}

.basa-message-content {
	max-width: 84%;
	min-width: 0;
}

.basa-bubble {
	padding: 10px 12px;
	border-radius: 15px 15px 15px 5px;
	background: var(--basa-soft);
	border: 1px solid #ecebf2;
	color: var(--basa-text);
	font-size: 13.5px;
	line-height: 1.48;
	white-space: pre-wrap;
	word-break: break-word;
	overflow-wrap: anywhere;
	box-shadow: 0 2px 6px rgba(34, 31, 65, .035);
}

.basa-message-user .basa-bubble {
	background: var(--basa-accent);
	border-color: transparent;
	color: #fff;
	border-radius: 15px 15px 5px 15px;
	box-shadow: 0 4px 11px color-mix(in srgb, var(--basa-accent) 20%, transparent);
}

.basa-message-meta {
	margin: 5px 3px 0;
	font-size: 10px;
	line-height: 1.2;
	color: #9a9ca8;
}

.basa-message-user .basa-message-meta {
	text-align: right;
}

.basa-message-actions {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	margin-top: 7px;
}

.basa-action-link {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	max-width: 100%;
	min-height: 35px;
	padding: 7px 10px;
	border-radius: 10px;
	border: 1px solid #d8d3f3;
	border: 1px solid color-mix(in srgb, var(--basa-accent) 25%, #dedee6);
	background: #fff;
	color: var(--basa-accent) !important;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none !important;
	box-shadow: none;
	transition: background .15s ease, transform .15s ease;
}

.basa-action-link:hover {
	background: color-mix(in srgb, var(--basa-accent) 6%, white);
	transform: translateY(-1px);
}

.basa-action-link span {
	font-size: 15px;
}

.basa-typing-row {
	margin-bottom: 8px;
}

.basa-typing {
	width: 54px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
}

.basa-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #9c9da8;
	animation: basa-dot 1.15s infinite ease-in-out;
}

.basa-typing span:nth-child(2) {
	animation-delay: .14s;
}

.basa-typing span:nth-child(3) {
	animation-delay: .28s;
}

.basa-quick-replies {
	padding: 4px 14px 8px;
	display: flex;
	gap: 7px;
	overflow-x: auto;
	background: #fff;
	scrollbar-width: none;
}

.basa-quick-replies::-webkit-scrollbar {
	display: none;
}

.basa-quick-reply {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 auto;
	min-height: 32px;
	max-width: 240px;
	padding: 6px 10px;
	margin: 0;
	border: 1px solid #ddd9f4;
	border: 1px solid color-mix(in srgb, var(--basa-accent) 22%, #e1e1e9);
	border-radius: 999px;
	background: #f8f7ff;
	background: color-mix(in srgb, var(--basa-accent) 4%, #fff);
	color: var(--basa-accent);
	color: color-mix(in srgb, var(--basa-accent) 83%, #1b1930);
	font: inherit;
	font-size: 11.5px;
	font-weight: 650;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}

.basa-quick-reply:hover {
	background: color-mix(in srgb, var(--basa-accent) 9%, #fff);
	border-color: color-mix(in srgb, var(--basa-accent) 40%, #e1e1e9);
}

.basa-privacy {
	min-height: 0;
	padding: 0 16px 7px;
	background: #fff;
	color: #8b8d99;
	font-size: 9.75px;
	line-height: 1.35;
	text-align: center;
}

.basa-privacy:empty {
	display: none;
}

.basa-composer {
	margin: 0 12px 9px;
	padding: 5px 5px 5px 12px;
	min-height: 48px;
	border: 1px solid #dedee7;
	border-radius: 15px;
	background: #fff;
	display: flex;
	align-items: flex-end;
	gap: 7px;
	box-shadow: 0 2px 8px rgba(24, 22, 55, .05);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.basa-composer:focus-within {
	border-color: var(--basa-accent);
	border-color: color-mix(in srgb, var(--basa-accent) 65%, #dedee7);
	box-shadow: 0 0 0 3px rgba(91, 70, 232, .1);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--basa-accent) 10%, transparent);
}

.basa-composer textarea {
	appearance: none;
	-webkit-appearance: none;
	flex: 1 1 auto;
	width: 100%;
	min-height: 36px;
	max-height: 104px;
	padding: 8px 0 6px;
	margin: 0;
	border: 0 !important;
	border-radius: 0;
	background: transparent !important;
	color: var(--basa-text) !important;
	font: inherit;
	font-size: 13.5px;
	line-height: 1.35;
	resize: none;
	box-shadow: none !important;
	outline: none !important;
}

.basa-composer textarea::placeholder {
	color: #999ba7;
	opacity: 1;
}

.basa-send {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	padding: 9px;
	margin: 0;
	border: 0;
	border-radius: 12px;
	background: var(--basa-accent);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 10px color-mix(in srgb, var(--basa-accent) 20%, transparent);
	transition: transform .15s ease, opacity .15s ease;
}

.basa-send:hover:not(:disabled) {
	transform: translateY(-1px);
}

.basa-send:disabled {
	opacity: .5;
	cursor: not-allowed;
}

.basa-send svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.basa-powered {
	padding: 0 0 8px;
	font-size: 9.5px;
	line-height: 1;
	color: #a1a2ad;
	text-align: center;
	background: #fff;
}

.basa-rtl {
	direction: rtl;
}

.basa-rtl .basa-header-actions {
	margin-left: 0;
	margin-right: auto;
}

.basa-rtl .basa-message-user {
	justify-content: flex-start;
}

.basa-rtl .basa-message-assistant {
	justify-content: flex-end;
}

.basa-rtl .basa-message-user .basa-bubble {
	border-radius: 15px 15px 15px 5px;
}

.basa-rtl .basa-message-assistant .basa-bubble {
	border-radius: 15px 15px 5px 15px;
}

.basa-rtl .basa-message-user .basa-message-meta {
	text-align: left;
}

.basa-rtl .basa-message-assistant .basa-message-meta {
	text-align: right;
}

@keyframes basa-pulse {
	0% { transform: scale(.92); opacity: .35; }
	68%, 100% { transform: scale(1.28); opacity: 0; }
}

@keyframes basa-message-in {
	from { opacity: 0; transform: translateY(5px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes basa-dot {
	0%, 60%, 100% { transform: translateY(0); opacity: .45; }
	30% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 560px) {
	.basa-chat-root,
	.basa-chat-root.basa-position-right,
	.basa-chat-root.basa-position-left {
		left: max(10px, env(safe-area-inset-left));
		right: max(10px, env(safe-area-inset-right));
		bottom: max(10px, env(safe-area-inset-bottom));
	}

	.basa-launcher {
		margin-left: auto;
		margin-right: 0;
		height: 56px;
		min-width: 56px;
		padding: 0 15px;
	}

	.basa-position-left .basa-launcher {
		margin-left: 0;
		margin-right: auto;
	}

	.basa-panel,
	.basa-position-right .basa-panel,
	.basa-position-left .basa-panel {
		position: fixed;
		left: max(8px, env(safe-area-inset-left));
		right: max(8px, env(safe-area-inset-right));
		bottom: max(76px, calc(env(safe-area-inset-bottom) + 66px));
		width: auto;
		height: min(680px, calc(100dvh - 92px));
		min-height: 420px;
		border-radius: 19px;
		transform-origin: bottom center;
	}

	.basa-launcher-label {
		display: none;
	}

	.basa-header {
		padding-left: 13px;
		padding-right: 9px;
	}

	.basa-language {
		max-width: 72px;
	}

	.basa-message-content {
		max-width: 88%;
	}
}

@media (max-height: 600px) and (min-width: 561px) {
	.basa-panel {
		height: calc(100vh - 100px);
		min-height: 390px;
		bottom: 68px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.basa-chat-root *,
	.basa-chat-root *::before,
	.basa-chat-root *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: .01ms !important;
	}
}
