/* אמה – מזוזות נחלים. בהיר, בגווני האתר. */
#alors-emma, #alors-emma * { box-sizing: border-box; }
#alors-emma {
	--emma-bg: #FFFFFF; --emma-deep: #F6F4F0; --emma-bubble: #F1EEE9;
	--emma-text: #2B2A28; --emma-muted: #6F6B65; --emma-line: rgba(43,42,40,.12);
	--emma-cyan: #2B2A28; --emma-cyan-line: #C9C3BA; --emma-green: #1F8A4C;
	--emma-bottom: 24px;
	position: fixed; right: 24px; bottom: var(--emma-bottom); z-index: 99990;
	font-family: Heebo, Arial, Helvetica, sans-serif; color: var(--emma-text);
	direction: rtl; text-align: right; font-size: 15px; line-height: 1.55;
}
#alors-emma button, #alors-emma input { font: inherit; letter-spacing: normal; text-transform: none; }
#alors-emma .emma-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#alors-emma :focus-visible { outline: 3px solid #A9773F; outline-offset: 2px; }

/* כפתור + תגית */
#alors-emma .emma-dock { display: flex; align-items: center; gap: 12px; }
#alors-emma .emma-launch {
	width: 68px; height: 68px; padding: 0; margin: 0; border: 0; border-radius: 50%;
	background: transparent; cursor: pointer; box-shadow: 0 10px 26px rgba(43,42,40,.22);
	display: flex; align-items: center; justify-content: center; flex: none;
	transition: transform .15s ease;
}
#alors-emma .emma-launch:hover { transform: scale(1.05); }
#alors-emma .emma-launch svg { width: 68px; height: 68px; display: block; }
#alors-emma .emma-tag {
	display: none; align-items: center; gap: 4px; padding: 6px; padding-right: 18px;
	background: #FFFFFF; color: #2B2A28; border: 1px solid var(--emma-line); border-radius: 500px; box-shadow: 0 10px 26px rgba(43,42,40,.16);
}
#alors-emma.emma-show-tag .emma-tag { display: flex; animation: emma-in .3s ease both; }
#alors-emma .emma-tag-text { border: 0; background: transparent; color: #2B2A28; font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap; min-height: 36px; padding: 0; }
#alors-emma .emma-tag-x { color: #2B2A28; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #EEEAE4; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; flex: none; }
#alors-emma.emma-open .emma-dock { display: none; }

/* החלון */
#alors-emma .emma-panel {
	display: none; position: fixed; right: 24px; bottom: var(--emma-bottom);
	width: 384px; height: min(620px, calc(100vh - 48px));
	background: var(--emma-bg); border: 1px solid var(--emma-line); border-radius: 22px;
	box-shadow: 0 20px 50px rgba(43,42,40,.22); flex-direction: column; overflow: hidden;
}
#alors-emma.emma-open .emma-panel { display: flex; animation: emma-in .25s ease both; }
#alors-emma .emma-head { padding: 14px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--emma-line); }
#alors-emma .emma-head > svg { width: 48px; height: 48px; flex: none; }
#alors-emma .emma-who { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
#alors-emma .emma-name { font-size: 18px; font-weight: 600; color: var(--emma-text); }
#alors-emma .emma-role { font-size: 13px; color: var(--emma-muted); }
#alors-emma .emma-test { font-size: 11px; color: #2B2A28; background: #F3E3C7; border-radius: 500px; padding: 1px 8px; align-self: flex-start; margin-top: 2px; }
#alors-emma .emma-close { color: var(--emma-text); width: 44px; height: 44px; border: 1.5px solid var(--emma-line); border-radius: 50%; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; flex: none; }

#alors-emma .emma-log { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
#alors-emma .emma-msg { max-width: 85%; padding: 11px 16px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; margin: 0; }
#alors-emma .emma-bot { align-self: flex-start; background: var(--emma-bubble); color: var(--emma-text); border-radius: 18px 18px 6px 18px; }
#alors-emma .emma-user { align-self: flex-end; background: var(--emma-cyan); color: #FFFFFF; font-weight: 500; border-radius: 18px 18px 18px 6px; }
#alors-emma .emma-typing { align-self: flex-start; background: var(--emma-bubble); border-radius: 18px; padding: 14px 16px; display: flex; gap: 5px; }
#alors-emma .emma-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--emma-muted); animation: emma-dot 1s infinite; }
#alors-emma .emma-typing i:nth-child(2) { animation-delay: .15s; } #alors-emma .emma-typing i:nth-child(3) { animation-delay: .3s; }

#alors-emma .emma-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
#alors-emma .emma-chip { min-height: 44px; padding: 0 18px; border-radius: 500px; border: 2px solid var(--emma-cyan-line); background: transparent; color: var(--emma-text); font-size: 15px; cursor: pointer; }
#alors-emma .emma-chip:hover { background: var(--emma-deep); }

/* טופס ליד */
#alors-emma .emma-lead { margin-top: 4px; padding: 16px; border: 2px solid var(--emma-cyan-line); border-radius: 20px; background: var(--emma-deep); display: flex; flex-direction: column; gap: 12px; }
#alors-emma .emma-field { display: flex; flex-direction: column; gap: 6px; }
#alors-emma .emma-field label { font-size: 14px; font-weight: 500; color: var(--emma-text); }
#alors-emma .emma-field input { min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--emma-cyan-line); background: var(--emma-bg); color: var(--emma-text); font-size: 16px; width: 100%; }
#alors-emma .emma-field input[type="tel"] { direction: ltr; text-align: right; }
#alors-emma .emma-err { font-size: 13px; color: #B3261E; min-height: 0; margin: 0; }
#alors-emma .emma-note { font-size: 12px; line-height: 1.5; color: var(--emma-muted); margin: 0; }
#alors-emma .emma-note a, #alors-emma .emma-foot a { color: var(--emma-muted); }
#alors-emma .emma-primary { min-height: 48px; border: 0; border-radius: 500px; background: var(--emma-cyan); color: #FFFFFF; font-size: 16px; font-weight: 600; cursor: pointer; width: 100%; }
#alors-emma .emma-primary[disabled] { opacity: .6; cursor: wait; }
#alors-emma .emma-ghost { min-height: 48px; border: 1.5px solid var(--emma-cyan-line); border-radius: 500px; background: transparent; color: var(--emma-text); font-size: 16px; cursor: pointer; width: 100%; }

/* תחתית */
#alors-emma .emma-bottom { padding: 10px 14px 14px; border-top: 1px solid var(--emma-line); display: flex; flex-direction: column; gap: 10px; }
#alors-emma .emma-form { display: flex; gap: 8px; align-items: center; margin: 0; }
#alors-emma .emma-input { flex: 1; min-width: 0; min-height: 46px; padding: 0 18px; border-radius: 500px; border: 1.5px solid var(--emma-cyan-line); background: var(--emma-deep); color: var(--emma-text); font-size: 16px; }
#alors-emma .emma-input::placeholder { color: #8C877F; }
#alors-emma .emma-link { color: var(--emma-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
#alors-emma .emma-send { width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--emma-cyan); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; flex: none; }
#alors-emma .emma-foot { display: flex; justify-content: space-between; align-items: center; font-size: 13px; gap: 8px; }
#alors-emma .emma-wa { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--emma-green); cursor: pointer; padding: 6px 0; font-size: 13px; white-space: nowrap; }

/* שאלת יציאה */
#alors-emma .emma-exit { display: none; position: absolute; inset: 0; background: rgba(43,42,40,.35); align-items: flex-end; }
#alors-emma.emma-exiting .emma-exit { display: flex; }
#alors-emma .emma-sheet { width: 100%; padding: 22px 20px 24px; background: var(--emma-deep); border-top: 1px solid var(--emma-line); border-radius: 22px 22px 0 0; display: flex; flex-direction: column; gap: 12px; }
#alors-emma .emma-sheet h2 { margin: 0; font-size: 20px; line-height: 1.35; font-weight: 600; color: var(--emma-text); font-family: inherit; }
#alors-emma .emma-sheet p { margin: 0 0 4px; color: var(--emma-muted); font-size: 15px; }

@keyframes emma-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes emma-dot { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

/* נייד: מסך מלא */
@media (max-width: 600px) {
	#alors-emma { right: 16px; }
	#alors-emma .emma-launch, #alors-emma .emma-launch svg { width: 60px; height: 60px; }
	#alors-emma .emma-dock { flex-direction: column-reverse; align-items: flex-start; gap: 10px; }
	#alors-emma .emma-tag-text { font-size: 14px; }
	#alors-emma .emma-panel { inset: 0; right: 0; bottom: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
	#alors-emma *, #alors-emma { animation: none !important; transition: none !important; }
}
