.genie-guide {
	position: fixed;
	right: max(18px, env(safe-area-inset-right));
	bottom: max(24px, env(safe-area-inset-bottom));
	z-index: 260;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	width: max-content;
	max-width: calc(100vw - 28px);
	pointer-events: none;
	--genie-text: #f8fbff;
	--genie-muted: rgba(248, 251, 255, 0.72);
	--genie-blue: #12aee8;
	--genie-gold: #f3ad3f;
	--genie-radius: 8px;
	--genie-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

.genie-lamp {
	position: relative;
	width: 98px;
	height: 70px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	cursor: pointer;
	pointer-events: auto;
	filter: drop-shadow(0 0 24px rgba(243, 173, 63, 0.44)) drop-shadow(0 0 20px rgba(18, 174, 232, 0.18));
	-webkit-tap-highlight-color: transparent;
	transition: filter 220ms var(--genie-ease), transform 220ms var(--genie-ease);
}

.genie-lamp:hover,
.genie-lamp:focus-visible,
.genie-guide.is-open .genie-lamp {
	filter: drop-shadow(0 0 30px rgba(243, 173, 63, 0.56)) drop-shadow(0 0 26px rgba(18, 174, 232, 0.24));
	transform: translateY(-2px);
}

.genie-lamp__glow,
.genie-lamp__smoke,
.genie-lamp__body,
.genie-lamp__spout,
.genie-lamp__handle,
.genie-lamp__base {
	position: absolute;
	display: block;
	pointer-events: none;
}

.genie-lamp__glow {
	left: 12px;
	right: 6px;
	bottom: 2px;
	height: 28px;
	border-radius: 999px;
	background: radial-gradient(ellipse at 50% 50%, rgba(243, 173, 63, 0.34), transparent 70%);
	filter: blur(9px);
	opacity: 0.84;
}

.genie-lamp__body {
	left: 30px;
	bottom: 16px;
	width: 48px;
	height: 25px;
	border-radius: 62% 58% 52% 56%;
	background: linear-gradient(135deg, #fff0ba, var(--genie-gold) 55%, #9c6518);
	box-shadow: inset -7px -5px 12px rgba(58, 30, 0, 0.26), inset 6px 5px 10px rgba(255, 255, 255, 0.34);
}

.genie-lamp__spout {
	right: 3px;
	bottom: 26px;
	width: 48px;
	height: 19px;
	border-top: 8px solid #f7c96f;
	border-right: 14px solid #f7c96f;
	border-radius: 0 999px 999px 0;
	transform: rotate(-10deg);
}

.genie-lamp__handle {
	left: 10px;
	bottom: 23px;
	width: 30px;
	height: 28px;
	border: 6px solid #d8952b;
	border-right: 0;
	border-radius: 60% 0 0 60%;
	transform: rotate(8deg);
}

.genie-lamp__base {
	left: 24px;
	bottom: 9px;
	width: 64px;
	height: 9px;
	border-radius: 999px;
	background: linear-gradient(90deg, #8c5814, #ffd681, #a66a18);
}

.genie-lamp__smoke {
	left: 52px;
	top: 0;
	width: 19px;
	height: 48px;
	border-radius: 999px;
	background:
		radial-gradient(ellipse at 50% 20%, rgba(255, 255, 255, 0.72), transparent 34%),
		linear-gradient(180deg, rgba(18, 174, 232, 0.48), rgba(255, 255, 255, 0.24), transparent);
	filter: blur(6px);
	opacity: 0.72;
	transform-origin: bottom center;
	animation: genieLampSmoke 4.4s var(--genie-ease) infinite;
}

.genie-lamp__smoke--two {
	left: 66px;
	top: 4px;
	height: 41px;
	opacity: 0.48;
	animation-delay: 720ms;
	animation-duration: 5.4s;
}

.genie-bubble {
	position: relative;
	width: min(390px, calc(100vw - 28px));
	max-height: min(680px, calc(100vh - 130px));
	display: grid;
	grid-template-rows: auto minmax(180px, 1fr) auto auto;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: var(--genie-radius);
	background:
		linear-gradient(180deg, rgba(12, 18, 30, 0.96), rgba(7, 10, 17, 0.95)),
		linear-gradient(135deg, rgba(18, 174, 232, 0.14), rgba(243, 173, 63, 0.1));
	box-shadow: 0 24px 74px rgba(0, 0, 0, 0.44), 0 0 58px rgba(18, 174, 232, 0.16);
	backdrop-filter: blur(18px);
	color: var(--genie-text);
	padding: 14px;
	pointer-events: auto;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px) scale(0.97);
	transform-origin: right bottom;
	transition: opacity 220ms var(--genie-ease), transform 220ms var(--genie-ease), visibility 220ms var(--genie-ease);
}

.genie-guide.is-open .genie-bubble {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.genie-bubble::before {
	content: "";
	position: absolute;
	inset: -24% -18% auto;
	height: 150px;
	pointer-events: none;
	background:
		radial-gradient(ellipse at 18% 70%, rgba(18, 174, 232, 0.26), transparent 54%),
		radial-gradient(ellipse at 52% 44%, rgba(255, 255, 255, 0.14), transparent 46%),
		radial-gradient(ellipse at 84% 68%, rgba(243, 173, 63, 0.14), transparent 52%);
	filter: blur(14px);
	opacity: 0.86;
	animation: genieBubbleSmoke 9s var(--genie-ease) infinite alternate;
}

.genie-bubble__header,
.genie-chat__messages,
.genie-chat__quick-actions,
.genie-chat__form {
	position: relative;
	z-index: 1;
}

.genie-bubble__header {
	display: flex;
	align-items: start;
	justify-content: space-between;
	gap: 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.genie-bubble__title {
	display: grid;
	gap: 3px;
}

.genie-bubble__kicker {
	color: #ffe0a3;
	font-size: 0.72rem;
	font-weight: 900;
	line-height: 1;
	text-transform: uppercase;
}

.genie-bubble__heading {
	margin: 0;
	color: var(--genie-text);
	font-size: 1rem;
	font-weight: 900;
	line-height: 1.2;
}

.genie-bubble__close {
	position: relative;
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	cursor: pointer;
	transition: background 180ms var(--genie-ease), transform 180ms var(--genie-ease);
}

.genie-bubble__close:hover {
	background: rgba(255, 255, 255, 0.14);
	transform: rotate(90deg);
}

.genie-bubble__close::before,
.genie-bubble__close::after {
	content: "";
	position: absolute;
	left: 10px;
	top: 16px;
	width: 12px;
	height: 2px;
	border-radius: 999px;
	background: var(--genie-text);
}

.genie-bubble__close::before {
	transform: rotate(45deg);
}

.genie-bubble__close::after {
	transform: rotate(-45deg);
}

.genie-chat__messages {
	display: grid;
	align-content: start;
	gap: 10px;
	min-height: 210px;
	max-height: 360px;
	overflow-y: auto;
	padding: 12px 3px;
	scrollbar-width: thin;
	scrollbar-color: rgba(243, 173, 63, 0.5) transparent;
}

.genie-chat__message {
	display: grid;
	gap: 7px;
	max-width: 88%;
}

.genie-chat__message--user {
	justify-self: end;
}

.genie-chat__message--assistant {
	justify-self: start;
}

.genie-chat__message-bubble {
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: var(--genie-radius);
	padding: 10px 11px;
	color: var(--genie-muted);
	background: rgba(255, 255, 255, 0.07);
	font-size: 0.88rem;
	font-weight: 700;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

.genie-chat__message--user .genie-chat__message-bubble {
	color: #06111a;
	background: linear-gradient(135deg, #37d7ff, var(--genie-blue) 52%, #7ce8ff);
	border-color: rgba(255, 255, 255, 0.24);
}

.genie-chat__message-actions,
.genie-chat__quick-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.genie-chat__quick-actions {
	padding-top: 10px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.genie-chat__chip,
.genie-chat__message-link {
	min-height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: var(--genie-radius);
	background: rgba(255, 255, 255, 0.08);
	color: var(--genie-text);
	padding: 9px 11px;
	font: inherit;
	font-size: 0.8rem;
	font-weight: 900;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: transform 180ms var(--genie-ease), background 180ms var(--genie-ease), border-color 180ms var(--genie-ease);
}

.genie-chat__chip:hover,
.genie-chat__message-link:hover {
	transform: translateY(-1px);
	background: rgba(255, 255, 255, 0.13);
	border-color: rgba(243, 173, 63, 0.42);
}

.genie-chat__message-link:first-child,
.genie-chat__chip:first-child {
	color: #06111a;
	background: linear-gradient(135deg, #37d7ff, var(--genie-blue) 52%, #7ce8ff);
	border-color: rgba(255, 255, 255, 0.24);
}

.genie-chat__form {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
	padding-top: 10px;
}

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

.genie-chat__input {
	min-height: 42px;
	width: 100%;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: var(--genie-radius);
	background: rgba(7, 10, 17, 0.74);
	color: var(--genie-text);
	padding: 11px 12px;
	font: inherit;
	font-size: 0.88rem;
	outline: none;
}

.genie-chat__input::placeholder {
	color: rgba(248, 251, 255, 0.42);
}

.genie-chat__input:focus {
	border-color: rgba(18, 174, 232, 0.72);
	box-shadow: 0 0 0 4px rgba(18, 174, 232, 0.14);
}

.genie-chat__send {
	min-height: 42px;
	border: 1px solid rgba(255, 255, 255, 0.24);
	border-radius: var(--genie-radius);
	background: linear-gradient(135deg, #fff0ba, var(--genie-gold));
	color: #241400;
	padding: 10px 12px;
	font: inherit;
	font-size: 0.84rem;
	font-weight: 900;
	cursor: pointer;
}

.genie-chat__send:disabled,
.genie-chat__input:disabled {
	opacity: 0.68;
	cursor: wait;
}

@keyframes genieLampSmoke {
	0% {
		transform: translateY(12px) scale(0.74) rotate(-8deg);
		opacity: 0;
	}
	25% {
		opacity: 0.76;
	}
	100% {
		transform: translateY(-18px) scale(1.1) rotate(8deg);
		opacity: 0;
	}
}

@keyframes genieBubbleSmoke {
	to {
		transform: translate3d(7%, -14px, 0) skewX(-6deg);
		opacity: 1;
	}
}

@media (max-width: 680px) {
	.genie-guide {
		right: max(10px, env(safe-area-inset-right));
		bottom: max(10px, env(safe-area-inset-bottom));
		max-width: calc(100vw - 20px);
	}

	.genie-bubble {
		width: min(360px, calc(100vw - 20px));
		max-height: calc(100vh - 100px);
		padding: 12px;
	}

	.genie-chat__messages {
		max-height: 320px;
	}

	.genie-lamp {
		width: 90px;
		height: 66px;
	}
}

@media (max-width: 420px) {
	.genie-bubble {
		width: calc(100vw - 20px);
	}

	.genie-chat__form {
		grid-template-columns: 1fr;
	}

	.genie-chat__send {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.genie-guide *,
	.genie-guide *::before,
	.genie-guide *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
}
