.uai-launcher,
.uai-launcher *,
.uai-destination,
.uai-destination * {
	box-sizing: border-box;
}

.uai-launcher {
	--uai-bg: transparent;
	--uai-site-bg: #212121;
	--uai-panel: #303030;
	--uai-accent: #fff;
	--uai-text: #fff;
	--uai-muted: #cfcfcf;
	--uai-min-height: 360px;
	position: relative;
	isolation: isolate;
	display: grid;
	width: 100%;
	min-height: var(--uai-min-height);
	place-items: center;
	overflow: visible;
	padding: 48px 28px 56px;
	background: transparent;
	color: var(--uai-text);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.uai-launcher__inner {
	width: min(100%, 980px);
	text-align: center;
}

.uai-launcher .screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	border: 0 !important;
	white-space: nowrap !important;
}

.uai-launcher__tabs {
	display: inline-flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin: 0 0 24px;
}

.uai-launcher__tab {
	min-width: 94px;
	height: 44px;
	margin: 0;
	border: 1px solid transparent;
	border-radius: 999px;
	background: color-mix(in srgb, var(--uai-panel) 92%, white 8%);
	box-shadow: none;
	color: var(--uai-text);
	cursor: pointer;
	font: inherit;
	font-size: 15px;
	font-weight: 650;
	line-height: 1;
	transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.uai-launcher__tab:hover,
.uai-launcher__tab:focus-visible {
	border-color: color-mix(in srgb, var(--uai-accent) 60%, white 20%);
	outline: none;
	transform: translateY(-1px);
}

.uai-launcher__tab.is-active {
	background: var(--uai-accent);
	box-shadow: 0 9px 28px rgba(0, 0, 0, 0.25);
	color: var(--uai-site-bg);
}

.uai-launcher__form {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto auto;
	align-items: end;
	column-gap: 9px;
	row-gap: 12px;
	width: 100%;
	min-height: 122px;
	padding: 17px 14px 12px 18px;
	border: 1px solid color-mix(in srgb, var(--uai-text) 13%, transparent);
	border-radius: 28px;
	background: color-mix(in srgb, var(--uai-panel) 96%, transparent);
	box-shadow: 0 20px 55px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.035);
	text-align: left;
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

.uai-launcher__form:focus-within {
	border-color: color-mix(in srgb, var(--uai-accent) 28%, transparent);
	box-shadow: 0 22px 58px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.uai-launcher__prompt {
	grid-column: 1 / -1;
	width: 100%;
	min-width: 0;
	height: 32px;
	min-height: 32px;
	max-height: 220px;
	margin: 0;
	padding: 2px 4px 7px;
	resize: none;
	overflow-y: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
	scrollbar-width: none;
	-ms-overflow-style: none;
	border: 0 !important;
	border-radius: 0;
	outline: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--uai-text) !important;
	font: inherit;
	font-size: 16px;
	line-height: 1.55;
}

.uai-launcher__prompt::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

.uai-launcher__prompt::placeholder {
	color: color-mix(in srgb, var(--uai-muted) 82%, transparent);
	opacity: 1;
}

.uai-model-picker {
	position: relative;
	grid-column: 1;
	justify-self: start;
}

.uai-model-picker__toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 210px;
	height: 46px;
	margin: 0;
	padding: 0 15px;
	border: 1px solid color-mix(in srgb, var(--uai-text) 7%, transparent);
	border-radius: 999px;
	background: color-mix(in srgb, var(--uai-panel) 82%, white 7%);
	box-shadow: none;
	color: var(--uai-text);
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 650;
}

.uai-model-picker__toggle:hover,
.uai-model-picker__toggle:focus-visible,
.uai-model-picker.is-open .uai-model-picker__toggle {
	border-color: color-mix(in srgb, var(--uai-accent) 62%, white 12%);
	outline: none;
}

.uai-model-picker__toggle:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.uai-model-picker__selected {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.uai-model-picker__toggle svg {
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
	transition: transform 160ms ease;
}

.uai-model-picker.is-open .uai-model-picker__toggle svg {
	transform: rotate(180deg);
}

.uai-model-picker__menu {
	position: absolute;
	z-index: 50;
	top: calc(100% + 13px);
	right: auto;
	left: 0;
	width: min(330px, calc(100vw - 40px));
	max-height: 340px;
	overflow-y: auto;
	scrollbar-gutter: stable;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.34) transparent;
	padding: 7px;
	border: 1px solid color-mix(in srgb, var(--uai-text) 13%, transparent);
	border-radius: 16px;
	background: color-mix(in srgb, var(--uai-panel) 96%, #070511);
	box-shadow: 0 25px 70px rgba(0, 0, 0, 0.48);
	animation: uai-menu-in 150ms ease both;
}

.uai-model-picker__menu::-webkit-scrollbar {
	width: 8px;
}

.uai-model-picker__menu::-webkit-scrollbar-track {
	margin-block: 8px;
	background: transparent;
}

.uai-model-picker__menu::-webkit-scrollbar-thumb {
	min-height: 36px;
	border: 2px solid transparent;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.28);
	background-clip: padding-box;
}

.uai-model-picker__menu::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.45);
	background-clip: padding-box;
}

.uai-model-picker__menu::-webkit-scrollbar-button {
	display: none;
	width: 0;
	height: 0;
}

.uai-model-picker__menu[hidden] {
	display: none;
}

/* Visible scrollbar overlay for normal mobile browsers. It is appended to <body>
 * so iOS/Chrome mobile cannot hide it with native overlay-scrollbar behavior. */
.uai-model-picker__mobile-scrollbar {
	position: fixed;
	z-index: 999999;
	display: none;
	width: 4px;
	margin: 0;
	padding: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
	pointer-events: none;
}

.uai-model-picker__mobile-scrollbar.is-visible {
	display: block;
}

.uai-model-picker__mobile-scrollbar-thumb {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	min-height: 28px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.58);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16);
}

.uai-model-picker__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-height: 62px;
	margin: 0;
	padding: 10px 12px;
	border: 0;
	border-radius: 11px;
	background: transparent;
	box-shadow: none;
	color: var(--uai-text);
	cursor: pointer;
	font: inherit;
	text-align: left;
}

.uai-model-picker__option + .uai-model-picker__option {
	margin-top: 4px;
}

.uai-model-picker__option:hover,
.uai-model-picker__option:focus-visible,
.uai-model-picker__option.is-selected {
	background: color-mix(in srgb, var(--uai-accent) 21%, transparent);
	outline: none;
}

.uai-model-picker__option-content {
	display: grid;
	gap: 1px;
	min-width: 0;
}

.uai-model-picker__option-content strong {
	overflow: hidden;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.25;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.uai-model-picker__option-content small {
	overflow: hidden;
	color: var(--uai-muted);
	font-size: 12px;
	font-weight: 450;
	line-height: 1.25;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.uai-model-picker__badge {
	flex: 0 0 auto;
	padding: 4px 7px;
	border-radius: 6px;
	background: color-mix(in srgb, var(--uai-accent) 29%, transparent);
	color: color-mix(in srgb, var(--uai-text) 92%, var(--uai-accent));
	font-size: 9px;
	font-weight: 800;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.uai-launcher__attach,
.uai-launcher__internet {
	grid-column: 2;
	justify-self: end;
	display: inline-flex;
	flex: 0 0 46px;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin: 0;
	padding: 0;
	border: 1px solid color-mix(in srgb, var(--uai-text) 10%, transparent);
	border-radius: 999px;
	background: color-mix(in srgb, var(--uai-panel) 82%, white 7%);
	box-shadow: none;
	color: var(--uai-text);
	cursor: pointer;
	transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.uai-launcher__internet {
	grid-column: 3;
}

.uai-launcher__attach[hidden],
.uai-launcher__internet[hidden] {
	display: none;
}

.uai-launcher__attach:hover,
.uai-launcher__attach:focus-visible,
.uai-launcher__attach.is-selected,
.uai-launcher__internet:hover,
.uai-launcher__internet:focus-visible {
	border-color: color-mix(in srgb, var(--uai-accent) 66%, white 10%);
	background: color-mix(in srgb, var(--uai-accent) 18%, var(--uai-panel));
	outline: none;
}

.uai-launcher__attach:hover,
.uai-launcher__attach:focus-visible,
.uai-launcher__internet:hover,
.uai-launcher__internet:focus-visible {
	transform: translateY(-1px);
}

.uai-launcher__internet.is-active {
	border-color: var(--uai-accent);
	background: var(--uai-accent);
	color: var(--uai-site-bg);
}

.uai-launcher__attach:disabled,
.uai-launcher__internet:disabled {
	cursor: not-allowed;
	opacity: 0.55;
	transform: none;
}

.uai-launcher__attach svg,
.uai-launcher__internet svg {
	width: 21px;
	height: 21px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.uai-launcher__attachment {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	max-width: min(100%, 420px);
	margin: 10px auto 0;
	padding: 5px 7px 5px 5px;
	border: 1px solid color-mix(in srgb, var(--uai-text) 13%, transparent);
	border-radius: 10px;
	background: color-mix(in srgb, var(--uai-panel) 94%, transparent);
	color: var(--uai-text);
	font-size: 12px;
}

.uai-launcher__attachment[hidden] {
	display: none;
}

.uai-launcher__attachment img {
	width: 34px;
	height: 34px;
	border-radius: 7px;
	object-fit: cover;
}

.uai-launcher__attachment span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.uai-launcher__attachment button {
	display: inline-grid;
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	margin: 0;
	padding: 0;
	place-items: center;
	border: 0;
	border-radius: 999px;
	background: color-mix(in srgb, var(--uai-text) 11%, transparent);
	box-shadow: none;
	color: var(--uai-text);
	cursor: pointer;
	font: inherit;
	font-size: 19px;
	line-height: 1;
}

.uai-launcher__submit {
	grid-column: 4;
	justify-self: end;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	gap: 9px;
	min-width: 154px;
	height: 48px;
	margin: 0;
	padding: 0 20px;
	border: 0;
	border-radius: 999px;
	background: var(--uai-accent);
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
	color: var(--uai-site-bg);
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 750;
	white-space: nowrap;
	transition: filter 160ms ease, transform 160ms ease;
}

.uai-launcher__submit:hover,
.uai-launcher__submit:focus-visible {
	filter: brightness(1.1);
	outline: 2px solid color-mix(in srgb, var(--uai-accent) 70%, white);
	outline-offset: 2px;
	transform: translateY(-1px);
}

.uai-launcher__submit:disabled {
	cursor: not-allowed;
	filter: grayscale(0.35);
	opacity: 0.48;
	transform: none;
}

.uai-launcher__submit svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2;
}

.uai-launcher__tagline,
.uai-launcher__status {
	margin: 15px 0 0;
	color: var(--uai-muted);
	font-size: 13px;
	line-height: 1.55;
}

.uai-launcher__status {
	min-height: 20px;
	margin-top: 6px;
}

.uai-launcher__status.is-error,
.uai-destination__status.is-error {
	color: #ff9eae;
}

.uai-destination {
	--uai-bg: transparent;
	--uai-site-bg: #212121;
	--uai-panel: #303030;
	--uai-accent: #fff;
	--uai-text: #fff;
	--uai-muted: #cfcfcf;
	width: 100%;
	min-height: 640px;
	padding: 20px clamp(12px, 2.5vw, 32px) 34px;
	background: transparent;
	color: var(--uai-text);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.uai-destination__header {
	display: flex;
	align-items: center;
	gap: 10px;
	width: min(100%, 1180px);
	min-height: 38px;
	margin: 0 auto 14px;
	color: var(--uai-muted);
	font-size: 13px;
}

.uai-destination__header strong {
	color: var(--uai-text);
	font-weight: 700;
}

.uai-destination__mode {
	padding: 5px 9px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--uai-accent) 22%, transparent);
	color: color-mix(in srgb, var(--uai-text) 94%, var(--uai-accent));
	font-size: 11px;
	font-weight: 750;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.uai-destination__divider {
	width: 1px;
	height: 17px;
	background: color-mix(in srgb, var(--uai-text) 16%, transparent);
}

.uai-destination__tool {
	width: min(100%, 1180px);
	margin: 0 auto;
}

.uai-destination--chat .aipkit_chat_container:not(.aipkit_popup_content) {
	min-height: min(760px, calc(100vh - 150px));
}

.uai-destination--image .uaig-generator {
	max-width: 100%;
}

.uai-destination__status {
	width: min(100%, 1180px);
	min-height: 22px;
	margin: 10px auto 0;
	color: var(--uai-muted);
	font-size: 13px;
	text-align: center;
}

.uai-destination__error {
	padding: 18px 20px;
	border: 1px solid rgba(255, 126, 148, 0.35);
	border-radius: 14px;
	background: rgba(128, 24, 45, 0.18);
	color: #ffd6dd;
	font-size: 14px;
	line-height: 1.55;
}

@keyframes uai-menu-in {
	from { opacity: 0; transform: translateY(-5px) scale(0.985); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 760px) {
	.uai-launcher {
		min-height: var(--uai-min-height);
		padding: 38px 16px 46px;
	}

	.uai-launcher__tabs {
		margin-top: 0;
	}

	.uai-launcher__form {
		min-height: 126px;
		padding: 15px 12px 12px;
		border-radius: 26px;
	}

	.uai-launcher__prompt {
		min-height: 44px;
		max-height: 190px;
		padding: 3px 6px 8px;
	}

	.uai-model-picker__toggle {
		max-width: min(210px, 44vw);
	}

	/* Real mobile browsers need an explicit touch-scrollable model list. */
	.uai-model-picker__menu {
		max-height: min(340px, 52dvh);
		overflow-y: auto;
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior-y: contain;
		touch-action: pan-y;
	}


	/* iOS Safari can fail to scroll an animated, absolutely-positioned overflow box. */
	@supports (-webkit-touch-callout: none) {
		.uai-model-picker__menu {
			animation: none;
			transform: translateZ(0);
		}
	}

	.uai-launcher__submit {
		min-width: 0;
		padding: 0 16px;
	}

	.uai-destination {
		padding-inline: 8px;
	}
}

@media (max-width: 600px) {
	.uai-launcher__submit span {
		display: none;
	}

	.uai-launcher__submit {
		width: 48px;
		padding: 0;
	}
}

@media (max-width: 430px) {
	.uai-launcher__tab {
		min-width: 78px;
	}

	.uai-launcher__submit span {
		display: none;
	}

	.uai-launcher__submit {
		width: 48px;
		padding: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.uai-launcher *,
	.uai-destination * {
		scroll-behavior: auto !important;
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}


/*
 * Mobile homepage safeguard: some external code-preview tooling can inject
 * #acdt-preview into the live page. It is not part of the launcher UI and
 * must not consume mobile viewport width when the homepage launcher is shown.
 */
@media (max-width: 921px) {
	body:has([data-uai-launcher]) #acdt-preview {
		display: none !important;
		visibility: hidden !important;
		position: fixed !important;
		inset: auto !important;
		width: 0 !important;
		height: 0 !important;
		min-width: 0 !important;
		min-height: 0 !important;
		max-width: 0 !important;
		max-height: 0 !important;
		margin: 0 !important;
		padding: 0 !important;
		border: 0 !important;
		overflow: hidden !important;
		pointer-events: none !important;
	}

	/* The injected preview can also leave the site root sized as if its
	 * right-hand editor panel still exists. Restore only the mobile homepage
	 * root that contains this launcher; inner Elementor/Astra widths are left alone. */
	html:has(body [data-uai-launcher]),
	body:has([data-uai-launcher]) {
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		margin-right: 0 !important;
		padding-right: 0 !important;
		overflow-x: hidden !important;
	}

	body:has([data-uai-launcher]) #page,
	body:has([data-uai-launcher]) > .site {
		box-sizing: border-box !important;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		margin-right: 0 !important;
		padding-right: 0 !important;
		right: auto !important;
		transform: none !important;
		flex: 0 0 100% !important;
		grid-column: 1 / -1 !important;
	}
}
