/* Welko – Store Assistant. Front-end chat. */
.welko {
	--welko-accent: #0f6e56;
	--welko-on-accent: #fff;
	--welko-bg: #ffffff;
	--welko-soft: #f3f4f3;
	--welko-line: rgba(0, 0, 0, .09);
	--welko-text: #1b1d1c;
	--welko-muted: #6a6f6c;
	--welko-shadow: 0 18px 50px rgba(0, 0, 0, .16), 0 3px 10px rgba(0, 0, 0, .08);
	position: fixed;
	bottom: 20px;
	z-index: 99990;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
	color: var(--welko-text);
	-webkit-font-smoothing: antialiased;
}
.welko-dark {
	--welko-bg: #1e2221;
	--welko-soft: #2a2f2d;
	--welko-line: rgba(255, 255, 255, .1);
	--welko-text: #eef1ef;
	--welko-muted: #a3aaa6;
	--welko-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 3px 10px rgba(0, 0, 0, .3);
}
.welko-right { right: 20px; }
.welko-left { left: 20px; }
.welko *, .welko *::before, .welko *::after { box-sizing: border-box; }
.welko svg { width: 20px; height: 20px; display: block; }
.welko button { font-family: inherit; cursor: pointer; margin: 0; }

/* Launcher */
.welko-launcher {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 0;
	padding: 0;
	background: var(--welko-accent);
	color: var(--welko-on-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
	transition: transform .18s ease, box-shadow .18s ease;
}
.welko-launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .22); }
.welko-launcher:focus-visible { outline: 3px solid var(--welko-accent); outline-offset: 3px; }
.welko-launcher svg { width: 24px; height: 24px; }
.welko-left .welko-launcher { margin-right: auto; }
.welko-right .welko-launcher { margin-left: auto; }
.welko-ico-close, .welko-is-open .welko-ico-chat { display: none; }
.welko-is-open .welko-ico-close { display: block; }

/* Panel */
.welko-panel {
	position: absolute;
	bottom: 66px;
	width: 370px;
	height: 560px;
	max-height: calc(100vh - 110px);
	background: var(--welko-bg);
	border: 1px solid var(--welko-line);
	border-radius: 16px;
	box-shadow: var(--welko-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: welko-in .2s ease;
}
.welko-panel[hidden] { display: none; }
.welko-right .welko-panel { right: 0; }
.welko-left .welko-panel { left: 0; }
@keyframes welko-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.welko-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 10px 12px 16px;
	border-bottom: 1px solid var(--welko-line);
}
.welko-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.welko-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--welko-accent); flex: none; }
.welko-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.welko-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.welko-lang { display: flex; border: 1px solid var(--welko-line); border-radius: 8px; overflow: hidden; margin-right: 4px; }
.welko-lang button {
	border: 0;
	background: transparent;
	color: var(--welko-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .04em;
	padding: 4px 8px;
	line-height: 1.4;
}
.welko-lang button[aria-pressed="true"] { background: var(--welko-soft); color: var(--welko-text); }
.welko-iconbtn {
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--welko-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.welko-iconbtn svg { width: 17px; height: 17px; }
.welko-iconbtn:hover { background: var(--welko-soft); color: var(--welko-text); }
.welko-iconbtn:focus-visible, .welko-lang button:focus-visible, .welko-send:focus-visible { outline: 2px solid var(--welko-accent); outline-offset: 1px; }

/* Messages */
.welko-log {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	overscroll-behavior: contain;
}
.welko-msg { max-width: 100%; }
.welko-user { align-self: flex-end; max-width: 85%; }
.welko-bubble {
	background: var(--welko-accent);
	color: var(--welko-on-accent);
	padding: 8px 12px;
	border-radius: 14px 14px 4px 14px;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.welko-bot { align-self: flex-start; width: 100%; }
.welko-text p { margin: 0 0 6px; }
.welko-text p:last-child { margin-bottom: 0; }
.welko-text ul { margin: 4px 0 6px; padding-left: 18px; }
.welko-text li { margin: 2px 0; }
.welko-text a { color: var(--welko-accent); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.welko-dark .welko-text a { color: inherit; }
.welko-text strong { font-weight: 600; }
.welko-err .welko-text { color: var(--welko-muted); }

/* Product cards */
.welko-card {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
	padding: 8px;
	border: 1px solid var(--welko-line);
	border-radius: 10px;
	color: inherit !important;
	text-decoration: none !important;
	transition: border-color .15s ease, background .15s ease;
}
.welko-card:hover { border-color: var(--welko-accent); }
.welko-thumb {
	width: 46px;
	height: 46px;
	border-radius: 7px;
	background: var(--welko-soft);
	flex: none;
	overflow: hidden;
}
.welko-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; }
.welko-card-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.welko-card-name { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.welko-card-line { font-size: 12px; color: var(--welko-muted); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.welko-card-arrow { color: var(--welko-muted); flex: none; }
.welko-card-arrow svg { width: 16px; height: 16px; }

.welko-sources {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 8px;
	font-size: 12px;
	color: var(--welko-muted);
}
.welko-sources svg { width: 13px; height: 13px; }
.welko-sources a { color: inherit !important; text-decoration: underline; text-underline-offset: 2px; }

/* Typing */
.welko-typing { display: flex; gap: 4px; padding: 6px 0; }
.welko-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--welko-muted); animation: welko-blink 1.2s infinite ease-in-out; }
.welko-typing span:nth-child(2) { animation-delay: .15s; }
.welko-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes welko-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* Input */
.welko-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 10px 10px 14px;
	border-top: 1px solid var(--welko-line);
	margin: 0;
}
.welko-input {
	flex: 1;
	resize: none;
	border: 0 !important;
	background: transparent !important;
	color: var(--welko-text) !important;
	font: inherit;
	font-size: 14px;
	line-height: 1.45;
	padding: 7px 0 !important;
	margin: 0;
	height: 36px;
	max-height: 120px !important;
	min-height: 0 !important;
	width: auto !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none;
}
.welko-input::placeholder { color: var(--welko-muted); opacity: 1; }
.welko-send {
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 10px;
	background: var(--welko-accent);
	color: var(--welko-on-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	padding: 0;
}
.welko-send svg { width: 18px; height: 18px; }
.welko-busy .welko-send { opacity: .5; cursor: default; }

/* Phones */
@media (max-width: 560px) {
	.welko { bottom: 14px; }
	.welko-right { right: 14px; }
	.welko-left { left: 14px; }
	.welko-panel {
		position: fixed;
		left: 8px !important;
		right: 8px !important;
		bottom: 78px;
		width: auto;
		height: auto;
		top: 12vh;
		max-height: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.welko-panel, .welko-launcher, .welko-typing span { animation: none; transition: none; }
}

@media print { .welko { display: none; } }
