/* Nemo Chat – widget. Color comes from the setting (--nemo-chat-color). */
.nemo-chat {
	--nemo-chat-color: #409fff;
	--nemo-chat-text: #1e2d41;
	--nemo-chat-muted: #5f6b7a;
	--nemo-chat-bg: #fff;
	--nemo-chat-soft: #f2f5f9;
	position: fixed;
	bottom: 20px;
	z-index: 99990;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
	color: var(--nemo-chat-text);
}
.nemo-chat--right { right: 20px; }
.nemo-chat--left { left: 20px; }

.nemo-chat *,
.nemo-chat *::before,
.nemo-chat *::after { box-sizing: border-box; }

.nemo-chat [hidden] { display: none !important; }

.nemo-chat button { font: inherit; cursor: pointer; }

.nemo-chat__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--nemo-chat-color);
	color: #fff;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}
.nemo-chat__toggle:hover { transform: scale(1.06); }
.nemo-chat__toggle:focus-visible,
.nemo-chat button:focus-visible,
.nemo-chat textarea:focus-visible,
.nemo-chat a:focus-visible { outline: 3px solid #1e2d41; outline-offset: 2px; }
.nemo-chat__toggle svg { width: 28px; height: 28px; fill: currentColor; }

.nemo-chat__panel {
	position: absolute;
	bottom: 72px;
	display: flex;
	flex-direction: column;
	width: 380px;
	max-width: calc(100vw - 24px);
	height: 600px;
	max-height: calc(100vh - 110px);
	background: var(--nemo-chat-bg);
	border-radius: 14px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28);
	overflow: hidden;
}
.nemo-chat--right .nemo-chat__panel { right: 0; }
.nemo-chat--left .nemo-chat__panel { left: 0; }

.nemo-chat__header {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 12px 14px;
	background: var(--nemo-chat-color);
	color: #fff;
}
.nemo-chat__title { flex: 1; font-weight: 700; font-size: 16px; }
.nemo-chat__icon-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #fff;
}
.nemo-chat__icon-btn:hover { background: rgba(255, 255, 255, 0.2); }
.nemo-chat__icon-btn svg { width: 20px; height: 20px; fill: currentColor; }

.nemo-chat__feedback {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
	padding: 16px;
	overflow-y: auto;
	background: var(--nemo-chat-bg, #f4f6f8);
}
.nemo-chat__feedback-form,
.nemo-chat__feedback-thanks {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 10px;
	min-height: 0;
}
.nemo-chat__feedback-form[hidden],
.nemo-chat__feedback-thanks[hidden] {
	display: none !important;
}
.nemo-chat__feedback-thanks {
	justify-content: center;
	align-items: stretch;
	text-align: center;
	padding: 12px 4px 0;
}
.nemo-chat__feedback-thanks-mark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin: 8px auto 4px;
	border-radius: 50%;
	background: #e8f5e9;
	color: #1b5e20;
	font-size: 22px;
	font-weight: 700;
	line-height: 1;
}
.nemo-chat__feedback-thanks .nemo-chat__feedback-title {
	font-size: 18px;
}
.nemo-chat__feedback-thanks .nemo-chat__feedback-hint {
	max-width: 280px;
	margin-left: auto;
	margin-right: auto;
	font-size: 14px;
}
.nemo-chat__feedback-thanks .nemo-chat__feedback-actions {
	justify-content: center;
	margin-top: 18px;
}
.nemo-chat__feedback-title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--nemo-chat-text, #1a1a1a);
}
.nemo-chat__feedback-hint {
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
	color: var(--nemo-chat-muted, #5c6670);
}
.nemo-chat__feedback-text {
	width: 100%;
	min-height: 96px;
	padding: 10px 12px;
	border: 1px solid #cfd6dd;
	border-radius: 10px;
	resize: vertical;
	font: inherit;
	font-size: 14px;
	box-sizing: border-box;
}
.nemo-chat__feedback-check {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 13px;
	line-height: 1.35;
	color: var(--nemo-chat-text, #1a1a1a);
	cursor: pointer;
}
.nemo-chat__feedback-check input {
	margin-top: 2px;
	flex: 0 0 auto;
}
.nemo-chat__feedback-status {
	margin: 0;
	font-size: 13px;
	line-height: 1.35;
}
.nemo-chat__feedback-status.is-ok { color: #1b5e20; }
.nemo-chat__feedback-status.is-error { color: #7a1c14; }
.nemo-chat__feedback-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: auto;
}
.nemo-chat__feedback-cancel,
.nemo-chat__feedback-send {
	padding: 8px 14px;
	border-radius: 20px;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}
.nemo-chat__feedback-cancel {
	border: 1px solid #cfd6dd;
	background: #fff;
	color: var(--nemo-chat-text, #1a1a1a);
}
.nemo-chat__feedback-send {
	border: 0;
	background: var(--nemo-chat-color);
	color: #fff;
}
.nemo-chat__feedback-send:disabled {
	opacity: 0.55;
	cursor: default;
}

.nemo-chat__test {
	margin: 0;
	padding: 4px 14px;
	background: #fff3cd;
	color: #664d03;
	font-size: 12px;
}

/* Privacy notice before the first chat */
.nemo-chat__gate {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
}
.nemo-chat__gate-scroll {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 16px 16px 4px;
}
.nemo-chat__gate-foot {
	flex: none;
	padding: 10px 16px 14px;
	background: var(--nemo-chat-bg);
	border-top: 1px solid var(--nemo-chat-soft);
}
.nemo-chat__gate h2 { margin: 0 0 10px; font-size: 17px; line-height: 1.3; color: var(--nemo-chat-text); }
.nemo-chat__gate p { margin: 0 0 10px; font-size: 14px; }
.nemo-chat__gate-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0; font-size: 14px; }
.nemo-chat__gate a { color: var(--nemo-chat-text); text-decoration: underline; }
.nemo-chat__start {
	display: block;
	width: 100%;
	padding: 12px 16px;
	border: 0;
	border-radius: 24px;
	background: var(--nemo-chat-color);
	color: #fff;
	font-weight: 700;
	font-size: 16px;
}
.nemo-chat__start:hover { filter: brightness(0.92); }

/* Messages */
.nemo-chat__body {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: var(--nemo-chat-soft);
	scroll-behavior: smooth;
}
.nemo-chat__msg { display: flex; margin: 0 0 10px; }
.nemo-chat__msg--user { justify-content: flex-end; }
.nemo-chat__bubble {
	max-width: 88%;
	padding: 9px 12px;
	border-radius: 14px;
	background: #fff;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.nemo-chat__msg--user .nemo-chat__bubble { background: var(--nemo-chat-color); color: #fff; border-bottom-right-radius: 4px; }
.nemo-chat__msg--bot .nemo-chat__bubble { border-bottom-left-radius: 4px; }
.nemo-chat__msg--error .nemo-chat__bubble { background: #fdecea; color: #7a1c14; }
.nemo-chat__bubble a { color: inherit; text-decoration: underline; }

.nemo-chat__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 10px;
	padding: 0 2px;
}
.nemo-chat__chip {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 4px 8px 4px 10px;
	border-radius: 999px;
	background: #fff;
	border: 1px solid #d5dde6;
	color: var(--nemo-chat-muted, #5b6b7c);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
}
.nemo-chat__chip-x {
	appearance: none;
	margin: 0 0 0 2px;
	padding: 0 2px;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	opacity: 0.55;
}
.nemo-chat__chip-x:hover,
.nemo-chat__chip-x:focus-visible {
	opacity: 1;
	outline: none;
}

.nemo-chat__replies {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 12px;
	padding: 0 2px;
}
.nemo-chat__reply {
	appearance: none;
	margin: 0;
	padding: 8px 12px;
	border-radius: 18px;
	border: 1px solid var(--nemo-chat-color);
	background: #fff;
	color: var(--nemo-chat-color);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
	cursor: pointer;
	text-align: left;
}
.nemo-chat__reply:hover,
.nemo-chat__reply:focus-visible {
	background: var(--nemo-chat-color);
	color: #fff;
	outline: none;
}
.nemo-chat__reply:disabled {
	opacity: 0.55;
	cursor: default;
}

.nemo-chat__cards { display: grid; gap: 10px; margin: 0 0 10px; }
.nemo-chat__card {
	display: flex;
	gap: 10px;
	padding: 8px;
	border-radius: 10px;
	background: #fff;
	color: inherit;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.nemo-chat__card:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22); }
.nemo-chat__card-img {
	flex: 0 0 88px;
	height: 76px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--nemo-chat-soft) center / cover no-repeat;
}
.nemo-chat__card-media {
	display: block;
	width: 100%;
	height: 100%;
	color: inherit;
	text-decoration: none;
}
.nemo-chat__card-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nemo-chat__card-body {
	min-width: 0;
	flex: 1;
	color: inherit;
	text-decoration: none;
}
.nemo-chat__card-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--nemo-chat-color); }
.nemo-chat__card-title { margin: 1px 0 2px; font-weight: 700; font-size: 14px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nemo-chat__card-price { font-weight: 700; font-size: 14px; }
.nemo-chat__card-meta { font-size: 12px; color: var(--nemo-chat-muted); }

.nemo-chat__more {
	display: inline-block;
	margin: 0 0 10px;
	padding: 8px 14px;
	border-radius: 20px;
	background: #fff;
	border: 1px solid var(--nemo-chat-color);
	color: var(--nemo-chat-color);
	font-weight: 700;
	font-size: 14px;
	text-decoration: none;
}
.nemo-chat__more:hover { background: var(--nemo-chat-color); color: #fff; }

.nemo-chat__typing { display: flex; gap: 4px; padding: 12px 14px; }
.nemo-chat__typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--nemo-chat-muted);
	animation: nemo-chat-blink 1.2s infinite ease-in-out;
}
.nemo-chat__typing span:nth-child(2) { animation-delay: 0.2s; }
.nemo-chat__typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes nemo-chat-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* Input */
.nemo-chat__form { display: flex; gap: 8px; padding: 10px 12px 4px; background: var(--nemo-chat-bg); border-top: 1px solid #e3e8ee; }
.nemo-chat__input {
	flex: 1;
	min-height: 42px;
	max-height: 110px;
	margin: 0;
	padding: 9px 12px;
	border: 1px solid #c9d1db;
	border-radius: 20px;
	font: inherit;
	resize: none;
	color: var(--nemo-chat-text);
	background: #fff;
}
.nemo-chat__send {
	flex: 0 0 42px;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--nemo-chat-color);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}
.nemo-chat__send svg { width: 20px; height: 20px; fill: currentColor; }
.nemo-chat__send:disabled,
.nemo-chat__input:disabled { opacity: 0.5; cursor: not-allowed; }
.nemo-chat__notice { margin: 0; padding: 4px 14px 10px; font-size: 11.5px; color: var(--nemo-chat-muted); background: var(--nemo-chat-bg); }

/* Honeypot: invisible to humans */
.nemo-chat__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

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

@media (max-width: 520px) {
	.nemo-chat { bottom: 12px; }
	.nemo-chat--right { right: 12px; }
	.nemo-chat--left { left: 12px; }
	.nemo-chat--open { inset: 0; bottom: 0; }
	.nemo-chat--open .nemo-chat__toggle { display: none; }
	.nemo-chat--open .nemo-chat__panel {
		position: fixed;
		inset: 0;
		width: 100%;
		max-width: none;
		height: 100%;
		max-height: none;
		border-radius: 0;
	}
	.nemo-chat__input { font-size: 16px; } /* prevents zoom on iOS */
}

@media (prefers-reduced-motion: reduce) {
	.nemo-chat__toggle,
	.nemo-chat__body { transition: none; scroll-behavior: auto; }
	.nemo-chat__typing span { animation: none; opacity: 0.6; }
}
