/* Stephen V. site assistant — matches custom.css navy + blue accent */
#site-chat-root {
	--chat-accent: #3b82f6;
	--chat-accent-h: #2563eb;
	--chat-panel: rgba(18, 32, 64, 0.96);
	--chat-panel2: #1a2d5c;
	--chat-bg: #080e1c;
	--chat-text: #f8fafc;
	--chat-muted: #94a3b8;
	--chat-user: #1e3a6e;
	font-family: "Segoe UI", system-ui, sans-serif;
}

#site-chat-toggle {
	position: fixed;
	right: 1.25rem;
	bottom: 1.25rem;
	z-index: 9998;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	border: 1px solid var(--chat-accent);
	border-radius: 999px;
	background: linear-gradient(135deg, var(--chat-panel) 0%, #152a52 100%);
	color: var(--chat-text);
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.06rem;
	text-transform: uppercase;
	padding: 0.75rem 1.1rem;
	cursor: pointer;
	box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(59, 130, 246, 0.4);
	animation: site-chat-pulse 3s ease-in-out infinite;
	transition: background 0.15s, transform 0.15s;
}

.site-chat-ai-badge {
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.08rem;
	text-transform: uppercase;
	padding: 0.15rem 0.4rem;
	border-radius: 4px;
	background: var(--chat-accent);
	color: #fff;
}

@keyframes site-chat-pulse {
	0%, 100% { box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(59, 130, 246, 0.35); }
	50% { box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.45), 0 0 0 6px rgba(59, 130, 246, 0); }
}

@keyframes site-chat-slide-up {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: translateY(0); }
}

#site-chat-toggle:hover,
#site-chat-toggle:focus {
	background: var(--chat-panel2);
	outline: none;
	transform: translateY(-1px);
}

#site-chat-panel {
	position: fixed;
	right: 1.25rem;
	bottom: 4.5rem;
	z-index: 9999;
	width: min(22rem, calc(100vw - 2rem));
	max-height: min(32rem, calc(100vh - 6rem));
	display: flex;
	flex-direction: column;
	border: 1px solid var(--chat-accent);
	border-radius: 10px;
	background: var(--chat-panel);
	box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.55);
	overflow: hidden;
	animation: site-chat-slide-up 0.22s ease-out;
}

#site-chat-panel.is-open {
	display: flex;
}

#site-chat-panel[hidden] {
	display: none;
}

.site-chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.85rem 1rem;
	border-bottom: 1px solid rgba(59, 130, 246, 0.35);
	background: rgba(8, 14, 28, 0.5);
}

.site-chat-header h2 {
	margin: 0;
	font-size: 0.8rem;
	letter-spacing: 0.12rem;
	text-transform: uppercase;
	color: var(--chat-text);
	font-weight: 700;
}

.site-chat-header p {
	margin: 0.2rem 0 0;
	font-size: 0.72rem;
	color: var(--chat-muted);
}

.site-chat-status {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.35rem;
	font-size: 0.65rem;
	color: var(--chat-muted);
}

.site-chat-status-dot {
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 50%;
	background: #64748b;
}

.site-chat-status-dot.is-live {
	background: #4ade80;
	box-shadow: 0 0 6px rgba(74, 222, 128, 0.65);
}

.site-chat-msg-meta {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.62rem;
	color: var(--chat-muted);
	font-style: italic;
}

.site-chat-close {
	border: 0;
	background: transparent;
	color: var(--chat-muted);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	padding: 0 0.25rem;
}

.site-chat-close:hover,
.site-chat-close:focus {
	color: var(--chat-text);
	outline: none;
}

.site-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 0.85rem;
	background: var(--chat-bg);
	min-height: 12rem;
	max-height: 20rem;
}

.site-chat-msg {
	margin: 0 0 0.65rem;
	padding: 0.55rem 0.7rem;
	border-radius: 8px;
	font-size: 0.82rem;
	line-height: 1.45;
	word-wrap: break-word;
}

.site-chat-msg--bot {
	background: var(--chat-panel2);
	color: var(--chat-text);
}

.site-chat-msg--user {
	background: var(--chat-user);
	color: var(--chat-text);
	margin-left: 1.5rem;
}

.site-chat-msg a {
	color: var(--chat-accent);
	border-bottom: dotted 1px rgba(59, 130, 246, 0.5);
	text-decoration: none;
}

.site-chat-msg a:hover {
	border-bottom-color: var(--chat-accent);
}

.site-chat-typing {
	font-size: 0.75rem;
	color: var(--chat-muted);
	font-style: italic;
	padding: 0 0.85rem 0.35rem;
}

.site-chat-suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	padding: 0 0.85rem 0.65rem;
	background: var(--chat-bg);
}

.site-chat-suggestions button {
	border: 1px solid rgba(59, 130, 246, 0.4);
	border-radius: 999px;
	background: transparent;
	color: var(--chat-muted);
	font-size: 0.68rem;
	padding: 0.3rem 0.55rem;
	cursor: pointer;
}

.site-chat-suggestions button:hover,
.site-chat-suggestions button:focus {
	color: var(--chat-text);
	border-color: var(--chat-accent);
	outline: none;
}

.site-chat-form {
	display: flex;
	gap: 0.4rem;
	padding: 0.65rem;
	border-top: 1px solid rgba(59, 130, 246, 0.25);
	background: rgba(8, 14, 28, 0.65);
}

.site-chat-form input {
	flex: 1;
	border: 1px solid rgba(59, 130, 246, 0.35);
	border-radius: 6px;
	background: var(--chat-panel2);
	color: var(--chat-text);
	font-size: 0.82rem;
	padding: 0.5rem 0.65rem;
}

.site-chat-form input:focus {
	outline: none;
	border-color: var(--chat-accent);
}

.site-chat-form button {
	border: 0;
	border-radius: 6px;
	background: var(--chat-accent);
	color: #fff;
	font-size: 0.78rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05rem;
	padding: 0.5rem 0.75rem;
	cursor: pointer;
}

.site-chat-form button:hover,
.site-chat-form button:focus {
	background: var(--chat-accent-h);
	outline: none;
}

.site-chat-form button:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.site-chat-footer {
	padding: 0.35rem 0.85rem 0.55rem;
	font-size: 0.62rem;
	color: var(--chat-muted);
	text-align: center;
	background: rgba(8, 14, 28, 0.65);
}

@media (max-width: 480px) {
	#site-chat-panel {
		right: 0.75rem;
		left: 0.75rem;
		width: auto;
		bottom: 4.25rem;
	}
}
