.ihai-page,
.ihai-app {
	--ihai-ink: #243943;
	--ihai-ink-soft: #38515c;
	--ihai-peach: #ffc9b8;
	--ihai-lilac: #9b96ff;
	--ihai-paper: #fbf8fb;
	--ihai-line: rgba(255, 255, 255, 0.2);
}

/* The dedicated, configured AI page must not show the older floating assistant too. */
body.ihai-dedicated-page .ihea {
	display: none !important;
}

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

.ihai-hero {
	background: linear-gradient(125deg, #fff4ef 0%, #f0efff 100%);
	border-radius: 38px;
	margin-bottom: 42px;
}

.ihai-hero .ih-report-title {
	font-size: clamp(34px, 4.3vw, 66px) !important;
	line-height: 1.04 !important;
	max-width: 880px;
}

.ihai-hero > p {
	font-size: clamp(17px, 1.6vw, 22px);
	line-height: 1.65;
	max-width: 850px;
}

.ihai-app,
.ihai-app * {
	box-sizing: border-box;
}

.ihai-app {
	display: grid;
	grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.5fr);
	background: var(--ihai-ink);
	border-radius: 38px;
	color: #fff;
	overflow: hidden;
	box-shadow: 0 28px 75px rgba(36, 57, 67, 0.16);
	min-height: 680px;
}

.ihai-intro {
	display: flex;
	flex-direction: column;
	padding: clamp(32px, 4.5vw, 68px);
	background:
		radial-gradient(circle at 10% 88%, rgba(255, 201, 184, 0.18), transparent 35%),
		var(--ihai-ink);
	border-right: 1px solid var(--ihai-line);
}

.ihai-eyebrow {
	color: var(--ihai-peach);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.18em;
	margin-bottom: 25px;
}

.ihai-intro h3 {
	color: #fff !important;
	font-size: clamp(32px, 3vw, 49px) !important;
	line-height: 1.08 !important;
	margin: 0 0 22px !important;
}

.ihai-intro p,
.ihai-intro li {
	color: rgba(255, 255, 255, 0.84);
	font-size: 17px;
	line-height: 1.65;
}

.ihai-intro ul {
	list-style: none;
	margin: 28px 0 34px;
	padding: 0;
}

.ihai-intro li {
	position: relative;
	padding: 9px 0 9px 30px;
}

.ihai-intro li::before {
	background: linear-gradient(135deg, var(--ihai-peach), var(--ihai-lilac));
	border-radius: 50%;
	content: "";
	height: 10px;
	left: 0;
	position: absolute;
	top: 18px;
	width: 10px;
}

.ihai-boundary {
	display: grid;
	gap: 5px;
	margin-top: auto;
	padding: 20px 22px;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.13);
	border-radius: 20px;
}

.ihai-boundary strong {
	color: var(--ihai-peach);
}

.ihai-boundary span {
	color: rgba(255, 255, 255, 0.76);
	font-size: 14px;
	line-height: 1.5;
}

.ihai-chat-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: clamp(22px, 3.5vw, 52px);
	background: linear-gradient(145deg, #2b424d 0%, #233842 100%);
}

.ihai-chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding-bottom: 22px;
	border-bottom: 1px solid var(--ihai-line);
}

.ihai-chat-header > div:first-child {
	display: grid;
	grid-template-columns: 13px auto;
	column-gap: 11px;
	align-items: center;
}

.ihai-chat-header strong {
	color: #fff;
	font-size: 18px;
}

.ihai-chat-header small {
	color: rgba(255, 255, 255, 0.68);
	font-size: 13px;
	grid-column: 2;
}

.ihai-status-dot {
	background: #87e8ba;
	border: 3px solid rgba(135, 232, 186, 0.22);
	border-radius: 50%;
	box-shadow: 0 0 0 4px rgba(135, 232, 186, 0.08);
	height: 10px;
	width: 10px;
}

.ihai-language {
	display: flex;
	background: rgba(255, 255, 255, 0.07);
	border-radius: 999px;
	padding: 4px;
}

.ihai-language button {
	background: transparent;
	border: 0;
	border-radius: 999px;
	color: rgba(255, 255, 255, 0.72);
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	min-width: 44px;
	padding: 8px 12px;
}

.ihai-language button[aria-pressed="true"] {
	background: linear-gradient(135deg, var(--ihai-peach), #d4ceff);
	color: var(--ihai-ink);
}

.ihai-messages {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 20px;
	margin: 24px -8px 14px 0;
	min-height: 280px;
	max-height: 540px;
	overflow-y: auto;
	padding: 4px 12px 12px 0;
	scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
	scrollbar-width: thin;
}

.ihai-message {
	display: flex;
	align-items: flex-start;
	gap: 13px;
	max-width: 88%;
}

.ihai-message--user {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.ihai-avatar {
	display: grid;
	flex: 0 0 38px;
	place-items: center;
	background: linear-gradient(135deg, var(--ihai-peach), var(--ihai-lilac));
	border-radius: 13px;
	color: var(--ihai-ink);
	font-size: 12px;
	font-weight: 800;
	height: 38px;
}

.ihai-message--user .ihai-avatar {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

.ihai-message > div:last-child {
	background: rgba(255, 255, 255, 0.09);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 4px 22px 22px 22px;
	min-width: 0;
	padding: 16px 18px;
}

.ihai-message--user > div:last-child {
	background: linear-gradient(135deg, #fff0eb, #efedff);
	border: 0;
	border-radius: 22px 4px 22px 22px;
	color: var(--ihai-ink);
}

.ihai-message strong {
	display: block;
	color: inherit;
	font-size: 13px;
	margin-bottom: 5px;
}

.ihai-message p,
.ihai-message li {
	color: inherit;
	font-size: 16px;
	line-height: 1.6;
}

.ihai-message p {
	margin: 0 0 0.7em;
}

.ihai-message p:last-child {
	margin-bottom: 0;
}

.ihai-message ul {
	margin: 8px 0 4px 20px;
	padding: 0;
}

.ihai-thinking::after {
	content: "";
	display: inline-block;
	width: 1.1em;
	animation: ihai-dots 1.2s steps(4, end) infinite;
}

@keyframes ihai-dots {
	0% { content: ""; }
	25% { content: "."; }
	50% { content: ".."; }
	75%, 100% { content: "..."; }
}

.ihai-sources {
	display: grid;
	gap: 7px;
	margin-top: 15px;
	padding-top: 13px;
	border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.ihai-sources > span {
	color: rgba(255, 255, 255, 0.6);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ihai-sources a {
	color: var(--ihai-peach) !important;
	font-size: 13px;
	line-height: 1.4;
	text-decoration: none;
}

.ihai-sources a:hover,
.ihai-sources a:focus-visible {
	text-decoration: underline;
}

.ihai-prompts {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin: 0 0 14px;
}

.ihai-prompts button {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 999px;
	color: rgba(255, 255, 255, 0.88);
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	line-height: 1.35;
	padding: 10px 15px;
}

.ihai-prompts button:hover,
.ihai-prompts button:focus-visible {
	background: rgba(255, 255, 255, 0.1);
	border-color: var(--ihai-peach);
}

.ihai-form {
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 23px;
	padding: 13px 15px 11px;
}

.ihai-form textarea {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	color: #fff !important;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	min-height: 58px;
	padding: 6px !important;
	resize: none;
	width: 100%;
}

.ihai-form textarea::placeholder {
	color: rgba(255, 255, 255, 0.52);
}

.ihai-form textarea:focus {
	outline: 0;
}

.ihai-honeypot {
	position: absolute !important;
	left: -10000px !important;
	height: 1px !important;
	width: 1px !important;
	overflow: hidden !important;
}

.ihai-compose-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	padding: 5px 2px 0 7px;
}

.ihai-compose-footer small {
	color: rgba(255, 255, 255, 0.52);
	font-size: 12px;
}

.ihai-compose-footer button {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	background: linear-gradient(135deg, var(--ihai-peach), #d0caff);
	border: 0;
	border-radius: 999px;
	color: var(--ihai-ink);
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 800;
	min-height: 46px;
	padding: 10px 18px;
}

.ihai-compose-footer button:disabled {
	cursor: wait;
	opacity: 0.62;
}

.ihai-disclaimer {
	color: rgba(255, 255, 255, 0.56);
	font-size: 12px;
	line-height: 1.5;
	margin: 11px 4px 0;
}

.ihai-processing {
	color: rgba(255, 255, 255, 0.68);
	font-size: 12px;
	line-height: 1.55;
	margin: 6px 4px 0;
}

.ihai-processing a {
	color: var(--ihai-peach) !important;
	font-weight: 700;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.ihai-processing a:hover,
.ihai-processing a:focus-visible {
	color: #fff !important;
}

.ihai-app button:focus-visible,
.ihai-app textarea:focus-visible,
.ihai-app a:focus-visible {
	outline: 3px solid var(--ihai-peach);
	outline-offset: 3px;
}

@media (max-width: 900px) {
	.ihai-app {
		grid-template-columns: 1fr;
		border-radius: 28px;
	}

	.ihai-intro {
		border-bottom: 1px solid var(--ihai-line);
		border-right: 0;
	}

	.ihai-intro ul {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 12px;
	}

	.ihai-boundary {
		margin-top: 0;
	}

	.ihai-messages {
		max-height: 500px;
	}
}

@media (max-width: 600px) {
	.ihai-hero {
		border-radius: 24px;
		margin-bottom: 24px;
	}

	.ihai-hero .ih-report-title {
		font-size: clamp(31px, 11vw, 44px) !important;
	}

	.ihai-intro,
	.ihai-chat-card {
		padding: 25px 20px;
	}

	.ihai-intro ul {
		display: block;
	}

	.ihai-chat-header {
		align-items: flex-start;
	}

	.ihai-message {
		max-width: 96%;
	}

	.ihai-avatar {
		flex-basis: 34px;
		height: 34px;
	}

	.ihai-prompts {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding: 2px 2px 8px;
		scroll-snap-type: x proximity;
	}

	.ihai-prompts button {
		flex: 0 0 auto;
		max-width: 82%;
		scroll-snap-align: start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ihai-thinking::after {
		animation: none;
		content: "…";
	}
}
