/* SoldierStrong Battle Buddy chat. Colors and type follow the soldier theme. */
.ss-bb-chat {
	--ss-bb-navy: #113968;
	--ss-bb-navy-deep: #0a2547;
	--ss-bb-red: #c92e2e;
	--ss-bb-red-dark: #a82222;
	--ss-bb-gap: 24px;
	--ss-bb-toggle-h: 60px;
	--ss-bb-z: 99990;
	font-family: "Open Sans", Arial, sans-serif;
}

.ss-bb-chat .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Keep the last footer links clear of the fixed button when scrolled to the bottom. */
body.ss-bb-chat-on .site-footer { padding-bottom: 100px; }
@media (max-width: 640px) {
	body.ss-bb-chat-on .site-footer { padding-bottom: 88px; }
}

/* ---------- Button ---------- */
.ss-bb-chat-toggle {
	position: fixed;
	right: var(--ss-bb-gap);
	bottom: var(--ss-bb-gap);
	z-index: var(--ss-bb-z);
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-height: var(--ss-bb-toggle-h);
	margin: 0;
	padding: 8px 22px 8px 8px;
	border: 0;
	border-radius: 0;
	background: var(--ss-bb-navy);
	color: #fff;
	font: 600 15px/1.2 "Open Sans", Arial, sans-serif;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 10px 24px rgba(5, 18, 36, .32);
	transition: background-color .2s ease, transform .2s ease;
}
.ss-bb-chat-toggle[hidden] { display: none; }
.ss-bb-chat-toggle:hover { background: var(--ss-bb-navy-deep); transform: translateY(-2px); color: #fff; }
.ss-bb-chat-toggle:focus { outline: none; }
.ss-bb-chat-toggle:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
	box-shadow: 0 0 0 7px var(--ss-bb-red), 0 10px 24px rgba(5, 18, 36, .32);
}
.ss-bb-chat-toggle-badge,
.ss-bb-chat-toggle-x {
	flex: none;
	display: inline-flex;
	width: 44px;
	height: 44px;
}
.ss-bb-chat-toggle-badge svg, .ss-bb-chat-toggle-badge img { width: 100%; height: 100%; display: block; }
.ss-bb-chat-toggle-x {
	display: none;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #fff;
	color: var(--ss-bb-navy);
}
.ss-bb-chat-toggle-x svg { width: 22px; height: 22px; }
.ss-bb-chat-toggle[aria-expanded="true"] .ss-bb-chat-toggle-badge { display: none; }
.ss-bb-chat-toggle[aria-expanded="true"] .ss-bb-chat-toggle-x { display: inline-flex; }
.ss-bb-chat-toggle-text { white-space: nowrap; }

/* ---------- Panel ---------- */
.ss-bb-chat-panel {
	position: fixed;
	right: var(--ss-bb-gap);
	bottom: calc(var(--ss-bb-gap) + var(--ss-bb-toggle-h) + 16px);
	z-index: var(--ss-bb-z);
	display: flex;
	flex-direction: column;
	width: 420px;
	max-width: calc(100vw - 2 * var(--ss-bb-gap));
	height: min(680px, calc(100vh - var(--ss-bb-toggle-h) - 3 * var(--ss-bb-gap) - 16px));
	height: min(680px, calc(100dvh - var(--ss-bb-toggle-h) - 3 * var(--ss-bb-gap) - 16px));
	background: #fff;
	box-shadow: 0 18px 48px rgba(5, 18, 36, .35);
	opacity: 0;
	transform: translateY(16px) scale(.98);
	transform-origin: bottom right;
	transition: opacity .2s ease, transform .25s ease;
}
.ss-bb-chat-panel[hidden] { display: none; }
.ss-bb-chat-panel.is-open { opacity: 1; transform: none; }
.ss-bb-chat-panel:focus { outline: none; }
.ss-bb-chat-panel:focus-visible { outline: 3px solid var(--ss-bb-red); outline-offset: 2px; }

.ss-bb-chat-sentinel { position: absolute; width: 1px; height: 1px; overflow: hidden; }

.ss-bb-chat-header {
	flex: none;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 10px 10px 14px;
	background: var(--ss-bb-navy);
	color: #fff;
}
.ss-bb-chat-header-badge { flex: none; width: 40px; height: 40px; }
.ss-bb-chat-header-badge svg, .ss-bb-chat-header-badge img { width: 100%; height: 100%; display: block; }
.ss-bb-chat-heading { flex: 1; margin: 0; line-height: 1.15; }
.ss-bb-chat-title {
	display: block;
	font: 700 20px/1.15 Cinzel, Georgia, serif;
	color: #fff;
}
.ss-bb-chat-sub { display: block; font-size: 13px; color: #d6e0ec; }

.ss-bb-chat-popout,
.ss-bb-chat-close {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 44px;
	height: 44px;
	margin: 0;
	padding: 0 10px;
	border: 2px solid transparent;
	border-radius: 0;
	background: transparent;
	color: #fff;
	font: 600 14px/1 "Open Sans", Arial, sans-serif;
	letter-spacing: .04em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
}
.ss-bb-chat-popout svg,
.ss-bb-chat-close svg { width: 20px; height: 20px; }
.ss-bb-chat-popout:hover,
.ss-bb-chat-close:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.ss-bb-chat-popout:focus,
.ss-bb-chat-close:focus { outline: none; }
.ss-bb-chat-popout:focus-visible,
.ss-bb-chat-close:focus-visible { outline: 3px solid #fff; outline-offset: -3px; box-shadow: none; color: #fff; }
.ss-bb-chat-close-text { display: none; }

.ss-bb-chat-body { position: relative; flex: 1; min-height: 0; background: #f4f7f6; }
.ss-bb-chat-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	color: #333;
	font-size: 16px;
}
.ss-bb-chat-frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background: transparent;
}

.ss-bb-chat-crisis {
	flex: none;
	margin: 0;
	padding: 8px 14px;
	background: #fff;
	border-top: 1px solid #dde3e8;
	color: #333;
	font-size: 14px;
	line-height: 1.4;
}
.ss-bb-chat-crisis a { color: #a82222; font-weight: 700; text-decoration: underline; white-space: nowrap; }
.ss-bb-chat-crisis a:focus-visible { outline: 3px solid var(--ss-bb-red); outline-offset: 2px; }

/* ---------- Phones: full screen ---------- */
@media (max-width: 640px) {
	.ss-bb-chat { --ss-bb-gap: 16px; --ss-bb-toggle-h: 56px; }
	.ss-bb-chat-toggle { padding: 6px 16px 6px 6px; font-size: 14px; letter-spacing: .04em; }
	.ss-bb-chat-toggle-badge, .ss-bb-chat-toggle-x { width: 40px; height: 40px; }

	.ss-bb-chat-panel {
		inset: 0;
		width: 100%;
		max-width: none;
		height: 100%;
		box-shadow: none;
		transform: translateY(24px);
	}
	.ss-bb-chat-header { padding-top: max(10px, env(safe-area-inset-top)); }
	.ss-bb-chat-crisis { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
	.ss-bb-chat-close { border-color: rgba(255, 255, 255, .7); }
	.ss-bb-chat-close-text { display: inline; }
	/* The panel covers the screen; its own Close button takes over. */
	.ss-bb-chat.is-open .ss-bb-chat-toggle { display: none; }
	html.ss-bb-chat-lock, html.ss-bb-chat-lock body { overflow: hidden; }
}

@media (max-width: 360px) {
	.ss-bb-chat-toggle { font-size: 13px; letter-spacing: .02em; }
}

@media (prefers-reduced-motion: reduce) {
	.ss-bb-chat-toggle, .ss-bb-chat-panel { transition: none; }
	.ss-bb-chat-toggle:hover { transform: none; }
}

@media print {
	.ss-bb-chat { display: none !important; }
	body.ss-bb-chat-on .site-footer { padding-bottom: 0; }
}

/* Tucked away while the page's own "Chat with Battle Buddy" button (in the hero) is on screen. */
.ss-bb-chat-toggle.is-tucked {
	visibility: hidden;
	opacity: 0;
	transform: translateY(16px);
	transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
}
.ss-bb-chat-toggle { transition: background-color .2s ease, transform .25s ease, opacity .25s ease; }
@media (prefers-reduced-motion: reduce) {
	.ss-bb-chat-toggle.is-tucked { transition: none; transform: none; }
}
.ss-bb-chat.is-open .ss-bb-chat-toggle.is-tucked { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
