.plugingo-jarvis {
	position: fixed;
	right: 1.25rem;
	bottom: 1.25rem;
	z-index: 9999;
	font-family: 'Manrope', sans-serif;
	width: auto;
	max-width: calc(100vw - 2.5rem);
	overflow: visible;
	isolation: isolate;
	transform: translateZ(0);
	-webkit-transform: translateZ(0);
}

.plugingo-jarvis,
.plugingo-jarvis * {
	box-sizing: border-box;
}

.plugingo-jarvis__launcher {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.45rem;
	height: 3.45rem;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, #123d72, #18a5a0);
	color: #fff;
	box-shadow: 0 18px 38px rgba(10, 43, 80, 0.28);
	cursor: pointer;
	transform: translate3d(0, 0, 0);
	-webkit-transform: translate3d(0, 0, 0);
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

.plugingo-jarvis__launcher-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
	font-size: 1.08rem;
}

.plugingo-jarvis__panel {
	position: absolute;
	right: 0;
	bottom: calc(100% + 0.9rem);
	width: 390px;
	max-width: calc(100vw - 2rem);
	min-width: 320px;
	height: clamp(420px, 62vh, 560px);
	max-height: calc(100vh - 2rem);
	min-height: 420px;
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	border: 1px solid rgba(190, 214, 243, 0.96);
	border-radius: 24px;
	background: rgba(251, 253, 255, 0.98);
	box-shadow: 0 28px 60px rgba(10, 43, 80, 0.2);
	overflow: hidden;
	transform: translate3d(0, 0, 0);
	-webkit-transform: translate3d(0, 0, 0);
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

.plugingo-jarvis__panel[hidden] {
	display: none !important;
}

.plugingo-jarvis__teaser {
	position: absolute;
	right: 0;
	bottom: calc(100% + 1rem);
	width: 240px;
	max-width: min(260px, calc(100vw - 2rem));
	min-width: 220px;
	padding: 0.8rem 0.95rem;
	border: 1px solid rgba(190, 214, 243, 0.96);
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.98);
	box-shadow: 0 18px 40px rgba(10, 43, 80, 0.16);
	color: #173c68;
	font: inherit;
	font-size: 0.92rem;
	font-weight: 700;
	line-height: 1.4;
	text-align: left;
	white-space: normal;
	word-break: normal;
	overflow-wrap: break-word;
	cursor: pointer;
	overflow: visible;
}

.plugingo-jarvis__teaser::after {
	content: '';
	position: absolute;
	right: 1.2rem;
	bottom: -0.45rem;
	width: 0.9rem;
	height: 0.9rem;
	background: inherit;
	border-right: 1px solid rgba(190, 214, 243, 0.96);
	border-bottom: 1px solid rgba(190, 214, 243, 0.96);
	transform: rotate(45deg);
}

.plugingo-jarvis__teaser[hidden] {
	display: none !important;
}

.plugingo-jarvis__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1rem 0.85rem;
	background: linear-gradient(160deg, #f2f8ff, #eefdfb);
	border-bottom: 1px solid rgba(190, 214, 243, 0.96);
}

.plugingo-jarvis__header-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.plugingo-jarvis__header strong {
	display: block;
	font-size: 1rem;
	color: #173c68;
}

.plugingo-jarvis__header span {
	font-size: 0.82rem;
	color: #507199;
}

.plugingo-jarvis__close {
	border: 0;
	background: transparent;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	color: #173c68;
}

.plugingo-jarvis__reset {
	border: 0;
	border-radius: 999px;
	padding: 0.5rem 0.8rem;
	background: #eaf2ff;
	color: #173c68;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.plugingo-jarvis__secondary.is-recording {
	background: #dc2626;
	color: #fff;
	border-color: #dc2626;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
}

.plugingo-jarvis__messages {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: stretch;
	align-content: flex-start;
	gap: 0.8rem;
	min-width: 0;
	min-height: 0;
	padding: 1rem;
	overflow: auto;
	background:
		radial-gradient(circle at top right, rgba(24, 165, 160, 0.08), transparent 38%),
		linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
	transform: translate3d(0, 0, 0);
	-webkit-transform: translate3d(0, 0, 0);
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

.plugingo-jarvis__message {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	align-items: flex-start;
	align-self: flex-start;
	flex: 0 0 auto;
	width: auto;
	max-width: 100%;
	min-height: 0 !important;
	height: auto !important;
}

.plugingo-jarvis__message.is-user {
	align-items: flex-end;
	align-self: flex-end;
	margin-left: auto;
}

.plugingo-jarvis__bubble {
	display: inline-flex;
	flex-direction: column;
	gap: 0.15rem;
	align-self: flex-start;
	flex: 0 0 auto;
	width: auto !important;
	height: auto !important;
	min-height: 0 !important;
	max-width: 92%;
	padding: 0.8rem 0.9rem;
	border-radius: 18px;
	background: #eff5ff;
	color: #183b64;
	line-height: 1.5;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.plugingo-jarvis__message.is-loading .plugingo-jarvis__bubble {
	min-width: min(220px, 100%);
}

.plugingo-jarvis__message.is-user .plugingo-jarvis__bubble {
	align-self: flex-end;
	background: linear-gradient(135deg, #1451b5, #1764da);
	color: #fff;
}

.plugingo-jarvis__message.is-system .plugingo-jarvis__bubble {
	background: #f2f6fb;
	color: #587392;
	font-style: italic;
}

.plugingo-jarvis__handoff {
	width: fit-content;
	border: 0;
	border-radius: 999px;
	padding: 0.62rem 0.9rem;
	background: #ff8a00;
	color: #fff;
	font-weight: 700;
	cursor: pointer;
}

.plugingo-jarvis__composer {
	display: grid;
	gap: 0.75rem;
	min-width: 0;
	padding: 0.95rem;
	border-top: 1px solid rgba(190, 214, 243, 0.96);
	background: #fff;
}

.plugingo-jarvis__input {
	width: 100%;
	max-width: 100%;
	min-height: 56px;
	max-height: 120px;
	border: 1px solid #cddff8;
	border-radius: 18px;
	padding: 0.8rem 0.9rem;
	font: inherit;
	resize: vertical;
	overflow: auto;
}

.plugingo-jarvis__actions {
	display: flex;
	min-width: 0;
	justify-content: space-between;
	gap: 0.65rem;
}

.plugingo-jarvis__primary,
.plugingo-jarvis__secondary {
	border: 0;
	border-radius: 999px;
	padding: 0.72rem 1rem;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.plugingo-jarvis__primary {
	background: #1451b5;
	color: #fff;
}

.plugingo-jarvis__secondary {
	background: #ecf4ff;
	color: #163d69;
}

.plugingo-jarvis__loader {
	display: grid;
	gap: 0.55rem;
	margin-bottom: 0.2rem;
}

.plugingo-jarvis__loader-spinner {
	width: 1rem;
	height: 1rem;
	border: 2px solid rgba(20, 81, 181, 0.18);
	border-top-color: #1451b5;
	border-radius: 999px;
	animation: plugingo-jarvis-spin 0.9s linear infinite;
}

.plugingo-jarvis__loader-bar {
	position: relative;
	display: block;
	width: 100%;
	height: 0.32rem;
	overflow: hidden;
	border-radius: 999px;
	background: rgba(20, 81, 181, 0.1);
}

.plugingo-jarvis__loader-bar span {
	position: absolute;
	inset: 0 auto 0 -38%;
	width: 38%;
	border-radius: inherit;
	background: linear-gradient(90deg, #18a5a0, #1451b5);
	animation: plugingo-jarvis-bar 1.25s ease-in-out infinite;
}

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

@keyframes plugingo-jarvis-bar {
	0% {
		left: -38%;
	}

	100% {
		left: 100%;
	}
}

@media (max-width: 640px) {
	.plugingo-jarvis {
		right: 0.85rem;
		left: 0.85rem;
		bottom: 0.85rem;
	}

	.plugingo-jarvis__panel {
		left: 0;
		width: auto;
		min-width: 0;
		max-width: none;
		min-height: 400px;
	}

	.plugingo-jarvis__teaser {
		left: auto;
		right: 0;
		width: min(240px, calc(100vw - 2rem));
		max-width: min(260px, calc(100vw - 2rem));
		min-width: 0;
	}

	.plugingo-jarvis__actions {
		flex-wrap: wrap;
	}
}


.plugingo-jarvis__message-label {
	display: block;
	margin: 0;
	font-size: 0.66rem;
	font-weight: 800;
	opacity: 0.82;
	text-transform: none;
	line-height: 1.2;
}

.plugingo-jarvis__message.is-user .plugingo-jarvis__message-label {
	color: rgba(255, 255, 255, 0.88);
	opacity: 1;
}

.plugingo-jarvis__message.is-assistant .plugingo-jarvis__message-label {
	color: #5c7696;
}
