.cuddlebug-embed .cuddlebug-panel {
	right: 10px;
	bottom: 78px;
	/* The host keeps the shadow visible while this frame restores. */
	box-shadow: none;
}

.cuddlebug-embed .cuddlebug-launcher,
.cuddlebug-embed .cuddlebug-launcher:hover,
.cuddlebug-embed .cuddlebug-launcher:focus {
	right: 10px;
	bottom: 10px;
	box-shadow: none;
	transform: none;
}

.cuddlebug-embed .cuddlebug-launcher [data-cuddlebug-open-icon],
.cuddlebug-embed .cuddlebug-launcher [data-cuddlebug-close-icon] {
	transition: none;
}

.cuddlebug-panel {
	position: fixed;
	right: 22px;
	bottom: 92px;
	z-index: 1001;
	display: flex;
	flex-direction: column;
	width: 370px;
	height: 585px;
	max-height: calc(100vh - 120px);
	max-height: calc(100dvh - 120px);
	overflow: hidden;
	border: 1px solid var(--bg-grey);
	border-radius: 8px;
	background: var(--bg-content);
	color: var(--text-black);
	box-shadow: 0 3px 10px rgba(20, 38, 63, 0.1);
	isolation: isolate;
	opacity: 0;
	transform: translateY(10px) scale(0.985);
	transform-origin: bottom right;
	transition:
		opacity 160ms ease,
		transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cuddlebug-panel--visible {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.cuddlebug--started .cuddlebug-panel {
	transform: none;
}

.cuddlebug-panel::before {
	position: absolute;
	z-index: 0;
	top: 0;
	right: 0;
	left: 0;
	height: 245px;
	background:
		linear-gradient(145deg, rgba(47, 95, 171, 0.09), rgba(123, 97, 209, 0.055) 44%, rgba(216, 102, 181, 0.035) 68%, transparent 88%);
	content: "";
	pointer-events: none;
}

.cuddlebug-panel > * {
	position: relative;
	z-index: 1;
}

.cuddlebug-panel[hidden] {
	display: none;
}

.cuddlebug-panel:focus {
	outline: none;
}

.cuddlebug-loading {
	display: none;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
	margin: 0 0 8px;
}

.cuddlebug-loading > span {
	width: 52.8%;
	height: 34px;
	padding: 13px 15px;
	border: 1px solid var(--bg-grey);
	border-radius: 18px;
	background: var(--bg-content);
}

.cuddlebug-loading > span::after {
	display: block;
	width: 70%;
	height: 6px;
	margin-left: auto;
	border-radius: 3px;
	background: var(--text-grey-dark);
	opacity: 0.2;
	content: "";
}

.cuddlebug--started .cuddlebug-loading {
	margin-top: 18px;
}

.cuddlebug--started .cuddlebug-loading > span {
	width: 45%;
	border-radius: 8px;
}

.cuddlebug--started .cuddlebug-loading > span:nth-child(odd) {
	align-self: flex-start;
}

.cuddlebug-panel[aria-busy="true"] .cuddlebug-loading {
	display: flex;
}

.cuddlebug-panel[aria-busy="true"] .cuddlebug-suggestions button,
.cuddlebug--started .cuddlebug-panel[aria-busy="true"] .cuddlebug-suggestions,
.cuddlebug-panel[aria-busy="true"] .cuddlebug-history {
	display: none;
}

/* Keep the inactive composer visible, but not an unvalidated draft. */
.cuddlebug-panel[aria-busy="true"] .cuddlebug-input:not(:placeholder-shown) {
	visibility: hidden;
}

@media (prefers-reduced-motion: no-preference) {
	.cuddlebug-loading > span {
		animation: cuddlebug-entry-in 280ms cubic-bezier(0.2, 0.8, 0.2, 1) 80ms both;
	}

	.cuddlebug-loading > span:nth-child(2) { animation-delay: 150ms; }
	.cuddlebug-loading > span:nth-child(3) { animation-delay: 220ms; }
}

.cuddlebug-launcher,
.cuddlebug-send {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: none;
}

.cuddlebug-messages {
	flex: 1;
	overflow-y: auto;
	padding: 0 18px 18px;
	background: transparent;
	overscroll-behavior: contain;
}

.cuddlebug-messages::-webkit-scrollbar {
	width: 10px;
}

.cuddlebug-messages::-webkit-scrollbar-thumb {
	border-radius: 5px;
	background: rgba(87, 100, 117, 0.52);
}

.cuddlebug-messages::-webkit-scrollbar-track {
	background: transparent;
}

.cuddlebug-brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex: 0 0 212px;
	border-bottom: 1px solid transparent;
	transition: flex-basis 160ms ease;
}

.cuddlebug-brand-icon {
	position: relative;
	display: inline-flex;
	align-items: flex-end;
	width: 40px;
	height: 40px;
	margin-bottom: 14px;
	color: var(--brand-primary);
}

.cuddlebug-sparkle {
	font-size: 32px;
	line-height: 1;
}

.cuddlebug-sparkle--small {
	position: absolute;
	top: 0;
	right: 0;
	font-size: 13px;
}

.cuddlebug-brand strong {
	font-size: 18px;
	font-weight: 600;
}

.cuddlebug--started .cuddlebug-brand {
	flex-basis: 50px;
	flex-direction: row;
	gap: 9px;
	border-bottom-color: var(--bg-grey);
	background: var(--bg-content);
}

.cuddlebug--started .cuddlebug-brand-icon {
	width: 22px;
	height: 22px;
	margin-bottom: 0;
}

.cuddlebug--started .cuddlebug-sparkle {
	font-size: 17px;
}

.cuddlebug--started .cuddlebug-sparkle--small {
	top: 0;
	right: 0;
	font-size: 8px;
}

.cuddlebug--started .cuddlebug-brand strong {
	font-size: 14px;
}

.cuddlebug--started .cuddlebug-intro {
	display: none;
}

.cuddlebug--started .cuddlebug-messages {
	padding-top: 14px;
	background: var(--bg-content);
}

.cuddlebug-message-label {
	margin: 0 0 5px;
	color: var(--text-grey-dark);
	font-size: 10px;
}

.cuddlebug-message {
	width: fit-content;
	max-width: 88%;
	margin-bottom: 14px;
	padding: 14px 18px;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.45;
	text-align: left;
	white-space: normal;
}

.cuddlebug-message-group--user {
	display: flex;
	justify-content: flex-end;
}

.cuddlebug-message--assistant {
	margin-right: auto;
	background: #f0f2f4;
	color: var(--text-black);
	white-space: pre-line;
}

.cuddlebug-emphasis {
	font-weight: 700;
}

.cuddlebug-intro .cuddlebug-message--assistant {
	white-space: normal;
}

.cuddlebug-sources {
	margin-top: 12px;
}

.cuddlebug-sources-title {
	display: block;
	margin-bottom: 3px;
	color: #26384a;
	font-size: 11px;
	font-weight: 600;
}

.cuddlebug-source {
	display: block;
	margin-top: 4px;
	color: #26384a;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.35;
	text-decoration: underline;
}

.cuddlebug-source:hover,
.cuddlebug-source:focus {
	color: #26384a;
	text-decoration: underline;
}

.cuddlebug-inline-link {
	color: var(--text-blue-darker);
	text-decoration: underline;
}

.cuddlebug-inline-link:hover,
.cuddlebug-inline-link:focus {
	color: var(--brand-primary);
	text-decoration: underline;
}

.cuddlebug-message--loading {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 52px;
	padding: 0;
	gap: 4px;
}

.cuddlebug-loading-dot {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: #8b80e8;
	animation: cuddlebug-loading 1.1s infinite ease-in-out;
}

.cuddlebug-loading-dot:nth-child(2) {
	animation-delay: 120ms;
}

.cuddlebug-loading-dot:nth-child(3) {
	animation-delay: 240ms;
}

.cuddlebug-message--user {
	margin-left: auto;
	padding: 12px 15px;
	background: var(--blue, #2957a4);
	color: #fff;
}

.cuddlebug-suggestions {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
	margin: 18px 0 8px;
}

.cuddlebug-suggestions > span {
	margin-bottom: 1px;
	color: var(--text-grey-dark);
	font-size: 10px;
}

.cuddlebug-suggestions button,
.cuddlebug-more-help button {
	padding: 8px 15px;
	border: 1px solid #c8d4e3;
	border-radius: 18px;
	background: var(--bg-content);
	color: var(--text-blue-darker);
	font-size: 13px;
	transition:
		background-color 140ms ease,
		border-color 140ms ease,
		transform 140ms ease;
}

.cuddlebug-suggestions button {
	max-width: 94%;
	line-height: 1.25;
	text-align: left;
}

.cuddlebug-suggestions button:hover,
.cuddlebug-suggestions button:focus,
.cuddlebug-more-help button:hover,
.cuddlebug-more-help button:focus {
	border-color: #9dc2f3;
	background: var(--bg-blue-lightest);
	transform: translateY(-1px);
}

.cuddlebug-form {
	position: relative;
	display: flex;
	align-items: center;
	padding: 8px 10px 8px 16px;
	border-top: 0;
	background: var(--bg-content);
}

.cuddlebug-form[hidden] {
	display: none;
}

.cuddlebug-form::before {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 2px;
	background: linear-gradient(90deg, #2f5fab, #6576d7 42%, #bf68b5 72%, #4a93d4);
	content: "";
	opacity: 0.82;
}

.cuddlebug-input {
	flex: 1;
	min-width: 0;
	height: 42px;
	padding: 9px 8px;
	border: 0;
	background: var(--bg-content);
	color: var(--text-black);
	font-size: 14px;
}

.cuddlebug-input:focus {
	z-index: 1;
	outline: none;
}

.cuddlebug-send {
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--blue, #2957a4);
	color: #fff;
	font-size: 15px;
	transition:
		background-color 140ms ease,
		transform 140ms ease;
}

.cuddlebug-send span {
	display: block;
	font-size: 21px;
	font-weight: 600;
	line-height: 1;
	transform: translateY(-1px);
}

.cuddlebug-send:hover,
.cuddlebug-send:focus {
	background: var(--blue, #2957a4);
	transform: translateY(-1px);
}

.cuddlebug-send:disabled {
	cursor: default;
	background: #d9dde2;
}

.cuddlebug-launcher {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 1000;
	isolation: isolate;
	width: 56px;
	height: 56px;
	border-radius: 42%;
	background: var(--blue, #2957a4);
	color: #fff;
	font-size: 21px;
	box-shadow: 0 4px 14px rgba(20, 38, 63, 0.24);
	transition:
		background-color 150ms ease,
		box-shadow 150ms ease,
		transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cuddlebug--faq-entrance .cuddlebug-launcher {
	transform-origin: center;
	animation: cuddlebug-launcher-emerge 900ms cubic-bezier(0.16, 1, 0.3, 1) 1000ms backwards;
}

.cuddlebug--faq-entrance .cuddlebug-launcher::before {
	position: absolute;
	z-index: -1;
	--cuddlebug-ripple-size: max(92px, 20.81vw);
	top: 50%;
	left: 50%;
	width: var(--cuddlebug-ripple-size);
	height: var(--cuddlebug-ripple-size);
	margin: calc(var(--cuddlebug-ripple-size) / -2) 0 0 calc(var(--cuddlebug-ripple-size) / -2);
	border-radius: 50%;
	background: radial-gradient(
		circle,
		rgba(41, 87, 164, 0.34) 0%,
		rgba(41, 87, 164, 0.25) 44%,
		rgba(41, 87, 164, 0.12) 74%,
		rgba(41, 87, 164, 0) 100%
	);
	content: "";
	pointer-events: none;
	transform: scale(0);
	animation: cuddlebug-launcher-ripple 2340ms linear 1000ms both;
}

.cuddlebug-launcher:hover,
.cuddlebug-launcher:focus {
	background: var(--blue, #2957a4);
	box-shadow: 0 7px 18px rgba(20, 38, 63, 0.3);
	transform: translateY(-2px);
}

.cuddlebug-launcher [data-cuddlebug-open-icon],
.cuddlebug-launcher [data-cuddlebug-close-icon] {
	position: absolute;
	transition:
		opacity 150ms ease,
		transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cuddlebug-open-icon {
	width: 24px;
	height: 20px;
	border: 2px solid currentColor;
	border-radius: 9px;
}

.cuddlebug-open-icon::after {
	position: absolute;
	right: 2px;
	bottom: -4px;
	width: 6px;
	height: 7px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	border-bottom-right-radius: 1px;
	background: var(--blue, #2957a4);
	content: "";
	transform: skewY(35deg);
}

.cuddlebug-close-icon {
	width: 20px;
	height: 20px;
}

.cuddlebug-close-icon::before {
	position: absolute;
	top: 1px;
	left: 3px;
	width: 12px;
	height: 12px;
	border-right: 3px solid currentColor;
	border-bottom: 3px solid currentColor;
	content: "";
	transform: rotate(45deg);
}

.cuddlebug-more-help {
	display: flex;
	justify-content: flex-end;
	margin: 0 0 14px;
}

.cuddlebug-launcher [data-cuddlebug-close-icon] {
	opacity: 0;
	transform: rotate(-30deg) scale(0.75);
}

.cuddlebug--open .cuddlebug-launcher [data-cuddlebug-open-icon] {
	opacity: 0;
	transform: rotate(30deg) scale(0.75);
}

.cuddlebug--open .cuddlebug-launcher [data-cuddlebug-close-icon] {
	opacity: 1;
	transform: rotate(0) scale(1);
}

.cuddlebug-entry--new {
	animation: cuddlebug-entry-in 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes cuddlebug-entry-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes cuddlebug-launcher-emerge {
	from {
		opacity: 0;
		filter: blur(2px);
		transform: scale(0);
	}

	to {
		opacity: 1;
		filter: blur(0);
		transform: scale(1);
	}
}

@keyframes cuddlebug-launcher-ripple {
	0% {
		opacity: 0;
		transform: scale(0.1);
	}

	12% {
		opacity: 1;
	}

	55% {
		opacity: 0.62;
	}

	72%,
	100% {
		opacity: 0;
		transform: scale(1);
	}
}

@keyframes cuddlebug-loading {
	0%,
	80%,
	100% {
		opacity: 0.3;
		transform: translateY(1px);
	}

	40% {
		opacity: 1;
		transform: translateY(-2px);
	}
}

.cuddlebug-launcher:focus-visible,
.cuddlebug-send:focus-visible,
.cuddlebug-source:focus-visible,
.cuddlebug-more-help button:focus-visible,
.cuddlebug-suggestions button:focus-visible {
	outline: 2px solid #6ea5e7;
	outline-offset: 2px;
}

html.night-mode-on .cuddlebug-panel,
html.night-mode-on .cuddlebug-form,
html.night-mode-on .cuddlebug-input {
	border-color: var(--shadow-grey);
	background: var(--bg-content);
	color: #fff;
}

html.night-mode-on .cuddlebug-messages {
	background: transparent;
}

html.night-mode-on .cuddlebug--started .cuddlebug-messages {
	background: var(--bg-content);
}

html.night-mode-on .cuddlebug--started .cuddlebug-brand {
	border-bottom-color: var(--shadow-grey);
}

html.night-mode-on .cuddlebug-message--assistant {
	background: var(--bg-accent-muted);
	color: #fff;
}

html.night-mode-on .cuddlebug-source,
html.night-mode-on .cuddlebug-inline-link,
html.night-mode-on .cuddlebug-sources-title,
html.night-mode-on .cuddlebug-message-label,
html.night-mode-on .cuddlebug-suggestions > span {
	color: var(--bg-accent-softest);
}

html.night-mode-on .cuddlebug-loading > span,
html.night-mode-on .cuddlebug-suggestions button,
html.night-mode-on .cuddlebug-more-help button {
	border-color: var(--shadow-grey);
	background: var(--bg-content);
	color: var(--bg-accent-softest);
}

html.night-mode-on .cuddlebug-send:disabled {
	background: #4c5561;
	color: #dce2e9;
}

html.night-mode-on .cuddlebug-suggestions button:hover,
html.night-mode-on .cuddlebug-suggestions button:focus,
html.night-mode-on .cuddlebug-more-help button:hover,
html.night-mode-on .cuddlebug-more-help button:focus {
	background: var(--bg-accent-muted);
}

@media (max-height: 500px) {
	.cuddlebug-brand { flex-basis: 100px; }
}

@media (max-width: 767px) {
	.cuddlebug-brand {
		flex-basis: min(120px, 20vh);
		flex-basis: min(120px, 20dvh);
	}

	.cuddlebug-panel {
		right: 12px;
		bottom: calc(var(--shortcut-nav-height, 0px) + 80px);
		left: 12px;
		width: auto;
		height: calc(100vh - var(--shortcut-nav-height, 0px) - 96px);
		height: calc(100dvh - var(--shortcut-nav-height, 0px) - 96px);
		max-height: calc(100vh - var(--shortcut-nav-height, 0px) - 96px);
		max-height: calc(100dvh - var(--shortcut-nav-height, 0px) - 96px);
	}

	.cuddlebug-input {
		font-size: 16px;
	}

	.cuddlebug-launcher {
		right: 14px;
		bottom: calc(var(--shortcut-nav-height, 0px) + 14px);
		width: 52px;
		height: 52px;
	}
}
