/**
 * Boksiowo Portal Engine PRO — Boksio AI Chat, frontend widget styles.
 *
 * Colour palette (v1.31.1-beta): Primary #2563EB, Secondary #1D4ED8,
 * Accent #F97316, Background #F7F9FC, AI bubble #F3F4F6, user bubble
 * #2563EB, border #E5E7EB — plus a full dark mode (#111827 / #1F2937 /
 * #374151 / #F9FAFB). Presentation-only change: every class name, DOM
 * hook and behaviour (typing indicator, auto-scroll, delete/retry/copy
 * buttons) is unchanged from v1.30.1-beta.
 *
 * Uses CSS custom properties (--bpe-ai-chat-primary / --bpe-ai-chat-secondary,
 * still set inline per-site from admin Settings — Ustawienia → Boksio AI
 * Chat → Kolor główny/dodatkowy — the values below are only the
 * out-of-the-box defaults) plus a [data-theme] attribute toggled by
 * ai-chat-widget.js between "light" and "dark" (an "auto" setting is
 * resolved to one of the two on load via prefers-color-scheme, then
 * persisted per-visitor). All colours below fall back sanely even if the
 * custom properties are somehow absent.
 */

.bpe-ai-chat {
	--bpe-ai-chat-primary: #2563eb;
	--bpe-ai-chat-secondary: #1d4ed8;
	--bpe-ai-chat-accent: #f97316;
	--bpe-ai-chat-bg: #ffffff;
	--bpe-ai-chat-messages-bg: #f7f9fc;
	--bpe-ai-chat-fg: #1f2937;
	--bpe-ai-chat-muted: #6b7280;
	--bpe-ai-chat-border: #e5e7eb;
	--bpe-ai-chat-bubble-assistant: #f3f4f6;
	--bpe-ai-chat-bubble-assistant-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.08);
	--bpe-ai-chat-bubble-user: var(--bpe-ai-chat-primary);
	--bpe-ai-chat-bubble-user-fg: #ffffff;

	position: fixed;
	bottom: 24px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.5;
}

.bpe-ai-chat[data-theme="dark"] {
	--bpe-ai-chat-bg: #1f2937;
	--bpe-ai-chat-messages-bg: #111827;
	--bpe-ai-chat-fg: #f9fafb;
	--bpe-ai-chat-muted: #9ca3af;
	--bpe-ai-chat-border: #374151;
	--bpe-ai-chat-bubble-assistant: #374151;
	--bpe-ai-chat-bubble-assistant-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.bpe-ai-chat--right {
	right: 24px;
}

.bpe-ai-chat--left {
	left: 24px;
}

.bpe-ai-chat__toggle {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	background: linear-gradient(135deg, var(--bpe-ai-chat-primary), var(--bpe-ai-chat-secondary));
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bpe-ai-chat__toggle:hover {
	transform: scale(1.06);
	box-shadow: 0 8px 24px rgba(37, 99, 235, 0.42);
}

.bpe-ai-chat__toggle:active {
	transform: scale(0.96);
}

.bpe-ai-chat__toggle-icon,
.bpe-ai-chat__toggle-icon-img {
	width: 28px;
	height: 28px;
}

.bpe-ai-chat__toggle-icon-img {
	border-radius: 50%;
	object-fit: cover;
}

.bpe-ai-chat__panel {
	position: absolute;
	bottom: 76px;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 140px);
	background: var(--bpe-ai-chat-bg);
	color: var(--bpe-ai-chat-fg);
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(16px) scale(0.98);
	/* No pointer-events:none gate here (removed) — it depended on the
	   .is-open class being added via requestAnimationFrame in
	   openPanel() (ai-chat-widget.js). When that rAF callback doesn't run
	   for any reason, .is-open never gets added, and the panel — despite
	   being un-hidden and visible — would stay permanently unclickable
	   with no way to recover short of a page reload. The [hidden]
	   attribute already fully handles "not interactive while closed"; a
	   fading-in panel being clickable a few ms early is a harmless
	   trade-off for never getting stuck. */
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.bpe-ai-chat--right .bpe-ai-chat__panel {
	right: 0;
}

.bpe-ai-chat--left .bpe-ai-chat__panel {
	left: 0;
}

.bpe-ai-chat__panel.is-open {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.bpe-ai-chat__header {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 14px;
	background: linear-gradient(135deg, var(--bpe-ai-chat-primary), var(--bpe-ai-chat-secondary));
	color: #fff;
	flex-shrink: 0;
}

.bpe-ai-chat__header-actions {
	display: flex;
	align-items: center;
	gap: 2px;
}

.bpe-ai-chat__avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
}

.bpe-ai-chat__bot-name {
	font-weight: 600;
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.bpe-ai-chat__icon-button {
	background: transparent;
	border: none;
	color: #fff;
	opacity: 0.85;
	cursor: pointer;
	padding: 4px;
	display: flex;
	border-radius: 6px;
}

.bpe-ai-chat__icon-button:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.12);
}

.bpe-ai-chat__icon-button svg {
	width: 18px;
	height: 18px;
}

.bpe-ai-chat__history-panel {
	position: absolute;
	top: 100%;
	right: 14px;
	width: 260px;
	max-width: calc(100vw - 48px);
	max-height: 280px;
	overflow-y: auto;
	background: var(--bpe-ai-chat-bg);
	color: var(--bpe-ai-chat-fg);
	border: 1px solid var(--bpe-ai-chat-border);
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
	padding: 8px;
	z-index: 2;
}

.bpe-ai-chat--left .bpe-ai-chat__history-panel {
	right: auto;
	left: 14px;
}

/* "Lucjan – bibliotekarz wiedzy" info panel — same popover pattern as
   .bpe-ai-chat__history-panel just above (position:absolute anchored to
   .bpe-ai-chat__header, which is position:relative; toggled via the
   `hidden` attribute in ai-chat-widget.js), just wider/taller to fit its
   longer, fixed copy. overflow-y:auto (requirement: scrollable content
   instead of ever growing past a sane height). */
.bpe-ai-chat__info-panel {
	position: absolute;
	top: 100%;
	right: 14px;
	width: 300px;
	max-width: calc(100vw - 48px);
	max-height: 320px;
	overflow-y: auto;
	background: var(--bpe-ai-chat-bg);
	color: var(--bpe-ai-chat-fg);
	border: 1px solid var(--bpe-ai-chat-border);
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
	padding: 16px;
	z-index: 2;
}

.bpe-ai-chat--left .bpe-ai-chat__info-panel {
	right: auto;
	left: 14px;
}

.bpe-ai-chat__info-panel-close {
	position: absolute;
	top: 8px;
	right: 8px;
	background: transparent;
	border: none;
	color: var(--bpe-ai-chat-muted);
	opacity: 0.85;
	cursor: pointer;
	padding: 4px;
	display: flex;
	border-radius: 6px;
}

.bpe-ai-chat__info-panel-close:hover {
	opacity: 1;
	background: rgba(127, 127, 127, 0.12);
}

.bpe-ai-chat__info-panel-close svg {
	width: 16px;
	height: 16px;
}

.bpe-ai-chat__info-panel-title {
	margin: 0 24px 10px 0;
	font-size: 14.5px;
	font-weight: 700;
	background: linear-gradient(135deg, var(--bpe-ai-chat-primary), var(--bpe-ai-chat-secondary));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.bpe-ai-chat__info-panel p {
	margin: 0 0 10px;
	font-size: 12.5px;
	line-height: 1.55;
}

.bpe-ai-chat__info-panel p:last-child {
	margin-bottom: 0;
}

.bpe-ai-chat__info-panel-disclaimer {
	font-style: italic;
	color: var(--bpe-ai-chat-muted);
}

@media (max-width: 480px) {
	.bpe-ai-chat__info-panel {
		width: calc(100vw - 32px);
		right: 8px;
		max-height: 260px;
		padding: 12px;
	}

	.bpe-ai-chat--left .bpe-ai-chat__info-panel {
		left: 8px;
	}

	.bpe-ai-chat__info-panel-title {
		font-size: 13.5px;
	}

	.bpe-ai-chat__info-panel p {
		font-size: 12px;
	}
}

.bpe-ai-chat__history-empty {
	margin: 4px 6px;
	color: var(--bpe-ai-chat-muted);
	font-size: 12.5px;
}

.bpe-ai-chat__history-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bpe-ai-chat__history-item {
	width: 100%;
	text-align: left;
	background: none;
	border: none;
	border-radius: 6px;
	padding: 7px 8px;
	cursor: pointer;
	color: inherit;
	font: inherit;
}

.bpe-ai-chat__history-item:hover,
.bpe-ai-chat__history-item:focus-visible {
	background: var(--bpe-ai-chat-bubble-assistant);
}

.bpe-ai-chat__history-item.is-active {
	background: var(--bpe-ai-chat-bubble-assistant);
	font-weight: 600;
}

.bpe-ai-chat__history-item-preview {
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 12.5px;
}

.bpe-ai-chat__history-item-date {
	display: block;
	font-size: 11px;
	color: var(--bpe-ai-chat-muted);
	margin-top: 1px;
}

.bpe-ai-chat__messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	scroll-behavior: smooth;
	background: var(--bpe-ai-chat-messages-bg);
}

.bpe-ai-chat__message {
	display: flex;
	animation: bpe-ai-chat-fade-in 0.2s ease;
}

@keyframes bpe-ai-chat-fade-in {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.bpe-ai-chat__message--user {
	justify-content: flex-end;
}

.bpe-ai-chat__message--assistant {
	justify-content: flex-start;
}

.bpe-ai-chat__bubble {
	max-width: 84%;
	padding: 10px 14px;
	border-radius: 18px;
	background: var(--bpe-ai-chat-bubble-assistant);
	color: var(--bpe-ai-chat-fg);
	white-space: pre-wrap;
	word-wrap: break-word;
	position: relative;
}

.bpe-ai-chat__message--user .bpe-ai-chat__bubble {
	background: var(--bpe-ai-chat-bubble-user);
	color: var(--bpe-ai-chat-bubble-user-fg);
	border-bottom-right-radius: 6px;
}

.bpe-ai-chat__message--assistant .bpe-ai-chat__bubble {
	box-shadow: var(--bpe-ai-chat-bubble-assistant-shadow);
	border-bottom-left-radius: 6px;
}

/* Streaming odpowiedzi (v1.32.4): blinking caret while a reply is being
   progressively revealed by appendAssistantReplyStreamed(). */
.bpe-ai-chat__message--streaming .bpe-ai-chat__bubble::after {
	content: '';
	display: inline-block;
	width: 2px;
	height: 1em;
	margin-left: 2px;
	vertical-align: text-bottom;
	background: currentColor;
	animation: bpe-ai-chat-caret 0.8s steps(1) infinite;
}

@keyframes bpe-ai-chat-caret {
	50% {
		opacity: 0;
	}
}

.bpe-ai-chat__bubble p {
	margin: 0 0 8px;
}

.bpe-ai-chat__bubble p:last-child {
	margin-bottom: 0;
}

.bpe-ai-chat__bubble .bpe-ai-chat__heading {
	margin: 4px 0 4px;
	font-weight: 700;
}

.bpe-ai-chat__bubble .bpe-ai-chat__heading:first-child {
	margin-top: 0;
}

.bpe-ai-chat__bubble ul,
.bpe-ai-chat__bubble ol {
	margin: 0 0 8px;
	padding-left: 20px;
}

.bpe-ai-chat__bubble ul:last-child,
.bpe-ai-chat__bubble ol:last-child {
	margin-bottom: 0;
}

.bpe-ai-chat__bubble li {
	margin-bottom: 2px;
}

.bpe-ai-chat__bubble a {
	color: inherit;
	text-decoration: underline;
}

.bpe-ai-chat__bubble code {
	background: rgba(0, 0, 0, 0.08);
	border-radius: 4px;
	padding: 1px 5px;
	font-family: Menlo, Consolas, monospace;
	font-size: 0.9em;
}

.bpe-ai-chat__bubble pre {
	background: #11121a;
	color: #e5e7eb;
	border-radius: 8px;
	padding: 10px 12px;
	overflow-x: auto;
	margin: 8px 0;
	position: relative;
}

.bpe-ai-chat__bubble pre code {
	background: transparent;
	padding: 0;
	color: inherit;
}

.bpe-ai-chat__copy-btn {
	position: absolute;
	top: 6px;
	right: 6px;
	background: rgba(255, 255, 255, 0.12);
	color: #e5e7eb;
	border: none;
	border-radius: 5px;
	font-size: 11px;
	padding: 3px 7px;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.bpe-ai-chat__bubble pre:hover .bpe-ai-chat__copy-btn {
	opacity: 1;
}

.bpe-ai-chat__bubble table {
	border-collapse: collapse;
	width: 100%;
	margin: 8px 0;
	font-size: 0.92em;
}

.bpe-ai-chat__bubble th,
.bpe-ai-chat__bubble td {
	border: 1px solid var(--bpe-ai-chat-border);
	padding: 5px 8px;
	text-align: left;
}

.bpe-ai-chat__bubble th {
	background: rgba(0, 0, 0, 0.05);
}

.bpe-ai-chat__message-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 4px;
}

.bpe-ai-chat__message-copy,
.bpe-ai-chat__message-delete,
.bpe-ai-chat__message-retry {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: none;
	border: none;
	color: var(--bpe-ai-chat-muted);
	font-size: 11px;
	cursor: pointer;
	padding: 0;
}

.bpe-ai-chat__message-copy:hover,
.bpe-ai-chat__message-delete:hover,
.bpe-ai-chat__message-retry:hover {
	color: var(--bpe-ai-chat-fg);
}

.bpe-ai-chat__message-delete {
	opacity: 0.6;
}

.bpe-ai-chat__message-delete:hover {
	opacity: 1;
	color: #dc2626;
}

.bpe-ai-chat__message-retry {
	margin-top: 6px;
	text-decoration: underline;
}

/* "Powiązane materiały" (v1.32.5) */

.bpe-ai-chat__related {
	max-width: 84%;
	margin-top: 6px;
	padding: 8px 12px;
	border-radius: 12px;
	border: 1px solid var(--bpe-ai-chat-border);
	background: var(--bpe-ai-chat-bg);
}

.bpe-ai-chat__related-heading {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--bpe-ai-chat-muted);
	margin-bottom: 6px;
}

.bpe-ai-chat__related-group {
	margin-bottom: 6px;
}

.bpe-ai-chat__related-group:last-child {
	margin-bottom: 0;
}

.bpe-ai-chat__related-group-title {
	display: block;
	font-size: 11px;
	font-weight: 600;
	color: var(--bpe-ai-chat-muted);
	margin-bottom: 2px;
}

.bpe-ai-chat__related-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.bpe-ai-chat__related-list a {
	font-size: 13px;
	color: var(--bpe-ai-chat-primary);
	text-decoration: none;
}

.bpe-ai-chat__related-list a:hover {
	text-decoration: underline;
}

/* "AI Actions" (v1.32.7) */

.bpe-ai-chat__actions {
	max-width: 84%;
	margin-top: 6px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.bpe-ai-chat__actions-group {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.bpe-ai-chat__actions-group-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--bpe-ai-chat-muted);
}

.bpe-ai-chat__actions-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.bpe-ai-chat__action-chip {
	background: none;
	border: 1px solid var(--bpe-ai-chat-primary);
	color: var(--bpe-ai-chat-primary);
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 12px;
	line-height: 1.3;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.bpe-ai-chat__action-chip:hover,
.bpe-ai-chat__action-chip:focus-visible {
	background: var(--bpe-ai-chat-accent);
	border-color: var(--bpe-ai-chat-accent);
	color: #fff;
}

.bpe-ai-chat-login-notice {
	font-size: 13px;
	color: var(--bpe-ai-chat-muted, #6b7280);
}

.bpe-ai-chat__typing {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 0 14px 8px;
}

.bpe-ai-chat__typing-text {
	margin-left: 2px;
	font-size: 12px;
	color: var(--bpe-ai-chat-muted);
}

.bpe-ai-chat__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--bpe-ai-chat-muted);
	animation: bpe-ai-chat-bounce 1.2s infinite ease-in-out;
}

.bpe-ai-chat__dot:nth-child(2) {
	animation-delay: 0.15s;
}

.bpe-ai-chat__dot:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes bpe-ai-chat-bounce {
	0%, 80%, 100% {
		transform: translateY(0);
		opacity: 0.5;
	}
	40% {
		transform: translateY(-4px);
		opacity: 1;
	}
}

.bpe-ai-chat__quick-replies {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0 14px 10px;
	flex-shrink: 0;
}

.bpe-ai-chat__quick-reply {
	background: none;
	border: 1px solid var(--bpe-ai-chat-primary);
	color: var(--bpe-ai-chat-primary);
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 12px;
	line-height: 1.3;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.bpe-ai-chat__quick-reply:hover,
.bpe-ai-chat__quick-reply:focus-visible {
	background: var(--bpe-ai-chat-accent);
	border-color: var(--bpe-ai-chat-accent);
	color: #fff;
}

.bpe-ai-chat__form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid var(--bpe-ai-chat-border);
	flex-shrink: 0;
}

/*
 * The widget renders inside arbitrary WordPress themes, whose own global
 * form styles (e.g. `input, textarea { color: ... }` resets) can carry
 * higher CSS specificity than a single widget class and silently override
 * the text color set below — invisible in light mode by coincidence, but
 * unreadable (dark text on a dark background) once dark mode is active.
 * The `#bpe-ai-chat-input` ID selector is included purely to guarantee
 * this widget always wins over host-theme form resets, regardless of
 * their selector complexity.
 */
.bpe-ai-chat__input,
#bpe-ai-chat-input {
	flex: 1;
	resize: none;
	max-height: 96px;
	border: 1px solid var(--bpe-ai-chat-border);
	border-radius: 10px;
	padding: 8px 10px;
	font: inherit;
	background: var(--bpe-ai-chat-bg);
	color: var(--bpe-ai-chat-fg);
	caret-color: var(--bpe-ai-chat-fg);
}

.bpe-ai-chat__input::placeholder,
#bpe-ai-chat-input::placeholder {
	color: var(--bpe-ai-chat-muted);
	opacity: 1;
}

.bpe-ai-chat__input:focus,
#bpe-ai-chat-input:focus {
	outline: 2px solid var(--bpe-ai-chat-primary);
	outline-offset: 1px;
}

.bpe-ai-chat__send {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: none;
	background: linear-gradient(135deg, var(--bpe-ai-chat-primary), var(--bpe-ai-chat-secondary));
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.bpe-ai-chat__send:not(:disabled):hover {
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.bpe-ai-chat__send:disabled {
	opacity: 0.5;
	cursor: default;
}

.bpe-ai-chat__send svg {
	width: 18px;
	height: 18px;
}

/* ETAP 6 (v1.30.1-beta): a small spinner on the send button itself while
   a request is in flight — distinct from (and in addition to) the "AI
   pisze…" typing indicator, which only appears once the visitor's own
   message has already been accepted server-side. */
.bpe-ai-chat__send.is-loading svg {
	animation: bpe-ai-chat-spin 0.8s linear infinite;
}

@keyframes bpe-ai-chat-spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

.bpe-ai-chat__message--error .bpe-ai-chat__bubble {
	background: #fee2e2;
	color: #991b1b;
}

@media (max-width: 480px) {
	.bpe-ai-chat__panel {
		width: calc(100vw - 24px);
		height: calc(100vh - 110px);
		bottom: 72px;
	}
}

/**
 * "LUKI" homepage teaser (front page only — see widget.php). Sits just
 * above the existing round toggle button, inside the same fixed corner
 * region .bpe-ai-chat already reserves, so it never overlaps page content
 * — only ever the same bottom-right (or bottom-left) strip the chat
 * widget itself already occupies.
 */

.bpe-ai-chat__luki-teaser {
	position: absolute;
	bottom: 76px;
	right: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: min(240px, calc(100vw - 48px));
	padding: 10px 16px 10px 10px;
	border: none;
	border-radius: 999px;
	background: var(--bpe-ai-chat-bg);
	color: var(--bpe-ai-chat-fg);
	box-shadow: 0 6px 20px rgba(16, 24, 40, 0.14);
	cursor: pointer;
	text-align: left;
	font-family: inherit;
}

.bpe-ai-chat--left .bpe-ai-chat__luki-teaser {
	right: auto;
	left: 0;
}

.bpe-ai-chat__luki-teaser.is-hidden {
	opacity: 0;
	transform: translateY(6px) scale(0.98);
	pointer-events: none;
}

.bpe-ai-chat__luki-teaser:not(.is-hidden) {
	animation: bpe-luki-teaser-in 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

.bpe-ai-chat__luki-avatar-wrap {
	position: relative;
	flex-shrink: 0;
	width: 44px;
	height: 44px;
}

.bpe-ai-chat__luki-avatar {
	position: relative;
	z-index: 1;
	display: block;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
}

.bpe-ai-chat__luki-ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid var(--bpe-ai-chat-primary);
	animation: bpe-luki-pulse 2.4s ease-out infinite;
}

.bpe-ai-chat__luki-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.25;
}

.bpe-ai-chat__luki-name {
	font-weight: 800;
	font-size: 13px;
	letter-spacing: 0.03em;
	color: var(--bpe-ai-chat-primary);
}

.bpe-ai-chat__luki-role {
	font-size: 11px;
	font-weight: 600;
	color: var(--bpe-ai-chat-muted);
}

.bpe-ai-chat__luki-prompt {
	margin-top: 3px;
	font-size: 12.5px;
	font-weight: 500;
	color: var(--bpe-ai-chat-fg);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: opacity 220ms ease;
}

.bpe-ai-chat__luki-prompt.is-fading {
	opacity: 0;
}

@keyframes bpe-luki-pulse {
	0% {
		transform: scale(1);
		opacity: 0.55;
	}
	70% {
		transform: scale(1.35);
		opacity: 0;
	}
	100% {
		transform: scale(1.35);
		opacity: 0;
	}
}

@keyframes bpe-luki-teaser-in {
	from {
		opacity: 0;
		transform: translateY(6px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.bpe-ai-chat__luki-ring {
		animation: none;
		opacity: 0.4;
	}

	.bpe-ai-chat__luki-teaser:not(.is-hidden) {
		animation: none;
	}
}

/* Mobile: the wide horizontal pill (avatar + name/role/prompt in a row)
   is too wide not to overlap centred hero copy underneath it — the hero
   text box runs almost full viewport width, so a ~170px-wide pill flush
   against the right edge sits directly on top of it. Below 600px the
   teaser instead docks as a slim vertical strip (avatar over stacked
   text) hugging the right edge, keeping its footprint narrow enough to
   clear the hero text column instead of covering it. */
@media (max-width: 600px) {
	.bpe-ai-chat__luki-teaser {
		flex-direction: column;
		align-items: center;
		gap: 4px;
		width: 92px;
		max-width: 92px;
		padding: 10px 8px 12px;
		border-radius: 20px;
	}

	.bpe-ai-chat__luki-text {
		align-items: center;
	}

	.bpe-ai-chat__luki-name,
	.bpe-ai-chat__luki-role {
		text-align: center;
	}

	.bpe-ai-chat__luki-prompt {
		max-width: 100%;
		white-space: normal;
		overflow: visible;
		text-overflow: clip;
		text-align: center;
		font-size: 10.5px;
		line-height: 1.25;
	}
}

@media (max-width: 360px) {
	.bpe-ai-chat__luki-teaser {
		width: 80px;
		max-width: 80px;
		padding: 8px 6px 10px;
	}

	.bpe-ai-chat__luki-avatar-wrap,
	.bpe-ai-chat__luki-avatar {
		width: 38px;
		height: 38px;
	}
}
