/* EML Report Chat — frontend chat popup. */

:root {
	--emlrc-accent: #7c3aed;
	--emlrc-accent-dark: #6d28d9;
	--emlrc-light-blue: #69D0F7;
	--emlrc-dark-blue: #013879;
}

body.emlrc-modal-open {
	overflow: hidden;
}

/* ---------------------------------------------------------------- */
/* Modal shell (Mutual-Benefits style: dim + centred rounded panel) */
/* ---------------------------------------------------------------- */


form.emlrc-form .emlrc-input{
	margin: 0 !important;
	border: 1px solid transparent;
	outline: none;
	box-shadow: none;
}
form.emlrc-form .emlrc-input:focus{
	border-color: transparent;
	box-shadow: none;
}
.emlrc-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(10, 8, 40, 0.62);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	overflow-y: auto;
}

.emlrc-modal__backdrop {
	position: absolute;
	inset: 0;
}

.emlrc-modal__panel {
	position: relative;
	z-index: 1;
	width: min(1000px, 100%);
	max-height: min(88vh, 940px);
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border-radius: 18px;
	box-shadow: 0 40px 90px rgba(5, 4, 30, 0.5);
	overflow: hidden;
	margin: auto;
}

.emlrc-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 50%;
	background: #17172b;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: transform 0.15s ease;
}

/* Hello Elementor's reset.css styles bare `button` at (0,1,1) — scope our
   buttons one class deeper so they always win the cascade. */
.emlrc-modal .emlrc-modal__close {
	background: #17172b;
	color: #fff;
	position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
}

.emlrc-modal__close:hover {
	transform: scale(1.06);
}

.emlrc-modal__close svg {
	display: block;
	width: 18px;
	height: 18px;
	margin: 0;
	flex: 0 0 auto;
}

/* ---------------------------------------------------------------- */
/* App body                                                         */
/* ---------------------------------------------------------------- */

.emlrc-app {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1;
}

.emlrc-body {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1;
	padding: 40px 50px 46px;
	gap: 0;
}

.emlrc-report-name {
	display: none;
	margin: 0 0 15px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #013879;
    padding-right: 48px;
}

.emlrc-title {
    margin: 30px 0 30px;
    font-size: clamp(22px, 2.6vw, 28px);
    line-height: 1.2;
    color: #000000;
    text-align: center;
}

/* Chat mode: the greeting steps aside for the conversation. */
.emlrc-app.emlrc-chat .emlrc-title {
	display: none;
}

.emlrc-app.emlrc-chat .emlrc-report-name {
	padding-right: 0;
	margin-bottom: 14px;
}

/* Search pill — pre-chat: purple border like the landing AI popup. */
.emlrc-form {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	flex: 0 0 auto;
	height: 66px;
	padding: 0 24px;
	background: #fff;
	border: 1px solid hsl(196.48deg 89.87% 69.02% / 58%);
	border-radius: 999px;
	transition: border-color 0.15s ease;
}

.emlrc-form:focus-within {
    border-color: var(--emlrc-light-blue);
    box-shadow: 0 0 0 3px #69d0f738;
}

.emlrc-search-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 21px;
	height: 27px;
	color: #013879;
}

.emlrc-search-icon svg {
	width: 21px;
	height: 27px;
}

.emlrc-input {
	flex: 1;
	min-width: 0;
	height: 100%;
	padding: 0;
	border: 0;
	outline: none;
	background: transparent;
	font-size: 16px;
	color: #101a33;
}

.emlrc-input::placeholder {
	color: #9aa0ad;
}

/* Landing hides the enter affordance inside the pill. */
.emlrc-enter {
	display: none;
}

/* Chat mode pill: slimmer, muted grey border, smaller sparkle (landing). */
.emlrc-app.emlrc-chat .emlrc-form {
	height: 58px;
	border-color: rgb(74 74 74 / 45%);
}

.emlrc-app.emlrc-chat .emlrc-search-icon,
.emlrc-app.emlrc-chat .emlrc-search-icon svg {
	width: 17px;
	height: 22px;
}

.emlrc-app.emlrc-chat .emlrc-input {
	font-size: 15px;
}

/* Disclaimer (bottom) — landing style: centred, muted, roomy. */
.emlrc-disclaimer {
	flex: 0 0 auto;
	margin: 40px 0 0;
	font-size: 15px;
	line-height: 1.4;
	color: #a7b1b7;
	text-align: center;
}

/* Conversation log */
.emlrc-result {
	flex: 0 1 auto;
	min-height: 0;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 22px;
	padding: 4px 4px 8px;
	scrollbar-width: thin;
}

.emlrc-app:not(.emlrc-chat) .emlrc-result:empty {
	display: none;
}

/* Chat mode: the log takes the room between the title and the follow-up pill. */
.emlrc-app.emlrc-chat .emlrc-result {
	flex: 1 1 auto;
	max-height: 48vh;
	margin-top: 20px;
	margin-bottom: 20px;
}

/* "Try asking" suggestions — landing style: grey rounded rows, lilac hover. */
.emlrc-suggest {
	flex: 0 0 auto;
	padding: 25px 0 0;
}

/* The list hides once a question has been asked (chat started). */
.emlrc-app.emlrc-chat .emlrc-suggest {
	display: none;
}

.emlrc-suggest-label {
	display: block;
	margin: 0 0 10px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #101a33;
}

.emlrc-suggest-list {
	display: block;
}

.emlrc-app .emlrc-suggest-item {
	display: block;
	width: auto;
	padding: 10px 14px;
	margin-bottom: 10px;
	border: 0;
	border-radius: 10px;
	background: #e9ecee;
	color: #000;
	font-size: 14px;
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
	transition: background 0.12s ease;
}

.emlrc-app .emlrc-suggest-item:hover {
    background: hsl(196.48deg 89.87% 69.02% / 57%);
    color: #000;
}

/* Conversation log */
.emlrc-result {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 4px 4px 8px;
	scrollbar-width: thin;
}

.emlrc-app:not(.emlrc-chat) .emlrc-result:empty {
	display: none;
}

.emlrc-app.emlrc-chat .emlrc-result {
	max-height: 52vh;
}

/* User bubble */
.emlrc-q {
	align-self: flex-end;
	max-width: 85%;
	padding: 10px 16px;
	border-radius: 18px 18px 4px 18px;
	background: var(--emlrc-light-blue);
	color: #000000;
	font-size: 14.5px;
	line-height: 1.45;
}

/* AI answer */
.emlrc-ai-label {
	display: none;
	align-items: center;
	gap: 6px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--emlrc-accent);
}

.emlrc-ai-spark {
	display: inline-flex;
	width: 14px;
	height: 14px;
}

.emlrc-ai-spark svg {
	width: 14px;
	height: 14px;
}

.emlrc-answer {
    line-height: 1.5;
    color: #1d2433;
    background: #f7f7f9;
    border-radius: 16px;
    padding: 16px 18px;
    margin: 0 0 14px;
    font-size: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.emlrc-answer p {
	margin: 0 0 10px;
}

.emlrc-answer ul {
	margin: 0 0 10px;
	padding-left: 20px;
}

.emlrc-answer li {
	margin: 0 0 6px;
}

.emlrc-cite {
	color: var(--emlrc-dark-blue);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.emlrc-pages {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	display: none;
}

.emlrc-pages-label {
	font-size: 12.5px;
	font-weight: 600;
	color: #7a8090;
}

.emlrc-page-btn {
	display: inline-block;
	padding: 6px 14px;
	border: 1px solid var(--emlrc-accent);
	border-radius: 999px;
	color: var(--emlrc-accent-dark);
	font-size: 12.5px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.emlrc-page-btn:hover {
	background: var(--emlrc-accent);
	color: #fff;
}

/* Not found / refusal */
.emlrc-notfound {
	padding: 12px 16px;
	border-radius: 12px;
	background: #f4f1fa;
	border: 1px solid rgb(124 58 237 / 18%);
	font-size: 14px;
	line-height: 1.55;
	color: #3c3f52;
}

/* Error */
.emlrc-error {
	padding: 12px 16px;
	border-radius: 12px;
	background: #fdf1f1;
	border: 1px solid rgb(220 38 38 / 25%);
	font-size: 14px;
	line-height: 1.5;
	color: #8a1f1f;
}

/* Loading dots */
.emlrc-loading {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: #7a8090;
	font-size: 13.5px;
}

.emlrc-dots {
	display: inline-flex;
	gap: 4px;
}

.emlrc-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #69d0f7;
	animation: emlrc-bounce 1.2s infinite ease-in-out;
}

.emlrc-dot:nth-child(2) {
	animation-delay: 0.15s;
}

.emlrc-dot:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes emlrc-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
	30% { transform: translateY(-5px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.emlrc-dot {
		animation: none;
	}
}

/* Embedded (shortcode) variant */
.emlrc-embed .emlrc-body {
	padding: 0;
}
/* Mobile ≤767px: while the chat popup is open, hide the launcher icon —
   it overlaps the follow-up input on narrow screens. body.emlrc-modal-open
   is toggled by emlrc.js on open/close. */
   @media (max-width: 767px) {
	body.emlrc-modal-open .eml-chi-stage {
		display: none;
	}
}

/* Mobile */
@media (max-width: 767px) {
	button.emlrc-suggest-item {
		text-wrap: wrap;
		white-space: normal;
	}
	.emlrc-title {
		font-size: clamp(21px, 2.6vw, 28px);
		line-height: 1.4;
	}
	.emlrc-app.emlrc-chat .emlrc-input {
		font-size: 14px;
		padding: 0 10px !important;
	}
	.emlrc-modal .emlrc-modal__close {
		top: 12px;
		right: 12px;
		width: 34px;
		height: 34px;
	}
	.emlrc-disclaimer {
		font-size: 13px;
		line-height: 1.4;
	}
	.emlrc-suggest-label{
		font-size: 14px;
	}
}
@media (max-width: 600px) {
	.emlrc-modal {
		padding: 12px;
		align-items: flex-end;
	}

	.emlrc-modal__panel {
		width: 100%;
		max-height: 92vh;
		border-radius: 20px;
	}

    .emlrc-body {
        padding: 36px 18px 18px;
    }

	.emlrc-app.emlrc-chat .emlrc-result {
		max-height: 58vh;
	}
}

