/* Best Solutions assistant — floating window (computers) and full screen (phones).
 * Uses the tokens of site.css: warm = action (send, call, request), cold = information, navy = trust.
 * The mark is the brand's split ring (sun half, ice half). */
.bsa { --bsa-w: 400px; font-family: var(--font); color: var(--ink); }
.bsa .bsa-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bsa button { font: inherit; color: inherit; }

/* Launcher: a round button above the app bar on phones; a pill with words on computers. */
.bsa .bsa-launcher {
	position: fixed; z-index: 69; right: 14px; bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom));
	display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 5px; border: 0; border-radius: 999px;
	background: var(--surface); color: var(--ink); font-weight: 700; font-size: 16px; cursor: pointer;
	box-shadow: 0 0 0 1px var(--line), 0 18px 36px -14px rgba(11, 31, 58, .55);
	transition: transform 180ms var(--ease), opacity 180ms ease, box-shadow 180ms ease; -webkit-tap-highlight-color: transparent;
}
/* The theme's styles must never take it out of its corner. */
.bsa .bsa-launcher { position: fixed !important; }
.bsa .bsa-launcher:hover { box-shadow: 0 0 0 1px var(--line-2), 0 22px 40px -14px rgba(11, 31, 58, .6); }
.bsa .bsa-launcher:active { transform: scale(.96); }
.bsa .bsa-launcher__icon, .bsa .bsa-mark {
	position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; flex: none;
	background: var(--deep); color: #fff;
}
/* The split ring around the mark. */
.bsa .bsa-launcher__icon::before, .bsa .bsa-mark::before {
	content: ""; position: absolute; inset: -3px; border-radius: 50%; padding: 3px; background: var(--grad-split);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.bsa .bsa-launcher__icon svg { width: 22px; height: 22px; }
.bsa .bsa-launcher__text { display: none; padding-right: 14px; }
.bsa .bsa-launcher__dot { position: absolute; top: 4px; left: 42px; width: 12px; height: 12px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 2px #fff; }
.bsa.is-open .bsa-launcher { transform: scale(.94); opacity: 0; pointer-events: none; }
@media (min-width: 900px) {
	.bsa .bsa-launcher { right: 24px; bottom: 24px; padding-right: 6px; }
	.bsa .bsa-launcher__text { display: inline; }
}

/* Window. A div, and selectors with two classes: the old theme's styles (for example ".layout2 section
   { position: relative }" in production) can never move it into the page. */
.bsa .bsa-panel {
	position: fixed !important; z-index: 90; inset: 0; display: flex; flex-direction: column; background: var(--surface);
	padding-top: env(safe-area-inset-top); opacity: 0; transform: translateY(24px);
	transition: opacity 220ms ease, transform 300ms var(--ease-out);
}
.bsa .bsa-panel.is-in { opacity: 1; transform: none; }
.bsa .bsa-panel[hidden] { display: none; }
html.bsa-locked, html.bsa-locked body { overflow: hidden; }
@media (min-width: 900px) {
	.bsa .bsa-panel {
		inset: auto 24px 24px auto; width: var(--bsa-w); height: min(680px, calc(100vh - 48px)); border-radius: var(--r-l);
		border: 1px solid var(--line); box-shadow: var(--sh-1), 0 40px 90px -30px rgba(7, 24, 48, .6); overflow: hidden;
		transform-origin: bottom right; transform: translateY(12px) scale(.97); padding-top: 0;
	}
}

.bsa .bsa-head { display: flex; align-items: center; gap: 14px; padding: 16px 10px 14px 18px; background: radial-gradient(120% 140% at 100% 0%, var(--deep-2), var(--deep)); color: #fff; }
.bsa .bsa-mark { width: 42px; height: 42px; background: rgba(255, 255, 255, .08); }
.bsa .bsa-mark svg { width: 21px; height: 21px; }
.bsa .bsa-titles { min-width: 0; flex: 1; }
.bsa .bsa-title { margin: 0; font-size: 19px; line-height: 1.15; font-weight: 800; font-stretch: 112%; letter-spacing: -0.01em; color: #fff; }
.bsa .bsa-sub { margin: 3px 0 0; font-size: 13.5px; line-height: 1.35; color: var(--on-deep-2); }
.bsa .bsa-iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; flex: none; transition: background-color 160ms ease, transform 160ms var(--ease); }
.bsa .bsa-iconbtn:active { transform: scale(.93); }
.bsa .bsa-head .bsa-iconbtn:hover { background: rgba(255, 255, 255, .12); }
.bsa .bsa-iconbtn svg { width: 22px; height: 22px; }
.bsa .bsa-bar .bsa-iconbtn { color: var(--ink-2); }
.bsa .bsa-bar .bsa-iconbtn:hover { background: var(--paper-2); }
.bsa .bsa-toggle[aria-pressed="true"] { background: var(--ice-soft); color: var(--ice) !important; }

.bsa .bsa-bar { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--paper); }
.bsa .bsa-chipbtn { min-height: 40px; padding: 0 16px; margin-right: auto; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 700; font-size: 14px; transition: border-color 160ms ease, color 160ms ease; }
.bsa .bsa-chipbtn:hover { border-color: var(--ice); color: var(--ice); }

.bsa .bsa-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; outline: none; background: var(--surface); }
.bsa .bsa-log:focus-visible { box-shadow: inset 0 0 0 2px var(--ice-2); }
.bsa .bsa-msg { display: flex; flex-direction: column; max-width: 90%; }
.bsa .bsa-msg--user { align-self: flex-end; align-items: flex-end; }
.bsa .bsa-msg.is-new { animation: bsa-in 260ms var(--ease-out); }
@keyframes bsa-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bsa .bsa-bubble { padding: 11px 15px; border-radius: 18px; line-height: 1.5; font-size: 16px; overflow-wrap: anywhere; }
.bsa .bsa-msg--bot .bsa-bubble { background: var(--paper); color: var(--ink); border-top-left-radius: 6px; }
.bsa .bsa-msg--user .bsa-bubble { background: var(--ice); color: #fff; border-top-right-radius: 6px; }
.bsa .bsa-bubble p { margin: 0 0 6px; font-size: inherit; line-height: inherit; }
.bsa .bsa-bubble p:last-child { margin-bottom: 0; }
.bsa .bsa-bubble strong { font-weight: 750; color: var(--ink); }
.bsa .bsa-msg--user .bsa-bubble strong { color: #fff; }
.bsa .bsa-list { margin: 4px 0; padding-left: 18px; font-size: inherit; line-height: inherit; }
.bsa .bsa-list li { margin: 3px 0; font-size: inherit; line-height: inherit; }
.bsa .bsa-link { color: var(--ice); text-decoration: underline; text-underline-offset: 2px; }
.bsa .bsa-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bsa .bsa-linkbtn {
	display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 15px; border-radius: 999px;
	background: var(--surface); color: var(--ice) !important; border: 1.5px solid var(--line-2); text-decoration: none !important;
	font-weight: 700; font-size: 14.5px; line-height: 1.15; cursor: pointer;
	transition: background-color 160ms ease, border-color 160ms ease, transform 160ms var(--ease);
}
.bsa .bsa-linkbtn:hover { border-color: var(--ice); background: var(--ice-soft); }
.bsa .bsa-linkbtn--act { background: var(--grad-sun); color: var(--ink) !important; border-color: transparent; box-shadow: 0 8px 18px -12px rgba(194, 65, 12, .8); }
.bsa .bsa-linkbtn--act:hover { background: var(--grad-sun); border-color: transparent; filter: saturate(1.08) brightness(1.03); }
.bsa .bsa-linkbtn:active { transform: scale(.96); }
.bsa .bsa-linkbtn svg { width: 17px; height: 17px; flex: none; }
.bsa .bsa-suggest { display: grid; gap: 6px; margin-top: 2px; }
.bsa .bsa-suggest__btn { text-align: left; min-height: 44px; padding: 10px 14px; border-radius: 14px; border: 1.5px dashed var(--line-2); background: none; cursor: pointer; color: var(--ink-2); font-size: 15px; transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease; }
.bsa .bsa-suggest__btn:hover { color: var(--ice); border-color: var(--ice); background: var(--ice-soft); }
.bsa .bsa-typing .bsa-bubble { display: inline-flex; gap: 5px; padding: 14px 16px; }
.bsa .bsa-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: bsa-dot 1s infinite ease-in-out; }
.bsa .bsa-dot:nth-child(3) { animation-delay: .15s; }
.bsa .bsa-dot:nth-child(4) { animation-delay: .3s; }
@keyframes bsa-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.bsa .bsa-quick { display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px; scrollbar-width: none; border-top: 1px solid var(--line); background: var(--surface); }
.bsa .bsa-quick::-webkit-scrollbar { display: none; }
.bsa .bsa-quick__btn { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 700; font-size: 14px; white-space: nowrap; color: var(--ink-2); transition: border-color 160ms ease, color 160ms ease; }
.bsa .bsa-quick__btn:hover { border-color: var(--ice); color: var(--ice); }
.bsa .bsa-status { margin: 0; padding: 0 16px; font-size: 14px; line-height: 1.6; color: var(--warn); }
.bsa .bsa-status:empty { display: none; }
.bsa .bsa-form { display: flex; align-items: flex-end; gap: 6px; padding: 8px 12px 8px 16px; background: var(--surface); }
.bsa .bsa-input { flex: 1; min-height: 48px; max-height: 120px; resize: none; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font: 500 16px/1.35 var(--font); }
.bsa .bsa-input::placeholder { color: var(--ink-3); }
.bsa .bsa-input:focus { outline: none; border-color: var(--ice); box-shadow: 0 0 0 4px rgba(21, 101, 181, .16); }
.bsa .bsa-form .bsa-iconbtn { color: var(--ink-2); }
.bsa .bsa-form .bsa-iconbtn:hover { background: var(--paper-2); }
.bsa .bsa-mic.is-on { background: var(--sun-deep) !important; color: #fff !important; animation: bsa-pulse 1.4s infinite; }
@keyframes bsa-pulse { 50% { box-shadow: 0 0 0 6px rgba(194, 65, 12, .2); } }
.bsa .bsa-send { display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 14px; background: var(--grad-sun); color: var(--ink); cursor: pointer; flex: none; transition: transform 160ms var(--ease), opacity 160ms ease; }
.bsa .bsa-send:hover { filter: saturate(1.08) brightness(1.03); }
.bsa .bsa-send:active { transform: scale(.93); }
.bsa .bsa-send:disabled { opacity: .55; cursor: progress; }
.bsa .bsa-send svg { width: 22px; height: 22px; }
.bsa .bsa-note { margin: 0; padding: 2px 16px calc(12px + env(safe-area-inset-bottom)); font-size: 12.5px; line-height: 1.4; color: var(--ink-3); background: var(--surface); }
.bsa :focus-visible { outline: 3px solid var(--ice-2); outline-offset: 2px; }
.bsa .bsa-head :focus-visible { outline-color: #fff; }
@media (prefers-reduced-motion: reduce) {
	.bsa .bsa-panel, .bsa .bsa-launcher { transition: opacity 150ms ease; transform: none !important; }
	.bsa .bsa-msg.is-new, .bsa .bsa-dot, .bsa .bsa-mic.is-on { animation: none; }
}
@media print { .bsa { display: none !important; } }
