/* Kavya Assistant - header voice + chat button and its panel. */

.kpa-orb {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	cursor: pointer;
	vertical-align: middle;
	-webkit-appearance: none;
	        appearance: none;
}

.kpa-orb__ring {
	position: absolute;
	inset: -5px;
	border-radius: 50%;
	background: conic-gradient(from 0deg, #1d7cf4, #b03cf0, #e5116e, #ff9f1c, #1d7cf4);
	opacity: .28;
	filter: blur(5px);
	animation: kpa-spin 5s linear infinite;
}

.kpa-orb__core {
	position: relative;
	z-index: 1;
	display: block;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background:
		radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 42%),
		conic-gradient(from 210deg, #1d7cf4, #6b4df5, #b03cf0, #e5116e, #1d7cf4);
	box-shadow: 0 4px 14px rgba(74, 58, 224, .4);
	animation: kpa-breathe 3.2s ease-in-out infinite;
}

.kpa-orb__wave {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 2.5px;
	height: 16px;
}

.kpa-orb__wave i {
	display: block;
	width: 2.5px;
	height: 6px;
	border-radius: 2px;
	background: #fff;
	animation: kpa-bar 1.1s ease-in-out infinite;
}

.kpa-orb__wave i:nth-child(2) { animation-delay: .15s; }
.kpa-orb__wave i:nth-child(3) { animation-delay: .3s; }
.kpa-orb__wave i:nth-child(4) { animation-delay: .45s; }

.kpa-orb__label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.kpa-orb:hover .kpa-orb__ring,
.kpa-orb:focus-visible .kpa-orb__ring {
	opacity: .5;
}

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

@keyframes kpa-breathe {
	0%, 100% { transform: scale(1); }
	50%      { transform: scale(1.07); }
}

@keyframes kpa-bar {
	0%, 100% { height: 5px; opacity: .75; }
	50%      { height: 14px; opacity: 1; }
}

/* ------------------------------------------------------------------ panel */

.kpa-panel {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 20000;
	display: flex;
	flex-direction: column;
	width: 390px;
	max-width: calc(100vw - 24px);
	max-height: min(640px, calc(100vh - 40px));
	border: 1px solid #e4e9f2;
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 26px 60px rgba(16, 29, 61, .26);
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px) scale(.98);
	transition: opacity .22s ease, transform .22s ease, visibility .22s;
	font-family: "Poppins", "Segoe UI", Arial, sans-serif;
}

.kpa-panel.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

.kpa-panel__head {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 14px 16px;
	border-bottom: 1px solid #eef1f7;
}

.kpa-panel__head .kpa-orb {
	width: 36px;
	height: 36px;
}

.kpa-panel__head .kpa-orb__core {
	width: 32px;
	height: 32px;
}

.kpa-panel__title {
	flex: 1 1 auto;
	min-width: 0;
}

.kpa-panel__title strong {
	display: block;
	color: #0b1220;
	font-size: .97rem;
	font-weight: 700;
	line-height: 1.2;
}

.kpa-panel__title span {
	display: block;
	margin-top: 2px;
	color: #8a94a6;
	font-size: .74rem;
}

.kpa-iconbtn {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 1px solid #e4e9f2;
	border-radius: 10px;
	background: #fff;
	color: #4b5563;
	font-size: 14px;
	cursor: pointer;
	transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.kpa-iconbtn svg,
.kpa-mic svg,
.kpa-send svg {
	display: block;
	width: 17px;
	height: 17px;
}

.kpa-iconbtn:hover {
	border-color: #1d7cf4;
	color: #0d57f2;
	background: #f2f7ff;
}

.kpa-iconbtn.is-off {
	color: #b4bac6;
}

.kpa-panel__body {
	flex: 1 1 auto;
	min-height: 150px;
	padding: 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #fbfcfe;
}

.kpa-msg {
	margin-bottom: 12px;
	font-size: .9rem;
	line-height: 1.55;
}

.kpa-msg--me {
	margin-left: auto;
	max-width: 85%;
	width: fit-content;
	padding: 9px 14px;
	border-radius: 14px 14px 4px 14px;
	background: linear-gradient(135deg, #1d7cf4, #0b4fd4);
	color: #fff;
	font-weight: 600;
}

.kpa-msg--ai {
	max-width: 95%;
	padding: 12px 14px;
	border: 1px solid #e9eef7;
	border-radius: 14px 14px 14px 4px;
	background: #fff;
	color: #1f2937;
}

.kpa-msg--ai ul {
	margin: 0;
	padding-left: 18px;
	list-style: disc outside;
}

.kpa-msg--ai li {
	margin-bottom: 5px;
	list-style: inherit;
}

.kpa-msg--ai li:last-child {
	margin-bottom: 0;
}

.kpa-msg--ai li::marker {
	color: #1d7cf4;
}

.kpa-msg--ai p {
	margin: 0 0 6px;
}

.kpa-msg--ai p:last-child {
	margin-bottom: 0;
}

.kpa-msg--ai strong {
	color: #0b1220;
}

.kpa-msg--err {
	padding: 10px 13px;
	border: 1px solid #f5c2c7;
	border-radius: 11px;
	background: #fdf2f3;
	color: #b02a37;
	font-size: .86rem;
}

.kpa-msg--wait {
	display: flex;
	align-items: center;
	gap: 9px;
	color: #6b7280;
	font-size: .86rem;
}

.kpa-msg--wait::before {
	content: "";
	width: 14px;
	height: 14px;
	border: 2px solid #d7e0ee;
	border-top-color: #1d7cf4;
	border-radius: 50%;
	animation: kpa-spin .7s linear infinite;
}

.kpa-hint {
	margin: 0 0 12px;
	color: #6b7280;
	font-size: .86rem;
	line-height: 1.55;
}

.kpa-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin-bottom: 4px;
}

.kpa-chip {
	padding: 7px 12px;
	border: 1px solid #e2e8f3;
	border-radius: 999px;
	background: #fff;
	color: #37415a;
	font-family: inherit;
	font-size: .78rem;
	font-weight: 600;
	cursor: pointer;
	transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.kpa-chip:hover {
	border-color: #1d7cf4;
	background: #f2f7ff;
	color: #0d57f2;
}

.kpa-panel__foot {
	flex: none;
	padding: 12px 14px 14px;
	border-top: 1px solid #eef1f7;
	background: #fff;
	border-radius: 0 0 20px 20px;
}

.kpa-bar {
	display: flex;
	align-items: flex-end;
	gap: 8px;
}

.kpa-input {
	flex: 1 1 auto;
	min-width: 0;
	max-height: 90px;
	padding: 10px 13px;
	border: 1.5px solid #dfe6f1;
	border-radius: 14px;
	background: #f8fafd;
	color: #0b1220;
	font-family: inherit;
	font-size: .9rem;
	line-height: 1.45;
	resize: none;
	outline: none;
	transition: border-color .18s ease, background .18s ease;
}

.kpa-input:focus {
	border-color: #1d7cf4;
	background: #fff;
}

.kpa-mic,
.kpa-send {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	color: #fff;
	font-size: 15px;
	cursor: pointer;
	transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.kpa-mic {
	background: linear-gradient(135deg, #e5116e, #b8004f);
}

.kpa-send {
	background: linear-gradient(135deg, #1d7cf4, #0b4fd4);
}

.kpa-mic:hover,
.kpa-send:hover {
	transform: translateY(-1px);
}

.kpa-send:disabled {
	opacity: .45;
	cursor: not-allowed;
	transform: none;
}

.kpa-mic.is-live {
	animation: kpa-mic-pulse 1.2s ease-in-out infinite;
}

@keyframes kpa-mic-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(229, 17, 110, .5); }
	50%      { box-shadow: 0 0 0 9px rgba(229, 17, 110, 0); }
}

.kpa-foot-note {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 9px 0 0;
	color: #a0a8b6;
	font-size: .7rem;
}

.kpa-lang {
	padding: 3px 7px;
	border: 1px solid #e4e9f2;
	border-radius: 7px;
	background: #fff;
	color: #4b5563;
	font-family: inherit;
	font-size: .7rem;
	cursor: pointer;
}

@media (max-width: 575px) {
	.kpa-panel {
		right: 0;
		bottom: 0;
		left: 0;
		width: auto;
		max-width: none;
		max-height: 86vh;
		border-radius: 20px 20px 0 0;
	}

	.kpa-panel__foot {
		border-radius: 0;
		padding-bottom: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kpa-orb__ring,
	.kpa-orb__core,
	.kpa-orb__wave i,
	.kpa-mic.is-live {
		animation: none;
	}

	.kpa-panel {
		transition: none;
	}
}
