/* Beacon chat assistant. Uses the site's Elementor global colours when present, with fallbacks. */
.ssb {
	--ssb-ink: var(--e-global-color-primary, #0B1220);
	--ssb-navy: var(--e-global-color-secondary, #0A1E3C);
	--ssb-text: var(--e-global-color-text, #4B5563);
	--ssb-accent: var(--e-global-color-accent, #4338CA);
	--ssb-teal: var(--e-global-color-ss_on_dark_teal, #5EEAD4);
	--ssb-line: var(--e-global-color-ss_line, #E8EBF1);
	--ssb-soft: var(--e-global-color-ss_light_bg, #F7F8FB);
	--ssb-tint: var(--e-global-color-ss_indigo_tint, #EEF2FF);
	--ssb-tint-border: var(--e-global-color-ss_indigo_border, #C7D2FE);
	font-size: 15px;
	line-height: 1.5;
}
.ssb *, .ssb *::before, .ssb *::after { box-sizing: border-box; }
.ssb-replaced { display: none !important; }
.ssb-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Launcher */
#ssb .ssb-launcher {
	position: fixed; right: 20px; bottom: 20px; z-index: 9990;
	display: inline-flex; align-items: center; gap: 8px;
	min-height: 48px; padding: 0 18px 0 14px; border: 0; border-radius: 999px;
	background: var(--ssb-ink); color: #fff; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; cursor: pointer;
	box-shadow: 0 16px 36px -14px rgba(15, 23, 42, .6);
	transition: transform .2s ease, background-color .2s ease;
}
#ssb .ssb-launcher:hover { background: var(--e-global-color-ss_ink_hover, #1F2937); transform: translateY(-2px); }
#ssb .ssb-launcher:focus-visible, .ssb button:focus-visible, .ssb a:focus-visible, .ssb input:focus-visible { outline: 3px solid var(--ssb-accent); outline-offset: 2px; }
#ssb .ssb-launcher svg { width: 20px; height: 20px; color: var(--ssb-teal); }
#ssb.ssb-is-open .ssb-launcher svg { color: #fff; }

/* Panel */
.ssb-panel {
	position: fixed; right: 20px; bottom: 80px; z-index: 9991;
	display: flex; flex-direction: column;
	width: 380px; max-width: calc(100vw - 40px); height: min(620px, calc(100vh - 110px));
	background: #fff; border: 1px solid var(--ssb-line); border-radius: 20px; overflow: hidden;
	box-shadow: 0 30px 70px -25px rgba(10, 30, 60, .45);
	animation: ssb-in .22s ease-out;
}
.ssb-panel[hidden] { display: none; }
@keyframes ssb-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.ssb-head {
	display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px;
	background: linear-gradient(135deg, var(--ssb-navy), #13306b); color: #fff;
}
.ssb-avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; background: rgba(255, 255, 255, .12); color: var(--ssb-teal); }
.ssb-avatar svg { width: 22px; height: 22px; }
.ssb-id { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ssb-id strong { font-size: 16px; line-height: 1.2; }
.ssb-id small { font-size: 12.5px; color: var(--e-global-color-ss_on_dark, #C3CEE0); }
#ssb .ssb-head button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: #fff; cursor: pointer; }
#ssb .ssb-head button:hover { background: rgba(255, 255, 255, .12); }
.ssb-head svg { width: 18px; height: 18px; }

.ssb-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: var(--ssb-soft); overscroll-behavior: contain; }
.ssb-msg { max-width: 88%; margin: 0 0 10px; padding: 10px 13px; border-radius: 16px; color: var(--ssb-ink); word-wrap: break-word; }
.ssb-msg p { margin: 0 0 6px; }
.ssb-msg p:last-of-type { margin-bottom: 0; }
.ssb-msg ul { margin: 6px 0 0; padding-left: 18px; }
.ssb-msg li { margin: 0 0 3px; }
.ssb-bot { background: #fff; border: 1px solid var(--ssb-line); border-bottom-left-radius: 6px; }
.ssb-user { margin-left: auto; background: var(--ssb-ink); color: #fff; border-bottom-right-radius: 6px; }
.ssb-lead { display: block; margin-bottom: 4px; font-size: 13px; color: var(--ssb-accent); }
#ssb .ssb-link { display: inline-flex; align-items: center; margin: 8px 6px 0 0; padding: 7px 12px; border-radius: 999px; background: var(--ssb-tint); border: 1px solid var(--ssb-tint-border); color: var(--e-global-color-ss_indigo_dark, #3730A3); font-weight: 600; font-size: 13.5px; text-decoration: none; }
#ssb .ssb-link:hover { background: #E0E7FF; }
#ssb .ssb-link.ssb-wa { background: #25D366; border-color: #25D366; color: #0B1220; }
#ssb .ssb-link.ssb-wa:hover { background: #1fbe5b; }
.ssb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#ssb .ssb-chips button, #ssb .ssb-chips a {
	padding: 7px 12px; border: 1px solid var(--ssb-tint-border); border-radius: 999px; background: #fff;
	color: var(--e-global-color-ss_indigo_dark, #3730A3); font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1.3; text-decoration: none; cursor: pointer; text-align: left;
}
#ssb .ssb-chips button:hover, #ssb .ssb-chips a:hover { background: var(--ssb-tint); }

.ssb-typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.ssb-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9CA3AF; animation: ssb-dot 1.1s infinite ease-in-out; }
.ssb-typing i:nth-of-type(2) { animation-delay: .15s; }
.ssb-typing i:nth-of-type(3) { animation-delay: .3s; }
@keyframes ssb-dot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

.ssb-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--ssb-line); background: #fff; }
#ssb .ssb-form input {
	flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--e-global-color-ss_field_border, #D6DAE3); border-radius: 12px;
	font-family: inherit; font-size: 15px; color: var(--ssb-ink); background: #fff;
}
#ssb .ssb-send { display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 12px; background: var(--ssb-ink); color: #fff; cursor: pointer; }
#ssb .ssb-send svg { width: 18px; height: 18px; }
.ssb-foot { margin: 0; padding: 0 12px 10px; background: #fff; font-size: 12px; color: var(--e-global-color-ss_muted, #6B7280); text-align: center; }
.ssb-foot a { color: inherit; text-decoration: underline; }

/* Phones: full screen */
@media (max-width: 600px) {
	.ssb-panel { inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; border: 0; border-radius: 0; }
	#ssb.ssb-is-open .ssb-launcher { display: none; }
	.admin-bar #ssb .ssb-panel { top: 46px; height: auto; } /* logged-in editors: below the WordPress toolbar */
	#ssb .ssb-form input { font-size: 16px; } /* no zoom on iOS */
}
@media (prefers-reduced-motion: reduce) {
	.ssb-panel, .ssb-typing i { animation: none; }
	#ssb .ssb-launcher { transition: none; }
}

/* Keep the site theme's global button and input styles out of Beacon. */
#ssb button { text-transform: none; letter-spacing: normal; box-shadow: none; min-width: 0; }
#ssb .ssb-launcher { box-shadow: 0 16px 36px -14px rgba(15, 23, 42, .6); }
#ssb .ssb-head button:hover, #ssb .ssb-head button:focus { background: rgba(255, 255, 255, .12); color: #fff; }
#ssb .ssb-chips button:hover, #ssb .ssb-chips button:focus { background: var(--ssb-tint); color: var(--e-global-color-ss_indigo_dark, #3730A3); }
#ssb .ssb-send:hover, #ssb .ssb-send:focus { background: var(--e-global-color-ss_ink_hover, #1F2937); color: #fff; }
#ssb .ssb-form input { box-shadow: none; }

/* Launcher: the site's headline gradient (indigo → sky → teal) with a soft glow, so it stands out. */
#ssb .ssb-launcher {
	min-height: 52px; padding: 0 22px 0 16px; font-size: 15px;
	background: linear-gradient(90deg, #4338ca 0%, #0369a1 55%, #0f766e 100%);
	background-size: 160% 100%; background-position: 0 0;
	box-shadow: 0 14px 34px -12px rgba(67, 56, 202, .65), 0 0 0 0 rgba(67, 56, 202, .45);
	transition: transform .2s ease, background-position .4s ease, box-shadow .2s ease;
	animation: ssb-glow 2.8s ease-out 1.2s 3;
}
#ssb .ssb-launcher:hover, #ssb .ssb-launcher:focus { background-position: 100% 0; color: #fff; transform: translateY(-2px); }
#ssb .ssb-launcher svg { color: #fff; width: 22px; height: 22px; }
@keyframes ssb-glow {
	0% { box-shadow: 0 14px 34px -12px rgba(67, 56, 202, .65), 0 0 0 0 rgba(3, 105, 161, .45); }
	70% { box-shadow: 0 14px 34px -12px rgba(67, 56, 202, .65), 0 0 0 14px rgba(3, 105, 161, 0); }
	100% { box-shadow: 0 14px 34px -12px rgba(67, 56, 202, .65), 0 0 0 0 rgba(3, 105, 161, 0); }
}
#ssb .ssb-head { background: linear-gradient(120deg, #0a1e3c 0%, #1e3a8a 60%, #0f766e 140%); }
@media (prefers-reduced-motion: reduce) { #ssb .ssb-launcher { animation: none; transition: none; } }
