/**
 * IMPERVORA AI Concierge -- luxury floating chat skin for the AI Engine chatbot.
 *
 * WHY THIS FILE EXISTS
 * The chatbot uses AI Engine theme `impervora`, whose type is `custom`. AI Engine
 * only registers a stylesheet for themes of type `internal`
 * (Meow_MWAI_Core::enqueue_theme), so a custom theme ships with NO base CSS at
 * all -- the plugin's 110KB layout sheet is never loaded. The theme's own inline
 * style targeted `.mwai-chatbot`, a selector that does not exist in AI Engine
 * 3.6.9 (the root element is `.mwai-chat`), so every rule in it was dead too.
 * The result was an entirely unstyled widget rendering inline in the footer.
 *
 * This sheet therefore owns 100% of the widget's appearance and layout. It is a
 * presentation layer only: no AI Engine option, prompt, model or endpoint is
 * touched by it. Every selector is scoped to `.mwai-impervora-theme`, the class
 * AI Engine puts on the chatbot root for this theme, so nothing here can reach
 * any other element on the site.
 *
 * PLACEMENT CONTRACT
 * The bottom-right corner is already occupied by `.impervora-fab` (z-index 9990,
 * bottom 16px, 144px tall at rest and 196px once its scroll-to-top button
 * appears). The launcher and the panel are lifted above it by
 * `--imp-cc-bottom`, which impervora-concierge.js recomputes from the FAB's live
 * bounding box. The value below is the static fallback for the no-JS case.
 * z-index 9995 sits above the FAB (9990) but below Astra's cart drawer (10000).
 *
 * DOM CONTRACT (AI Engine 3.6.9 -- verified against the rendered page)
 *   .mwai-chat.mwai-window.mwai-bottom-right.mwai-animation-zoom.mwai-impervora-theme
 *     .mwai-trigger.mwai-open-button
 *       .mwai-icon-text-container > .mwai-icon-text-close, .mwai-icon-text
 *       .mwai-icon-container > img.mwai-icon
 *     .mwai-window-box
 *       .mwai-header > .mwai-name, .mwai-buttons > .mwai-close-button
 *       .mwai-body
 *         .mwai-conversation > .mwai-reply.mwai-ai|.mwai-user, .mwai-shortcuts, .mwai-blocks
 *         .mwai-input > .mwai-input-text > textarea, button.mwai-input-submit
 *         .mwai-footer > .mwai-tools, .mwai-compliance
 * State classes on the root: .mwai-open .mwai-opening .mwai-closing .mwai-blocked
 */

.mwai-chat.mwai-impervora-theme {
	/* Ink. Matte black, not pure black -- pure black reads as a system dialog. */
	--imp-cc-ink: #0e0e0e;
	--imp-cc-ink-2: #191919;
	--imp-cc-ink-3: #242424;

	/* Champagne gold. #C9A86A is specified for this widget; the systemic site
	   gold is #C6A667. The two are within a hair of each other and both are
	   scoped, so they never sit side by side. */
	--imp-cc-gold: #c9a86a;
	--imp-cc-gold-soft: #e2cd9e;
	--imp-cc-gold-deep: #a8874a;

	--imp-cc-ivory: #f7f4ef;
	--imp-cc-ivory-2: #efeae1;
	--imp-cc-paper: #ffffff;
	--imp-cc-charcoal: #232323;
	--imp-cc-muted: #8a8a8a;
	--imp-cc-hairline: #e4ded4;

	--imp-cc-serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
	--imp-cc-sans: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

	--imp-cc-radius: 20px;
	--imp-cc-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
	--imp-cc-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

	/* Overwritten at runtime by impervora-concierge.js from the live FAB rect. */
	--imp-cc-bottom: 226px;
	--imp-cc-right: 20px;

	position: fixed !important;
	right: var(--imp-cc-right);
	bottom: calc(var(--imp-cc-bottom) + env(safe-area-inset-bottom, 0px));
	/* A zero-size anchor: the launcher and the panel are absolutely positioned
	   against this corner, so the widget can never take part in page flow,
	   stretch to full width, or push content down. */
	width: 0;
	height: 0;
	max-height: none !important;
	max-width: none !important;
	margin: 0;
	padding: 0;
	z-index: 9995;
	pointer-events: none;
	font-family: var(--imp-cc-sans);
	font-size: 14px;
	line-height: 1.55;
	color: var(--imp-cc-charcoal);
	-webkit-font-smoothing: antialiased;
}

/* AI Engine mounts and unmounts elements on an opacity transition and relies on
   transitionend to finish the teardown. Without a real transition on
   .mwai-transition the greeting bubble would never unmount after dismissal. */
.mwai-chat.mwai-impervora-theme .mwai-transition {
	opacity: 0;
	transition: opacity 200ms var(--imp-cc-ease);
}

.mwai-chat.mwai-impervora-theme .mwai-transition.mwai-transition-visible {
	opacity: 1;
}

/* The root itself carries .mwai-transition; it must never be dimmed. */
.mwai-chat.mwai-impervora-theme.mwai-transition {
	opacity: 1;
}

.mwai-chat.mwai-impervora-theme *,
.mwai-chat.mwai-impervora-theme *::before,
.mwai-chat.mwai-impervora-theme *::after {
	box-sizing: border-box;
}


/* ==========================================================================
   1. FLOATING LAUNCHER
   ========================================================================== */

.mwai-chat.mwai-impervora-theme .mwai-trigger {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 62px;
	height: 62px;
	pointer-events: auto;
}

.mwai-chat.mwai-impervora-theme .mwai-icon-container {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 62px;
	height: 62px;
	padding: 0;
	border: 1px solid var(--imp-cc-gold);
	border-radius: 50%;
	background: radial-gradient(circle at 32% 26%, var(--imp-cc-ink-3), var(--imp-cc-ink) 70%);
	box-shadow:
		0 10px 30px rgba(14, 14, 14, 0.28),
		0 2px 6px rgba(14, 14, 14, 0.18),
		inset 0 1px 0 rgba(226, 205, 158, 0.16);
	cursor: pointer;
	transition:
		transform 260ms var(--imp-cc-ease),
		box-shadow 260ms var(--imp-cc-ease),
		border-color 260ms var(--imp-cc-ease);
}

.mwai-chat.mwai-impervora-theme .mwai-icon-container:hover {
	transform: translate3d(0, -3px, 0);
	border-color: var(--imp-cc-gold-soft);
	box-shadow:
		0 16px 38px rgba(14, 14, 14, 0.34),
		0 2px 6px rgba(14, 14, 14, 0.2),
		inset 0 1px 0 rgba(226, 205, 158, 0.28);
}

.mwai-chat.mwai-impervora-theme .mwai-icon-container:active {
	transform: translate3d(0, 0, 0) scale(0.96);
}

.mwai-chat.mwai-impervora-theme .mwai-icon-container:focus-visible {
	outline: 2px solid var(--imp-cc-gold);
	outline-offset: 3px;
}

/* AI Engine writes width/height attributes on the <img> from the iconSize
   param; the glyph is sized here instead so the disc keeps its proportions. */
.mwai-chat.mwai-impervora-theme .mwai-icon-container .mwai-icon {
	width: 27px !important;
	height: 27px !important;
	display: block;
	transition: transform 260ms var(--imp-cc-ease);
}

.mwai-chat.mwai-impervora-theme .mwai-icon-container:hover .mwai-icon {
	transform: scale(1.06);
}

/* Attention pulse. Driven by impervora-concierge.js, which adds the class for
   one cycle every ~25s while the panel is closed. */
@keyframes imp-cc-pulse {
	0% {
		box-shadow:
			0 10px 30px rgba(14, 14, 14, 0.28),
			0 0 0 0 rgba(201, 168, 106, 0.5);
	}
	70% {
		box-shadow:
			0 10px 30px rgba(14, 14, 14, 0.28),
			0 0 0 16px rgba(201, 168, 106, 0);
	}
	100% {
		box-shadow:
			0 10px 30px rgba(14, 14, 14, 0.28),
			0 0 0 0 rgba(201, 168, 106, 0);
	}
}

.mwai-chat.mwai-impervora-theme.imp-cc-pulse .mwai-icon-container {
	animation: imp-cc-pulse 2200ms var(--imp-cc-ease) 2;
}

/* The launcher belongs to the closed state only. */
.mwai-chat.mwai-impervora-theme.mwai-open:not(.mwai-opening) .mwai-trigger {
	display: none;
}

.mwai-chat.mwai-impervora-theme.mwai-closing .mwai-trigger {
	display: block;
}

.mwai-chat.mwai-impervora-theme.mwai-opening .mwai-icon-container {
	transform: scale(0.82);
	opacity: 0.25;
}


/* ==========================================================================
   2. GREETING BUBBLE
   ========================================================================== */

.mwai-chat.mwai-impervora-theme .mwai-icon-text-container {
	position: absolute;
	right: 2px;
	bottom: 76px;
	width: max-content;
	max-width: 244px;
	pointer-events: auto;
}

.mwai-chat.mwai-impervora-theme .mwai-icon-text {
	position: relative;
	padding: 13px 17px;
	border: 1px solid var(--imp-cc-hairline);
	border-radius: 16px 16px 4px 16px;
	background: var(--imp-cc-paper);
	color: var(--imp-cc-charcoal);
	font-family: var(--imp-cc-serif);
	font-size: 16px;
	line-height: 1.35;
	letter-spacing: 0.01em;
	text-align: left;
	box-shadow: 0 14px 34px rgba(14, 14, 14, 0.16);
	cursor: pointer;
	animation: imp-cc-bubble-in 320ms var(--imp-cc-ease) both;
	transition: transform 220ms var(--imp-cc-ease), border-color 220ms var(--imp-cc-ease);
}

.mwai-chat.mwai-impervora-theme .mwai-icon-text::after {
	/* Gold hairline tail pointing at the launcher. */
	content: "";
	position: absolute;
	right: 18px;
	bottom: -6px;
	width: 11px;
	height: 11px;
	background: var(--imp-cc-paper);
	border-right: 1px solid var(--imp-cc-hairline);
	border-bottom: 1px solid var(--imp-cc-hairline);
	transform: rotate(45deg);
}

.mwai-chat.mwai-impervora-theme .mwai-icon-text:hover {
	transform: translate3d(0, -2px, 0);
	border-color: var(--imp-cc-gold);
}

@keyframes imp-cc-bubble-in {
	from {
		opacity: 0;
		transform: translate3d(0, 8px, 0) scale(0.96);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.mwai-chat.mwai-impervora-theme .mwai-icon-text-close {
	position: absolute;
	top: -9px;
	right: -9px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	/* Icon-only control: padding MUST stay 0 or Astra's bare `button`/round
	   control rules inflate it into a blank oval. */
	padding: 0;
	border: 1px solid var(--imp-cc-hairline);
	border-radius: 50%;
	background: var(--imp-cc-ink);
	color: var(--imp-cc-ivory);
	font-size: 10px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(14, 14, 14, 0.24);
	transition: background 200ms var(--imp-cc-ease), color 200ms var(--imp-cc-ease);
}

.mwai-chat.mwai-impervora-theme .mwai-icon-text-close:hover {
	background: var(--imp-cc-gold);
	color: var(--imp-cc-ink);
}

/* Once the visitor has met the concierge, the teaser is retired for the rest of
   the session (class set by impervora-concierge.js from sessionStorage). */
.mwai-chat.mwai-impervora-theme.imp-cc-greeted .mwai-icon-text-container {
	display: none !important;
}


/* ==========================================================================
   3. PANEL SHELL
   ========================================================================== */

.mwai-chat.mwai-impervora-theme .mwai-window-box {
	position: absolute;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 700px;
	max-height: calc(100vh - var(--imp-cc-bottom) - env(safe-area-inset-bottom, 0px) - 24px);
	border: 1px solid rgba(201, 168, 106, 0.35);
	border-radius: var(--imp-cc-radius);
	background: var(--imp-cc-paper);
	box-shadow: var(--imp-cc-shadow);
	pointer-events: auto;
	transform-origin: calc(100% - 26px) calc(100% - 26px);
	opacity: 0;
	transform: scale(0.94);
	transition:
		opacity 250ms var(--imp-cc-ease),
		transform 250ms var(--imp-cc-ease);
}

@supports (height: 100dvh) {
	.mwai-chat.mwai-impervora-theme .mwai-window-box {
		max-height: calc(100dvh - var(--imp-cc-bottom) - env(safe-area-inset-bottom, 0px) - 24px);
	}
}

.mwai-chat.mwai-impervora-theme:not(.mwai-open):not(.mwai-opening):not(.mwai-closing) .mwai-window-box {
	display: none;
}

.mwai-chat.mwai-impervora-theme.mwai-opening .mwai-window-box {
	opacity: 1;
	transform: scale(0.97);
}

.mwai-chat.mwai-impervora-theme.mwai-open .mwai-window-box {
	opacity: 1;
	transform: scale(1);
}

.mwai-chat.mwai-impervora-theme.mwai-closing .mwai-window-box {
	opacity: 0;
	transform: scale(0.94);
	transition:
		opacity 180ms ease-in,
		transform 180ms ease-in;
}

.mwai-chat.mwai-impervora-theme .mwai-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	background: var(--imp-cc-paper);
}


/* ==========================================================================
   4. HEADER
   ==========================================================================
   AI Engine injects an inline <style> into the widget that hides .mwai-header
   with `display: none !important` below 760px, and substitutes a
   `.mwai-mobile-header` only when its own isMobile flag is true. That flag is
   computed as `document.innerWidth <= 768` -- `document.innerWidth` is always
   undefined, so the flag is permanently false and the substitute header never
   renders. Left alone the panel would have no header at all on mobile. The
   injected rules are (0,4,0) and (0,5,0); adding `.mwai-impervora-theme` to the
   chain outranks both, which is why the selectors below are written long. */

.mwai-chat.mwai-window.mwai-animation-zoom.mwai-impervora-theme .mwai-header,
.mwai-chat.mwai-window.mwai-animation-zoom.mwai-impervora-theme.mwai-opening .mwai-header,
.mwai-chat.mwai-window.mwai-animation-zoom.mwai-impervora-theme.mwai-open .mwai-header {
	display: flex !important;
}

.mwai-chat.mwai-impervora-theme .mwai-header {
	position: relative;
	flex: 0 0 auto;
	align-items: flex-start;
	gap: 12px;
	padding: 18px 20px 16px;
	background: linear-gradient(180deg, var(--imp-cc-ink-2) 0%, var(--imp-cc-ink) 100%);
	/* The gold divider beneath the header. */
	border-bottom: 1px solid var(--imp-cc-gold);
	color: var(--imp-cc-ivory);
	user-select: none;
}

.mwai-chat.mwai-impervora-theme .mwai-header .mwai-name {
	flex: 1 1 auto;
	min-width: 0;
	font-family: var(--imp-cc-serif);
	font-size: 20px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0.02em;
	color: var(--imp-cc-paper);
}

.mwai-chat.mwai-impervora-theme .mwai-header .mwai-name::after {
	content: "Luxury Jewelry Advisor";
	display: block;
	margin-top: 5px;
	font-family: var(--imp-cc-sans);
	font-size: 10px;
	font-weight: 400;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--imp-cc-gold);
}

.mwai-chat.mwai-impervora-theme .mwai-header .mwai-buttons {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 6px;
	margin-top: 2px;
}

.mwai-chat.mwai-impervora-theme .mwai-header .mwai-buttons > * {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	/* Icon-only controls: padding MUST be 0. Astra's unscoped `button` rule
	   otherwise pads them into blank ovals with a 0px glyph. */
	padding: 0;
	border: 1px solid rgba(244, 242, 239, 0.16);
	border-radius: 50%;
	background: transparent;
	color: var(--imp-cc-ivory);
	cursor: pointer;
	transition:
		background 200ms var(--imp-cc-ease),
		border-color 200ms var(--imp-cc-ease),
		color 200ms var(--imp-cc-ease);
}

.mwai-chat.mwai-impervora-theme .mwai-header .mwai-buttons > *:hover {
	border-color: var(--imp-cc-gold);
	background: rgba(201, 168, 106, 0.16);
	color: var(--imp-cc-gold-soft);
}

.mwai-chat.mwai-impervora-theme .mwai-header .mwai-buttons > *:focus-visible {
	outline: 2px solid var(--imp-cc-gold);
	outline-offset: 2px;
}

/* AI Engine ships the close control as an empty div, so the glyph is drawn
   here rather than inherited from a plugin sprite. */
.mwai-chat.mwai-impervora-theme .mwai-header .mwai-close-button::before {
	content: "";
	width: 11px;
	height: 11px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M18 6 6 18M6 6l12 12' stroke='black' stroke-width='2.4' stroke-linecap='round' fill='none'/></svg>") center / contain no-repeat;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M18 6 6 18M6 6l12 12' stroke='black' stroke-width='2.4' stroke-linecap='round' fill='none'/></svg>") center / contain no-repeat;
}

/* Minimize control, added by impervora-concierge.js (AI Engine renders no such
   button). It collapses the panel to its header bar and keeps the
   conversation; Close returns the widget to the launcher. */
.mwai-chat.mwai-impervora-theme .mwai-header .imp-cc-minimize {
	/* Appended after Close so React never has to reconcile around it; `order`
	   puts it where it belongs -- minimize, then close. */
	order: -1;
}

/* Not scoped to .mwai-header: the control is also placed in the mobile header,
   which has no .mwai-buttons group. */
.mwai-chat.mwai-impervora-theme .imp-cc-minimize::before {
	content: "";
	width: 11px;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
}

/* Collapsed: the dash becomes a restore square. */
.mwai-chat.mwai-impervora-theme.imp-cc-minimized .imp-cc-minimize::before {
	width: 11px;
	height: 11px;
	border: 2px solid currentColor;
	border-radius: 2px;
	background: none;
}

/* --------------------------------------------------------------------------
   4b. MOBILE HEADER
   --------------------------------------------------------------------------
   On a touch device AI Engine swaps `.mwai-header` for `.mwai-mobile-header`,
   a different element with a different structure (title + close, no button
   group). Verified on a real mobile context, not inferred. It is dressed to
   match the desktop header exactly so the two read as one design. */

.mwai-chat.mwai-impervora-theme .mwai-mobile-header {
	position: relative;
	display: flex;
	flex: 0 0 auto;
	align-items: flex-start;
	gap: 10px;
	padding: 15px 16px 13px;
	background: linear-gradient(180deg, var(--imp-cc-ink-2) 0%, var(--imp-cc-ink) 100%);
	border-bottom: 1px solid var(--imp-cc-gold);
	color: var(--imp-cc-ivory);
	user-select: none;
}

.mwai-chat.mwai-impervora-theme .mwai-mobile-header-title {
	flex: 1 1 auto;
	min-width: 0;
	order: 0;
	font-family: var(--imp-cc-serif);
	font-size: 18px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0.02em;
	color: var(--imp-cc-paper);
}

.mwai-chat.mwai-impervora-theme .mwai-mobile-header-title::after {
	content: "Luxury Jewelry Advisor";
	display: block;
	margin-top: 5px;
	font-family: var(--imp-cc-sans);
	font-size: 10px;
	font-weight: 400;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--imp-cc-gold);
}

/* WordPress rewrites the 💎 in the title into an <img class="emoji">; Astra's
   unscoped `img { height: auto }` would otherwise leave it at its natural size. */
.mwai-chat.mwai-impervora-theme .mwai-mobile-header-title img.emoji,
.mwai-chat.mwai-impervora-theme .mwai-header .mwai-name img.emoji {
	display: inline-block;
	width: 0.9em;
	height: 0.9em;
	margin: 0 0.16em 0 0;
	vertical-align: -0.08em;
}

.mwai-chat.mwai-impervora-theme .mwai-mobile-header .imp-cc-minimize,
.mwai-chat.mwai-impervora-theme .mwai-mobile-header-close {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin-top: 1px;
	/* Icon-only controls: padding stays 0. */
	padding: 0;
	border: 1px solid rgba(244, 242, 239, 0.16);
	border-radius: 50%;
	background: transparent;
	color: var(--imp-cc-ivory);
	cursor: pointer;
	transition:
		background 200ms var(--imp-cc-ease),
		border-color 200ms var(--imp-cc-ease),
		color 200ms var(--imp-cc-ease);
}

.mwai-chat.mwai-impervora-theme .mwai-mobile-header .imp-cc-minimize {
	order: 1;
}

.mwai-chat.mwai-impervora-theme .mwai-mobile-header-close {
	order: 2;
}

.mwai-chat.mwai-impervora-theme .mwai-mobile-header .imp-cc-minimize:hover,
.mwai-chat.mwai-impervora-theme .mwai-mobile-header-close:hover {
	border-color: var(--imp-cc-gold);
	background: rgba(201, 168, 106, 0.16);
	color: var(--imp-cc-gold-soft);
}

.mwai-chat.mwai-impervora-theme .mwai-mobile-header-close svg {
	width: 15px;
	height: 15px;
	fill: none;
	stroke: currentColor;
}

/* Collapsed state: header bar only. */
.mwai-chat.mwai-impervora-theme.imp-cc-minimized .mwai-window-box {
	height: auto;
}

.mwai-chat.mwai-impervora-theme.imp-cc-minimized .mwai-body {
	display: none;
}


/* ==========================================================================
   5. CONVERSATION
   ========================================================================== */

.mwai-chat.mwai-impervora-theme .mwai-conversation {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 20px 18px 8px;
	background:
		linear-gradient(180deg, rgba(247, 244, 239, 0.85) 0%, var(--imp-cc-paper) 180px);
	scrollbar-width: thin;
	scrollbar-color: rgba(201, 168, 106, 0.5) transparent;
}

.mwai-chat.mwai-impervora-theme .mwai-conversation::-webkit-scrollbar {
	width: 6px;
}

.mwai-chat.mwai-impervora-theme .mwai-conversation::-webkit-scrollbar-thumb {
	border-radius: 3px;
	background: rgba(201, 168, 106, 0.45);
}

.mwai-chat.mwai-impervora-theme .mwai-reply {
	display: flex;
	flex-direction: column;
	max-width: 88%;
	margin: 0 0 14px;
}

.mwai-chat.mwai-impervora-theme .mwai-reply.mwai-user {
	margin-left: auto;
	align-items: flex-end;
}

.mwai-chat.mwai-impervora-theme .mwai-reply .mwai-name {
	display: block;
	margin: 0 0 5px 2px;
	font-size: 9px;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--imp-cc-muted);
}

.mwai-chat.mwai-impervora-theme .mwai-reply.mwai-ai .mwai-name {
	color: var(--imp-cc-gold-deep);
}

.mwai-chat.mwai-impervora-theme .mwai-reply .mwai-text {
	display: block;
	padding: 12px 16px;
	font-size: 14px;
	line-height: 1.6;
	word-break: break-word;
}

.mwai-chat.mwai-impervora-theme .mwai-reply.mwai-ai .mwai-text {
	border: 1px solid var(--imp-cc-hairline);
	border-radius: 16px 16px 16px 4px;
	background: var(--imp-cc-ivory);
	color: var(--imp-cc-charcoal);
}

.mwai-chat.mwai-impervora-theme .mwai-reply.mwai-user .mwai-text {
	border: 1px solid var(--imp-cc-ink);
	border-radius: 16px 16px 4px 16px;
	background: var(--imp-cc-ink);
	color: var(--imp-cc-paper);
}

.mwai-chat.mwai-impervora-theme .mwai-reply.mwai-system .mwai-text,
.mwai-chat.mwai-impervora-theme .mwai-reply.mwai-error .mwai-text {
	border: 1px solid #e0c3c3;
	border-radius: 12px;
	background: #fcf5f5;
	color: #8a3d3d;
}

/* Timestamps. AI Engine renders none, so impervora-concierge.js stamps each
   turn with a data attribute as it appears and the label is drawn as a
   pseudo-element -- no node is ever inserted into React's tree. Messages
   restored from local memory are left unstamped rather than given a
   fabricated time. */
.mwai-chat.mwai-impervora-theme .mwai-reply[data-imp-time]::after {
	content: attr(data-imp-time);
	margin: 5px 3px 0;
	font-size: 10px;
	letter-spacing: 0.08em;
	color: var(--imp-cc-muted);
}

.mwai-chat.mwai-impervora-theme .mwai-reply .mwai-text p {
	margin: 0 0 0.7em;
}

.mwai-chat.mwai-impervora-theme .mwai-reply .mwai-text p:last-child {
	margin-bottom: 0;
}

.mwai-chat.mwai-impervora-theme .mwai-reply .mwai-text a {
	color: var(--imp-cc-gold-deep);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.mwai-chat.mwai-impervora-theme .mwai-reply.mwai-user .mwai-text a {
	color: var(--imp-cc-gold-soft);
}

.mwai-chat.mwai-impervora-theme .mwai-reply .mwai-text ul,
.mwai-chat.mwai-impervora-theme .mwai-reply .mwai-text ol {
	/* Astra sets an unscoped `ul { margin: 0 0 1.5em 3em }`; reset it here. */
	margin: 0.4em 0 0.6em;
	padding-left: 1.15em;
}

.mwai-chat.mwai-impervora-theme .mwai-reply .mwai-text img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

.mwai-chat.mwai-impervora-theme .mwai-reply-actions {
	display: flex;
	gap: 6px;
	margin-top: 6px;
	opacity: 0.55;
	transition: opacity 200ms var(--imp-cc-ease);
}

.mwai-chat.mwai-impervora-theme .mwai-reply-actions:hover {
	opacity: 1;
}

.mwai-chat.mwai-impervora-theme .mwai-reply-actions.mwai-hidden {
	opacity: 0;
}

.mwai-chat.mwai-impervora-theme .mwai-reply-actions svg {
	width: 15px;
	height: 15px;
	stroke: var(--imp-cc-muted);
	fill: none;
	cursor: pointer;
}

.mwai-chat.mwai-impervora-theme .mwai-empty-hint {
	font-family: var(--imp-cc-serif);
	font-size: 17px !important;
	color: var(--imp-cc-muted);
}


/* ==========================================================================
   6. TYPING INDICATOR
   ==========================================================================
   BouncingDots is rendered with inline styles (9px, #a3a1a1), so the gold
   treatment has to be forced. */

.mwai-chat.mwai-impervora-theme .mwai-bouncing-loader {
	justify-content: flex-start !important;
	height: 30px !important;
	padding-left: 4px;
}

.mwai-chat.mwai-impervora-theme .mwai-bouncing-dot {
	width: 7px !important;
	height: 7px !important;
	margin: 5px 0 0 6px !important;
	background-color: var(--imp-cc-gold) !important;
	opacity: 0.9 !important;
}


/* ==========================================================================
   7. QUICK ACTIONS + SUGGESTION CHIPS
   ==========================================================================
   Rendered by AI Engine inside .mwai-conversation from the
   mwai_chatbot_shortcuts filter. Both groups are <button class="mwai-shortcut">;
   the group is chosen by the extra class supplied server-side. */

.mwai-chat.mwai-impervora-theme .mwai-shortcuts {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 2px 0 14px;
}

.mwai-chat.mwai-impervora-theme .mwai-shortcuts::before {
	content: "How may we help?";
	flex: 0 0 100%;
	margin-bottom: 2px;
	font-size: 9px;
	font-weight: 500;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--imp-cc-gold-deep);
}

.mwai-chat.mwai-impervora-theme .mwai-shortcut {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	/* 44px minimum touch target on coarse pointers is restored in the media
	   query below; 34px keeps the welcome cluster from pushing the greeting
	   out of view on a 700px panel. */
	min-height: 34px;
	margin: 0;
	padding: 7px 12px;
	border: 1px solid var(--imp-cc-gold);
	border-radius: 999px;
	background: var(--imp-cc-paper);
	color: var(--imp-cc-charcoal);
	font-family: var(--imp-cc-sans);
	font-size: 11px;
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: 0.05em;
	text-transform: none;
	text-align: left;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: none;
	transition:
		background 220ms var(--imp-cc-ease),
		color 220ms var(--imp-cc-ease),
		border-color 220ms var(--imp-cc-ease),
		transform 220ms var(--imp-cc-ease);
}

.mwai-chat.mwai-impervora-theme .mwai-shortcut:hover:not(:disabled) {
	background: var(--imp-cc-ink);
	border-color: var(--imp-cc-ink);
	color: var(--imp-cc-gold-soft);
	transform: translate3d(0, -1px, 0);
}

.mwai-chat.mwai-impervora-theme .mwai-shortcut:focus-visible {
	outline: 2px solid var(--imp-cc-gold);
	outline-offset: 2px;
}

.mwai-chat.mwai-impervora-theme .mwai-shortcut:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.mwai-chat.mwai-impervora-theme .mwai-shortcut .mwai-icon {
	display: inline-flex;
	align-items: center;
	font-size: 13px;
	line-height: 1;
}

.mwai-chat.mwai-impervora-theme .mwai-shortcut .mwai-label {
	display: inline-block;
}

/* Suggested questions: quieter, ivory, no gold outline. */
.mwai-chat.mwai-impervora-theme .mwai-shortcut.imp-cc-suggest {
	border-color: var(--imp-cc-hairline);
	background: var(--imp-cc-ivory);
	color: #4a4a4a;
	padding: 7px 12px;
	font-size: 10.5px;
	font-weight: 400;
	letter-spacing: 0.03em;
	white-space: normal;
}

.mwai-chat.mwai-impervora-theme .mwai-shortcut.imp-cc-suggest:hover:not(:disabled) {
	background: var(--imp-cc-ivory-2);
	border-color: var(--imp-cc-gold);
	color: var(--imp-cc-ink);
}

/* A hairline above the first chip separates the two groups without needing a
   wrapper element inside React's tree. */
.mwai-chat.mwai-impervora-theme .mwai-shortcut.imp-cc-suggest-first {
	margin-left: 0;
}

.mwai-chat.mwai-impervora-theme .mwai-shortcuts .imp-cc-suggest-first {
	position: relative;
	margin-top: 12px;
}

.mwai-chat.mwai-impervora-theme .mwai-shortcuts .imp-cc-suggest-first::before {
	content: "";
	position: absolute;
	top: -8px;
	left: 0;
	width: 46px;
	height: 1px;
	background: var(--imp-cc-gold);
	opacity: 0.5;
}

/* Once the visitor has said something of their own the welcome cluster has
   done its job. Degrades to "chips stay visible" where :has() is unsupported. */
.mwai-chat.mwai-impervora-theme .mwai-conversation:has(.mwai-reply.mwai-user) .mwai-shortcuts {
	display: none;
}


/* ==========================================================================
   8. CONSENT / CONTENT BLOCKS
   ==========================================================================
   AI Engine's GDPR consent block (an AI Engine setting, untouched here) locks
   the input until it is accepted, so it is styled as a deliberate gate rather
   than left as raw text. */

.mwai-chat.mwai-impervora-theme .mwai-blocks {
	margin: 4px 0 14px;
}

.mwai-chat.mwai-impervora-theme .mwai-blocks > div {
	padding: 14px 16px;
	border: 1px solid var(--imp-cc-hairline);
	border-radius: 14px;
	background: var(--imp-cc-ivory);
}

.mwai-chat.mwai-impervora-theme .mwai-blocks p {
	margin: 0 0 11px;
	font-size: 11.5px;
	line-height: 1.55;
	color: #5c5c5c;
}

.mwai-chat.mwai-impervora-theme .mwai-blocks button {
	width: 100%;
	min-height: 40px;
	padding: 11px 16px;
	border: 1px solid var(--imp-cc-ink);
	border-radius: 999px;
	background: var(--imp-cc-ink);
	color: var(--imp-cc-gold-soft);
	font-family: var(--imp-cc-sans);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 220ms var(--imp-cc-ease), color 220ms var(--imp-cc-ease);
}

.mwai-chat.mwai-impervora-theme .mwai-blocks button:hover {
	background: var(--imp-cc-gold);
	border-color: var(--imp-cc-gold);
	color: var(--imp-cc-ink);
}


/* ==========================================================================
   9. INPUT
   ========================================================================== */

.mwai-chat.mwai-impervora-theme .mwai-input {
	display: flex;
	flex: 0 0 auto;
	align-items: flex-end;
	gap: 9px;
	padding: 12px 16px;
	border-top: 1px solid var(--imp-cc-hairline);
	background: var(--imp-cc-paper);
}

.mwai-chat.mwai-impervora-theme .mwai-input-text {
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	align-items: center;
	padding: 4px 14px;
	border: 1px solid var(--imp-cc-hairline);
	border-radius: 22px;
	background: var(--imp-cc-ivory);
	transition: border-color 200ms var(--imp-cc-ease), background 200ms var(--imp-cc-ease);
}

.mwai-chat.mwai-impervora-theme .mwai-input-text:focus-within {
	border-color: var(--imp-cc-gold);
	background: var(--imp-cc-paper);
}

.mwai-chat.mwai-impervora-theme .mwai-input-text.mwai-locked {
	opacity: 0.6;
}

.mwai-chat.mwai-impervora-theme .mwai-input-text textarea {
	width: 100%;
	max-height: 96px;
	min-height: 34px !important;
	margin: 0;
	padding: 7px 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--imp-cc-charcoal);
	font-family: var(--imp-cc-sans);
	font-size: 13.5px;
	line-height: 1.45;
	resize: none;
	outline: none;
	overflow-y: auto;
}

.mwai-chat.mwai-impervora-theme .mwai-input-text textarea:focus {
	border: 0;
	box-shadow: none;
	outline: none;
}

.mwai-chat.mwai-impervora-theme .mwai-input-text textarea::placeholder {
	color: var(--imp-cc-muted);
	font-size: 12.5px;
	opacity: 1;
}

.mwai-chat.mwai-impervora-theme .mwai-input-submit {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin: 0;
	padding: 12px 20px;
	border: 1px solid var(--imp-cc-gold);
	border-radius: 999px;
	background: linear-gradient(180deg, var(--imp-cc-gold-soft) 0%, var(--imp-cc-gold) 100%);
	color: var(--imp-cc-ink);
	font-family: var(--imp-cc-sans);
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(201, 168, 106, 0.3);
	transition:
		background 220ms var(--imp-cc-ease),
		color 220ms var(--imp-cc-ease),
		box-shadow 220ms var(--imp-cc-ease),
		transform 220ms var(--imp-cc-ease);
}

.mwai-chat.mwai-impervora-theme .mwai-input-submit:hover:not(:disabled) {
	background: var(--imp-cc-ink);
	border-color: var(--imp-cc-ink);
	color: var(--imp-cc-gold-soft);
	transform: translate3d(0, -1px, 0);
	box-shadow: 0 8px 20px rgba(14, 14, 14, 0.24);
}

.mwai-chat.mwai-impervora-theme .mwai-input-submit:focus-visible {
	outline: 2px solid var(--imp-cc-ink);
	outline-offset: 2px;
}

.mwai-chat.mwai-impervora-theme .mwai-input-submit:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	box-shadow: none;
}


/* ==========================================================================
   10. FOOTER
   ========================================================================== */

.mwai-chat.mwai-impervora-theme .mwai-footer {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 10px;
	padding: 0 16px calc(12px + env(safe-area-inset-bottom, 0px));
	background: var(--imp-cc-paper);
}

.mwai-chat.mwai-impervora-theme .mwai-tools {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 6px;
}

.mwai-chat.mwai-impervora-theme .mwai-file-upload-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	/* Icon-only control: padding stays 0. */
	padding: 0;
	border: 1px solid var(--imp-cc-hairline);
	border-radius: 50%;
	color: var(--imp-cc-muted);
	cursor: pointer;
	transition: color 200ms var(--imp-cc-ease), border-color 200ms var(--imp-cc-ease);
}

.mwai-chat.mwai-impervora-theme .mwai-file-upload-icon:hover {
	border-color: var(--imp-cc-gold);
	color: var(--imp-cc-gold-deep);
}

.mwai-chat.mwai-impervora-theme .mwai-file-upload-icon svg {
	width: 13px;
	height: 13px;
}

/* The compliance notice is long by design (it is a real disclosure). It is
   clamped to two lines and faded out rather than cut mid-word, and opens on
   hover or keyboard focus so the full text is always reachable. */
.mwai-chat.mwai-impervora-theme .mwai-compliance {
	flex: 1 1 auto;
	min-width: 0;
	max-height: 27px;
	overflow: hidden;
	font-size: 9px;
	line-height: 1.45;
	letter-spacing: 0.02em;
	color: var(--imp-cc-muted);
	-webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0, 0, 0, 0.15) 100%);
	mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0, 0, 0, 0.15) 100%);
	cursor: help;
	transition: max-height 300ms var(--imp-cc-ease);
}

.mwai-chat.mwai-impervora-theme .mwai-compliance:hover,
.mwai-chat.mwai-impervora-theme .mwai-compliance:focus-within {
	max-height: 140px;
	-webkit-mask-image: none;
	mask-image: none;
}

.mwai-chat.mwai-impervora-theme .mwai-compliance a {
	color: var(--imp-cc-gold-deep);
}


/* ==========================================================================
   11. RESPONSIVE
   ==========================================================================
   The panel is deliberately never full-bleed: it stays a floating card at every
   width, as specified. */

@media (max-width: 782px) {
	/* WordPress admin bar becomes 46px tall and position:fixed at this width;
	   nothing here depends on it, but the launcher keeps clear of the FAB via
	   the runtime measurement regardless. */
	.mwai-chat.mwai-impervora-theme .mwai-window-box {
		width: 360px;
		height: 620px;
	}
}

@media (max-width: 600px) {
	.mwai-chat.mwai-impervora-theme {
		--imp-cc-right: 12px;
	}

	.mwai-chat.mwai-impervora-theme .mwai-window-box {
		width: min(360px, calc(100vw - 24px));
		max-width: calc(100vw - 24px);
		height: 600px;
	}

	.mwai-chat.mwai-impervora-theme .mwai-icon-text-container {
		max-width: min(220px, calc(100vw - 48px));
	}

	.mwai-chat.mwai-impervora-theme .mwai-header {
		padding: 15px 16px 13px;
	}

	.mwai-chat.mwai-impervora-theme .mwai-header .mwai-name {
		font-size: 18px;
	}

	.mwai-chat.mwai-impervora-theme .mwai-conversation {
		padding: 16px 14px 6px;
	}

	.mwai-chat.mwai-impervora-theme .mwai-input {
		padding: 10px 12px;
	}

	.mwai-chat.mwai-impervora-theme .mwai-input-submit {
		padding: 12px 15px;
		letter-spacing: 0.12em;
	}

	.mwai-chat.mwai-impervora-theme .mwai-footer {
		padding: 0 12px calc(10px + env(safe-area-inset-bottom, 0px));
	}
}

@media (pointer: coarse) {
	.mwai-chat.mwai-impervora-theme .mwai-shortcut {
		min-height: 44px;
	}

	.mwai-chat.mwai-impervora-theme .mwai-header .mwai-buttons > * {
		width: 34px;
		height: 34px;
	}

	.mwai-chat.mwai-impervora-theme .mwai-icon-text-close {
		width: 26px;
		height: 26px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mwai-chat.mwai-impervora-theme *,
	.mwai-chat.mwai-impervora-theme *::before,
	.mwai-chat.mwai-impervora-theme *::after {
		animation-duration: 1ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 1ms !important;
	}

	/* .mwai-transition still needs a real transition or the greeting bubble
	   never unmounts -- 1ms above keeps transitionend firing. */
	.mwai-chat.mwai-impervora-theme .mwai-icon-container:hover,
	.mwai-chat.mwai-impervora-theme .mwai-shortcut:hover,
	.mwai-chat.mwai-impervora-theme .mwai-input-submit:hover {
		transform: none;
	}
}

/* Printing a floating chat panel is never wanted. */
@media print {
	.mwai-chat.mwai-impervora-theme {
		display: none !important;
	}
}


/* ==========================================================================
   GREETING BUBBLE -- narrow-viewport footprint

   At 390px the 244px bubble rendered about 220px wide, reaching from x156 to
   x376 across a 350px content column. Trimming it and its type reduces how
   much it can ever sit over, and pairs with the scroll gate in
   impervora-concierge.js which keeps it off the hero CTAs entirely.
   ========================================================================== */

@media (max-width: 921px) {

	.mwai-chat.mwai-impervora-theme .mwai-icon-text-container {
		max-width: 188px;
	}

	.mwai-chat.mwai-impervora-theme .mwai-icon-text {
		padding: 11px 14px;
		font-size: 15px;
	}

	/* Held by impervora-concierge.js until the visitor has scrolled past the
	   hero; released, then retired for the session a few seconds later. */
	html.imp-cc-greet-hold .mwai-chat.mwai-impervora-theme .mwai-icon-text-container {
		display: none !important;
	}
}
