/* SA Chat Assistant — matches site brand (navy #011627, red #d94948, Montserrat) */
#sa-chat-root {
	--sa-navy: #011627;
	--sa-red: #d94948;
	--sa-red-dark: #b93837;
	--sa-bg: #ffffff;
	--sa-soft: #f3f5f8;
	--sa-text: #1d2733;
	--sa-muted: #5b6673;
	--sa-border: #e2e6ec;
	font-family: Montserrat, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.45;
	color: var(--sa-text);
}
#sa-chat-root *, #sa-chat-root *::before, #sa-chat-root *::after { box-sizing: border-box; }

/* Launcher */
.sa-chat-launcher {
	position: fixed; right: 20px; bottom: 20px; z-index: 99998;
	display: flex; align-items: center; gap: 10px;
	height: 56px; padding: 0 20px 0 16px; border: 0; border-radius: 28px;
	background: var(--sa-navy); color: #fff; cursor: pointer;
	font: 600 14px/1 inherit; font-family: inherit;
	box-shadow: 0 8px 24px rgba(1, 22, 39, .28);
	transition: transform .15s ease, box-shadow .15s ease;
}
.sa-chat-launcher:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(1, 22, 39, .34); }
.sa-chat-launcher:focus-visible { outline: 3px solid var(--sa-red); outline-offset: 3px; }
.sa-chat-launcher svg { width: 24px; height: 24px; flex: none; }
.sa-chat-launcher .sa-dot {
	position: absolute; top: 6px; left: 34px; width: 10px; height: 10px; border-radius: 50%;
	background: var(--sa-red); border: 2px solid var(--sa-navy);
}
.sa-chat-launcher[hidden] { display: none; }

/* Panel */
.sa-chat-panel {
	position: fixed; right: 20px; bottom: 20px; z-index: 99999;
	width: 370px; max-width: calc(100vw - 40px);
	height: 580px; max-height: calc(100vh - 40px);
	display: flex; flex-direction: column;
	background: var(--sa-bg); border-radius: 16px; overflow: hidden;
	box-shadow: 0 16px 48px rgba(1, 22, 39, .28);
	animation: sa-pop .18s ease-out;
}
.sa-chat-panel[hidden] { display: none; }
@keyframes sa-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.sa-chat-head {
	display: flex; align-items: center; gap: 12px;
	padding: 14px 12px 14px 16px; background: var(--sa-navy); color: #fff;
}
.sa-chat-avatar {
	width: 38px; height: 38px; border-radius: 50%; flex: none;
	background: var(--sa-red); display: grid; place-items: center;
	font-weight: 700; font-size: 14px; letter-spacing: .5px;
}
.sa-chat-title { flex: 1; min-width: 0; }
.sa-chat-title strong { display: block; font-size: 15px; }
.sa-chat-title span { display: block; font-size: 12px; opacity: .8; }
.sa-chat-iconbtn {
	width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #fff;
	display: grid; place-items: center; cursor: pointer;
}
.sa-chat-iconbtn:hover { background: rgba(255,255,255,.12); }
.sa-chat-iconbtn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.sa-chat-iconbtn svg { width: 20px; height: 20px; }

.sa-chat-body {
	flex: 1; overflow-y: auto; padding: 16px; background: var(--sa-soft);
	display: flex; flex-direction: column; gap: 10px;
	scroll-behavior: smooth;
}
.sa-msg {
	max-width: 86%; padding: 10px 13px; border-radius: 14px; white-space: pre-line; word-wrap: break-word;
}
.sa-msg a { color: inherit; text-decoration: underline; }
.sa-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--sa-border); border-bottom-left-radius: 4px; }
.sa-msg.user { align-self: flex-end; background: var(--sa-navy); color: #fff; border-bottom-right-radius: 4px; }
.sa-msg.alert { align-self: stretch; max-width: 100%; background: #fff4f4; border: 1px solid #f2c4c4; color: #7a1f1e; }
.sa-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid var(--sa-border); border-radius: 14px; }
.sa-typing i { width: 6px; height: 6px; border-radius: 50%; background: #9aa4b1; animation: sa-blink 1s infinite; }
.sa-typing i:nth-child(2) { animation-delay: .15s; } .sa-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes sa-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

.sa-chips { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 100%; }
.sa-chip {
	border: 1px solid var(--sa-navy); background: #fff; color: var(--sa-navy);
	padding: 7px 12px; border-radius: 18px; cursor: pointer; font: 500 13px/1.2 inherit; font-family: inherit;
}
.sa-chip:hover { background: var(--sa-navy); color: #fff; }
.sa-chip:focus-visible { outline: 2px solid var(--sa-red); outline-offset: 2px; }
.sa-chip.primary { background: var(--sa-red); border-color: var(--sa-red); color: #fff; }
.sa-chip.primary:hover { background: var(--sa-red-dark); border-color: var(--sa-red-dark); }

.sa-consent { align-self: stretch; background: #fff; border: 1px solid var(--sa-border); border-radius: 12px; padding: 12px; font-size: 13px; }
.sa-consent label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.sa-consent input { margin-top: 3px; flex: none; }
.sa-consent .sa-chips { margin-top: 10px; }

.sa-chat-foot { border-top: 1px solid var(--sa-border); background: #fff; }
.sa-chat-form { display: flex; gap: 8px; padding: 10px 12px; }
.sa-chat-input {
	flex: 1; min-width: 0; height: 42px; padding: 0 14px; border: 1px solid var(--sa-border); border-radius: 21px;
	font: 14px inherit; font-family: inherit; color: var(--sa-text); background: #fff;
}
.sa-chat-input:focus { outline: none; border-color: var(--sa-navy); box-shadow: 0 0 0 3px rgba(1,22,39,.12); }
.sa-chat-send {
	width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%;
	background: var(--sa-red); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.sa-chat-send:hover { background: var(--sa-red-dark); }
.sa-chat-send svg { width: 18px; height: 18px; }
.sa-chat-links {
	display: flex; justify-content: space-between; gap: 8px; padding: 0 14px 10px; font-size: 12px; color: var(--sa-muted);
}
.sa-chat-links button {
	border: 0; background: none; padding: 0; color: var(--sa-navy); font: 600 12px inherit; font-family: inherit;
	text-decoration: underline; cursor: pointer;
}
.sa-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Mobile: full screen */
@media (max-width: 480px) {
	.sa-chat-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100%; max-height: 100%; border-radius: 0; }
	.sa-chat-launcher { right: 14px; bottom: 14px; padding: 0 16px 0 14px; }
	.sa-chat-launcher .sa-label { display: none; }
	.sa-chat-launcher { width: 56px; padding: 0; justify-content: center; }
	.sa-chat-launcher .sa-dot { left: 34px; }
	.sa-chat-input { font-size: 16px; } /* stops iOS zoom */
}
@media (prefers-reduced-motion: reduce) {
	.sa-chat-panel, .sa-typing i { animation: none; }
	.sa-chat-launcher { transition: none; }
}
