/* Sitewide Emma assistant. Every selector is scoped to avoid theme conflicts. */
.gchs-emma[hidden] { display:none !important; }
.gchs-emma {
	position: fixed;
	right: clamp(14px, 2vw, 28px);
	bottom: max(18px, env(safe-area-inset-bottom));
	z-index: 9997;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	font-family: var(--wp--preset--font-family--body, Arial, sans-serif);
	pointer-events: none;
}

.gchs-emma *, .gchs-emma *::before, .gchs-emma *::after { box-sizing: border-box; }
.gchs-emma__launcher, .gchs-emma__panel { pointer-events: auto; }

.gchs-emma__launcher {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
}

.gchs-emma__launcher-label {
	display: inline-flex;
	align-items: center;
	min-height: 42px;
	padding: 0 17px;
	border: 1px solid rgba(255,255,255,.35);
	border-radius: 999px;
	background: #1e3f65;
	box-shadow: 0 8px 24px rgba(22,41,63,.28);
	font-family: var(--wp--preset--font-family--subheading, Arial, sans-serif);
	font-size: .85rem;
	font-weight: 700;
	letter-spacing: .2px;
	transition: transform .2s ease, background .2s ease;
}

.gchs-emma__launcher-image {
	display: block;
	width: 112px;
	height: 112px;
	filter: drop-shadow(0 12px 14px rgba(22,41,63,.3));
	transition: transform .2s ease, filter .2s ease;
}

.gchs-emma__launcher-image img,
.gchs-emma__avatar img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gchs-emma__launcher-image picture,
.gchs-emma__avatar picture { display: block; width: 100%; height: 100%; }
.gchs-emma__launcher:hover .gchs-emma__launcher-label,
.gchs-emma__launcher:focus-visible .gchs-emma__launcher-label { background: #295783; transform: translateX(-2px); }
.gchs-emma__launcher:hover .gchs-emma__launcher-image,
.gchs-emma__launcher:focus-visible .gchs-emma__launcher-image { transform: translateY(-3px); filter: drop-shadow(0 16px 17px rgba(22,41,63,.38)); }
/* Keep keyboard focus visible through the label/image hover treatment above,
   without drawing one large oval around the two-piece launcher. */
.gchs-emma__launcher:focus-visible { outline: none; }

/* Artwork-specific launcher treatments. */
.gchs-emma.gchs-emma--photo_realistic { bottom:env(safe-area-inset-bottom,0px); }
.gchs-emma--realistic .gchs-emma__launcher-label,
.gchs-emma--photo_realistic .gchs-emma__launcher-label {
	position: relative;
	max-width: 112px;
	min-height: 52px;
	padding: 8px 13px;
	border-color: #c8d5e1;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(22,41,63,.22);
	color: #1e3f65;
	font-size: .74rem;
	line-height: 1.2;
	text-align: center;
}
.gchs-emma--realistic .gchs-emma__launcher-label::before,
.gchs-emma--photo_realistic .gchs-emma__launcher-label::before {
	content: '';
	position: absolute;
	right: -9px;
	top: 24px;
	width: 16px;
	height: 16px;
	border-top: 1px solid #c8d5e1;
	border-right: 1px solid #c8d5e1;
	background: #fff;
	transform: rotate(45deg);
}
.gchs-emma--realistic .gchs-emma__launcher:hover .gchs-emma__launcher-label,
.gchs-emma--realistic .gchs-emma__launcher:focus-visible .gchs-emma__launcher-label,
.gchs-emma--photo_realistic .gchs-emma__launcher:hover .gchs-emma__launcher-label,
.gchs-emma--photo_realistic .gchs-emma__launcher:focus-visible .gchs-emma__launcher-label { background:#f8fbfe;color:#173653; }
.gchs-emma--realistic .gchs-emma__launcher:hover .gchs-emma__launcher-label::before,
.gchs-emma--realistic .gchs-emma__launcher:focus-visible .gchs-emma__launcher-label::before,
.gchs-emma--photo_realistic .gchs-emma__launcher:hover .gchs-emma__launcher-label::before,
.gchs-emma--photo_realistic .gchs-emma__launcher:focus-visible .gchs-emma__launcher-label::before { background:#f8fbfe; }
.gchs-emma--realistic .gchs-emma__launcher-image { width: 108px; height: 108px; }
.gchs-emma--realistic .gchs-emma__launcher-image img { transform: scale(1.05);transform-origin:50% 60%; }
.gchs-emma--photo_realistic .gchs-emma__launcher { gap:0; }
.gchs-emma--photo_realistic .gchs-emma__launcher-label { top:-19px;margin-right:-7px;animation:gchs-emma-bubble-pop .48s cubic-bezier(.2,.86,.3,1.18) .52s backwards; }
.gchs-emma--photo_realistic .gchs-emma__launcher-image { width:108px;height:108px; }
.gchs-emma--photo_realistic .gchs-emma__launcher-image picture { animation:gchs-emma-photo-pop .68s cubic-bezier(.2,.82,.24,1.14) .16s backwards; }
.gchs-emma--photo_realistic .gchs-emma__launcher-image img { object-fit:contain;transform:scale(1.06);transform-origin:50% 60%; }

.gchs-emma--cartoon_circle .gchs-emma__launcher-image,
.gchs-emma--cartoon_fish .gchs-emma__launcher-image { width: 100px;height:100px;filter:drop-shadow(0 10px 13px rgba(22,41,63,.28)); }
/* The illustrated ears extend beyond the artwork's pale circle. Do not apply
   a CSS circular mask here or the ear tips are cut off. */
.gchs-emma--cartoon_circle .gchs-emma__launcher-image img,
.gchs-emma--cartoon_fish .gchs-emma__launcher-image img { border-radius:0; }

.gchs-emma__panel {
	display: flex;
	flex-direction: column;
	width: min(410px, calc(100vw - 28px));
	height: min(650px, calc(100vh - 140px));
	min-height: 470px;
	margin-bottom: 16px;
	overflow: hidden;
	border: 1px solid #dbe3ec;
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 22px 65px rgba(22,41,63,.28);
	animation: gchs-emma-panel-in .24s cubic-bezier(.2,.75,.25,1) both;
}

.gchs-emma__panel[hidden], .gchs-emma [hidden] { display: none !important; }

.gchs-emma__header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 15px;
	background: linear-gradient(135deg, #183756, #295783);
	color: #fff;
}

.gchs-emma__avatar {
	width: 52px;
	height: 52px;
	flex: 0 0 52px;
	overflow: hidden;
	border: 2px solid rgba(255,255,255,.85);
	border-radius: 50%;
	background: #fff;
}
.gchs-emma--realistic .gchs-emma__avatar img { transform:scale(1.72);transform-origin:50% 28%; }
.gchs-emma--photo_realistic .gchs-emma__avatar img { object-fit:cover;transform:scale(1.34);transform-origin:50% 25%; }
.gchs-emma--cartoon_circle .gchs-emma__avatar img,
.gchs-emma--cartoon_fish .gchs-emma__avatar img { transform:scale(1.12); }

.gchs-emma__identity { flex: 1 1 auto; min-width: 0; }
.gchs-emma__title { display:flex;align-items:center;gap:8px;margin:0;color:#fff;font-family:var(--wp--preset--font-family--heading,Arial,sans-serif);font-size:1.4rem;line-height:1.05; }
.gchs-emma__title span { padding:3px 6px;border-radius:999px;background:rgba(255,255,255,.16);font-family:Arial,sans-serif;font-size:.57rem;font-weight:700;letter-spacing:.2px;text-transform:uppercase; }
.gchs-emma__status { display:flex;align-items:center;gap:6px;margin:5px 0 0;color:rgba(255,255,255,.82);font-family:var(--wp--preset--font-family--subheading,Arial,sans-serif);font-size:.72rem;font-weight:600; }
.gchs-emma__status span { width:8px;height:8px;border-radius:50%;background:#9bbf3e;box-shadow:0 0 0 3px rgba(155,191,62,.2); }

.gchs-emma__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255,255,255,.1);
	color: #fff;
	cursor: pointer;
}
.gchs-emma__close:hover { background: rgba(255,255,255,.2); }
.gchs-emma__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.gchs-emma__body { display:flex;flex:1 1 auto;min-height:0;flex-direction:column;background:#f8fafc; }
.gchs-emma__gate { overflow-y:auto;padding:21px;background:#fff; }
.gchs-emma__welcome { margin:0 0 10px;color:#26384c;font-size:.98rem;line-height:1.55; }
.gchs-emma__gate-intro { margin:0 0 18px;color:#5d6b7b;font-size:.82rem;line-height:1.5; }
.gchs-emma__gate-form { display:grid;gap:7px; }
.gchs-emma__gate-form label { margin-top:5px;color:#26384c;font-size:.75rem;font-weight:700; }
.gchs-emma__gate-form label span { color:#7a8795;font-weight:400; }
.gchs-emma__gate-form input {
	width: 100%;
	height: 44px;
	padding: 8px 11px;
	border: 1px solid #cdd8e4;
	border-radius: 9px;
	background: #fff;
	color: #1f2d3d;
	font: inherit;
	font-size: .9rem;
}
.gchs-emma__gate-form input:focus { border-color:#2d70aa;outline:3px solid rgba(113,181,233,.3); }
.gchs-emma__honey { position:absolute!important;left:-10000px!important;width:1px!important;height:1px!important;overflow:hidden!important; }

.gchs-emma__primary {
	min-height: 45px;
	margin-top: 10px;
	padding: 10px 16px;
	border: 0;
	border-radius: 10px;
	background: #9bbf3e;
	color: #183756;
	font-family: var(--wp--preset--font-family--subheading, Arial, sans-serif);
	font-size: .86rem;
	font-weight: 800;
	cursor: pointer;
}
.gchs-emma__primary:hover { background:#aacd4d; }
.gchs-emma__primary:focus-visible { outline:3px solid rgba(45,112,170,.35);outline-offset:2px; }
.gchs-emma__primary:disabled { cursor:wait;opacity:.65; }
.gchs-emma__privacy { margin:15px 0 0;color:#718094;font-size:.68rem;line-height:1.45; }

.gchs-emma__chat { display:flex;flex:1 1 auto;min-height:0;flex-direction:column; }
.gchs-emma__messages { flex:1 1 auto;min-height:0;overflow-y:auto;padding:16px;scroll-behavior:smooth; }
.gchs-emma__message { width:fit-content;max-width:86%;margin:0 0 13px; }
.gchs-emma__message.has-pet-cards { width:100%;max-width:100%; }
.gchs-emma__message.is-user { margin-left:auto; }
.gchs-emma__message-role { display:block;margin:0 0 4px;color:#677789;font-size:.62rem;font-weight:800;letter-spacing:.35px;text-transform:uppercase; }
.gchs-emma__message.is-user .gchs-emma__message-role { text-align:right; }
.gchs-emma__message-body { padding:10px 12px;border:1px solid #dbe4ed;border-radius:5px 14px 14px 14px;background:#fff;color:#26384c;font-size:.84rem;line-height:1.48;box-shadow:0 2px 8px rgba(30,63,101,.05); }
.gchs-emma__message.is-user .gchs-emma__message-body { border-color:#1e3f65;border-radius:14px 5px 14px 14px;background:#1e3f65;color:#fff; }
.gchs-emma__message-body p { margin:0 0 9px; }
.gchs-emma__message-body p:last-child { margin-bottom:0; }
.gchs-emma__message-body a { color:#1f65a1;font-weight:700;text-decoration:underline; }
.gchs-emma__message-body a:focus-visible { outline:2px solid #245493;outline-offset:2px; }
.gchs-emma__pet-cards { display:grid;gap:9px;margin-top:12px;padding-top:11px;border-top:1px solid #e4ebf2; }
.gchs-emma__pet-card { display:grid;min-height:88px;grid-template-columns:86px minmax(0,1fr);overflow:hidden;border:1px solid #d7e2ed;border-radius:12px;background:#f8fbfe;color:#1e3f65!important;text-decoration:none!important;box-shadow:0 3px 9px rgba(30,63,101,.07);transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease; }
.gchs-emma__pet-card:hover { border-color:#71b5e9;box-shadow:0 6px 15px rgba(30,63,101,.13);transform:translateY(-1px); }
.gchs-emma__pet-card:focus-visible { outline:3px solid rgba(45,112,170,.38)!important;outline-offset:2px!important; }
.gchs-emma__pet-photo { display:flex;min-height:88px;align-items:center;justify-content:center;overflow:hidden;background:#dfeaf3;color:#245493;font-family:var(--wp--preset--font-family--subheading,Arial,sans-serif);font-size:1.45rem;font-weight:800; }
.gchs-emma__pet-photo img { display:block;width:100%;height:100%;min-height:88px;object-fit:cover; }
.gchs-emma__pet-photo.is-placeholder { background:linear-gradient(135deg,#e9f2f8,#d9e8f2); }
.gchs-emma__pet-card-body { display:flex;min-width:0;flex-direction:column;justify-content:center;padding:10px 11px; }
.gchs-emma__pet-name { display:block;overflow:hidden;color:#1e3f65;font-family:var(--wp--preset--font-family--subheading,Arial,sans-serif);font-size:.9rem;line-height:1.2;text-overflow:ellipsis;white-space:nowrap; }
.gchs-emma__pet-details { display:-webkit-box;overflow:hidden;margin-top:3px;color:#637488;font-size:.69rem;font-weight:500;line-height:1.35;-webkit-box-orient:vertical;-webkit-line-clamp:2; }
.gchs-emma__pet-cta { display:block;margin-top:6px;color:#245493;font-size:.69rem;font-weight:800;line-height:1.2;text-decoration:underline;text-underline-offset:2px; }
.gchs-emma__message-actions { display:flex;flex-wrap:wrap;gap:7px;margin-top:11px;padding-top:10px;border-top:1px solid #e4ebf2; }
.gchs-emma__action { display:inline-flex;min-height:38px;align-items:center;justify-content:center;padding:8px 13px;border:1px solid #245493;border-radius:999px;background:#fff;color:#1e3f65;font:inherit;font-size:.72rem;font-weight:800;line-height:1.2;cursor:pointer;box-shadow:0 2px 5px rgba(30,63,101,.08); }
.gchs-emma__action:hover { background:#edf5fb; }
.gchs-emma__action.is-donate { border-color:#9bbf3e;background:#9bbf3e;color:#183756; }
.gchs-emma__action.is-donate:hover { border-color:#aacd4d;background:#aacd4d; }
.gchs-emma__action:focus-visible { outline:3px solid rgba(45,112,170,.35);outline-offset:2px; }

.gchs-emma__message.is-typing { display:flex;gap:4px;padding:12px 15px;border:1px solid #dbe4ed;border-radius:5px 14px 14px 14px;background:#fff; }
.gchs-emma__message.is-typing span { width:6px;height:6px;border-radius:50%;background:#67809a;animation:gchs-emma-typing 1s ease-in-out infinite; }
.gchs-emma__message.is-typing span:nth-child(2){animation-delay:.14s}.gchs-emma__message.is-typing span:nth-child(3){animation-delay:.28s}

.gchs-emma__suggestions { display:flex;gap:7px;overflow-x:auto;padding:2px 14px 11px;scrollbar-width:thin; }
.gchs-emma__suggestions button { flex:0 0 auto;min-height:34px;padding:6px 10px;border:1px solid #b8cade;border-radius:999px;background:#fff;color:#1e3f65;font:inherit;font-size:.7rem;font-weight:700;cursor:pointer; }
.gchs-emma__suggestions button:hover { border-color:#71b5e9;background:#edf5fb; }
.gchs-emma__suggestions button:focus-visible { outline:2px solid #245493;outline-offset:1px; }

.gchs-emma__composer { display:flex;align-items:flex-end;gap:8px;padding:11px 12px calc(11px + env(safe-area-inset-bottom));border-top:1px solid #dfe7ef;background:#fff; }
.gchs-emma__composer textarea { flex:1 1 auto;min-height:42px;max-height:112px;resize:none;padding:10px 12px;border:1px solid #cbd6e2;border-radius:12px;background:#fff;color:#26384c;font:inherit;font-size:.85rem;line-height:1.35; }
.gchs-emma__composer textarea:focus { border-color:#2d70aa;outline:3px solid rgba(113,181,233,.25); }
.gchs-emma__composer button { display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;flex:0 0 42px;padding:0;border:0;border-radius:50%;background:#9bbf3e;color:#183756;cursor:pointer; }
.gchs-emma__composer button:hover { background:#aacd4d; }
.gchs-emma__composer button:focus-visible { outline:3px solid rgba(45,112,170,.35);outline-offset:2px; }
.gchs-emma__composer button:disabled,.gchs-emma__composer textarea:disabled { cursor:wait;opacity:.6; }
.gchs-emma__error { margin:0;padding:9px 13px;border-top:1px solid #fecaca;background:#fff1f2;color:#9f1239;font-size:.74rem;line-height:1.4; }

@keyframes gchs-emma-panel-in { from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none} }
@keyframes gchs-emma-typing { 0%,60%,100%{transform:translateY(0);opacity:.45}30%{transform:translateY(-4px);opacity:1} }
@keyframes gchs-emma-photo-pop {
	0% { opacity:0;transform:translateY(22px) scale(.72) rotate(2deg); }
	68% { opacity:1;transform:translateY(-3px) scale(1.035) rotate(-.5deg); }
	100% { opacity:1;transform:none; }
}
@keyframes gchs-emma-bubble-pop {
	0% { opacity:0;transform:translate(15px,8px) scale(.78); }
	72% { opacity:1;transform:translate(-2px,-1px) scale(1.025); }
	100% { opacity:1;transform:none; }
}

@media (max-width:480px) {
	.gchs-emma { right:12px;bottom:max(12px,env(safe-area-inset-bottom)); }
	.gchs-emma.gchs-emma--photo_realistic { bottom:env(safe-area-inset-bottom,0px); }
	.gchs-emma__launcher-label { display:none; }
	.gchs-emma__launcher-image { width:92px;height:92px; }
	.gchs-emma--realistic .gchs-emma__launcher { gap:6px; }
	.gchs-emma--photo_realistic .gchs-emma__launcher { gap:0; }
	.gchs-emma--realistic .gchs-emma__launcher-label,
	.gchs-emma--photo_realistic .gchs-emma__launcher-label { display:inline-flex;position:absolute;right:76px;top:6px;width:96px;min-height:46px;padding:7px 10px;font-size:.68rem; }
	.gchs-emma--photo_realistic .gchs-emma__launcher-label { right:72px;top:-2px;margin-right:0; }
	.gchs-emma--realistic .gchs-emma__launcher-label::before,
	.gchs-emma--photo_realistic .gchs-emma__launcher-label::before { top:21px; }
	.gchs-emma--realistic .gchs-emma__launcher-image,
	.gchs-emma--photo_realistic .gchs-emma__launcher-image { width:88px;height:88px; }
	.gchs-emma--cartoon_circle .gchs-emma__launcher-image,
	.gchs-emma--cartoon_fish .gchs-emma__launcher-image { width:86px;height:86px; }
	.gchs-emma__panel { width:calc(100vw - 24px);height:calc(100dvh - 112px);max-height:none;min-height:420px;margin-bottom:10px;border-radius:16px; }
	.gchs-emma__gate { padding:18px; }
	.gchs-emma__messages { padding:14px; }
}

@media (prefers-reduced-motion:reduce) {
	.gchs-emma__panel,.gchs-emma__message.is-typing span,
	.gchs-emma--photo_realistic .gchs-emma__launcher-label,
	.gchs-emma--photo_realistic .gchs-emma__launcher-image picture { animation:none; }
	.gchs-emma__launcher-label,.gchs-emma__launcher-image { transition:none; }
}

@media print { .gchs-emma { display:none!important; } }
