/* Webeditor AI Engine – látogatói chat widget. A téma betűtípusát örökli. */
.weai {
	--weai-accent: #79c24d;
	--weai-dark: #4f7e32;
	--weai-ink: #1f2933;
	--weai-muted: #6b7280;
	--weai-line: #e5e7eb;
	--weai-bg: #f5f7f4;
	position: fixed;
	bottom: 22px;
	right: 22px;
	z-index: 99999;
	font: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--weai-ink);
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}
.weai[data-pos="left"] { right: auto; left: 22px; align-items: flex-start; }
.weai *, .weai *::before, .weai *::after { box-sizing: border-box; }
.weai button { font: inherit; }

/* ---------- Indító gomb ---------- */
.weai-launch {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 58px;
	padding: 0 22px 0 18px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--weai-accent), var(--weai-dark));
	color: #fff;
	font-weight: 600;
	letter-spacing: .01em;
	cursor: pointer;
	box-shadow: 0 10px 25px -6px rgba(31, 41, 51, .35), 0 2px 6px rgba(31, 41, 51, .12);
	transition: transform .2s ease, box-shadow .2s ease;
}
.weai-launch svg { flex: none; }
.weai-launch:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -8px rgba(31, 41, 51, .4), 0 3px 8px rgba(31, 41, 51, .14); }
.weai-launch-dot {
	position: absolute;
	top: 8px;
	left: 38px;
	width: 10px;
	height: 10px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #22c55e;
}
.weai-launch { position: relative; }
.weai.is-open .weai-launch { display: none; }
.weai-launch:focus-visible, .weai button:focus-visible, .weai-input:focus-visible { outline: 3px solid color-mix(in srgb, var(--weai-accent) 55%, transparent); outline-offset: 2px; }

/* ---------- Panel ---------- */
.weai-panel {
	display: flex;
	flex-direction: column;
	width: min(390px, calc(100vw - 24px));
	height: min(620px, calc(100vh - 44px));
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 24px 60px -12px rgba(31, 41, 51, .35), 0 4px 14px rgba(31, 41, 51, .08);
	overflow: hidden;
	transform-origin: bottom right;
	animation: weai-pop .22s cubic-bezier(.2, .9, .3, 1.2);
}
.weai[data-pos="left"] .weai-panel { transform-origin: bottom left; }
.weai-panel[hidden] { display: none; }
@keyframes weai-pop { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

/* Fejléc */
.weai-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 14px 16px 20px;
	background: linear-gradient(135deg, var(--weai-accent), var(--weai-dark));
	color: #fff;
}
.weai-head-text { flex: 1; min-width: 0; }
.weai-title { display: block; font-weight: 700; font-size: 16px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weai-status { display: flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: .92; }
.weai-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #bbf7d0; box-shadow: 0 0 0 2px rgba(187, 247, 208, .35); }
.weai-icon {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .14);
	color: inherit;
	cursor: pointer;
	transition: background .15s ease;
}
.weai-icon:hover { background: rgba(255, 255, 255, .28); }

/* Üzenetek */
.weai-msgs {
	flex: 1;
	overflow-y: auto;
	padding: 18px 14px 10px;
	background: var(--weai-bg);
	display: flex;
	flex-direction: column;
	gap: 10px;
	scroll-behavior: smooth;
}
.weai-row { display: flex; max-width: 88%; animation: weai-in .18s ease-out; }
.weai-row-user { align-self: flex-end; justify-content: flex-end; }
.weai-row-assistant { align-self: flex-start; }
@keyframes weai-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.weai-msg {
	padding: 10px 14px;
	border-radius: 18px;
	white-space: normal;
	overflow-wrap: anywhere;
	min-width: 0;
}
.weai-assistant {
	background: #fff;
	border-bottom-left-radius: 6px;
	box-shadow: 0 1px 2px rgba(31, 41, 51, .06), 0 2px 8px rgba(31, 41, 51, .04);
}
.weai-user {
	background: linear-gradient(135deg, var(--weai-accent), var(--weai-dark));
	color: #fff;
	border-bottom-right-radius: 6px;
	white-space: pre-wrap;
}
.weai-msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.weai-assistant a { color: var(--weai-dark); font-weight: 600; }
.weai-msg strong { font-weight: 700; }
.weai-msg ul { margin: 6px 0; padding-left: 18px; }
.weai-msg li { margin: 3px 0; }
.weai-error { background: #fef2f2; color: #991b1b; box-shadow: inset 0 0 0 1px #fecaca; }

/* Gépelés jelző */
.weai-msg.is-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.weai-msg.is-typing::before,
.weai-msg.is-typing::after,
.weai-msg.is-typing span { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; animation: weai-bounce 1.2s infinite ease-in-out; }
.weai-msg.is-typing span { animation-delay: .15s; }
.weai-msg.is-typing::after { animation-delay: .3s; }
@keyframes weai-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Beviteli sáv */
.weai-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin: 10px 12px 0;
	padding: 6px 6px 6px 14px;
	border: 1px solid var(--weai-line);
	border-radius: 24px;
	background: #fff;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.weai-form:focus-within { border-color: var(--weai-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--weai-accent) 22%, transparent); }
.weai-input {
	flex: 1;
	min-height: 38px;
	max-height: 120px;
	padding: 8px 0;
	border: 0;
	outline: 0;
	font: inherit;
	resize: none;
	background: transparent;
	color: inherit;
	box-shadow: none;
}
.weai .weai-input,
.weai .weai-input:focus,
.weai .weai-input:focus-visible { outline: none !important; border: 0 !important; box-shadow: none !important; background: transparent !important; }
.weai-send {
	flex: none;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--weai-accent), var(--weai-dark));
	color: #fff;
	cursor: pointer;
	transition: transform .15s ease, opacity .15s ease;
}
.weai-send:hover { transform: scale(1.06); }
.weai-send:disabled { opacity: .45; cursor: default; transform: none; }
.weai-notice {
	padding: 8px 16px 12px;
	font-size: 11.5px;
	text-align: center;
	color: var(--weai-muted);
	background: #fff;
}
.weai-panel > .weai-form:last-child { margin-bottom: 12px; }

@media (max-width: 480px) {
	.weai { right: 12px; bottom: 12px; }
	.weai[data-pos="left"] { left: 12px; }
	.weai-panel { width: calc(100vw - 24px); height: calc(100vh - 24px); height: calc(100dvh - 24px); }
	.weai-launch { width: 58px; padding: 0; justify-content: center; }
	.weai-launch-text { display: none; }
	.weai-launch-dot { left: 36px; }
}
@media (prefers-reduced-motion: reduce) {
	.weai-panel, .weai-row, .weai-launch, .weai-send { animation: none; transition: none; }
	.weai-msg.is-typing::before, .weai-msg.is-typing::after, .weai-msg.is-typing span { animation: none; }
}

/* A téma gombstílusainak (padding, line-height, min-height, szöveg) semlegesítése. */
.weai .weai-icon,
.weai .weai-send {
	padding: 0 !important;
	margin: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	line-height: 1 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
}
.weai .weai-icon { width: 34px !important; height: 34px !important; }
.weai .weai-send { width: 38px !important; height: 38px !important; }
.weai .weai-icon svg,
.weai .weai-send svg { display: block; margin: 0; }
.weai .weai-send svg { transform: translateX(1px); }

/* ---------- Rendszám kereső kártya ---------- */
.weai .weai-card {
	align-self: stretch;
	margin: 2px 0 4px;
	padding: 14px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 1px 2px rgba(31, 41, 51, .06), 0 6px 18px rgba(31, 41, 51, .07);
	border-top: 3px solid var(--weai-accent);
	animation: weai-in .2s ease-out;
}
.weai-card-title { font-weight: 700; font-size: 15px; }
.weai-card-sub { margin: 2px 0 12px; font-size: 13px; color: var(--weai-muted); line-height: 1.4; }
.weai-card-row { display: flex; gap: 8px; align-items: stretch; }
.weai-plate {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: stretch;
	height: 46px;
	border: 2px solid #1f2933;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
	cursor: text;
	box-shadow: inset 0 0 0 2px #fff, 0 1px 3px rgba(0, 0, 0, .12);
	transition: box-shadow .15s ease;
}
.weai-plate:focus-within { box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px color-mix(in srgb, var(--weai-accent) 35%, transparent); }
.weai-plate-eu {
	flex: none;
	width: 28px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	background: #003399;
	color: #fff;
	font-size: 12px;
	line-height: 1;
}
.weai-plate-eu b { font-weight: 700; }
.weai .weai-plate-input {
	flex: 1;
	min-width: 0;
	width: 100%;
	height: auto !important;
	margin: 0 !important;
	padding: 0 10px !important;
	border: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
	color: #111 !important;
	font: inherit;
	font-size: 22px !important;
	font-weight: 700;
	letter-spacing: .12em;
	text-align: center;
	text-transform: uppercase;
	font-variant-numeric: tabular-nums;
}
.weai .weai-plate-input::placeholder { color: #c4c8cc; font-weight: 600; }
.weai .weai-card-btn {
	flex: none;
	margin: 0 !important;
	padding: 0 16px !important;
	min-height: 0 !important;
	height: 46px !important;
	line-height: 1 !important;
	border: 0 !important;
	border-radius: 10px !important;
	background: linear-gradient(135deg, var(--weai-accent), var(--weai-dark)) !important;
	color: #fff !important;
	font-weight: 700;
	text-transform: none !important;
	cursor: pointer;
	transition: transform .15s ease;
}
.weai .weai-card-btn:hover { transform: translateY(-1px); }
.weai-card-err { margin-top: 6px; font-size: 12.5px; color: #b42318; }
.weai-card-err:empty { display: none; }
.weai-assistant.weai-result { border-left: 3px solid var(--weai-accent); }
