/* Julie chat widget. Adjust the variables to match the site. */
.jba {
	--jba-bg: #faf8f5;
	--jba-surface: #ffffff;
	--jba-ink: #2b2723;
	--jba-muted: #8a817a;
	--jba-accent: #2b2723;
	--jba-accent-ink: #faf8f5;
	--jba-bubble-user: #2b2723;
	--jba-bubble-user-ink: #faf8f5;
	--jba-bubble-bot: #efeae4;
	--jba-line: #e4ddd5;
	--jba-radius: 18px;
	--jba-font: inherit;
	font-family: var(--jba-font);
	color: var(--jba-ink);
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
}
.jba *, .jba *::before, .jba *::after { box-sizing: border-box; }

.jba-launcher {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 18px 12px 14px;
	border: 0;
	border-radius: 999px;
	background: var(--jba-accent);
	color: var(--jba-accent-ink);
	font: 500 15px/1 var(--jba-font);
	letter-spacing: 0.02em;
	cursor: pointer;
	box-shadow: 0 8px 28px rgba(43, 39, 35, 0.22);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.jba-launcher:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(43, 39, 35, 0.28); }
.jba-launcher svg { width: 20px; height: 20px; }
.jba-open .jba-launcher { display: none; }

.jba-panel {
	display: none;
	flex-direction: column;
	width: 370px;
	height: min(600px, calc(100vh - 40px));
	background: var(--jba-bg);
	border: 1px solid var(--jba-line);
	border-radius: var(--jba-radius);
	box-shadow: 0 24px 60px rgba(43, 39, 35, 0.22);
	overflow: hidden;
	animation: jba-in 0.22s ease-out;
}
.jba-open .jba-panel { display: flex; }
@keyframes jba-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.jba-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 18px;
	background: var(--jba-surface);
	border-bottom: 1px solid var(--jba-line);
}
.jba-avatar {
	width: 38px; height: 38px;
	border-radius: 50%;
	display: grid; place-items: center;
	background: var(--jba-bubble-bot);
	font: 500 16px/1 var(--jba-font);
	letter-spacing: 0.04em;
}
.jba-title { font-weight: 600; font-size: 16px; line-height: 1.2; }
.jba-subtitle { font-size: 12.5px; color: var(--jba-muted); margin-top: 2px; }
.jba-close {
	margin-left: auto;
	width: 34px; height: 34px;
	border: 0; border-radius: 50%;
	background: transparent; color: var(--jba-ink);
	cursor: pointer; font-size: 22px; line-height: 1;
}
.jba-close:hover { background: var(--jba-bubble-bot); }

.jba-test {
	padding: 6px 18px;
	font-size: 11.5px;
	background: #fff4d6;
	color: #6b5200;
	border-bottom: 1px solid var(--jba-line);
}

.jba-log {
	flex: 1;
	overflow-y: auto;
	padding: 18px 16px 8px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	scroll-behavior: smooth;
}
.jba-msg {
	max-width: 84%;
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 14.5px;
	line-height: 1.5;
	word-wrap: break-word;
	white-space: normal;
}
.jba-msg p { margin: 0 0 6px; }
.jba-msg p:last-child { margin-bottom: 0; }
.jba-bot { align-self: flex-start; background: var(--jba-bubble-bot); border-bottom-left-radius: 6px; }
.jba-user { align-self: flex-end; background: var(--jba-bubble-user); color: var(--jba-bubble-user-ink); border-bottom-right-radius: 6px; }

.jba-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.jba-typing span {
	width: 6px; height: 6px; border-radius: 50%;
	background: var(--jba-muted);
	animation: jba-dot 1.2s infinite ease-in-out;
}
.jba-typing span:nth-child(2) { animation-delay: 0.15s; }
.jba-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes jba-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.jba-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px 12px 8px;
	background: var(--jba-surface);
	border-top: 1px solid var(--jba-line);
}
.jba-input {
	flex: 1;
	resize: none;
	max-height: 120px;
	min-height: 42px;
	padding: 10px 14px;
	border: 1px solid var(--jba-line);
	border-radius: 21px;
	background: var(--jba-bg);
	color: var(--jba-ink);
	font: 14.5px/1.4 var(--jba-font);
	outline: none;
}
.jba-input:focus { border-color: var(--jba-muted); }
.jba-send {
	width: 42px; height: 42px;
	flex-shrink: 0;
	border: 0; border-radius: 50%;
	background: var(--jba-accent); color: var(--jba-accent-ink);
	display: grid; place-items: center;
	cursor: pointer;
}
.jba-send:disabled { opacity: 0.4; cursor: default; }
.jba-send svg { width: 18px; height: 18px; }

.jba-foot {
	padding: 0 16px 10px;
	background: var(--jba-surface);
	font-size: 11px;
	color: var(--jba-muted);
	text-align: center;
}
.jba-foot a { color: inherit; }

@media (max-width: 520px) {
	.jba { right: 12px; bottom: 12px; }
	.jba-open { inset: 0; right: 0; bottom: 0; }
	.jba-open .jba-panel { width: 100%; height: 100%; border-radius: 0; border: 0; }
	.jba-input { font-size: 16px; } /* stops iOS zoom */
}
@media (prefers-reduced-motion: reduce) {
	.jba-panel, .jba-launcher, .jba-typing span { animation: none; transition: none; }
}
