/* SST Assistant chat widget. Colours and font follow the base theme. */
.sst-chat {
	--sst-brown: #483525;
	--sst-brown-dark: #36271a;
	--sst-red: #ec5d5d;
	--sst-cream: #fbf7f2;
	--sst-text: #2b2018;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: "brandon-grotesque", "brandon_grotesque_regularRg", Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.4;
	color: var(--sst-text);
}

.sst-chat *,
.sst-chat *::before,
.sst-chat *::after {
	box-sizing: border-box;
}

.sst-chat__launcher {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
	padding: 12px 18px;
	border: 0;
	border-radius: 999px;
	background: var(--sst-red);
	color: #fff;
	font: inherit;
	font-weight: 700;
	letter-spacing: .03em;
	text-transform: uppercase;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
	cursor: pointer;
}

.sst-chat__launcher:hover,
.sst-chat__launcher:focus-visible {
	background: #d94c4c;
}

.sst-chat.is-open .sst-chat__launcher {
	display: none;
}

.sst-chat__panel {
	display: flex;
	flex-direction: column;
	width: 370px;
	max-width: calc(100vw - 24px);
	height: 540px;
	max-height: calc(100vh - 40px);
	overflow: hidden;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
}

.sst-chat__panel[hidden] {
	display: none;
}

.sst-chat__header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 14px;
	background: var(--sst-brown);
	color: #fff;
}

.sst-chat__title {
	flex: 1;
	font-weight: 700;
	font-size: 15px;
	letter-spacing: .02em;
}

.sst-chat__new,
.sst-chat__close {
	border: 0;
	background: transparent;
	color: #fff;
	font: inherit;
	cursor: pointer;
}

.sst-chat__new {
	padding: 3px 8px;
	border: 1px solid rgba(255, 255, 255, .5);
	border-radius: 4px;
	font-size: 13px;
}

.sst-chat__close {
	padding: 0 4px;
	font-size: 26px;
	line-height: 1;
}

.sst-chat__log {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: var(--sst-cream);
}

.sst-chat__msg {
	max-width: 85%;
	margin: 0 0 10px;
	padding: 9px 12px;
	border-radius: 12px;
	word-wrap: break-word;
}

.sst-chat__msg--assistant {
	background: #fff;
	border: 1px solid #eadfd3;
	border-bottom-left-radius: 4px;
}

.sst-chat__msg--user {
	margin-left: auto;
	background: var(--sst-brown);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.sst-chat__msg--error {
	background: #fdecea;
	color: #8a1f17;
	font-size: 14px;
}

.sst-chat__msg a {
	color: var(--sst-red);
	text-decoration: underline;
}

.sst-chat__msg--user a {
	color: #fff;
}

.sst-chat__typing span {
	display: inline-block;
	width: 7px;
	height: 7px;
	margin-right: 4px;
	border-radius: 50%;
	background: #b8a99a;
	animation: sst-bounce 1.2s infinite ease-in-out;
}

.sst-chat__typing span:nth-child(2) { animation-delay: .15s; }
.sst-chat__typing span:nth-child(3) { animation-delay: .3s; }

@keyframes sst-bounce {
	0%, 80%, 100% { transform: translateY(0); opacity: .5; }
	40% { transform: translateY(-5px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.sst-chat__typing span { animation: none; }
}

.sst-chat__form {
	display: flex;
	align-items: stretch;
	margin: 0;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #eadfd3;
	background: #fff;
}

/* The theme sets textarea { width/min-width: 100%; height: 46px }, which pushed the Send
   button out of the panel, so these override with higher specificity. */
.sst-chat .sst-chat__input {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	max-width: none;
	height: auto;
	margin: 0;
	min-height: 40px;
	max-height: 120px;
	padding: 9px 10px;
	border: 1px solid #d6c9bc;
	border-radius: 8px;
	font: inherit;
	font-size: 16px; /* 16px stops iOS zooming on focus */
	resize: none;
}

.sst-chat .sst-chat__input:focus {
	outline: 2px solid var(--sst-red);
	outline-offset: -1px;
	border-color: transparent;
}

.sst-chat .sst-chat__send {
	flex: 0 0 auto;
	width: auto;
	min-width: 0;
	height: auto;
	margin: 0;
	float: none;
	padding: 0 16px;
	border: 0;
	border-radius: 8px;
	background: var(--sst-red);
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.sst-chat .sst-chat__send:disabled {
	opacity: .6;
	cursor: default;
}

.sst-chat__note {
	padding: 0 12px 8px;
	background: #fff;
	color: #8a7b6e;
	font-size: 12px;
	text-align: center;
}

@media (max-width: 480px) {
	.sst-chat {
		right: 12px;
		bottom: 12px;
	}

	.sst-chat.is-open {
		right: 0;
		bottom: 0;
		left: 0;
	}

	.sst-chat__panel {
		width: 100%;
		max-width: 100%;
		height: 100vh;
		height: 100dvh;
		max-height: none;
		border-radius: 0;
	}
}
