/* HEX64 AI Assistant - widget */

.hex64ai {
	--h-navy: #10294a;
	--h-blue: #1e6fd9;
	--h-ink: #16202b;
	--h-muted: #6b7a8c;
	--h-line: #e3e8ee;
	--h-bg: #ffffff;

	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
}

/* ---------- launcher ---------- */

.hex64ai-launch {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 8px 20px 8px 8px;
	border-radius: 32px;
	border: 1px solid var(--h-line);
	background: #fff;
	color: var(--h-ink);
	font: inherit;
	cursor: pointer;
	box-shadow: 0 10px 28px rgba(16, 41, 74, .16);
	transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
	margin-left: auto;
}

.hex64ai-launch:hover {
	transform: translateY(-2px);
	border-color: #c9d6e4;
	box-shadow: 0 14px 34px rgba(16, 41, 74, .2);
}
.hex64ai-launch:focus-visible { outline: 3px solid var(--h-blue); outline-offset: 3px; }
.hex64ai.is-open .hex64ai-launch { display: none; }

.hex64ai-avatar {
	position: relative;
	flex: 0 0 42px;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--h-blue), var(--h-navy));
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hex64ai-dot {
	position: absolute;
	right: -1px;
	bottom: -1px;
	width: 13px;
	height: 13px;
	border-radius: 50%;
	background: #22c55e;
	border: 2.5px solid #fff;
}

.hex64ai-launch-txt { text-align: left; line-height: 1.25; }
.hex64ai-launch-t1 { display: block; font-weight: 650; font-size: 14.5px; }
.hex64ai-launch-t2 { display: block; font-size: 11.5px; color: var(--h-muted); }

/* The header wears the same face, one size down. */
.hex64ai-avatar-sm { flex: 0 0 34px; width: 34px; height: 34px; }
.hex64ai-avatar-sm .hex64ai-dot { width: 11px; height: 11px; border-width: 2px; border-color: var(--h-navy); }

/*
 * Phones: collapse to the circle. A pill at 375px covers too much of the page
 * and lands on top of the site's own fixed ENQUIRE NOW bar.
 *
 * The label is VISUALLY hidden, not removed - display:none would strip the
 * button's accessible name, leaving screen-reader users with an unlabelled
 * button. This keeps the name and drops only the pixels.
 */
@media (max-width: 480px) {
	.hex64ai-launch { padding: 7px; border-radius: 50%; gap: 0; }
	.hex64ai-launch-txt {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
		white-space: nowrap;
		border: 0;
	}
}

/* ---------- panel ---------- */

.hex64ai-panel {
	width: 370px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 100px);
	background: var(--h-bg);
	border: 1px solid var(--h-line);
	border-radius: 14px;
	box-shadow: 0 18px 50px rgba(16, 41, 74, .22);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.hex64ai-panel[hidden] { display: none; }

.hex64ai-head {
	background: var(--h-navy);
	color: #fff;
	padding: 13px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.hex64ai-headtxt { flex: 1; min-width: 0; }
.hex64ai-title { font-weight: 600; font-size: 15px; }
.hex64ai-sub { font-size: 12px; opacity: .72; }

.hex64ai-close {
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	opacity: .8;
}
.hex64ai-close:hover { opacity: 1; }
.hex64ai-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- log ---------- */

.hex64ai-log {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f7f9fb;
}

.hex64ai-msg {
	max-width: 85%;
	padding: 9px 13px;
	border-radius: 13px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.hex64ai-bot {
	background: #fff;
	color: var(--h-ink);
	border: 1px solid var(--h-line);
	border-bottom-left-radius: 4px;
	align-self: flex-start;
}

.hex64ai-user {
	background: var(--h-navy);
	color: #fff;
	border-bottom-right-radius: 4px;
	align-self: flex-end;
}

.hex64ai-err { border-color: #e6b8b8; background: #fdf4f4; color: #8a2b2b; }

.hex64ai-link {
	color: var(--h-blue);
	text-decoration: underline;
	overflow-wrap: anywhere;
}
.hex64ai-user .hex64ai-link { color: #cfe2ff; }
.hex64ai-link:focus-visible { outline: 2px solid var(--h-blue); outline-offset: 2px; }

/* ---------- typing ---------- */

.hex64ai-typing { display: flex; gap: 4px; align-items: center; padding: 13px; }
.hex64ai-typing span {
	width: 7px; height: 7px; border-radius: 50%;
	background: var(--h-muted); opacity: .45;
	animation: hex64ai-bounce 1.3s infinite;
}
.hex64ai-typing span:nth-child(2) { animation-delay: .18s; }
.hex64ai-typing span:nth-child(3) { animation-delay: .36s; }

@keyframes hex64ai-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: .45; }
	30% { transform: translateY(-4px); opacity: .9; }
}

@media (prefers-reduced-motion: reduce) {
	.hex64ai-typing span { animation: none; }
	.hex64ai-launch { transition: none; }
}

/* ---------- form ---------- */

.hex64ai-form {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid var(--h-line);
	background: #fff;
}

.hex64ai-input {
	flex: 1;
	border: 1px solid var(--h-line);
	border-radius: 9px;
	padding: 10px 12px;
	font: inherit;
	color: var(--h-ink);
	background: #fff;
	min-width: 0;
}
.hex64ai-input:focus { outline: 2px solid var(--h-blue); outline-offset: -1px; border-color: var(--h-blue); }
.hex64ai-input:disabled { background: #f2f5f8; }

.hex64ai-send {
	border: 0;
	border-radius: 9px;
	width: 42px;
	background: var(--h-navy);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
}
.hex64ai-send:hover:not(:disabled) { background: var(--h-blue); }
.hex64ai-send:disabled { opacity: .5; cursor: default; }
.hex64ai-send:focus-visible { outline: 3px solid var(--h-blue); outline-offset: 2px; }

.hex64ai-foot {
	padding: 7px 14px 10px;
	font-size: 11px;
	color: var(--h-muted);
	text-align: center;
	background: #fff;
}

/* ---------- small screens ---------- */

@media (max-width: 480px) {
	.hex64ai { right: 12px; bottom: 12px; left: 12px; }
	.hex64ai-panel { width: 100%; height: min(540px, calc(100vh - 90px)); }
}
