/* Patched for the Ericom Service Desk demo by desk/eva/patch-eva.mjs. Do not edit; rebuild. */
/*
 * Eva dock: a messenger-style window, bottom right, in Ericom's colours (SPEC-8 section 5).
 * Brand header with a back chevron, white body with the conversation as bubbles, a ruled
 * footer with the message box and the call controls, and a round brand launcher. Mounted
 * into #eva-dock, which sits outside main#main so the pjax router never replaces it.
 *
 * Colours come from the site's tokens.css: #0081c9 is Ericom's primary blue. White text on it
 * is 4.0:1, enough for the 24 px title and the icons but not for body-size text, so the
 * visitor's bubbles use the darker brand blue (#006aa6, 5.6:1).
 */

.eva-dock {
	--eva-blue: #0081c9;
	--eva-blue-dark: #006aa6;
	--eva-blue-soft: rgb(0 129 201 / 0.1);
	--eva-ink: #282b2c;
	--eva-body: #404040;
	--eva-muted: #5f6468;
	--eva-rule: #e3e5e6;
	--eva-foot-rule: #8a8f93;
	--eva-bubble: #ececec;
	--eva-surface: #ffffff;
	--eva-surface-2: #f5f6f7;
	--eva-danger: #b3261e;
	--eva-radius: 10px;
	--eva-shadow: 0 12px 40px rgb(20 24 26 / 0.16), 0 2px 8px rgb(20 24 26 / 0.08);
	--eva-gap: 24px;
	--eva-panel-w: 380px;
	--eva-launch: 60px;
	position: fixed;
	inset-block-end: var(--eva-gap);
	inset-inline-end: var(--eva-gap);
	z-index: 900;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--eva-ink);
	line-height: 1.4;
}

.eva-dock *,
.eva-dock *::before,
.eva-dock *::after { box-sizing: border-box; }

.eva-dock button,
.eva-dock textarea { font: inherit; }

.eva-dock :focus-visible { outline: 3px solid var(--eva-ink); outline-offset: 2px; }

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

.eva-dock svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.eva-dock svg .eva-fill { fill: currentColor; stroke: none; }

/* ---- Launcher: a round brand button; Eva closed, a down chevron open -------------------- */

.eva-dock__launcher {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	border-radius: 100px;
}

.eva-dock__launcher[hidden] { display: none; }
.eva-dock__launcher:focus-visible { outline-offset: 4px; }

.eva-dock__label {
	padding: 10px 16px;
	border-radius: 100px;
	background: var(--eva-surface);
	box-shadow: var(--eva-shadow);
	color: var(--eva-ink);
	font-size: 0.95rem;
	font-weight: 600;
	white-space: nowrap;
	transition: color 0.15s ease;
}

.eva-dock__launcher:hover .eva-dock__label { color: var(--eva-blue-dark); }
.eva-dock[data-open="true"] .eva-dock__label { display: none; }

.eva-dock__bubble {
	position: relative;
	display: grid;
	place-items: center;
	flex: none;
	width: var(--eva-launch);
	height: var(--eva-launch);
	border-radius: 50%;
	background: var(--eva-blue);
	color: #fff;
	box-shadow: 0 6px 18px rgb(20 24 26 / 0.28), 0 1px 4px rgb(20 24 26 / 0.16);
	transition: background-color 0.15s ease;
}

.eva-dock__launcher:hover .eva-dock__bubble { background: var(--eva-blue-dark); }

/* Eva inside the brand circle: the stage flight lands on this face. */
.eva-dock__face {
	position: relative;
	display: block;
	width: calc(var(--eva-launch) - 8px);
	height: calc(var(--eva-launch) - 8px);
	border-radius: 50%;
	background: var(--eva-surface);
}

.eva-dock__face img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

.eva-dock__chev { display: none; }
.eva-dock__chev svg { width: 30px; height: 30px; stroke-width: 2.4; }
.eva-dock[data-open="true"] .eva-dock__face { display: none; }
.eva-dock[data-open="true"] .eva-dock__chev { display: block; }

/* The ring: a thin brand halo that breathes outward while Eva listens. */
.eva-dock__ring {
	position: absolute;
	inset: -6px;
	border: 2px solid var(--eva-blue);
	border-radius: 50%;
	opacity: 0;
	pointer-events: none;
}

.eva-dock[data-state="listening"] .eva-dock__ring {
	animation: eva-ring 1.8s ease-out infinite;
}

.eva-dock[data-state="speaking"] .eva-dock__ring {
	opacity: 0.55;
	animation: eva-ring-soft 1.2s ease-in-out infinite;
}

.eva-dock[data-state="connecting"] .eva-dock__ring,
.eva-dock[data-state="calling"] .eva-dock__ring,
.eva-dock[data-state="thinking"] .eva-dock__ring { opacity: 0.4; }

@keyframes eva-ring {
	0% { transform: scale(1); opacity: 0.7; }
	100% { transform: scale(1.35); opacity: 0; }
}

@keyframes eva-ring-soft {
	0%, 100% { transform: scale(1); opacity: 0.55; }
	50% { transform: scale(1.08); opacity: 0.25; }
}

/* ---- Window ------------------------------------------------------------------------------ */

.eva-dock__panel {
	display: flex;
	flex-direction: column;
	width: var(--eva-panel-w);
	/* Open, the launcher sits under the window as its chevron, so leave it room. */
	height: min(600px, calc(100vh - 2 * var(--eva-gap) - var(--eva-launch) - 16px));
	border-radius: 4px;
	background: var(--eva-surface);
	box-shadow: var(--eva-shadow);
	overflow: hidden;
	transform-origin: 100% 100%;
	animation: eva-panel-in 0.18s ease-out;
}

.eva-dock__panel[hidden] { display: none; }

@keyframes eva-panel-in {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to { opacity: 1; transform: none; }
}

/* Header: the solid brand bar. */
.eva-dock__head {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 60px;
	padding: 8px 10px 8px 8px;
	background: var(--eva-blue);
	color: #fff;
	box-shadow: 0 2px 4px rgb(20 24 26 / 0.18);
}

.eva-dock__head :focus-visible { outline: 2px solid #fff; outline-offset: -4px; }

.eva-dock__icon-btn,
.eva-dock__head-btn {
	display: grid;
	place-items: center;
	flex: none;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: #fff;
	cursor: pointer;
}

.eva-dock__icon-btn svg,
.eva-dock__head-btn svg { width: 24px; height: 24px; stroke-width: 2.2; }
.eva-dock__icon-btn:hover,
.eva-dock__head-btn:hover:not(:disabled) { background: rgb(255 255 255 / 0.16); }
.eva-dock__head-btn:disabled { opacity: 0.45; cursor: default; }

.eva-dock__id {
	display: flex;
	flex: 1;
	align-items: center;
	flex-wrap: wrap;
	gap: 2px 12px;
	min-width: 0;
}

.eva-dock__title {
	margin: 0;
	color: #fff;
	font-size: 1.5rem;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0;
}

.eva-dock__chipcol {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
}

.eva-dock__chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 9px;
	border-radius: 100px;
	background: rgb(255 255 255 / 0.18);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 600;
	white-space: nowrap;
}

.eva-dock__chip::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}

.eva-dock[data-tone="active"] .eva-dock__chip { background: #fff; color: var(--eva-blue-dark); }
.eva-dock[data-tone="error"] .eva-dock__chip { background: #fff; color: var(--eva-danger); }

.eva-dock__note {
	font-size: 0.72rem;
	color: #fff;
	white-space: nowrap;
}

/* ---- Body: the conversation ---------------------------------------------------------------- */

.eva-dock__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
	padding: 20px 16px 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--eva-surface);
}

/* Everything sits at the bottom, under empty space, until the conversation fills the window. */
.eva-dock__intro {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-block-start: auto;
	padding-block-end: 4px;
	text-align: center;
}

.eva-dock__avatar {
	position: relative;
	display: block;
	flex: none;
	width: 64px;
	height: 64px;
	margin-block-end: 8px;
	border-radius: 50%;
	box-shadow: 0 0 0 2px var(--eva-surface), 0 0 0 4px var(--eva-blue);
}

.eva-dock__avatar img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

.eva-dock__name { margin: 0; font-size: 1rem; font-weight: 600; color: var(--eva-ink); }
.eva-dock__role { margin: 0; font-size: 0.82rem; color: var(--eva-muted); }

.eva-dock__start {
	margin: 18px 0 12px;
	color: var(--eva-muted);
	font-size: 0.9rem;
	text-align: center;
}

.eva-dock__log {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.eva-dock__log:empty { display: none; }

/* A message: Eva's on the left with the round mark, the visitor's on the right in brand blue. */
.eva-msg {
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr);
	column-gap: 10px;
	align-items: center;
	margin: 0;
	padding-inline-end: 28px;
}

.eva-msg__mark {
	grid-column: 1;
	grid-row: 1;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	box-shadow: 0 0 0 3px rgb(0 129 201 / 0.12);
}

.eva-msg__bubble {
	grid-column: 2;
	grid-row: 1;
	justify-self: start;
	max-width: 100%;
	margin: 0;
	padding: 11px 15px;
	border-radius: 12px;
	background: var(--eva-bubble);
	color: #1d1f20;
	font-size: 0.95rem;
	font-weight: 400;
	line-height: 1.45;
	overflow-wrap: anywhere;
	white-space: pre-wrap;
}

.eva-msg__meta,
.eva-msg__error {
	grid-column: 2;
	margin: 5px 0 0;
	color: var(--eva-muted);
	font-size: 0.8rem;
}

.eva-msg__error { color: var(--eva-danger); }

.eva-msg--visitor {
	grid-template-columns: minmax(0, 1fr);
	padding-inline: 48px 0;
}

.eva-msg--visitor .eva-msg__bubble,
.eva-msg--visitor .eva-msg__meta,
.eva-msg--visitor .eva-msg__error { grid-column: 1; justify-self: end; text-align: end; }

.eva-msg--visitor .eva-msg__bubble { background: var(--eva-blue-dark); color: #fff; }
.eva-msg--visitor[data-failed="true"] .eva-msg__bubble { opacity: 0.7; }

/* ---- The state card: Eva's welcome, a status line, or a block in the conversation ------- */

.eva-dock__card { margin-block-start: 14px; }
.eva-dock__card:empty { display: none; }

.eva-dock__card[data-kind="welcome"] { margin-block-start: 0; }
.eva-dock__log:not(:empty) + .eva-dock__card[data-kind="welcome"] { margin-block-start: 14px; }

.eva-dock__card[data-kind="status"] {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.eva-dock__card[data-kind="status"] .eva-card__title { font-size: 0.92rem; color: var(--eva-body); }
.eva-dock__card[data-kind="status"] .eva-card__meta { margin-block-start: 2px; }

.eva-dock__card[data-kind="block"] {
	padding: 14px 16px;
	border: 1px solid var(--eva-rule);
	border-radius: 12px;
	background: var(--eva-surface);
}

.eva-card__title { margin: 0 0 4px; font-size: 1.05rem; font-weight: 600; color: var(--eva-ink); }
.eva-card__line { margin: 0; font-size: 0.92rem; color: var(--eva-body); }
.eva-card__line + .eva-card__line { margin-block-start: 4px; }
.eva-card__meta { margin: 10px 0 0; font-size: 0.82rem; color: var(--eva-muted); }

.eva-card__row { display: flex; align-items: center; gap: 12px; }
.eva-card__row .eva-card__title { margin: 0; }

.eva-card__big {
	margin: 0 0 6px;
	font-size: 1.6rem;
	font-weight: 300;
	letter-spacing: -0.01em;
	color: var(--eva-ink);
	font-variant-numeric: tabular-nums;
}

.eva-card__company {
	margin-block-start: 10px;
	padding: 10px 12px;
	border-radius: 8px;
	background: var(--eva-surface-2);
}

/* Name and website on one line, so the block stays short in the conversation. */
.eva-card__company-head { display: flex; align-items: baseline; gap: 8px; margin: 0; min-width: 0; }
.eva-card__company-name { font-size: 0.92rem; font-weight: 600; }
.eva-card__company a { color: #00669e; font-size: 0.85rem; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.eva-card__link { color: #00669e; }

.eva-card__company-summary {
	display: -webkit-box;
	margin: 4px 0 0;
	overflow: hidden;
	font-size: 0.85rem;
	color: var(--eva-body);
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.eva-card__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 14px; }

.eva-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 40px;
	padding: 8px 18px;
	border: 0;
	border-radius: 100px;
	background: var(--eva-blue-dark);
	color: #fff;
	font-size: 0.92rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.eva-btn:hover { background: #00557f; color: #fff; }

.eva-btn--quiet { background: var(--eva-surface-2); color: var(--eva-ink); box-shadow: inset 0 0 0 1px var(--eva-rule); }
.eva-btn--quiet:hover { background: #e9ebec; color: var(--eva-ink); }

.eva-btn--danger { background: var(--eva-danger); }
.eva-btn--danger:hover { background: #8f1e18; }

/* Voice bars: five short bars that move while Eva listens or speaks. */
.eva-bars { display: inline-flex; align-items: center; gap: 3px; height: 22px; }

.eva-bars span {
	width: 3px;
	height: 6px;
	border-radius: 2px;
	background: var(--eva-blue);
	opacity: 0.85;
}

.eva-dock[data-state="listening"] .eva-bars span { animation: eva-bar 1.1s ease-in-out infinite; }
.eva-dock[data-state="speaking"] .eva-bars span { animation: eva-bar 0.7s ease-in-out infinite; }
.eva-dock[data-state="thinking"] .eva-bars span,
.eva-dock[data-state="connecting"] .eva-bars span,
.eva-dock[data-state="transferring"] .eva-bars span,
.eva-dock[data-state="calling"] .eva-bars span { animation: eva-dot 1.2s ease-in-out infinite; }

.eva-bars span:nth-child(2) { animation-delay: 0.12s !important; }
.eva-bars span:nth-child(3) { animation-delay: 0.24s !important; }
.eva-bars span:nth-child(4) { animation-delay: 0.36s !important; }
.eva-bars span:nth-child(5) { animation-delay: 0.48s !important; }

@keyframes eva-bar {
	0%, 100% { height: 6px; }
	50% { height: 20px; }
}

@keyframes eva-dot {
	0%, 100% { opacity: 0.25; }
	50% { opacity: 1; }
}

/* Phone mode: Eva is on the visitor's phone; the call timer sits above the conversation. */
.eva-dock__phone {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 12px 0 0;
	padding: 10px 12px;
	border-radius: 8px;
	background: var(--eva-blue-soft);
	color: #00669e;
	font-size: 0.9rem;
	font-weight: 600;
}

.eva-dock__phone[hidden] { display: none; }
.eva-dock__phone-clock { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---- Footer: the ruled message box, then the call controls ---------------------------------- */

.eva-dock__foot {
	border-block-start: 1px solid var(--eva-foot-rule);
	background: var(--eva-surface);
}

.eva-dock__compose {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin-block-start: -1px;
	padding: 12px 10px 4px 16px;
}

.eva-dock__compose[hidden] { display: none; }

.eva-dock__input {
	flex: 1;
	min-width: 0;
	min-height: 44px;
	max-height: 112px;
	margin: 0;
	padding: 10px 0;
	border: 0;
	background: none;
	color: var(--eva-ink);
	/* 16 px: iOS zooms the page into any smaller field. */
	font-size: 1rem;
	line-height: 1.5;
	resize: none;
}

.eva-dock__input::placeholder { color: #6f7377; opacity: 1; }
/* Focus shows as the footer rule turning brand blue and thicker, the way a messenger does it. */
.eva-dock__input:focus-visible { outline: none; }
.eva-dock__compose:focus-within { box-shadow: inset 0 2px 0 var(--eva-blue); }
.eva-dock__input:disabled { cursor: default; }

.eva-dock__send {
	display: grid;
	place-items: center;
	flex: none;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--eva-blue);
	cursor: pointer;
}

.eva-dock__send svg { width: 26px; height: 26px; }
.eva-dock__send:hover:not(:disabled) { background: var(--eva-blue-soft); }
.eva-dock__send:disabled { color: #a3a7aa; cursor: default; }

.eva-dock__controls {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	padding: 6px 12px 12px;
}

.eva-dock__controls .eva-btn { min-height: 36px; padding: 6px 14px; font-size: 0.86rem; }
.eva-dock__controls .eva-btn svg { width: 16px; height: 16px; }
.eva-dock__foot .eva-btn[hidden] { display: none; }
.eva-dock__foot .eva-btn[disabled] { opacity: 0.45; cursor: default; }
.eva-dock__foot .eva-btn--quiet[aria-pressed="true"] { background: var(--eva-ink); color: #fff; box-shadow: none; }
.eva-dock__call { flex: 1; }
/* Desk demo: Talk to Eva and Chat with Eva share the footer. */
.eva-dock__chat { flex: 1; }

/* During the stage flight the flown video is Eva; the launcher waits underneath. */
.eva-stage-flight .eva-dock__launcher { visibility: hidden; }

/*
 * Loop video as the avatar (EvaDock.setAvatarVideo). The 16:9 frame is scaled so the circle
 * shows Eva's face: centre and radius match FACE in eva-stage.js (x of the width, y and r of
 * the height), so the stage video lands on the launcher without a jump.
 */
.eva-avatar-clip {
	--face-x: 0.492;
	--face-y: 0.257;
	--face-r: 0.243;
	position: absolute;
	inset: 0;
	overflow: hidden;
	border-radius: 50%;
	background: #d9dcde;
}

.eva-avatar-video {
	position: absolute;
	top: calc(50% - var(--face-y) * 50% / var(--face-r));
	left: calc(50% - var(--face-x) * 50% / var(--face-r) * 16 / 9);
	width: calc(50% / var(--face-r) * 16 / 9);
	height: calc(50% / var(--face-r));
	max-width: none;
	object-fit: fill;
	pointer-events: none;
}

/* ---- Phones: the window spans the width, pinned to the bottom ------------------------------- */

@media (max-width: 480px) {
	.eva-dock[data-open="true"] {
		inset-inline: 0;
		inset-block-end: 0;
	}

	/* The back chevron closes the window here; the launcher would cover the footer. */
	.eva-dock[data-open="true"] .eva-dock__launcher { display: none; }

	.eva-dock__panel {
		width: 100%;
		height: 72vh;
		border-radius: 0;
	}

	.eva-dock__label { padding: 8px 14px; font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
	.eva-dock__panel { animation: none; }
	.eva-dock__ring,
	.eva-dock[data-state] .eva-dock__ring,
	.eva-dock[data-state] .eva-bars span { animation: none !important; }
	.eva-dock[data-state="listening"] .eva-dock__ring { opacity: 0.6; }
	.eva-dock[data-state="listening"] .eva-bars span,
	.eva-dock[data-state="speaking"] .eva-bars span { height: 12px; }
}

@media print {
	.eva-dock { display: none; }
}

/* ---- Files Eva can read (SPEC-3 B) ---------------------------------------------------- */

.eva-dock__foot .eva-dock__clip { flex: 0 0 auto; width: 44px; padding-inline: 0; display: inline-grid; place-items: center; }
.eva-dock__foot .eva-dock__clip svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.eva-dock[data-mode="phone"] .eva-dock__clip { display: none; }

.eva-dock__file {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 16px 8px;
	padding: 8px 10px;
	border: 1px solid var(--eva-rule);
	border-radius: var(--eva-radius);
	background: var(--eva-surface-2);
}
.eva-dock__file[hidden] { display: none; }
.eva-dock__file[data-state="error"] { border-color: rgb(179 38 30 / 0.35); background: rgb(179 38 30 / 0.05); }
.eva-file__pic { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 6px; overflow: hidden; display: grid; place-items: center; background: var(--eva-surface); color: var(--eva-blue); }
.eva-file__pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eva-file__pic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.eva-file__text { flex: 1; min-width: 0; }
.eva-file__text p { margin: 0; }
.eva-file__name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eva-file__line { font-size: 0.82rem; color: var(--eva-muted); }
.eva-dock__file[data-state="sending"] .eva-file__line::after { content: ""; display: inline-block; width: 0.9em; animation: eva-file-dots 1.2s steps(4, end) infinite; overflow: hidden; vertical-align: bottom; white-space: nowrap; }
.eva-dock__file[data-state="error"] .eva-file__line { color: var(--eva-danger); }
.eva-file__btn { flex: 0 0 auto; padding: 6px 10px; font-size: 0.8rem; }
.eva-dock[data-drop="true"] .eva-dock__panel { outline: 3px dashed var(--eva-blue); outline-offset: 4px; }
@keyframes eva-file-dots { from { width: 0; } to { width: 0.9em; } }
@media (prefers-reduced-motion: reduce) { .eva-dock__file[data-state="sending"] .eva-file__line::after { animation: none; } }

/* ---- Eva's slot: she stands above the card (SPEC-4 A) --------------------------------- */

/*
 * The slot is on (data-slot="on") once a face has been asked for, or Eva is on the visitor's
 * phone, on screens 480 px and wider. eva-dock.js sets the sizes: --eva-slot-h is her height
 * with the card open (440 TV, 340 iPad landscape, 260, 200), --eva-slot-min minimised (220),
 * --eva-slot-aspect the keyed frame's width over height. Below 480 px none of this applies.
 */

.eva-dock__stage[hidden],
.eva-dock__pill[hidden],
.eva-dock__note[hidden],
.eva-dock__avatar[hidden] { display: none; }

.eva-dock[data-slot="on"] {
	--eva-slot-cur: var(--eva-slot-min);
	--eva-slot-w: calc(var(--eva-slot-cur) * var(--eva-slot-aspect));
	gap: 0;
	align-items: center;
	/* She is wider than the window on the bigger screens; keep all of her on screen. */
	inset-inline-end: max(var(--eva-gap), calc((var(--eva-slot-w) - var(--eva-panel-w)) / 2 + 12px));
}

.eva-dock[data-slot="on"][data-open="true"] { --eva-slot-cur: var(--eva-slot-h); }

.eva-dock__stage {
	display: flex;
	flex-direction: column;
	align-items: center;
	transition: opacity 0.3s ease-out;
}

.eva-dock__stage-media {
	position: relative;
	width: var(--eva-slot-w);
	height: var(--eva-slot-cur);
	cursor: default;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	/* Minimised there is no card in front of her waist; fade the cut instead. */
	-webkit-mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
	mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
}

.eva-dock[data-open="false"] .eva-dock__stage-media { cursor: pointer; }

/* With the card open its top hides the bottom 8 per cent of her, so the cut never shows. */
.eva-dock[data-slot="on"][data-open="true"] .eva-dock__stage-media {
	margin-block-end: calc(var(--eva-slot-cur) * -0.08);
	-webkit-mask-image: none;
	mask-image: none;
}

/*
 * With Eva standing on the window its height is fixed (10 Nov 2026): a window that grew and
 * shrank with each state moved her up and down. 480 px leaves room for the conversation
 * between the header and the footer; phone mode adds the 40 px "On the phone" row. A short
 * viewport still caps it, and the conversation scrolls inside the body.
 */
.eva-dock[data-slot="on"] { --eva-panel-h: 480px; }
.eva-dock[data-slot="on"][data-mode="phone"] { --eva-panel-h: 520px; }

.eva-dock[data-slot="on"] .eva-dock__panel {
	position: relative;
	z-index: 1;
	height: var(--eva-panel-h);
	max-height: min(560px, calc(100vh - 2 * var(--eva-gap) - 0.92 * var(--eva-slot-h)));
}

.eva-dock__still,
.eva-dock__canvas {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: 50% 100%;
	transform-origin: 50% 100%;
	transition: opacity 0.3s ease-out;
	-webkit-user-drag: none;
}

/* The face takes over from the still on its first frame, and hands back if it fails or stops. */
.eva-dock__canvas { opacity: 0; }
.eva-dock[data-face="live"] .eva-dock__canvas { opacity: 1; }
.eva-dock[data-face="live"] .eva-dock__still { opacity: 0; }

/* Grounds her: a soft dark ellipse where she meets the top of the card. */
.eva-dock__shadow {
	position: absolute;
	inset-inline-start: 50%;
	inset-block-end: 2%;
	/* Wider than her shoulders, so it shows either side of her on the card's top edge. */
	width: 100%;
	height: 12%;
	transform: translateX(-50%);
	border-radius: 50%;
	background: radial-gradient(closest-side, rgb(20 24 26 / 0.32), rgb(20 24 26 / 0));
	filter: blur(6px);
	pointer-events: none;
}

/*
 * While the face connects or recovers, a slow sheen across the still says something is
 * happening without a spinner turning her into a loading state. The still masks it, so the
 * light runs across her and never across the page beside her (ported from the Tess guide).
 */
.eva-dock[data-face="connecting"] .eva-dock__stage-media::after,
.eva-dock[data-face="recovering"] .eva-dock__stage-media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(112deg, rgb(255 255 255 / 0) 42%, rgb(255 255 255 / 0.32) 50%, rgb(255 255 255 / 0) 58%);
	background-size: 260% 100%;
	background-repeat: no-repeat;
	-webkit-mask: url("/eva/eva-still.webp") bottom center / contain no-repeat;
	mask: url("/eva/eva-still.webp") bottom center / contain no-repeat;
	animation: eva-sheen 1.8s linear infinite;
	pointer-events: none;
}

@keyframes eva-sheen {
	from { background-position: 130% 0; }
	to { background-position: -30% 0; }
}

/* A face that has failed for good: the still breathes so she never looks dead. */
.eva-dock[data-face="failed"] .eva-dock__still { animation: eva-breathe 5s ease-in-out infinite; }

@keyframes eva-breathe {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.012); }
}

/* Phone mode: no lip sync is possible, so the loop is her picture, a rounded 16:9 tile. */
.eva-dock__tile { display: none; }

.eva-dock[data-mode="phone"] .eva-dock__still,
.eva-dock[data-mode="phone"] .eva-dock__canvas,
.eva-dock[data-mode="phone"] .eva-dock__shadow,
.eva-dock[data-mode="phone"] .eva-dock__stage-media::after { display: none; }

.eva-dock[data-mode="phone"] .eva-dock__stage-media {
	-webkit-mask-image: none;
	mask-image: none;
}

.eva-dock[data-mode="phone"] .eva-dock__tile {
	position: absolute;
	inset-inline: 0;
	inset-block-end: 0;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 14px;
	background: #000 url("/eva/attract-poster.jpg") 49.2% 25.7% / cover no-repeat;
	box-shadow: var(--eva-shadow);
}

/* Open, the tile sits on the card rather than behind it. */
.eva-dock[data-mode="phone"][data-open="true"] .eva-dock__tile { inset-block-end: 8%; }

.eva-dock__tile-video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* FACE in eva-stage.js: keep her face in frame if the tile is ever not 16:9. */
	object-position: 49.2% 25.7%;
	pointer-events: none;
}

/* Minimised: a pill under her with what she is doing; it and the slot reopen the card. */
.eva-dock__pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-block-start: 8px;
	padding: 8px 16px;
	border: 0;
	border-radius: 100px;
	background: var(--eva-surface);
	box-shadow: var(--eva-shadow);
	color: var(--eva-ink);
	font-size: 0.9rem;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
}

.eva-dock__pill::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--eva-muted);
}

.eva-dock[data-tone="active"] .eva-dock__pill::before { background: var(--eva-blue); }
.eva-dock[data-tone="error"] .eva-dock__pill::before { background: var(--eva-danger); }
.eva-dock__pill:hover { color: var(--eva-blue-dark); }

/* During the stage flight the flown loop is Eva; the slot and the card wait, then fade in. */
.eva-stage-flight .eva-dock__stage { opacity: 0; }
.eva-stage-flight .eva-dock[data-slot="on"] .eva-dock__panel { opacity: 0; animation: none; }

@media (prefers-reduced-motion: reduce) {
	.eva-dock[data-face="connecting"] .eva-dock__stage-media::after,
	.eva-dock[data-face="recovering"] .eva-dock__stage-media::after,
	.eva-dock[data-face="failed"] .eva-dock__still { animation: none; }
}
