/* HonyBot — panel styles.
   Tokens measured from the live site: canvas #ECF0F5, band #3E5062, action #F78DA7,
   link underline #2FA3F2, radii 3px / 9999px, Open Sans. Everything is scoped to #honybot
   so nothing here can leak into the theme. */

#honybot,
#honybot * {
	box-sizing: border-box;
}

/* Host-theme leakage guard. Extra applies text-transform:uppercase to buttons and to
   ::placeholder, and its own font/borders to form fields; the panel must not inherit any of it. */
#honybot button,
#honybot input,
#honybot textarea,
#honybot select {
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
}

#honybot textarea::placeholder,
#honybot input::placeholder {
	text-transform: none;
	letter-spacing: normal;
	opacity: 1;
}

#honybot {
	--hb-canvas: #ecf0f5;
	--hb-surface: #ffffff;
	--hb-grad: linear-gradient(172deg, #ffffff 0%, #f9fbfd 38%, #eff4fa 74%, #e8eff7 100%);
	--hb-band: #3e5062;
	--hb-band-2: #334453;
	--hb-ink: #313131;
	--hb-ink-link: rgba(0, 0, 0, 0.75);
	--hb-link: #2fa3f2;
	--hb-action: #f78da7;
	--hb-action-2: #e9768f;
	--hb-border: #e7e7e7;
	--hb-grey-1: #f3f4f5;
	--hb-grey-2: #f0f0f0;
	--hb-grey-3: #e9edf1;
	--hb-muted: #94a3b1;
	--hb-alert: #c93a51;
	--hb-pill-shadow: rgba(0, 0, 0, 0.24) 7px 6px 28px 1px;
	--hb-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
	position: fixed;
	inset: auto 0 0 auto;
	z-index: 9990;
	font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
		"Hiragino Sans", "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", "Malgun Gothic",
		"Noto Sans CJK SC", "Noto Sans SC", "Noto Sans", "Noto Sans Arabic", "Noto Sans Devanagari",
		sans-serif;
	font-size: 14px;
	line-height: 1.6;
	color: var(--hb-ink);
	text-align: left;
}

/* ---------- launcher ---------- */
#honybot .hb-launch {
	position: absolute;
	right: 20px;
	bottom: 20px;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	height: 48px;
	padding: 0 20px 0 16px;
	margin: 0;
	border: 0;
	border-radius: 9999px;
	background: var(--hb-band);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.1px;
	text-decoration: none;
	cursor: pointer;
	box-shadow: var(--hb-pill-shadow);
	transition: transform 0.18s var(--hb-ease), background 0.18s var(--hb-ease),
		box-shadow 0.18s var(--hb-ease), opacity 0.16s var(--hb-ease);
	white-space: nowrap;
	-webkit-appearance: none;
	appearance: none;
}

#honybot .hb-launch:hover {
	background: var(--hb-band-2);
	transform: translateY(-2px);
	box-shadow: rgba(0, 0, 0, 0.3) 8px 10px 30px 1px;
}

#honybot .hb-launch:active {
	transform: translateY(0) scale(0.985);
}

#honybot .hb-launch:focus-visible {
	outline: 3px solid var(--hb-link);
	outline-offset: 3px;
}

#honybot .hb-launch .hb-spark {
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	fill: none;
	stroke: #fff;
	stroke-width: 2;
	stroke-linejoin: round;
	stroke-linecap: round;
}

/* the mark is a speech bubble with three dots — the site's own logo is a speech bubble,
   and it cannot be mistaken for the four-point star Gemini uses */
#honybot .hb-spark circle {
	fill: currentColor;
	stroke: none;
}

@keyframes hb-twinkle {
	0%, 86%, 100% { transform: scale(1) rotate(0deg); }
	90% { transform: scale(1.14) rotate(9deg); }
	94% { transform: scale(0.96) rotate(-4deg); }
}

#honybot .hb-launch.is-compact {
	width: 48px;
	padding: 0;
	justify-content: center;
}

#honybot .hb-launch.is-compact .hb-label {
	display: none;
}

#honybot .hb-dot {
	position: absolute;
	top: -3px;
	right: -3px;
	min-width: 19px;
	height: 19px;
	padding: 0 5px;
	border-radius: 9999px;
	background: var(--hb-alert);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 19px;
	text-align: center;
	box-shadow: 0 0 0 3px #fff;
	transform: scale(0);
	transition: transform 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#honybot .hb-dot.is-on { transform: scale(1); }

/* ---------- panel ---------- */
/* Docked right-hand panel: full viewport height, slides in from the edge, and the page is
   pushed left by the same width (see the body rule below). */
#honybot .hb-panel {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: 384px;
	height: 100%;
	max-height: none;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--hb-grad);
	border-radius: 0;
	box-shadow: rgba(0, 0, 0, 0.16) -14px 0 38px -18px;
	transform: translateX(101%);
	pointer-events: none;
	transition: transform 0.22s var(--hb-ease);
	font-size: 14px;
	z-index: 9991;
}

#honybot.is-open .hb-panel,
html[data-hb="open"] #honybot .hb-panel {
	transform: none;
	pointer-events: auto;
}

/* The WP admin bar is fixed at z-index 99999 and would cover the panel's header. */
body.admin-bar #honybot .hb-panel {
	top: 32px;
}

/* Push, not overlay: the reader keeps the whole article visible beside the chat. */
body {
	transition: margin-right 0.22s var(--hb-ease);
}

html[data-hb="open"][data-hb-layout="push"] body {
	margin-right: 384px !important;
}

#honybot.is-open .hb-launch,
html[data-hb="open"] #honybot .hb-launch {
	opacity: 0;
	transform: translateY(10px) scale(0.9);
	pointer-events: none;
}

#honybot .hb-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 12px 12px 16px;
	background: var(--hb-band);
	color: #fff;
	flex: 0 0 auto;
}

#honybot .hb-av {
	width: 30px;
	height: 30px;
	flex: 0 0 30px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	display: grid;
	place-items: center;
}

#honybot .hb-av svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: #fff;
	stroke-width: 2;
	stroke-linejoin: round;
	stroke-linecap: round;
}
#honybot .hb-av svg circle { fill: #fff; stroke: none; }

#honybot .hb-tt { line-height: 1.25; min-width: 0; }

#honybot .hb-nm {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
}

#honybot .hb-tt {
	/* let the subtitle ellipsis instead of pushing the action buttons out of the header */
	min-width: 0;
}

#honybot .hb-sub {
	font-size: 11.5px;
	color: #b9c8d6;
	letter-spacing: 0.2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#honybot .hb-acts { margin-left: auto; display: flex; gap: 2px; }

#honybot .hb-acts button {
	width: 30px;
	height: 30px;
	display: grid;
	place-items: center;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 3px;
	background: none;
	color: #dfe8f0;
	font: inherit;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

#honybot .hb-acts button:hover { background: rgba(255, 255, 255, 0.13); color: #fff; }
#honybot .hb-acts button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

/* ---------- stream ---------- */
#honybot .hb-body {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px 16px 6px;
	color-scheme: light;
	scrollbar-width: thin;
	scrollbar-color: #cfd9e3 transparent;
}

#honybot .hb-msg { margin: 0 0 16px; animation: hb-rise 0.2s var(--hb-ease) both; }

@keyframes hb-rise {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

#honybot .hb-msg.is-me { display: flex; justify-content: flex-end; }

#honybot .hb-msg.is-me .hb-bubble {
	background: var(--hb-grey-1);
	border-radius: 3px;
	padding: 9px 13px;
	max-width: 86%;
	font-size: 14px;
	color: var(--hb-ink);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

#honybot .hb-bot { font-size: 14px; line-height: 1.62; color: var(--hb-ink); overflow-wrap: anywhere; }
#honybot .hb-bot p { margin: 0 0 10px; }
#honybot .hb-bot p:last-child { margin-bottom: 0; }
#honybot .hb-bot ul { margin: 0 0 10px; padding-left: 18px; list-style: disc; }
#honybot .hb-bot li { margin: 0 0 3px; }
#honybot .hb-bot strong { font-weight: 600; color: #111; }

#honybot .hb-bot a {
	color: var(--hb-ink-link);
	text-decoration: underline;
	text-decoration-color: var(--hb-link);
	text-underline-position: under;
}

#honybot .hb-bot a:hover { text-decoration-color: var(--hb-band); }

/* source chips */
#honybot .hb-srcs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }

#honybot .hb-src {
	display: inline-block;
	padding: 3px 7px;
	border: 1px solid transparent;
	border-radius: 3px;
	background: var(--hb-grey-2);
	color: var(--hb-band) !important;
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.7px;
	text-transform: uppercase;
	text-decoration: none !important;
	line-height: 1.5;
}

#honybot .hb-src:hover { background: var(--hb-grey-3); border-color: var(--hb-border); }

/* CTA — deliberately the same object as the site's "Visit <site>" button */
#honybot .hb-cta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 12px 0 0;
	padding: 11px 20px;
	border-radius: 9999px;
	background: var(--hb-action);
	color: var(--hb-ink) !important;
	font-size: 14.5px;
	font-weight: 600;
	text-decoration: none !important;
	box-shadow: var(--hb-pill-shadow);
	transition: background 0.16s var(--hb-ease), transform 0.16s var(--hb-ease);
}

#honybot .hb-cta:hover { background: var(--hb-action-2); transform: translateY(-1px); }
#honybot .hb-cta .hb-cta-why { font-weight: 400; font-size: 12px; opacity: 0.75; }
#honybot .hb-cta .hb-cta-arw { margin-left: auto; font-size: 16px; }

/* chips / suggestions */
#honybot .hb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }

#honybot .hb-chip {
	padding: 6px 12px;
	border: 1px solid var(--hb-border);
	border-radius: 9999px;
	background: #fff;
	color: var(--hb-band);
	font: inherit;
	font-size: 12.5px;
	line-height: 1.4;
	cursor: pointer;
	transition: border-color 0.15s var(--hb-ease), background 0.15s var(--hb-ease);
	-webkit-appearance: none;
	appearance: none;
	text-align: left;
}

#honybot .hb-chip:hover { border-color: var(--hb-band); background: #f8fafc; }
#honybot .hb-chip:focus-visible { outline: 2px solid var(--hb-link); outline-offset: 2px; }

#honybot .hb-hello { margin: 0 0 12px; }

/* typing */
#honybot .hb-typing { display: inline-flex; gap: 4px; padding: 6px 0 8px; }

#honybot .hb-typing i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #a9b6c4;
	animation: hb-bob 1.1s var(--hb-ease) infinite;
}

#honybot .hb-typing i:nth-child(2) { animation-delay: 0.13s; }
#honybot .hb-typing i:nth-child(3) { animation-delay: 0.26s; }

@keyframes hb-bob {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
	30% { transform: translateY(-4px); opacity: 1; }
}

/* ---------- composer ---------- */
#honybot .hb-foot {
	flex: 0 0 auto;
	border-top: 1px solid rgba(62, 80, 98, 0.09);
	padding: 10px 12px 11px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.6) 100%);
}

#honybot .hb-in {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 7px 7px 7px 11px;
	border: 1px solid transparent;
	border-radius: 3px;
	background: rgba(0, 0, 0, 0.05);
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

#honybot .hb-in:focus-within {
	background: #fff;
	border-color: var(--hb-band);
	box-shadow: 0 0 0 3px rgba(62, 80, 98, 0.08);
}

#honybot .hb-in textarea {
	flex: 1 1 auto;
	width: 100%;
	max-height: 96px;
	margin: 0;
	padding: 5px 0;
	border: 0;
	background: none;
	box-shadow: none;
	resize: none;
	font: inherit;
	font-size: 14px;
	line-height: 1.5;
	color: var(--hb-ink);
	outline: none;
	overflow-y: auto;
}

#honybot .hb-in textarea::placeholder { color: var(--hb-muted); }

#honybot .hb-send {
	width: 32px;
	height: 32px;
	flex: 0 0 32px;
	display: grid;
	place-items: center;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: var(--hb-band);
	color: #fff;
	cursor: pointer;
	transition: background 0.15s, transform 0.15s;
	-webkit-appearance: none;
	appearance: none;
}

#honybot .hb-send svg { width: 15px; height: 15px; fill: currentColor; }
#honybot .hb-send:hover { background: var(--hb-band-2); transform: scale(1.05); }
#honybot .hb-send[disabled] { background: #c3cdd7; cursor: default; transform: none; }
#honybot .hb-send:focus-visible { outline: 2px solid var(--hb-link); outline-offset: 2px; }

#honybot .hb-hint {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	padding: 6px 2px 0;
	font-size: 10.5px;
	color: var(--hb-muted);
}

/* ---------- quiet attention: a wiggle and a small "Hi" ---------- */
@keyframes hb-wiggle {
	0%, 100% { transform: rotate(0deg) translateY(0); }
	12% { transform: rotate(-5deg) translateY(-1px); }
	26% { transform: rotate(5deg) translateY(-1px); }
	40% { transform: rotate(-3.5deg); }
	54% { transform: rotate(2.5deg); }
	68% { transform: rotate(-1.5deg); }
	82% { transform: rotate(0.5deg); }
}

#honybot .hb-launch.is-wiggle {
	animation: hb-wiggle 1.15s var(--hb-ease) 1;
}

#honybot .hb-hi {
	position: absolute;
	right: 76px; /* clears the theme's back-to-top button, which shares this corner */
	bottom: 82px;
	padding: 9px 17px;
	border-radius: 9999px;
	background: linear-gradient(160deg, #4b5f75 0%, #3e5062 52%, #2c3b49 100%);
	color: #fff;
	border: 1.5px solid rgba(255, 255, 255, 0.65);
	box-shadow:
		rgba(20, 30, 40, 0.42) 0 12px 28px -10px,
		rgba(255, 255, 255, 0.5) 0 1px 0 inset;
	font-size: 14.5px;
	font-weight: 650;
	letter-spacing: 0.2px;
	line-height: 1.35;
	white-space: nowrap;
	opacity: 0;
	transform-origin: 100% 100%;
	pointer-events: none;
	z-index: 2;
}

/* a tail pointing at the pill, so the bubble reads as coming from it */
#honybot .hb-hi::after {
	content: "";
	position: absolute;
	right: 22px;
	bottom: -5px;
	width: 11px;
	height: 11px;
	background: linear-gradient(160deg, #3e5062, #2c3b49);
	transform: rotate(45deg);
	border-radius: 2px;
}

/* pop in, then breathe twice while it is on screen (~4.6s, matching the JS hold) */
#honybot .hb-hi.is-on {
	opacity: 1;
	animation: hb-hi-pop 4.6s var(--hb-ease) both;
}

@keyframes hb-hi-pop {
	0%   { opacity: 0; transform: translateY(12px) scale(0.78); }
	9%   { opacity: 1; transform: translateY(0) scale(1.08); }
	16%  { transform: scale(0.97); }
	23%  { transform: scale(1.01); }
	30%  { transform: scale(1); }
	48%  { transform: scale(1.09); }
	64%  { transform: scale(1); }
	82%  { transform: scale(1.09); }
	100% { transform: scale(1); opacity: 1; }
}

/* ---------- nudge ---------- */
#honybot .hb-nudge {
	position: absolute;
	right: 20px;
	bottom: 80px;
	width: 300px;
	padding: 14px 16px 13px;
	background: #fff;
	border: 1px solid var(--hb-border);
	border-radius: 3px;
	box-shadow: rgba(0, 0, 0, 0.18) 0 10px 30px -6px;
	opacity: 0;
	transform: translateY(10px) scale(0.98);
	pointer-events: none;
	transition: opacity 0.26s var(--hb-ease), transform 0.26s var(--hb-ease);
}

#honybot .hb-nudge.is-on { opacity: 1; transform: none; pointer-events: auto; }

#honybot .hb-nudge .hb-who {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 7px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1.1px;
	text-transform: uppercase;
	color: var(--hb-band);
}

#honybot .hb-nudge .hb-av { width: 22px; height: 22px; flex: 0 0 22px; background: var(--hb-band); }
#honybot .hb-nudge .hb-av svg { width: 12px; height: 12px; }

#honybot .hb-nudge p { margin: 0 0 11px; font-size: 13.5px; line-height: 1.5; color: var(--hb-ink); }

#honybot .hb-nudge .hb-row { display: flex; align-items: center; gap: 8px; }

#honybot .hb-nudge .hb-reply {
	padding: 6px 14px;
	border: 0;
	border-radius: 9999px;
	background: var(--hb-grey-2);
	color: var(--hb-band);
	font: inherit;
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

#honybot .hb-nudge .hb-reply:hover { background: var(--hb-border); }

#honybot .hb-nudge .hb-x {
	margin-left: auto;
	padding: 2px 4px;
	border: 0;
	background: none;
	color: var(--hb-muted);
	font: inherit;
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

#honybot .hb-nudge .hb-x:hover { color: var(--hb-ink); }

/* ---------- states ---------- */
#honybot .hb-hide { display: none !important; }

/* ---------- small screens: bottom sheet ---------- */
@media (max-width: 720px) {
	/* Stretch the anchor itself, so a 100% panel is exactly the visible width (100vw includes
	   the scrollbar and pushes the sheet off the left edge). */
	#honybot {
		left: 0;
		right: 0;
		bottom: 0;
		width: auto;
		height: 0;
	}

	/* phone: chat takes the lower three quarters, content stays visible above it */
	#honybot .hb-panel {
		top: auto;
		left: 0;
		right: 0;
		bottom: 0;
		width: auto;
		height: 75dvh;
		max-height: 75dvh;
		border-radius: 0;
		transform: translateY(100%);
		box-shadow: rgba(0, 0, 0, 0.3) 0 -10px 40px -12px;
	}

	html[data-hb="open"] #honybot .hb-panel {
		transform: none;
	}

	/* bottom-anchored sheet: the admin bar must not pin it to the top */
	body.admin-bar #honybot .hb-panel {
		top: auto;
		height: 75dvh;
		max-height: 75dvh;
	}

	html[data-hb="open"][data-hb-layout="push"] body {
		margin-right: 0 !important;
	}

	#honybot .hb-launch { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
	#honybot .hb-nudge { right: 14px; width: calc(100vw - 28px); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
	#honybot .hb-hi { right: 14px; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
	#honybot .hb-hint span:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	#honybot *,
	#honybot *::before,
	#honybot *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
