.jonah {
	--jonah-accent: #16345c;
	--jonah-ink: #1c2733;
	--jonah-muted: #6b7280;
	--jonah-paper: #f7f5f1;
	--jonah-line: #e7e2d9;
	--jonah-radius: 16px;
	max-width: 640px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--jonah-ink);
	line-height: 1.5;
}

/* ---- Collapsed input bar (the "quick chat" pill) ---- */
.jonah__bar {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #fff;
	border: 1px solid var(--jonah-line);
	border-radius: 999px;
	padding: 6px 6px 6px 20px;
	box-shadow: 0 6px 22px rgba(22, 52, 92, 0.07);
	transition: border-color .18s ease, box-shadow .18s ease, border-radius .22s ease;
}
.jonah.is-open .jonah__bar {
	border-radius: 14px;
	box-shadow: 0 6px 22px rgba(22, 52, 92, 0.10);
}
.jonah__bar:focus-within {
	border-color: var(--jonah-accent);
	box-shadow: 0 8px 26px rgba(22, 52, 92, 0.14);
}
.jonah__input {
	flex: 1;
	border: 0;
	outline: 0;
	background: transparent;
	font: inherit;
	color: var(--jonah-ink);
	padding: 12px 0;
	min-width: 0;
}
.jonah__input::placeholder { color: var(--jonah-muted); }
.jonah__send {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 999px;
	background: var(--jonah-accent);
	color: #fff;
	cursor: pointer;
	transition: transform .12s ease, opacity .12s ease;
}
.jonah__send:hover { transform: translateY(-1px); }
.jonah__send:active { transform: translateY(0); }
.jonah.is-busy .jonah__send { opacity: .5; pointer-events: none; }

/* ---- Preset chips ---- */
.jonah__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}
.jonah__chip {
	border: 1px solid var(--jonah-line);
	background: #fff;
	color: var(--jonah-accent);
	font: inherit;
	font-size: 14px;
	padding: 8px 14px;
	border-radius: 999px;
	cursor: pointer;
	transition: background .14s ease, border-color .14s ease, transform .12s ease;
}
.jonah__chip:hover {
	background: var(--jonah-paper);
	border-color: var(--jonah-accent);
	transform: translateY(-1px);
}
.jonah.is-open .jonah__chips { margin-top: 10px; }

/* ---- Expanding conversation panel ---- */
.jonah__panel {
	border: 1px solid var(--jonah-line);
	border-radius: var(--jonah-radius);
	background: #fff;
	overflow: hidden;
	margin-bottom: 12px;
	max-height: 0;
	opacity: 0;
	transition: max-height .28s ease, opacity .22s ease;
}
.jonah.is-open .jonah__panel {
	max-height: 460px;
	opacity: 1;
}
.jonah__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 18px;
	background: var(--jonah-accent);
	color: #fff;
}
.jonah__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
}
.jonah__title { font-weight: 600; letter-spacing: .01em; }
.jonah__log {
	padding: 18px;
	height: 372px;
	overflow-y: auto;
	background:
		radial-gradient(circle at 100% 0, rgba(22, 52, 92, 0.03), transparent 40%),
		var(--jonah-paper);
}

/* ---- Message bubbles ---- */
.jonah__msg {
	max-width: 84%;
	padding: 11px 14px;
	border-radius: 14px;
	margin-bottom: 10px;
	font-size: 15px;
	word-wrap: break-word;
}
.jonah__msg p { margin: 0 0 6px; }
.jonah__msg p:last-child { margin-bottom: 0; }
.jonah__msg ul { margin: 4px 0 4px 18px; padding: 0; }
.jonah__msg--user {
	margin-left: auto;
	background: var(--jonah-accent);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.jonah__msg--bot {
	background: #fff;
	border: 1px solid var(--jonah-line);
	border-bottom-left-radius: 4px;
}
.jonah__msg--error {
	background: #fff4f3;
	border: 1px solid #f3c9c4;
	color: #8a2f26;
}

/* ---- Links inside messages ---- */
.jonah__msg a {
	color: var(--jonah-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
	word-break: break-word;
}
.jonah__msg a:hover { opacity: .75; }
.jonah__msg--user a { color: #fff; }

/* ---- Sources ---- */
.jonah__sources {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: -2px 0 12px;
}
.jonah__source {
	font-size: 12px;
	color: var(--jonah-accent);
	background: #fff;
	border: 1px solid var(--jonah-line);
	border-radius: 999px;
	padding: 4px 10px;
	text-decoration: none;
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.jonah__source:hover { background: var(--jonah-paper); }

/* ---- Typing indicator ---- */
.jonah__typing { display: inline-flex; gap: 4px; align-items: center; }
.jonah__typing span {
	width: 6px; height: 6px; border-radius: 50%;
	background: var(--jonah-muted);
	animation: jonahBounce 1.2s infinite ease-in-out;
}
.jonah__typing span:nth-child(2) { animation-delay: .15s; }
.jonah__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes jonahBounce {
	0%, 80%, 100% { transform: translateY(0); opacity: .5; }
	40% { transform: translateY(-4px); opacity: 1; }
}

/* ---- Focus + motion accessibility ---- */
.jonah__chip:focus-visible,
.jonah__send:focus-visible,
.jonah__source:focus-visible,
.jonah__msg a:focus-visible {
	outline: 2px solid var(--jonah-accent);
	outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
	.jonah__panel, .jonah__bar, .jonah__chip, .jonah__send { transition: none; }
	.jonah__typing span { animation: none; }
}

/* ---- Mobile ---- */
@media (max-width: 520px) {
	.jonah.is-open .jonah__panel { max-height: 70vh; }
	.jonah__log { height: 300px; }
	.jonah__msg { max-width: 90%; }
}
