.jcwa {
	--jcwa-ink: #182536;
	--jcwa-muted: #5d6b80;
	--jcwa-primary: #F6921E;
	--jcwa-primary-dark: #d97b09;
	--jcwa-soft: #f3f6fb;
	--jcwa-line: #e3e9f2;
	width: 100%;
	max-width: 480px;
	margin: 1rem auto;
	border: 1px solid var(--jcwa-line);
	border-radius: 1.125rem;
	background: #fff;
	color: var(--jcwa-ink);
	box-shadow: 0 16px 40px rgba(22, 35, 56, 0.12);
	overflow: hidden;
	font-family: inherit;
	font-size: 0.95rem;
	line-height: 1.5;
}

.jcwa *,
.jcwa *::before,
.jcwa *::after {
	box-sizing: border-box;
}

.jcwa__header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 1.125rem;
	border-bottom: 1px solid var(--jcwa-line);
}

.jcwa__mark {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 0.85rem;
	background: var(--jcwa-primary);
	color: #fff;
	font-weight: 700;
}

.jcwa__header h2 {
	margin: 0 0 0.15rem;
	font-size: 1rem;
	line-height: 1.2;
	font-weight: 700;
	text-align: left;
}

.jcwa__header p {
	margin: 0 !important;
	color: var(--jcwa-muted);
	font-size: 0.78rem;
}

.jcwa__status {
	margin-left: auto;
	color: #0f7a43;
	font-size: 0.75rem;
	font-weight: 600;
	white-space: nowrap;
}

.jcwa__status::before {
	content: "";
	display: inline-block;
	width: 0.45rem;
	height: 0.45rem;
	margin-right: 0.35rem;
	border-radius: 50%;
	background: #20aa65;
}

.jcwa__progress {
	height: 0.25rem;
	background: #eef2f7;
}

.jcwa__progress span {
	display: block;
	width: 8%;
	height: 100%;
	background: var(--jcwa-primary);
	transition: width 0.25s ease;
}

.jcwa__messages {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	height: 26rem;
	min-height: 18rem;
	overflow: auto;
	padding: 1.125rem;
	scroll-behavior: smooth;
}

.jcwa__bubble {
	max-width: 90%;
	padding: 0.75rem 0.9rem;
	border-radius: 1rem;
	overflow-wrap: anywhere;
}

.jcwa__bubble--bot {
	align-self: flex-start;
	background: var(--jcwa-soft);
	border-bottom-left-radius: 0.3rem;
	white-space: pre-wrap;
}

.jcwa__bubble--rich {
	white-space: normal;
}

.jcwa__bubble--user {
	align-self: flex-end;
	background: var(--jcwa-primary);
	color: #fff;
	border-bottom-right-radius: 0.3rem;
	white-space: pre-wrap;
}

.jcwa__line {
	margin: 0.2rem 0;
}

.jcwa__line strong {
	font-weight: 650;
}

.jcwa__warning {
	margin-top: 0.65rem;
	padding: 0.65rem 0.75rem;
	border-left: 3px solid #e8a317;
	border-radius: 0.35rem;
	background: #fff8e6;
	color: #604800;
}

.jcwa__components {
	margin: 0.35rem 0 0.2rem;
	padding-left: 1.15rem;
}

.jcwa__composer {
	padding: 0.85rem 1rem 1rem;
	border-top: 1px solid var(--jcwa-line);
}

.jcwa__form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.jcwa__form input {
	flex: 1 1 100%;
	min-width: 0;
	padding: 0.7rem 0.8rem;
	border: 1px solid #c9d3e2;
	border-radius: 0.6rem;
	background: #fff;
	color: inherit;
	font: inherit;
}

.jcwa__form input:disabled {
	background: #f4f7fb;
	color: #6b7280;
	cursor: wait;
}

.jcwa__form input:focus,
.jcwa button:focus-visible {
	outline: 2px solid var(--jcwa-primary);
	outline-offset: 2px;
}

.jcwa button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0.6rem 1rem;
	border: 0;
	border-radius: 0.6rem;
	background: var(--jcwa-primary);
	color: #fff;
	font: 600 0.95rem inherit;
	line-height: 1.2;
	cursor: pointer;
}

.jcwa button:hover {
	background: var(--jcwa-primary-dark);
}

.jcwa button:disabled {
	opacity: 0.65;
	cursor: wait;
}

.jcwa__choices {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	width: 100%;
}

.jcwa__choices button {
	width: 100%;
	min-height: 3.25rem;
	font-size: 1rem;
}

.jcwa__typing {
	display: inline-flex;
	gap: 0.25rem;
	align-items: center;
	height: 1rem;
}

.jcwa__typing i {
	width: 0.4rem;
	height: 0.4rem;
	border-radius: 50%;
	background: #8b96a6;
	animation: jcwa-bounce 0.9s infinite alternate;
}

.jcwa__typing i:nth-child(2) {
	animation-delay: 0.2s;
}

.jcwa__typing i:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes jcwa-bounce {
	to {
		opacity: 0.35;
		transform: translateY(-4px);
	}
}

.jcwa__quote {
	margin-top: 0.65rem;
	padding: 0.75rem 0.85rem;
	border: 1px solid #dce4f0;
	border-radius: 0.75rem;
	background: #fff;
}

.jcwa__quote div {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.3rem 0;
}

.jcwa__quote div:last-child {
	margin-top: 0.25rem;
	padding-top: 0.65rem;
	border-top: 1px solid var(--jcwa-line);
	font-size: 1.15rem;
}

.jcwa__error {
	width: 100%;
	color: #b42318;
	font-size: 0.85rem;
}

.jcwa__success {
	text-align: center;
	font-size: 1.05rem;
}

@media (max-width: 576px) {
	.jcwa {
		margin: 0.5rem 0;
		border-radius: 0.9rem;
	}

	.jcwa__messages {
		height: min(58vh, 26rem);
		padding: 0.9rem;
	}

	.jcwa__header {
		padding: 0.85rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jcwa__progress span,
	.jcwa__typing i,
	.jcwa__messages {
		transition: none;
		animation: none;
		scroll-behavior: auto;
	}
}
